/* ===========================================
   TALA DASHBOARD — Styles
   =========================================== */

:root {
    --hot-pink: #FF6B9D;
    --neon-purple: #B24BF3;
    --electric-cyan: #00F5FF;
    --matrix-green: #00FF88;
    --gradient-primary: linear-gradient(135deg, #FF6B9D 0%, #B24BF3 100%);
    --gradient-secondary: linear-gradient(135deg, #00F5FF 0%, #B24BF3 100%);
    --text-color: #1A1A1A;
    --text-light: #666666;
    --text-lighter: #999999;
    --light-bg: #F5F6FA;
    --white: #FFFFFF;
    --border-radius: 12px;
    --transition-speed: 0.3s;
    --sidebar-width: 250px;
    --topbar-height: 64px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light-bg);
    color: var(--text-color);
    min-height: 100vh;
}

/* ===========================================
   LOGIN PAGE
   =========================================== */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: var(--gradient-primary);
    padding: 32px;
    text-align: center;
}

.login-logo {
    height: 56px;
    filter: brightness(0) invert(1);
    margin-bottom: 12px;
}

.login-header h1 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
}

.login-body {
    padding: 32px;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-speed);
}

.login-field input:focus {
    border-color: var(--hot-pink);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

.login-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
}

.login-lockout {
    background: #fffbeb;
    color: #d97706;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    border: 1px solid #fde68a;
}

/* ===========================================
   SIDEBAR
   =========================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--text-color);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-speed);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.sidebar-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    color: var(--white);
    background: var(--gradient-primary);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 4px;
}

.sidebar-user i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-username {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
}

.sidebar-role {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

.logout-link {
    color: rgba(255, 255, 255, 0.45) !important;
}

.logout-link:hover {
    color: #f87171 !important;
    background: rgba(248, 113, 113, 0.1) !important;
}

/* ===========================================
   TOPBAR & MAIN CONTENT
   =========================================== */

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    color: var(--text-color);
}

.main-content {
    padding: 32px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* ===========================================
   STAT CARDS
   =========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-left: 4px solid var(--hot-pink);
}

.stat-card:nth-child(2) { border-left-color: var(--neon-purple); }
.stat-card:nth-child(3) { border-left-color: var(--electric-cyan); }
.stat-card:nth-child(4) { border-left-color: var(--matrix-green); }

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
}

/* ===========================================
   CHARTS (Pure CSS)
   =========================================== */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Horizontal bar chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 140px;
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--light-bg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 6px;
    min-width: 2px;
    transition: width 0.6s ease;
}

.bar-fill.purple { background: var(--gradient-secondary); }
.bar-fill.cyan { background: linear-gradient(135deg, #00F5FF 0%, #00FF88 100%); }

.bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    width: 50px;
    text-align: right;
    flex-shrink: 0;
}

/* Daily chart (vertical bars) */
.daily-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 160px;
    padding-top: 10px;
}

.daily-bar {
    flex: 1;
    background: var(--gradient-primary);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    position: relative;
    cursor: pointer;
    transition: opacity var(--transition-speed);
}

.daily-bar:hover {
    opacity: 0.8;
}

.daily-bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    margin-bottom: 4px;
}

/* ===========================================
   DATA TABLE
   =========================================== */

.table-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
}

.table-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
}

.data-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table th a {
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.data-table th a:hover {
    color: var(--text-color);
}

.data-table tr:hover td {
    background: #fafafa;
}

.data-table td.email {
    color: var(--hot-pink);
    font-weight: 500;
}

/* ===========================================
   BUTTONS
   =========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-color);
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    border-color: var(--hot-pink);
    color: var(--hot-pink);
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #dc2626;
    color: var(--white);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
}

/* ===========================================
   FILTERS
   =========================================== */

.filters {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
    transition: border-color var(--transition-speed);
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--hot-pink);
}

.filter-input {
    min-width: 200px;
}

/* ===========================================
   PAGINATION
   =========================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-lighter);
}

.pagination-links {
    display: flex;
    gap: 4px;
}

.pagination-links a,
.pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-light);
    border: 1px solid #e0e0e0;
    transition: all var(--transition-speed);
}

.pagination-links a:hover {
    border-color: var(--hot-pink);
    color: var(--hot-pink);
}

.pagination-links span.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: transparent;
}

/* ===========================================
   FORMS (User Management)
   =========================================== */

.form-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
    max-width: 500px;
}

.form-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-speed);
}

.form-row input:focus,
.form-row select:focus {
    border-color: var(--hot-pink);
}

/* ===========================================
   BADGES & TAGS
   =========================================== */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-admin {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(178, 75, 243, 0.1));
    color: var(--neon-purple);
}

.badge-viewer {
    background: rgba(0, 245, 255, 0.1);
    color: #0891b2;
}

/* ===========================================
   ALERTS
   =========================================== */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* ===========================================
   EMPTY STATE
   =========================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-lighter);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .hamburger {
        display: block;
    }

    .topbar {
        padding: 0 16px;
    }

    .main-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .filters {
        padding: 12px 16px;
    }

    .filter-input {
        min-width: 100%;
    }

    .table-header {
        padding: 16px;
    }

    .bar-label {
        width: 80px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pagination-links {
        justify-content: center;
    }
}
