@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --sidebar-width: 270px;
    --sidebar-collapsed: 68px;
    --header-height: 64px;
    --sidebar-bg: #0c0c1e;
    --sidebar-hover: #1a1a3e;
    --sidebar-active: #4f46e5;
    --sidebar-active-bg: rgba(79,70,229,.12);
    --sidebar-text: #8b8fa3;
    --sidebar-text-active: #fff;
    --sidebar-accent: #4f46e5;
    --sidebar-gold: #ffb600;
    --header-bg: rgba(255,255,255,.92);
    --content-bg: #f0f2f6;
    --card-bg: #fff;
    --card-border: #eef0f4;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-lighter: #f5f7ff;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --success: #22c55e;
    --success-light: #f0fdf4;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
    --shadow-xl: 0 16px 48px rgba(0,0,0,.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-lg: 16px;
    --transition: all .2s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--content-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Layout ── */
#admin-wrapper { display: flex; min-height: 100vh; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Sidebar ── */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform .3s cubic-bezier(.4,0,.2,1), width .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 20px rgba(0,0,0,.08);
}

#sidebar .sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(79,70,229,.15) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,.05);
}

#sidebar .sidebar-brand .brand-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--sidebar-active), var(--sidebar-gold));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,.3);
}

#sidebar .sidebar-brand .brand-icon i { color: #fff; }

#sidebar .sidebar-brand .brand-text {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 60%, rgba(255,182,0,.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#sidebar .sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

#sidebar .sidebar-body::-webkit-scrollbar { width: 4px; }
#sidebar .sidebar-body::-webkit-scrollbar-track { background: transparent; }
#sidebar .sidebar-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
#sidebar .sidebar-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }

#sidebar .nav-section-title {
    padding: 16px 14px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.2);
}

#sidebar .nav-item { list-style: none; padding: 0; margin: 1px 0; }

#sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--sidebar-text) !important;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    gap: 12px;
    position: relative;
    border-left: 3px solid transparent;
}

#sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0 !important;
    border-left-color: rgba(255,255,255,.1);
}

#sidebar .nav-link.active {
    background: var(--sidebar-active-bg) !important;
    color: #fff !important;
    border-left-color: var(--sidebar-active);
}

#sidebar .nav-link i:first-child { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }

#sidebar .nav-link .chevron {
    margin-left: auto;
    font-size: 11px;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    opacity: .4;
}
#sidebar .nav-link[aria-expanded="true"] .chevron { transform: rotate(180deg); opacity: .7; }

#sidebar .nav-sub {
    padding-left: 0;
    list-style: none;
    overflow: hidden;
}

#sidebar .nav-sub .nav-link {
    padding: 8px 14px 8px 48px;
    font-size: 13px;
    font-weight: 400;
}

#sidebar .nav-sub .nav-link i { font-size: 5px; width: auto; }

#sidebar .sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

#sidebar .sidebar-footer .nav-link {
    padding: 9px 14px;
    font-size: 13px;
}

/* Sidebar Badge Override */
#sidebar .badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
}

/* ── Sidebar Compact Mode ── */
#sidebar.collapsed { width: var(--sidebar-collapsed); }
#sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0; }
#sidebar.collapsed .sidebar-brand .brand-icon { margin-right: 0; }
#sidebar.collapsed .sidebar-brand .brand-text,
#sidebar.collapsed .nav-link span,
#sidebar.collapsed .nav-link .chevron,
#sidebar.collapsed .sidebar-footer .nav-link span,
#sidebar.collapsed .nav-section-title { display: none; }
#sidebar.collapsed .nav-link { justify-content: center; padding: 12px; border-left: none; }
#sidebar.collapsed .nav-link i:first-child { margin: 0; font-size: 20px; width: auto; }
#sidebar.collapsed .nav-link.active { border-left: none; box-shadow: inset 0 0 0 2px var(--sidebar-active); }
#sidebar.collapsed .nav-sub { display: none !important; }

/* ── Main Content ── */
#main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}

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

/* ── Header ── */
#header {
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

#header .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

#header .sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    display: none;
}

#header .sidebar-toggle:hover { background: var(--border-light); color: var(--text); }

#header .sidebar-collapse-btn { display: flex; }

#header .header-search {
    position: relative;
    width: 320px;
}

#header .header-search input {
    width: 100%;
    padding: 9px 14px 9px 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--border-light);
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

#header .header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
    background: #fff;
}

#header .header-search input::placeholder { color: var(--text-light); }

#header .header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 15px;
    pointer-events: none;
}

#header .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

#header .header-btn {
    position: relative;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 19px;
    cursor: pointer;
    transition: var(--transition);
}

#header .header-btn:hover {
    background: var(--border-light);
    color: var(--text);
}

#header .header-btn .badge-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--header-bg);
}

#header .header-btn .badge-count {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--header-bg);
}

/* ── User Dropdown ── */
#header .user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 10px;
    border: none;
    background: none;
    color: var(--text);
}

#header .user-dropdown:hover { background: var(--border-light); }

#header .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79,70,229,.25);
}

#header .user-dropdown .user-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
}

#header .user-dropdown .user-role {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
    text-align: left;
}

/* ── Notifications Dropdown ── */
.notif-dropdown {
    width: 360px;
    max-height: 400px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-top: 8px !important;
}

.notif-dropdown .notif-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-dropdown .notif-header h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.notif-dropdown .notif-body { max-height: 280px; overflow-y: auto; }

.notif-dropdown .notif-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background .1s;
    text-decoration: none;
    color: var(--text);
}

.notif-dropdown .notif-item:hover { background: var(--primary-lighter); }
.notif-dropdown .notif-item:last-child { border-bottom: none; }

.notif-dropdown .notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.notif-dropdown .notif-icon.bg-warning-subtle { background: var(--warning-light); color: #d97706; }
.notif-dropdown .notif-icon.bg-info-subtle { background: var(--info-light); color: #2563eb; }
.notif-dropdown .notif-icon.bg-success-subtle { background: var(--success-light); color: #16a34a; }
.notif-dropdown .notif-icon.bg-danger-subtle { background: var(--danger-light); color: #dc2626; }

.notif-dropdown .notif-content { flex: 1; min-width: 0; }
.notif-dropdown .notif-content .notif-text {
    font-size: 13px; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-dropdown .notif-content .notif-time {
    font-size: 11px; color: var(--text-muted); margin-top: 3px;
}

.notif-dropdown .notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}
.notif-dropdown .notif-empty i { font-size: 36px; display: block; margin-bottom: 10px; opacity: .3; }

/* ── Breadcrumb / Page Header ── */
.page-header {
    padding: 24px 28px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h4 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -.3px;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 5px 0 0;
    font-size: 13px;
}

.breadcrumb-item { color: var(--text-light); }
.breadcrumb-item a { color: var(--text-light); text-decoration: none; transition: color .15s; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); opacity: .5; }
.breadcrumb-item.active { color: var(--text-muted); font-weight: 500; }

/* ── Content Area ── */
.content-body {
    padding: 24px 28px 40px;
    flex: 1;
}

/* ── Alerts (Toast) ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.alert-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    min-width: 320px;
    max-width: 440px;
    animation: toastIn .35s cubic-bezier(.4,0,.2,1);
    border: none;
}

.alert-toast i { font-size: 19px; }
.alert-toast .btn-close { font-size: 12px; margin-left: auto; opacity: .5; }
.alert-toast .btn-close:hover { opacity: 1; }

.alert-toast.alert-success { background: var(--success-light); color: #166534; border-left: 4px solid var(--success); }
.alert-toast.alert-danger { background: var(--danger-light); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-toast.alert-info { background: var(--info-light); color: #1e40af; border-left: 4px solid var(--info); }
.alert-toast.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 22px; }
.card-footer {
    background: transparent;
    border-top: 1px solid var(--border);
    padding: 16px 22px;
}

/* ── Tables ── */
.table {
    margin: 0;
    font-size: 13.5px;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 14px 18px;
}

.table tbody td {
    padding: 14px 18px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover { background: var(--primary-lighter); }
.table tbody tr:last-child td { border-bottom: none; }

.table-responsive {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Modern table with card appearance */
.table-modern {
    border-collapse: separate;
    border-spacing: 0 6px;
    margin-top: -6px;
}

.table-modern thead th {
    background: transparent;
    border: none;
    padding: 8px 18px;
}

.table-modern tbody tr {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.table-modern tbody tr:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.table-modern tbody td {
    border: none;
    padding: 16px 18px;
}

.table-modern tbody td:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table-modern tbody td:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Buttons ── */
.btn {
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    letter-spacing: .2px;
}

.btn:active { transform: scale(.97); }

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

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 4px; }

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,.25);
}

.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #16a34a; border-color: #16a34a; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,197,94,.3); }

.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,.3); }

.btn-warning { color: #fff; }
.btn-warning:hover { transform: translateY(-1px); }

.btn-info { color: #fff; }
.btn-info:hover { transform: translateY(-1px); }

/* ── Forms ── */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control, .form-select {
    font-size: 13.5px;
    border-radius: var(--radius-xs);
    border-color: var(--border);
    padding: 9px 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-control:hover, .form-select:hover {
    border-color: #cbd5e1;
}

.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-control-sm { padding: 6px 10px; font-size: 12.5px; }

.input-group-text {
    font-size: 13px;
    border-color: var(--border);
    background: #f8fafc;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    cursor: pointer;
}

.form-switch.form-switch-lg .form-check-input {
    width: 3em;
    height: 1.5em;
}

/* ── Stats Cards ── */
.dashboard-stats .card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.dashboard-stats .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.dashboard-stats .card-body {
    position: relative;
    z-index: 1;
}

.dashboard-stats .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--sidebar-gold));
    opacity: .6;
}

.stat-number {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }

.stat-icon.gradient-1 { background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: #4f46e5; }
.stat-icon.gradient-2 { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #16a34a; }
.stat-icon.gradient-3 { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #d97706; }
.stat-icon.gradient-4 { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; }

/* ── Badges ── */
.badge {
    font-weight: 600;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: .2px;
}

.badge.bg-primary { background: var(--primary) !important; }
.badge.bg-success { background: var(--success) !important; }
.badge.bg-warning { color: #fff !important; }
.badge.bg-info { color: #fff !important; }

/* ── Tabs ── */
.nav-tabs {
    border-bottom: 1px solid var(--border);
    gap: 2px;
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    border: none;
    padding: 10px 18px;
    position: relative;
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tabs .nav-link:hover {
    color: var(--text);
    border: none;
    background: var(--border-light);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: none;
    border: none;
    font-weight: 600;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

/* ── Modals ── */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
}

.modal-header .modal-title {
    font-size: 16px;
    font-weight: 700;
}

.modal-body { padding: 22px; }

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 16px 22px;
}

/* ── Pagination ── */
.pagination { gap: 4px; }
.fgpagination { display: flex; gap: 4px; list-style: none; padding-left: 0; flex-wrap: wrap; justify-content: center; margin: 16px 0; }

.fgpagination li a,
.fgpagination li span {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs) !important;
    color: var(--text);
    font-size: 13px;
    padding: 7px 14px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}
.fgpagination li a:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.fgpagination li span.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.fgpagination li.disabled span {
    opacity: .5;
    cursor: default;
}

.page-link {
    border: 1px solid var(--border);
    border-radius: var(--radius-xs) !important;
    color: var(--text);
    font-size: 13px;
    padding: 7px 14px;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}
.page-item.disabled .page-link {
    opacity: .5;
}

/* ── Dropdown ── */
.dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    font-size: 13px;
    margin-top: 6px !important;
}

.dropdown-item {
    border-radius: var(--radius-xs);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.dropdown-item:hover { background: var(--primary-lighter); color: var(--primary); }
.dropdown-item i { font-size: 16px; width: 20px; text-align: center; }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger) !important; }
.dropdown-divider { margin: 4px 0; }

/* ── Progress ── */
.progress {
    border-radius: 20px;
    background: var(--border);
    height: 8px;
}
.progress-bar {
    border-radius: 20px;
    background: linear-gradient(90deg, var(--primary), var(--sidebar-gold));
}

/* ── Sortable Tree ── */
.sortable-tree { list-style: none; padding: 0; }
.sortable-tree li { list-style: none; }
.sortable-tree .tree-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: move;
    transition: var(--transition);
}

.sortable-tree .tree-item:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.08);
}
.sortable-tree .tree-item .handle { color: var(--text-light); cursor: grab; }
.sortable-tree .tree-item .actions { margin-left: auto; display: flex; gap: 6px; }

/* ── CodeMirror Overrides ── */
.CodeMirror {
    height: auto !important;
    min-height: 500px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px;
}

/* ── Alerts (Inline) ── */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 13px;
    padding: 14px 18px;
}

.alert-success { background: var(--success-light); color: #166534; }
.alert-danger { background: var(--danger-light); color: #991b1b; }
.alert-info { background: var(--info-light); color: #1e40af; }
.alert-warning { background: var(--warning-light); color: #92400e; }

.alert-dismissible .btn-close { font-size: 14px; }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}
.empty-state i {
    font-size: 52px;
    color: var(--text-light);
    opacity: .25;
    margin-bottom: 16px;
    display: block;
}
.empty-state h5 { font-weight: 700; color: var(--text); }
.empty-state p { color: var(--text-muted); max-width: 400px; margin: 8px auto 20px; }

/* ── Fade In Animation ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .35s cubic-bezier(.4,0,.2,1); }

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

/* ── Quick Action Cards ── */
.quick-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}

.quick-action-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--text);
}

.quick-action-card .qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.quick-action-card .qa-content { flex: 1; }
.quick-action-card .qa-content h6 { margin: 0; font-weight: 600; font-size: 14px; }
.quick-action-card .qa-content small { color: var(--text-muted); }

/* ── Section Cards (for settings, corporate) ── */
.settings-section,
.corp-section {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.settings-section-header,
.corp-section-header {
    background: #f8fafc;
    padding: 14px 18px;
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius) var(--radius) 0 0;
}

.settings-section-body,
.corp-section-body { padding: 18px; }

/* ── Corporate Items ── */
.corp-item {
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 18px;
    margin-bottom: 12px;
    position: relative;
    transition: var(--transition);
}

.corp-item:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,70,229,.06);
}

.corp-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* ── Site Type Cards ── */
.site-type-card {
    cursor: pointer;
    border: 2px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px 16px;
    text-align: center;
    transition: var(--transition);
}

.site-type-card:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.site-type-card.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.site-type-card.selected .text-muted {
    color: rgba(255,255,255,.7) !important;
}

.site-type-card .bi {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 8px;
}

.site-type-card small { font-size: 11px; }

.site-type-radio { display: none; }

/* ── Icon Picker ── */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.icon-picker .icon-opt {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
}

.icon-picker .icon-opt:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.icon-picker .icon-opt.sel {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* ── Home Feature Items ── */
.home-feature-item {
    background: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    position: relative;
}

.home-feature-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* ── Module Management ── */
.modules-card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.module-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}

.module-body { padding: 0; }

.module-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    cursor: default;
    transition: background .1s;
}

.module-item:last-child { border-bottom: none; }
.module-item:hover { background: var(--primary-lighter); }

.module-item .drag-handle {
    cursor: grab;
    color: var(--text-light);
    font-size: 18px;
    flex-shrink: 0;
}

.module-item .drag-handle:active { cursor: grabbing; }

.module-item .info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-item .info .name {
    font-weight: 600;
    font-size: 14px;
}

.module-item .info .title-input {
    max-width: 280px;
    font-size: 13px;
}

.module-item .info .module-key-badge {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.module-item .info .has-showcase {
    color: var(--primary);
    font-size: 11px;
}

.module-item .actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.module-item.sortable-ghost { opacity: .4; background: var(--primary-light); }
.module-item.sortable-chosen { background: var(--border-light); }

.module-placeholder { padding: 24px; text-align: center; color: var(--text-light); }

/* ── Showcase Modal List ── */
.showcase-modal-list { max-height: 320px; overflow-y: auto; }
.showcase-modal-list .form-check {
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    margin-bottom: 6px;
    transition: background .1s;
}
.showcase-modal-list .form-check:hover { background: var(--primary-lighter); }

/* ── Additional Utilities ── */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--sidebar-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-soft-primary { background: var(--primary-light); }
.bg-soft-success { background: var(--success-light); }
.bg-soft-warning { background: var(--warning-light); }
.bg-soft-danger { background: var(--danger-light); }

/* ── Responsive ── */
@media (max-width: 1199.98px) {
    #header .header-search { width: 220px; }
}

@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    #sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0,0,0,.2);
    }

    #main-content { margin-left: 0; }
    #sidebar.collapsed + #main-content { margin-left: 0; }

    #header .sidebar-toggle { display: flex; }

    #header .header-search { width: 180px; }
}

@media (max-width: 767.98px) {
    :root { --header-height: 58px; }

    #header { padding: 0 16px; }
    #header .header-search { display: none; }
    #header .user-dropdown .user-name,
    #header .user-dropdown .user-role { display: none; }

    .page-header { padding: 18px 16px 0; flex-direction: column; align-items: flex-start; }
    .content-body { padding: 18px 16px 28px; }

    .notif-dropdown {
        width: 300px;
        right: -60px !important;
    }

    .table thead { display: none; }
    .table tbody td {
        display: block;
        padding: 10px 14px;
        border: none;
    }
    .table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-bottom: 3px;
    }
    .table tbody tr {
        display: block;
        padding: 14px;
        border-bottom: 1px solid var(--border);
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }
    .alert-toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* ── Media Grid ── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 4px;
}
.media-grid .media-item {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all .2s;
    background: #f8fafc;
}
.media-grid .media-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    transform: translateY(-2px);
}
.media-grid .media-item.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .25);
}
.media-grid .media-item img.media-thumb,
.media-grid .media-item video.media-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}
.media-grid .media-item .media-file {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #94a3b8;
    background: #f1f5f9;
}
.media-grid .media-item .media-info {
    padding: 8px 10px;
    border-top: 1px solid #e2e8f0;
}
.media-grid .media-item .media-title {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1e293b;
}
.media-grid .media-item .media-meta {
    font-size: 11px;
    color: #94a3b8;
    margin: 2px 0 0;
}

/* ── Media Picker Modal ── */
#media-modal .modal-body,
#mediaPickerModal .modal-body {
    padding: 16px;
    min-height: 300px;
}
#media-modal #admin-wrapper,
#mediaPickerModal #admin-wrapper {
    display: block;
}
#media-modal #main-content,
#mediaPickerModal #main-content {
    margin-left: 0;
}
#media-modal #sidebar,
#mediaPickerModal #sidebar,
#media-modal #header,
#mediaPickerModal #header,
#media-modal .page-header,
#mediaPickerModal .page-header {
    display: none;
}
#media-modal .content-body,
#mediaPickerModal .content-body {
    padding: 0;
}
#media-modal .media-grid,
#mediaPickerModal .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
#media-modal .media-grid .media-item img.media-thumb,
#mediaPickerModal .media-grid .media-item img.media-thumb {
    height: 120px;
}
#media-modal .media-grid .media-item .media-file,
#mediaPickerModal .media-grid .media-item .media-file {
    height: 120px;
}

/* ── Media Uploader Preview ── */
.media-preview-box img,
.media-uploader .media-preview-box img {
    max-width: 140px;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* ── Error Pages ── */
.admin-body.err-page {
    background: #0c0c1e;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}
.err-box {
    text-align: center;
    padding: 40px 20px;
}
.err-box h1 {
    font-family: 'Inter', sans-serif;
    font-size: clamp(100px, 15vw, 160px);
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 10px;
}
.err-box p {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #8b8fa3;
    margin-bottom: 32px;
}
.err-box .btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    color: #8b8fa3;
    border: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    transition: all .3s;
}
.err-box .btn-ghost:hover {
    background: rgba(79,70,229,.15);
    color: #fff;
    border-color: rgba(79,70,229,.3);
    transform: translateY(-2px);
}
