:root {
    --primary: #fea016;
    --primary-hover: #e08b10;
    --primary-soft: rgba(254, 160, 22, 0.15);
    --primary-glow: rgba(254, 160, 22, 0.3);
    --primary-gradient: linear-gradient(135deg, #FFB74D 0%, #fea016 100%);

    --sidebar-bg: #101e32;
    --sidebar-text: #e2e8f0;
    --sidebar-text-muted: #94a3b8;
    --sidebar-active: #fea016;
    --sidebar-active-bg: rgba(255, 255, 255, 0.05);

    --bg-light: #f1f5f9;
    --card-light: #ffffff;
    --text-light: #1e293b;
    --text-muted-light: #64748b;
    --border-light: #e2e8f0;
    --shadow-premium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);

    --bg-dark: #0f172a;
    --card-dark: #1e293b;
    --text-dark: #f8fafc;
    --text-muted-dark: #94a3b8;
    --border-dark: #334155;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    --header-height: 64px;
    --footer-height: 48px;
}

[data-theme="light"] {
    --bg: var(--bg-light);
    --card: var(--card-light);
    --text: var(--text-light);
    --text-muted: var(--text-muted-light);
    --border: var(--border-light);
    --shadow: var(--shadow-premium);
}

[data-theme="dark"] {
    --bg: var(--bg-dark);
    --card: var(--card-dark);
    --text: var(--text-dark);
    --text-muted: var(--text-muted-dark);
    --border: var(--border-dark);
    --shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
    line-height: 1.5;
    background-image: radial-gradient(at 0% 0%, rgba(254, 160, 22, 0.03) 0px, transparent 50%);
    font-size: 0.9375rem; /* 15px */
}

#dash-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem;
    background: var(--card);
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
}

.auth-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 0 0 100px 100px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -0.03em;
    color: var(--text);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 100%;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: var(--transition);
    font-size: 0.9375rem;
    font-weight: 500;
}

.input-group select option {
    background: var(--card);
    color: var(--text);
}

::-webkit-calendar-picker-indicator {
    filter: invert(0.5) !important;
}

[data-theme="dark"] ::-webkit-calendar-picker-indicator {
    filter: invert(1) !important;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--card);
}

.btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    background: var(--text);
    color: var(--card);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    background: var(--primary);
    box-shadow: 0 10px 15px -3px var(--primary-soft);
}

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

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

[data-theme="dark"] .nav {
    background: rgba(15, 23, 42, 0.95);
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    padding: 1.5rem 1rem;
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    z-index: 90;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
}

.dashboard-layout {
    display: flex;
    flex: 1;
}

.card {
    background: var(--card);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.05);
}

.main-content {
    flex: 1;
    padding: 2rem;
    background: var(--bg);
    min-height: calc(100vh - var(--header-height));
}

footer {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 250px;
    height: var(--footer-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--border);
    z-index: 80;
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
}

[data-theme="dark"] footer {
    background: rgba(15, 23, 42, 0.9);
}

@media (max-width: 768px) {
    footer {
        left: 0;
        padding: 0.5rem;
    }

    .main-content {
        padding: 1rem 1rem 4rem 1rem !important;
    }
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-light);
}

[data-theme="dark"] th {
    background: var(--bg-dark);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-active {
    background: rgba(22, 163, 74, 0.1);
    color: #166534;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

[data-theme="dark"] .badge-active {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

.badge-suspended {
    background: rgba(220, 38, 38, 0.1);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .badge-suspended {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: rgba(0,0,0,0.05);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1001;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -110% !important;
        top: 64px;
        height: calc(100vh - 64px);
        width: 100% !important;
        right: 0 !important;
        z-index: 1000;
        transition: var(--transition);
        display: block !important;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .sidebar.show {
        left: 0 !important;
    }

    .nav {
        height: 64px;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .card {
        padding: 1.25rem !important;
    }

    table, thead, tbody, th, td, tr {
        display: block !important;
        width: 100% !important;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        background: var(--card) !important;
        border: 1px solid var(--border) !important;
        border-radius: 0.75rem !important;
        margin-bottom: 1.5rem !important;
        padding: 1rem !important;
        box-shadow: var(--shadow) !important;
    }

    td {
        border: none !important;
        border-bottom: 1px solid var(--border) !important;
        position: relative !important;
        padding: 0.75rem 0.5rem 0.75rem 40% !important;
        text-align: right !important;
        font-size: 0.875rem !important;
        min-height: 2.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    td:last-child {
        border-bottom: 0 !important;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 700;
        text-align: left;
        color: var(--text-muted);
        font-size: 0.75rem;
    }
    
    .modal-content {
        padding: 1.5rem !important;
    }
}

.header-user {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-user {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 0 1.5rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-avatar {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-bottom: 0.75rem;
    color: var(--sidebar-text);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 2px solid var(--sidebar-bg);
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user .username {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sidebar-text);
    display: block;
    margin-bottom: 0.2rem;
}

.sidebar-user .role {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--sidebar-text-muted);
    text-transform: capitalize;
}

.modal {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: var(--card);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 440px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    margin: auto;
}

.back-to-top {
    position: fixed;
    bottom: calc(var(--footer-height) + 1.5rem);
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px var(--primary-soft);
}

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: var(--card);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 380px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.toast.toast-success {
    border-left: 3px solid #10b981;
}

.toast.toast-error {
    border-left: 3px solid #ef4444;
}

.toast.hiding {
    animation: slideOut 0.3s forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
    to { opacity: 0; transform: translateX(100%); }
}

.sidebar-link {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--sidebar-text-muted) !important;
    text-decoration: none !important;
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.sidebar-link:hover {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text) !important;
}

.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active) !important;
    border-left: 3px solid var(--sidebar-active);
}

#global-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-gradient);
    z-index: 9999;
    box-shadow: 0 0 10px var(--primary);
}
