/* ================================================================
   NOVASHAM — PREMIUM LUXURY UI REDESIGN
   Dark Glassmorphism · Enterprise SaaS Aesthetic
   NOTE: CSS-ONLY redesign. No HTML structure, IDs, classes used by
   JS, onclick handlers, or logic were changed. Every selector below
   maps 1:1 to markup that already exists in index.html.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    /* Backgrounds */
    --bg: #09090B;
    --bg-alt: #0F172A;
    --bg-soft: #111827;
    --bg-elevated: #14141a;

    /* Cards / surfaces */
    --card-bg: #161B22;
    --card-bg-alt: #1E293B;
    --glass: rgba(30, 35, 48, 0.55);
    --glass-strong: rgba(22, 27, 34, 0.75);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    /* Brand */
    --primary: #6C63FF;
    --primary-soft: rgba(108, 99, 255, 0.16);
    --secondary: #8B5CF6;
    --accent: #D4AF37;
    --accent-soft: rgba(212, 175, 55, 0.15);

    /* Semantic */
    --success: #22C55E;
    --success-soft: rgba(34, 197, 94, 0.14);
    --warning: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --info: #38BDF8;
    --info-soft: rgba(56, 189, 248, 0.14);

    /* Text */
    --text: #FFFFFF;
    --text-light: #94A3B8;
    --text-dim: #64748B;

    /* System */
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 0 1px rgba(108, 99, 255, 0.15), 0 8px 24px rgba(108, 99, 255, 0.18);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 272px;
    --header-height: 72px;

    --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #8B5CF6 100%);
    --gradient-accent: linear-gradient(135deg, #D4AF37 0%, #F0D078 100%);
    --gradient-success: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    --gradient-danger: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --gradient-bg: radial-gradient(circle at 15% 0%, rgba(108, 99, 255, 0.10) 0%, transparent 45%),
                    radial-gradient(circle at 85% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 45%),
                    linear-gradient(180deg, #0F172A 0%, #09090B 60%);
}
html {
    font-size: 15px;
}
body {
    font-family: 'Cairo', 'IBM Plex Sans Arabic', 'Alexandria', system-ui, sans-serif;
    background: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text);
    display: flex;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}
a {
    text-decoration: none;
    color: inherit;
}
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    font-size: 0.9rem;
}
input,
select,
textarea {
    font-family: inherit;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    width: 100%;
    transition: var(--transition);
}
input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}
input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.045);
}
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.16);
}
select {
    color-scheme: dark;
}
textarea {
    resize: vertical;
    min-height: 70px;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6C63FF, #8B5CF6);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8B5CF6, #6C63FF);
    background-clip: padding-box;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.85) 0%, rgba(15, 18, 26, 0.9) 100%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    color: #d0e0e8;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.sidebar-brand {
    padding: 1.5rem 1.5rem 1.2rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    position: relative;
}
.sidebar-brand::before {
    content: "◈";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--gradient-primary);
    box-shadow: 0 6px 18px rgba(108, 99, 255, 0.4);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.sidebar-brand span {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-brand small {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.5;
    margin-right: 0.3rem;
}
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.85rem;
    overflow-y: auto;
}
.sidebar-nav .nav-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 1rem 0.9rem 0.4rem;
    font-weight: 700;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    color: #a8b3c4;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.15rem 0;
    cursor: pointer;
    position: relative;
}
.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(-2px);
}
.sidebar-nav a:hover .icon {
    background: rgba(108, 99, 255, 0.18);
    transform: scale(1.06);
}
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.22) 0%, rgba(139, 92, 246, 0.08) 100%);
    color: #fff;
    box-shadow: inset 3px 0 0 0 var(--primary);
}
.sidebar-nav a.active .icon {
    background: var(--gradient-primary);
    box-shadow: 0 4px 14px rgba(108, 99, 255, 0.45);
}
.sidebar-nav a .icon {
    font-size: 0.95rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
    flex-shrink: 0;
    transition: var(--transition);
}
.sidebar-nav a .icon svg {
    vertical-align: middle !important;
    width: 17px;
    height: 17px;
}
.card-header h3 svg,
.top-header .page-title svg {
    margin-left: 0.5rem;
    color: var(--primary);
    opacity: 0.9;
}
.badge-notif svg {
    color: var(--text-light);
}
.badge-notif:hover svg {
    color: var(--text);
}
.sidebar-toggle svg {
    display: block;
}
.logout-btn svg {
    color: currentColor;
}
.close-btn svg {
    display: block;
    margin: auto;
}
.btn svg {
    flex-shrink: 0;
}
.sidebar-footer {
    padding: 1.1rem 1.4rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dim);
    flex-shrink: 0;
}
.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #dbe4ee;
    margin-bottom: 0.6rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}
.sidebar-footer .user-info .avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.35);
}
.sidebar-footer .logout-btn {
    color: #f0a0a0;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.55rem;
}
.sidebar-footer .logout-btn:hover {
    color: #fff;
    background: var(--gradient-danger);
    border-color: transparent;
}

/* ===== MAIN CONTENT ===== */
.main-wrapper {
    margin-right: calc(var(--sidebar-width) + 24px);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.top-header {
    height: var(--header-height);
    background: rgba(15, 18, 26, 0.6);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--border);
    padding: 0 2.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}
.top-header .page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.top-header .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.top-header .header-actions .badge-notif {
    position: relative;
    cursor: pointer;
    font-size: 1.15rem;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.top-header .header-actions .badge-notif:hover {
    background: var(--primary-soft);
    border-color: rgba(108, 99, 255, 0.35);
    transform: translateY(-1px);
}
.top-header .header-actions .badge-notif .count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--gradient-danger);
    color: #fff;
    font-size: 0.55rem;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 0 0 2px #0F172A, 0 0 10px rgba(239, 68, 68, 0.6);
}

.content-area {
    padding: 1.75rem 2.2rem 3rem;
    flex: 1;
}

/* ===== PAGE SECTIONS ===== */
.page-section {
    display: none;
    animation: fadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-section.active {
    display: block;
}
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CARDS & COMPONENTS ===== */
.card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5) 0%, rgba(22, 27, 34, 0.5) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem 1.6rem;
    margin-bottom: 1.4rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.card:hover {
    border-color: var(--border-strong);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.card-header h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.card-header .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    position: relative;
    overflow: hidden;
}
.btn:active {
    transform: scale(0.97);
}
.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.35);
}
.btn-primary:hover {
    box-shadow: 0 6px 22px rgba(108, 99, 255, 0.5);
    transform: translateY(-1px);
}
.btn-secondary {
    background: linear-gradient(135deg, #8B5CF6, #6C63FF);
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}
.btn-secondary:hover {
    box-shadow: 0 6px 22px rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}
.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}
.btn-success:hover {
    box-shadow: 0 6px 22px rgba(34, 197, 94, 0.45);
    transform: translateY(-1px);
}
.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    box-shadow: 0 6px 22px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}
.btn-warning {
    background: var(--gradient-warning);
    color: #fff;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}
.btn-warning:hover {
    box-shadow: 0 6px 22px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-light);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: var(--text-dim);
}
.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.74rem;
}
.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.68rem;
}
.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===== TABLE ===== */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}
table th {
    text-align: right;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    z-index: 1;
}
table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-light);
}
table tr:last-child td {
    border-bottom: none;
}
table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.015);
}
table tr:hover td {
    background: var(--primary-soft);
    color: var(--text);
}
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.85rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-light);
    border: 1px solid var(--border);
}
.status-badge.active,
.status-badge.approved,
.status-badge.paid,
.status-badge.completed {
    background: var(--success-soft);
    color: #4ADE80;
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.12);
}
.status-badge.pending,
.status-badge.draft {
    background: var(--warning-soft);
    color: #FBBF24;
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.12);
}
.status-badge.cancelled,
.status-badge.rejected {
    background: var(--danger-soft);
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.12);
}
.status-badge.on-hold {
    background: var(--info-soft);
    color: #7DD3FC;
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.12);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.empty-state .icon {
    font-size: 2.5rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 0.5rem;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.6rem;
}
.stat-card {
    background: linear-gradient(155deg, rgba(108, 99, 255, 0.1) 0%, rgba(22, 27, 34, 0.6) 55%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.5), transparent 40%, transparent 60%, rgba(212, 175, 55, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}
.stat-card::after {
    content: "◆";
    position: absolute;
    top: 1.1rem;
    left: 1.2rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gradient-primary);
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 6px 18px rgba(108, 99, 255, 0.4);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    border-color: rgba(108, 99, 255, 0.35);
}
.stat-card .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.05em;
    font-weight: 600;
    padding-left: 3rem;
}
.stat-card .value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text);
    margin-top: 0.4rem;
    letter-spacing: -0.02em;
}
.stat-card .sub {
    font-size: 0.7rem;
    color: var(--text-dim);
}
/* distinct accent per stat card position */
.stat-card:nth-child(2)::after { content: "◈"; background: linear-gradient(135deg, #8B5CF6, #6C63FF); box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4); }
.stat-card:nth-child(3)::after { content: "◇"; background: var(--gradient-accent); color: #1a1508; box-shadow: 0 6px 18px rgba(212, 175, 55, 0.4); }
.stat-card:nth-child(4)::after { content: "◉"; background: var(--gradient-warning); box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 10, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open {
    display: flex;
    animation: overlayIn 0.25s ease;
}
@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.92) 0%, rgba(17, 20, 28, 0.96) 100%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-radius: var(--radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.8rem 2.2rem 2.2rem;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-strong);
}
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.94) translateY(24px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.modal-box .modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.modal-box .modal-title::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 56px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}
.modal-box .modal-title .close-btn {
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.modal-box .modal-title .close-btn:hover {
    opacity: 1;
    background: var(--gradient-danger);
    border-color: transparent;
}
.modal-box .form-group {
    margin-bottom: 1.1rem;
}
.modal-box .form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-light);
}
.modal-box .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}
.modal-box .form-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-start;
    margin-top: 1.3rem;
    flex-wrap: wrap;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 1.2rem;
    left: 1.2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 380px;
    width: 100%;
}
.toast {
    padding: 0.85rem 1.3rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(17, 20, 28, 0.97));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--border);
    border-right: 3px solid var(--secondary);
}
.toast.success {
    border-right-color: var(--success);
}
.toast.error {
    border-right-color: var(--danger);
}
.toast.warning {
    border-right-color: var(--warning);
}
.toast .toast-close {
    margin-right: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 0 0.2rem;
    transition: var(--transition);
}
.toast .toast-close:hover {
    color: #fff;
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ===== AUTH PAGES ===== */
.auth-page {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--gradient-bg);
    padding: 1.5rem;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.18), transparent 70%);
    top: -120px;
    right: -120px;
    filter: blur(10px);
}
.auth-page::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12), transparent 70%);
    bottom: -100px;
    left: -100px;
    filter: blur(10px);
}
.auth-page.active {
    display: flex !important;
}
.auth-box {
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.7) 0%, rgba(17, 20, 28, 0.8) 100%);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-radius: var(--radius-lg);
    padding: 2.8rem 2.8rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-strong);
    position: relative;
    z-index: 1;
}
.auth-box .auth-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}
.auth-box .auth-sub {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}
.auth-box .auth-sub a {
    color: var(--secondary);
    font-weight: 600;
}
.auth-box .auth-sub a:hover {
    text-decoration: underline;
}
.auth-box .form-group {
    margin-bottom: 1.1rem;
}
.auth-box .btn-block {
    margin-top: 0.4rem;
    padding: 0.75rem;
}
.auth-box .auth-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 1.4rem;
}
.auth-box .auth-switch a {
    color: var(--secondary);
    font-weight: 600;
}
.auth-box .auth-switch a:hover {
    text-decoration: underline;
}

.auth-tab.active {
    background: var(--gradient-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
}
.auth-panel {
    display: none;
}
.auth-panel.active {
    display: block;
    animation: fadeUp 0.3s ease;
}
#authPage {
    display: none;
}
#authPage.active {
    display: flex !important;
}
#mainWrapper {
    display: none;
}
#sidebar {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
    .sidebar {
        transform: translateX(110%);
        width: 280px;
        top: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-right: 0;
    }
    .top-header {
        padding: 0 1.1rem;
    }
    .content-area {
        padding: 1.1rem;
    }
    .modal-box {
        padding: 1.3rem;
        margin: 0.5rem;
        border-radius: var(--radius);
    }
    .modal-box .form-row {
        grid-template-columns: 1fr;
    }
    .auth-box {
        padding: 2rem 1.6rem;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    .sidebar-toggle {
        display: flex !important;
    }
    .modal-box .form-actions {
        justify-content: stretch;
    }
    .modal-box .form-actions button {
        flex: 1;
    }
}
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }
    .card-header .actions {
        justify-content: flex-start;
    }
    .top-header .page-title {
        font-size: 0.95rem;
    }
    .modal-box .form-row {
        grid-template-columns: 1fr;
    }
    .stat-card .label {
        padding-left: 0;
        padding-top: 3rem;
    }
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}
.text-muted {
    color: var(--text-light);
}
.mt-1 {
    margin-top: 0.5rem;
}
.mb-1 {
    margin-bottom: 0.5rem;
}
.gap-1 {
    gap: 0.5rem;
}
.flex {
    display: flex;
}
.flex-wrap {
    flex-wrap: wrap;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.w-full {
    width: 100%;
}
.hidden {
    display: none !important;
}
.sidebar-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.sidebar-toggle:hover {
    background: var(--primary-soft);
    border-color: rgba(108, 99, 255, 0.35);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 10, 0.55);
    backdrop-filter: blur(4px);
    z-index: 999;
}
.sidebar-overlay.open {
    display: block;
    animation: overlayIn 0.25s ease;
}
@media (max-width: 820px) {
    .sidebar-overlay.open {
        display: block;
    }
}

.badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.4rem;
    box-shadow: 0 0 8px currentColor;
}
.badge-dot.green {
    background: var(--success);
    color: var(--success);
}
.badge-dot.orange {
    background: var(--warning);
    color: var(--warning);
}
.badge-dot.red {
    background: var(--danger);
    color: var(--danger);
}
.badge-dot.blue {
    background: var(--info);
    color: var(--info);
}
.badge-dot.gray {
    background: var(--text-dim);
    color: var(--text-dim);
}
.clickable {
    cursor: pointer;
}
.truncate {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

.modal-box .form-actions {
    justify-content: flex-start;
}
@media (max-width: 820px) {
    .modal-box .form-actions {
        justify-content: stretch;
    }
    .modal-box .form-actions button {
        flex: 1;
    }
}

/* ===== INLINE-STYLE OVERRIDE HELPERS =====
   The dashboard overview grid and settings form use inline styles for
   layout (background:var(--bg); ...). Mapping --bg to the dark
   palette above already makes those inline blocks match the new
   luxury surface automatically — no HTML edits required. */
