/* ══════════════════════════════════════════════════════════════
   PREMIUM DARK SIDEBAR DASHBOARD — Enterprise RTL Design System
   Inspired by: Linear, Notion, Vercel, Tailwind UI
   Font: Plus Jakarta Sans (via Google Fonts)
══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Changa:wght@400;500;600;700;800&family=Almarai:wght@300;400;700;800&display=swap');

/* ── CSS Design Tokens ─────────────────────────────────────── */
:root {
    /* Sidebar */
    --sidebar-bg:         #0f1117;
    --sidebar-width:      270px;
    --sidebar-text:       #a0aec0;
    --sidebar-text-hover: #f7fafc;
    --sidebar-border:     rgba(255,255,255,0.06);
    --sidebar-item-hover: rgba(255,255,255,0.05);
    --sidebar-active-bg:  rgba(99,102,241,0.15);
    --sidebar-active-glow:rgba(99,102,241,0.3);

    /* Brand / Accent */
    --brand:          #6366f1;   /* indigo */
    --brand-dark:     #4f46e5;
    --brand-light:    rgba(99,102,241,0.12);
    --brand-glow:     0 0 24px rgba(99,102,241,0.45);

    /* Main Content */
    --bg:             #f8f9fc;
    --surface:        #ffffff;
    --surface-2:      #f1f3f9;
    --border:         #e5e9f2;

    /* Status Colors */
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #3b82f6;
    --violet:         #8b5cf6;
    --pink:           #ec4899;
    --teal:           #14b8a6;
    --orange:         #f97316;

    /* Text */
    --text-heading:   #111827;
    --text-body:      #374151;
    --text-muted:     #6b7280;
    --text-light:     #9ca3af;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-xl:  0 24px 64px rgba(0,0,0,0.16), 0 8px 24px rgba(0,0,0,0.08);

    /* Radii */
    --r-xs:  6px;
    --r-sm:  10px;
    --r-md:  14px;
    --r-lg:  20px;
    --r-xl:  28px;
    --r-full:9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast:   all 0.15s var(--ease);
    --t-normal: all 0.25s var(--ease);
    --t-slow:   all 0.4s  var(--ease);
}
@media (max-width: 768px) {
    .invoice-header, .invoice-body {
        padding: 20px;
    }

        .invoice-header .col-sm-6 {
            text-align: center !important;
            justify-content: center !important;
        }

            .invoice-header .col-sm-6 .text-end {
                text-align: center !important;
                margin-right: 0 !important;
                margin-bottom: 15px;
            }

    .info-card {
        margin-bottom: 15px;
        border-right: none;
        border-bottom: 4px solid var(--invoice-accent);
    }

    .total-section {
        padding: 15px;
    }

    .grand-total {
        font-size: 1.25rem;
    }
}
/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }

body {
    font-family: 'Almarai', sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-body);
    background-color: var(--bg);
    direction: rtl;
    text-align: right;
    height: 100%;
    overflow-x: hidden;
}

/* ── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
    font-family: 'Changa', sans-serif;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT SHELL
══════════════════════════════════════════════════════════════ */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR — Premium Dark
══════════════════════════════════════════════════════════════ */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1050;
    transition: transform 0.3s var(--ease), width 0.3s var(--ease);
    overflow: hidden;
    border-left: 1px solid var(--sidebar-border);
}

/* Subtle noise texture overlay */
#sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.4;
}

/* Glow orb top-left */
#sidebar::after {
    content: '';
    position: absolute;
    top: -80px;
    left: -80px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(99,102,241,0.18) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Sidebar Header / Brand ─────────────────────────────────── */
.sidebar-header {
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--brand), #8b5cf6);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: var(--brand-glow);
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-family: 'Changa', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    color: #f7fafc;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 0.68rem;
    color: var(--sidebar-text);
    font-weight: 400;
    display: block;
    margin-top: 1px;
}

/* ── Sidebar Navigation ─────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    position: relative;
    z-index: 1;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

.nav-section-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(160,174,192,0.5);
    padding: 18px 12px 8px;
    display: block;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    color: var(--sidebar-text);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--t-normal);
    position: relative;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav .nav-link .nav-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: var(--r-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: var(--t-normal);
    background: rgba(255,255,255,0.04);
}

.sidebar-nav .nav-link:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-item-hover);
}

.sidebar-nav .nav-link:hover .nav-icon-wrap {
    transform: scale(1.08);
}

/* Active State */
.sidebar-nav .nav-link.nav-active {
    color: #fff;
    background: var(--sidebar-active-bg);
    border: 1px solid rgba(99,102,241,0.25);
}

.sidebar-nav .nav-link.nav-active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--brand);
    border-radius: 4px 0 0 4px;
    box-shadow: 0 0 8px var(--brand);
}

.sidebar-nav .nav-link.nav-active .nav-icon-wrap {
    background: var(--brand);
    box-shadow: 0 0 16px rgba(99,102,241,0.5);
    color: #fff;
}

/* Icon Colors Per Section */
.icon-dashboard  { background: rgba(99,102,241,0.15)  !important; color: #818cf8; }
.icon-customers  { background: rgba(20,184,166,0.15)  !important; color: #2dd4bf; }
.icon-services   { background: rgba(139,92,246,0.15)  !important; color: #a78bfa; }
.icon-invoices   { background: rgba(245,158,11,0.15)  !important; color: #fbbf24; }
.icon-visits     { background: rgba(16,185,129,0.15)  !important; color: #34d399; }
.icon-treasury   { background: rgba(239,68,68,0.15)   !important; color: #f87171; }
.icon-users      { background: rgba(236,72,153,0.15)  !important; color: #f472b6; }
.icon-settings   { background: rgba(107,114,128,0.15) !important; color: #9ca3af; }

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
}

.sidebar-footer .user-info:hover { background: var(--sidebar-item-hover); }

.sidebar-footer .user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--brand), var(--violet));
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-footer .user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--sidebar-text-hover);
    line-height: 1.2;
}

.sidebar-footer .user-role {
    font-size: 0.68rem;
    color: var(--sidebar-text);
    display: block;
}

/* ══════════════════════════════════════════════════════════════
   CONTENT AREA
══════════════════════════════════════════════════════════════ */
#content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-right: var(--sidebar-width);
    transition: margin-right 0.3s var(--ease);
    background: var(--bg);
}

#content-wrapper.sidebar-hidden {
    margin-right: 0;
}

/* ── Top Navbar ─────────────────────────────────────────────── */
.top-navbar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 900;
    flex-shrink: 0;
    box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

/* Toggle Button */
.sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--t-fast);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

/* Breadcrumb */
.top-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.top-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--t-fast);
}

.top-breadcrumb a:hover { color: var(--brand); }

.top-breadcrumb .bc-sep {
    color: var(--text-light);
    font-size: 0.75rem;
}

.top-breadcrumb .bc-current {
    color: var(--text-heading);
    font-weight: 600;
}

/* Page Title in Navbar */
.top-page-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
}

/* Top Right Actions */
.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--t-fast);
    font-size: 1rem;
    text-decoration: none;
}

.top-action-btn:hover {
    background: var(--surface-2);
    color: var(--text-heading);
    border-color: #d1d5db;
}

/* ── Scrollable Page Content ─────────────────────────────────── */
.page-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 32px;
}

.page-content::-webkit-scrollbar { width: 5px; }
.page-content::-webkit-scrollbar-track { background: transparent; }
.page-content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
.page-content::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ══════════════════════════════════════════════════════════════
   GLASS PANELS
══════════════════════════════════════════════════════════════ */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    transition: var(--t-normal);
}

.glass-panel:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    transition: var(--t-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: #d1d5db;
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: var(--t-normal);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), #8b5cf6);
    border-radius: var(--r-md) var(--r-md) 0 0;
    opacity: 0;
    transition: var(--t-normal);
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-card:hover::after { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.btn {
    font-family: 'Changa', sans-serif;
    font-weight: 600;
    border-radius: var(--r-sm);
    transition: var(--t-fast);
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--brand);
    border: none;
    color: #fff;
    box-shadow: 0 1px 2px rgba(99,102,241,0.3), 0 4px 12px rgba(99,102,241,0.2);
}

.btn-primary:hover {
    background: var(--brand-dark);
    box-shadow: 0 1px 2px rgba(99,102,241,0.4), 0 6px 18px rgba(99,102,241,0.3);
    transform: translateY(-1px);
    color: #fff;
}

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

.btn-outline-primary {
    border: 1px solid var(--brand);
    color: var(--brand);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

.btn-outline-secondary {
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: var(--surface);
}

.btn-outline-secondary:hover {
    background: var(--surface-2);
    color: var(--text-heading);
    border-color: #d1d5db;
}

.btn-success  { background:#10b981; border:none; color:#fff; }
.btn-success:hover  { background:#059669; color:#fff; transform:translateY(-1px); box-shadow:0 4px 12px rgba(16,185,129,0.3); }
.btn-danger   { background:#ef4444; border:none; color:#fff; }
.btn-danger:hover   { background:#dc2626; color:#fff; transform:translateY(-1px); box-shadow:0 4px 12px rgba(239,68,68,0.3); }
.btn-warning  { background:#f59e0b; border:none; color:#fff; }
.btn-warning:hover  { background:#d97706; color:#fff; transform:translateY(-1px); }

/* Outline variants */
.btn-outline-danger  { border:1px solid #ef4444; color:#ef4444; background:transparent; }
.btn-outline-danger:hover  { background:#ef4444; color:#fff; }
.btn-outline-success { border:1px solid #10b981; color:#10b981; background:transparent; }
.btn-outline-success:hover { background:#10b981; color:#fff; }
.btn-outline-warning { border:1px solid #f59e0b; color:#f59e0b; background:transparent; }
.btn-outline-warning:hover { background:#f59e0b; color:#fff; }

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-control, .form-select {
    font-family: 'Almarai', sans-serif;
    border-radius: var(--r-sm);
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-body);
    transition: var(--t-fast);
    text-align: right;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12), var(--shadow-sm);
    outline: none;
    background: #fff;
}

.form-label {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.875rem;
    margin-bottom: 6px;
}

.input-group-text {
    font-family: 'Changa', sans-serif;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════════ */
.table {
    font-family: 'Almarai', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 13px 16px;
    vertical-align: middle;
    border-bottom-color: var(--border);
}

.table-hover tbody tr {
    transition: var(--t-fast);
}

.table-hover tbody tr:hover {
    background-color: rgba(99,102,241,0.04);
}

.table thead th {
    font-weight: 700;
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: var(--surface-2);
    border-bottom: 1.5px solid var(--border);
    padding-top: 12px;
    padding-bottom: 12px;
}

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
    font-family: 'Almarai', sans-serif;
    font-weight: 600;
    border-radius: var(--r-full);
    padding: 4px 11px;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.bg-success { background-color: var(--success) !important; }
.bg-danger  { background-color: var(--danger)  !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-info    { background-color: var(--info)    !important; }

/* Soft Badges */
.badge-soft-success { background: rgba(16,185,129,0.12); color: #059669; }
.badge-soft-danger  { background: rgba(239,68,68,0.12);  color: #dc2626; }
.badge-soft-warning { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-soft-info    { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-soft-purple  { background: rgba(139,92,246,0.12); color: #7c3aed; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════════ */
.alert {
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-weight: 500;
    padding: 14px 18px;
}

.alert-success { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.alert-danger  { background:#fef2f2; color:#991b1b; border-color:#fecaca; }
.alert-warning { background:#fffbeb; color:#92400e; border-color:#fde68a; }
.alert-info    { background:#eff6ff; color:#1e40af; border-color:#bfdbfe; }

/* ══════════════════════════════════════════════════════════════
   TOASTS
══════════════════════════════════════════════════════════════ */
.toast {
    font-family: 'Almarai', sans-serif;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xl);
    font-size: 0.9rem;
    border: 1px solid rgba(0,0,0,0.06);
    min-width: 300px;
}

.toast-header {
    border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   UPLOAD ZONE
══════════════════════════════════════════════════════════════ */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--r-md);
    padding: 24px;
    text-align: center;
    background: var(--surface-2);
    cursor: pointer;
    transition: var(--t-normal);
}

.upload-zone:hover {
    background: rgba(99,102,241,0.05);
    border-color: var(--brand);
    transform: scale(1.01);
}

/* ══════════════════════════════════════════════════════════════
   IMAGE ZOOM
══════════════════════════════════════════════════════════════ */
.zoom-container {
    overflow: hidden;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: var(--t-normal);
}

.zoom-container img { transition: transform 0.5s var(--ease); }
.zoom-container:hover img  { transform: scale(1.12); }
.zoom-container:hover      { box-shadow: var(--shadow-lg) !important; }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.animate-fade-in     { animation: fadeInUp 0.5s var(--ease) both; }
.animate-slide-right { animation: slideInRight 0.4s var(--ease) both; }
.animate-pulse       { animation: pulse 2s ease-in-out infinite; }

/* Staggered children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }

/* ══════════════════════════════════════════════════════════════
   SCROLLBAR (Global)
══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ══════════════════════════════════════════════════════════════
   RTL HELPERS
══════════════════════════════════════════════════════════════ */
.bi { display: inline-block; }

[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem  !important; }
[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem   !important; }
[dir="rtl"] .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT HELPERS
══════════════════════════════════════════════════════════════ */
.employee-card { padding: 16px; margin-bottom: 12px; }
.employee-card .name { font-size: 1.15rem; font-weight: 800; color: var(--text-heading); }
.employee-card .info { font-size: 0.9rem; color: var(--text-muted); }

.compact-container  { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.compact-header     { margin-bottom: 1rem !important; }
.compact-header h1  { font-size: 1.6rem !important; }
.compact-panel      { padding: 1rem !important; margin-bottom: 1rem !important; }

.two-column-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .two-column-form { grid-template-columns: 1fr; } }

.compact-profile-pic { width: 80px !important; height: 80px !important; }
.smaller { font-size: 0.8rem; }
.text-muted { color: var(--text-muted) !important; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR MOBILE OVERLAY
══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    #sidebar {
        transform: translateX(100%);
    }
    #sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: -20px 0 60px rgba(0,0,0,0.3);
    }
    #content-wrapper {
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    .top-navbar { padding: 0 16px; height: 56px; }
    .top-breadcrumb .bc-current { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
    .page-content { padding: 16px 16px; }
    .glass-panel, .card { padding: 16px !important; }
    .hero-title { font-size: 2.2rem !important; }
    h1, .h1 { font-size: 1.5rem !important; }
    h2, .h2 { font-size: 1.3rem !important; }
    h3, .h3 { font-size: 1.1rem !important; }
    .btn { padding: 6px 12px; font-size: 0.85rem; }
    .two-column-form { grid-template-columns: 1fr; }
    
    /* Make table action buttons wrap better on mobile */
    td .btn-group { display: flex; flex-wrap: wrap; gap: 4px; }
    td .btn-group > .btn { border-radius: var(--r-xs) !important; flex: 1 1 auto; }
}

@media (max-width: 576px) {
    .top-breadcrumb { display: none; } /* Hide breadcrumbs on very small screens to save space */
    .top-actions .btn { padding: 4px 8px; font-size: 0.8rem; }
}

/* ══════════════════════════════════════════════════════════════
   PRINT
══════════════════════════════════════════════════════════════ */
@media print {
    #sidebar, .top-navbar, .toast-container, .no-print,
    .sidebar-overlay { display: none !important; }
    #content-wrapper { margin-right: 0 !important; }
    .page-content { padding: 0 !important; overflow: visible !important; }
    body { background: #fff !important; }
    .glass-panel, .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    .invoice-container { box-shadow: none; margin: 0; max-width: 100%; border-radius: 0; }
    .invoice-header { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000; }
    .invoice-table th { background-color: #f3f4f6 !important; -webkit-print-color-adjust: exact; }
    .badge { border: 1px solid currentColor; background: transparent !important; }
}