/* ============================================
   Admin Dashboard - Custom Styles
   Theme: Navy (#0f172a), White, Gray
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --navy: #0f172a;
    --navy-light: #1e293b;
    --navy-lighter: #334155;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --white: #ffffff;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-50);
    color: var(--navy);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, #0f2847 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    border-radius: 50%;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .logo-icon {
    width: 48px;
    height: 48px;
    background: var(--navy);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.login-card .logo-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.login-card p.subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--navy-lighter);
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--navy);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.is-invalid {
    border-color: var(--danger);
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-text {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
    display: none;
}

.form-input.is-invalid + .error-text {
    display: block;
}

.btn-primary {
    width: auto;
    padding: 0.7rem 1.5rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--navy-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-primary.loading .spinner {
    display: inline-block;
}

.btn-primary.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--navy);
    z-index: 50;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--topbar-height);
}

.sidebar-header .brand-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header .brand-icon svg {
    width: 20px;
    height: 20px;
    color: var(--white);
}

.sidebar-header .brand-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .brand-text {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav .nav-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-label {
    text-align: center;
    font-size: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}

.nav-item.active {
    background: var(--accent);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
}

.nav-item .nav-text {
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------- Sidebar Submenu ---------- */

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.nav-group-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}

.nav-group-toggle.active {
    color: var(--white);
    background: rgba(255,255,255,0.06);
}

.nav-group-toggle svg.menu-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
}

.nav-group-toggle .nav-text {
    flex: 1;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .nav-group-toggle .nav-text {
    opacity: 0;
    pointer-events: none;
}

.nav-group-toggle .chevron {
    width: 16px;
    height: 16px;
    min-width: 16px;
    transition: transform 0.25s ease;
    opacity: 0.5;
}

.nav-group-toggle.open .chevron {
    transform: rotate(90deg);
    opacity: 0.8;
}

.sidebar.collapsed .nav-group-toggle .chevron {
    opacity: 0;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.5rem;
}

.nav-submenu.open {
    max-height: 500px;
}

.sidebar.collapsed .nav-submenu {
    display: none;
}

.nav-submenu .nav-sub-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.45rem 0.75rem 0.45rem 2.25rem;
    border-radius: 6px;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.nav-submenu .nav-sub-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gray-500);
    position: absolute;
    left: 1.25rem;
    transition: var(--transition);
}

.nav-submenu .nav-sub-item:hover {
    color: var(--white);
    background: rgba(255,255,255,0.04);
}

.nav-submenu .nav-sub-item:hover::before {
    background: var(--white);
}

.nav-submenu .nav-sub-item.active {
    color: var(--accent);
    background: rgba(59,130,246,0.08);
}

.nav-submenu .nav-sub-item.active::before {
    background: var(--accent);
}

/* ---------- Topbar ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 40;
    transition: var(--transition);
}

.sidebar.collapsed ~ .topbar {
    left: var(--sidebar-collapsed);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: var(--transition);
}

.btn-toggle:hover {
    background: var(--gray-200);
    color: var(--navy);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
}

.profile-dropdown-wrapper {
    position: relative;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9999px;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    color: var(--navy);
    font: inherit;
    transition: var(--transition);
}

.profile-trigger:hover {
    background: var(--gray-100);
}

.profile-name {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.profile-caret {
    width: 14px;
    height: 14px;
    color: var(--gray-500);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 50;
}

.profile-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    color: var(--navy);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: var(--transition);
}

.profile-dropdown-item:hover {
    background: var(--gray-100);
}

.profile-dropdown-item.logout {
    color: var(--danger);
}

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--topbar-height));
    transition: var(--transition);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ---------- Stat Cards ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.stat-card .stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--accent); }
.stat-card .stat-icon.green { background: rgba(34,197,94,0.1); color: var(--success); }
.stat-card .stat-icon.orange { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-card .stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.125rem;
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ---------- Card / Panel ---------- */
.card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
}

.card-body {
    padding: 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-hover); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-600);
}
.btn-outline:hover { border-color: var(--gray-300); background: var(--gray-50); }

.btn-sm {
    padding: 0.35rem 0.625rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

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

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #16a34a; }

/* ---------- DataTable Overrides ---------- */
.dataTables_wrapper {
    font-size: 0.875rem;
}

/* Hide default DT elements — we use custom toolbar */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: none;
}

/* -- Custom Toolbar -- */
.dt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.dt-toolbar-left,
.dt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.dt-search {
    position: relative;
}

.dt-search .dt-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.dt-search .dt-search-icon svg {
    width: 16px;
    height: 16px;
}

.dt-search input {
    width: 260px;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--navy);
    background: var(--white);
    outline: none;
    transition: var(--transition);
}

.dt-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.dt-per-page select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--navy);
    background: var(--white);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: var(--transition);
}

.dt-per-page select:focus {
    border-color: var(--accent);
}

/* -- Table -- */
table.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

table.dataTable thead th {
    background: var(--navy);
    color: rgba(255,255,255,0.85);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.8rem 1rem;
    border-bottom: none;
    position: relative;
    white-space: nowrap;
}

table.dataTable thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255,255,255,0.12);
}

table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_desc::before,
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    opacity: 0.5;
}

table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    opacity: 1;
}

table.dataTable tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--navy-lighter);
    vertical-align: middle;
    font-size: 0.8125rem;
}

table.dataTable tbody tr {
    transition: background 0.15s ease;
}

table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

table.dataTable tbody tr:hover {
    background: rgba(59,130,246,0.04);
}

table.dataTable tbody tr:nth-child(even) {
    background: var(--gray-50);
}

table.dataTable tbody tr:nth-child(even):hover {
    background: rgba(59,130,246,0.06);
}

/* -- Custom Footer (Info + Pagination) -- */
.dt-custom-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.dt-info {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.dt-info strong {
    color: var(--navy);
    font-weight: 600;
}

/* -- Custom Pagination -- */
.dt-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.dt-pagination .dt-page-btn {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-600);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: var(--transition);
    user-select: none;
}

.dt-pagination .dt-page-btn:hover:not(.active):not(.disabled) {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--navy);
}

.dt-pagination .dt-page-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(15,23,42,0.25);
}

.dt-pagination .dt-page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dt-pagination .dt-page-btn svg {
    width: 14px;
    height: 14px;
}

.dt-pagination .dt-page-ellipsis {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

/* Hide default DT info & pagination */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    display: none !important;
}

/* -- Action Buttons in Table -- */
.action-group {
    display: flex;
    gap: 6px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon svg {
    width: 15px;
    height: 15px;
}

.btn-icon-edit {
    background: rgba(59,130,246,0.1);
    color: var(--accent);
}

.btn-icon-edit:hover {
    background: var(--accent);
    color: var(--white);
}

.btn-icon-delete {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.btn-icon-delete:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-icon-view {
    background: rgba(34,197,94,0.1);
    color: var(--success);
}

.btn-icon-view:hover {
    background: var(--success);
    color: var(--white);
}

/* -- User Avatar Cell -- */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.user-cell .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-cell .user-info .user-name {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.8125rem;
}

.user-cell .user-info .user-id {
    font-size: 0.6875rem;
    color: var(--gray-400);
}

/* ---------- Select2 Overrides ---------- */
.select2-container--default .select2-selection--single {
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    height: 40px;
    padding: 0.125rem 0.25rem;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    color: var(--navy);
    font-size: 0.875rem;
    padding-left: 0.75rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.select2-dropdown {
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    overflow: hidden;
}

.select2-results__option {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.select2-results__option--highlighted[aria-selected] {
    background: var(--accent) !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-family: inherit;
}

/* ---------- Badge ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-admin { background: rgba(59,130,246,0.1); color: var(--accent); }
.badge-user { background: rgba(34,197,94,0.1); color: var(--success); }
.badge-editor { background: rgba(245,158,11,0.1); color: var(--warning); }

/* ---------- Mobile Overlay ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 45;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

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

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

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .topbar {
        left: 0 !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

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

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

    .login-card {
        padding: 1.75rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- SweetAlert2 Custom ---------- */
.swal2-popup {
    border-radius: 16px !important;
    font-family: 'Inter', sans-serif !important;
}

.swal2-styled.swal2-confirm {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 0.5rem 1.5rem !important;
}

.swal2-styled.swal2-cancel {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 0.5rem 1.5rem !important;
}
