/* ===== CSS VARIABLES - PREMIUM WHITE THEME ===== */
:root {
    --primary: #2563eb;
    /* Modern Royal Blue */
    --primary-light: #eff6ff;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    --sidebar-w: 260px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

ul {
    list-style: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 20px;
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== LAYOUT ===== */
.admin-page {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: white;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.025em;
}

.brand-role {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.menu-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 20px 12px 8px;
    font-weight: 700;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition);
}

.menu-item a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.menu-item.active a {
    background: var(--primary);
    color: white;
}

.menu-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    display: grid;
    place-items: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-details {
    flex: 1;
    min-width: 0;
}

.admin-name {
    font-weight: 600;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-role {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.logout-btn {
    color: var(--text-dim);
    transition: color var(--transition);
    cursor: pointer;
    background: none;
    border: none;
}

.logout-btn:hover {
    color: var(--danger);
}

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* TOPBAR */
.topbar {
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text);
}

.breadcrumb {
    font-weight: 500;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-time {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 500;
}

.topbar-logout {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-weight: 500;
    font-size: 0.8rem;
    transition: all var(--transition);
}

.topbar-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fef2f2;
}

/* PAGE CONTENT */
.page-body {
    padding: 32px;
    flex: 1;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text);
    letter-spacing: -0.025em;
}

.page-title strong {
    font-weight: 700;
    color: var(--text);
}

.page-desc {
    color: var(--text-dim);
    margin-top: 4px;
}

/* CARD */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.stat-icon i,
.menu-icon i,
.sidebar-logo i,
.logout-btn i,
.mobile-toggle i {
    display: block;
}

.menu-icon i {
    font-size: 18px;
}

.sidebar-logo i {
    font-size: 22px;
}

.stat-icon i {
    font-size: 24px;
}

.bg-blue {
    background: #eff6ff;
    color: #2563eb;
}

.bg-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.bg-amber {
    background: #fffbeb;
    color: #d97706;
}

.bg-green {
    background: #f0fdf4;
    color: #16a34a;
}

.stat-label {
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* TABLES */
.table-wrapper {
    overflow-x: auto;
    margin: 0 -24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}

/* BADGE */
.badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-blue {
    background: #eff6ff;
    color: #2563eb;
}

.badge-green {
    background: #f0fdf4;
    color: #16a34a;
}

.badge-amber {
    background: #fffbeb;
    color: #d97706;
}

/* FORMS */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    outline: none;
    transition: border-color 0.2s ease;
    background: #fff;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fee2e2;
}

.btn-danger:hover {
    background: #fee2e2;
}

/* LOGIN PAGE */
.login-page {
    background: #f1f5f9;
    display: grid;
    place-items: center;
    min-height: 100vh;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 32px 32px;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

/* SEARCH & ACTION BAR */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-box input {
    padding-left: 36px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .topbar {
        padding: 0 16px;
    }

    .page-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
}