/* ================================================================
   Qawam — Design System v4 (jade on teal)
   Light & Dark themes · Mobile-first · RTL
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

/* =================================================================
   THEME VARIABLES
================================================================= */
:root, [data-theme="dark"] {
    /* Brand */
    --brand:           #3FB39A;
    --brand-light:     #7ED4BC;
    --brand-dark:      #1E8A72;
    --brand-glow:      rgba(63, 179, 154, 0.45);
    --brand-subtle:    rgba(63, 179, 154, 0.10);
    --brand-grad:      linear-gradient(135deg, #3FB39A 0%, #7ED4BC 100%);

    /* Surfaces */
    --bg-0:            #03191B;
    --bg-1:            #062626;
    --bg-2:            #0B3434;
    --bg-3:            #134444;

    --surface-card:    rgba(11, 52, 52, 0.78);
    --surface-card-h:  rgba(19, 68, 68, 0.92);
    --surface-input:   rgba(19, 68, 68, 0.5);
    --surface-input-f: rgba(19, 68, 68, 0.85);
    --surface-overlay: rgba(255, 255, 255, 0.04);
    --surface-overlay-strong: rgba(255, 255, 255, 0.08);
    --surface-inset:   rgba(0, 0, 0, 0.18);

    /* Topbar / Sidebar */
    --sidebar-bg:      linear-gradient(180deg, rgba(3, 25, 27, 0.97) 0%, rgba(6, 38, 38, 0.97) 100%);
    --topbar-bg:       rgba(6, 38, 38, 0.65);

    /* Text */
    --t-1:             #F8FAFC;
    --t-2:             #cbd5e1;
    --t-3:             #94a3b8;
    --t-dim:           rgba(248, 250, 252, 0.4);
    --t-on-brand:      #03191B;

    /* Borders */
    --line:            rgba(248, 250, 252, 0.07);
    --line-strong:     rgba(248, 250, 252, 0.16);

    /* Status */
    --c-success:       #22c55e;
    --c-info:          #60a5fa;
    --c-warn:          #fbbf24;
    --c-danger:        #ef4444;
    --c-purple:        #a78bfa;
    --c-pink:          #f472b6;
    --c-cyan:          #06b6d4;

    /* Shadow */
    --shadow-sm:       0 2px 8px rgba(0,0,0,0.18);
    --shadow:          0 8px 24px rgba(0,0,0,0.28);
    --shadow-lg:       0 20px 48px rgba(0,0,0,0.42);
    --shadow-glow:     0 8px 32px var(--brand-glow);

    /* Radii */
    --r-xs: 6px;  --r-sm: 10px;  --r-md: 14px;  --r-lg: 18px;  --r-xl: 24px;

    /* Layout */
    --sidebar-w:       268px;
    --topbar-h:        60px;

    /* Motion */
    --ease:            cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast:          0.18s var(--ease);
    --t-base:          0.28s var(--ease);

    color-scheme: dark;
}

[data-theme="light"] {
    --bg-0:            #E2E8F0;
    --bg-1:            #F1F5F9;
    --bg-2:            #FFFFFF;
    --bg-3:            #E2E8F0;

    --surface-card:    #FFFFFF;
    --surface-card-h:  #FFFFFF;
    --surface-input:   #F8FAFC;
    --surface-input-f: #FFFFFF;
    --surface-overlay: rgba(15, 23, 42, 0.04);
    --surface-overlay-strong: rgba(15, 23, 42, 0.08);
    --surface-inset:   #F1F5F9;

    --sidebar-bg:      linear-gradient(180deg, #062626 0%, #0B3434 100%);
    --topbar-bg:       rgba(255, 255, 255, 0.92);

    --t-1:             #0F172A;
    --t-2:             #334155;
    --t-3:             #64748B;
    --t-dim:           rgba(15, 23, 42, 0.45);

    --line:            rgba(15, 23, 42, 0.08);
    --line-strong:     rgba(15, 23, 42, 0.16);

    --shadow-sm:       0 2px 6px rgba(15, 23, 42, 0.06);
    --shadow:          0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg:       0 16px 40px rgba(15, 23, 42, 0.12);

    color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100vh; overflow-x: hidden; }

body {
    font-family: 'Cairo', system-ui, sans-serif;
    background: var(--bg-1);
    background-image:
        radial-gradient(circle at 12% 8%, rgba(63, 179, 154, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 88% 92%, rgba(63, 179, 154, 0.04) 0%, transparent 50%);
    color: var(--t-1);
    direction: rtl;
    line-height: 1.55;
    font-size: 14px;
    letter-spacing: 0.1px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* =================================================================
   GLASS / SURFACES
================================================================= */
.glass {
    background: var(--surface-card);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

/* =================================================================
   APP LAYOUT
================================================================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-left: 1px solid var(--line);
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform var(--t-base);
    color: #F8FAFC;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(248, 250, 252, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand-logo {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(63, 179, 154, 0.2);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px var(--brand-glow);
    flex-shrink: 0;
    overflow: hidden;
}
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-text .name { font-weight: 800; font-size: 1.02rem; color: var(--brand); }
.sidebar-brand-text .tagline { font-size: 0.72rem; color: rgba(248, 250, 252, 0.55); }

.sidebar-nav { padding: 14px 0; flex: 1; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(248, 250, 252, 0.16); border-radius: 4px; }

.nav-section {
    padding: 14px 22px 6px;
    color: rgba(248, 250, 252, 0.4);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 22px;
    color: rgba(248, 250, 252, 0.75);
    font-size: 0.92rem;
    font-weight: 500;
    border-right: 3px solid transparent;
    transition: var(--t-fast);
}
.nav-link i { width: 20px; text-align: center; font-size: 1rem; color: rgba(248, 250, 252, 0.45); }
.nav-link:hover { background: rgba(63, 179, 154, 0.06); color: #fff; }
.nav-link:hover i { color: var(--brand); }
.nav-link.active {
    background: linear-gradient(90deg, transparent, rgba(63, 179, 154, 0.15));
    color: var(--brand);
    border-right-color: var(--brand);
}
.nav-link.active i { color: var(--brand); }
.nav-badge {
    margin-inline-start: auto;
    background: var(--c-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-divider { margin: 12px 18px; border-top: 1px solid rgba(248, 250, 252, 0.08); }

.sidebar-foot {
    padding: 14px 18px;
    border-top: 1px solid rgba(248, 250, 252, 0.08);
    display: flex; align-items: center; gap: 10px;
}
.user-avatar {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--brand-grad);
    color: var(--bg-0);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}
.user-meta { line-height: 1.3; flex: 1; min-width: 0; }
.user-meta .name {
    font-weight: 700; font-size: 0.86rem; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-meta .role { font-size: 0.7rem; color: rgba(248, 250, 252, 0.5); }

/* =================================================================
   TOPBAR
================================================================= */
.main {
    flex: 1;
    min-width: 0;
    margin-right: var(--sidebar-w);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-h);
    padding: 0 18px;
    background: var(--topbar-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    position: sticky; top: 0; z-index: 100;
}

.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}
.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--line);
    background: var(--surface-input);
    border-radius: 10px;
    color: var(--t-1);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--t-fast);
}
.topbar-search input::placeholder { color: var(--t-3); }
.topbar-search input:focus { border-color: var(--brand); background: var(--surface-input-f); }
.topbar-search i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--t-3); font-size: 0.95rem;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--surface-input);
    border: 1px solid var(--line);
    color: var(--t-2);
    display: inline-flex; align-items: center; justify-content: center;
    transition: var(--t-fast);
    position: relative;
    flex-shrink: 0;
}
.icon-btn:hover { background: var(--brand-subtle); border-color: var(--brand); color: var(--brand); }
.icon-btn .badge {
    position: absolute; top: -3px; right: -3px;
    background: var(--c-danger); color: white;
    font-size: 0.62rem; font-weight: 700;
    padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center;
}
.menu-toggle { display: none; }

/* =================================================================
   CONTENT
================================================================= */
.content { padding: 22px; padding-bottom: 60px; }

.page-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 22px; gap: 14px; flex-wrap: wrap;
}
.page-head > div:first-child { flex: 1; min-width: 0; }
.page-head h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--t-1);
    line-height: 1.25;
    word-wrap: break-word;
}
.page-head .sub { color: var(--t-3); font-size: 0.86rem; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    color: var(--t-3); font-size: 0.82rem;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--t-3); transition: var(--t-fast); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb i { font-size: 0.7rem; opacity: 0.5; }

/* =================================================================
   CARDS
================================================================= */
.card {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: var(--shadow-sm);
    transition: var(--t-fast);
}
.card:hover { border-color: var(--line-strong); }

.card-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    gap: 8px;
    flex-wrap: wrap;
}
.card-head h3 { font-size: 1rem; font-weight: 700; color: var(--t-1); }
.card-head .actions { display: flex; gap: 6px; }

/* =================================================================
   STATS
================================================================= */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: var(--t-fast);
    box-shadow: var(--shadow-sm);
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.stat::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--accent, var(--brand));
    opacity: 0.85;
}
.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--r-md);
    background: var(--accent-bg, rgba(63, 179, 154, 0.12));
    color: var(--accent, var(--brand));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.stat-body { line-height: 1.2; flex: 1; min-width: 0; }
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--t-1);
    letter-spacing: -0.5px;
}
.stat-label { color: var(--t-3); font-size: 0.84rem; margin-top: 2px; font-weight: 500; }
.stat-trend { font-size: 0.76rem; margin-top: 4px; color: var(--t-3); }
.stat-trend.up { color: var(--c-success); }
.stat-trend.down { color: var(--c-danger); }

/* =================================================================
   BUTTONS
================================================================= */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 11px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--t-fast);
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--brand-grad);
    color: var(--bg-0);
    box-shadow: 0 6px 18px var(--brand-glow);
}
.btn-primary:hover { box-shadow: 0 10px 28px var(--brand-glow); }

.btn-ghost {
    background: var(--surface-input);
    border-color: var(--line);
    color: var(--t-1);
}
.btn-ghost:hover { background: var(--surface-input-f); border-color: var(--brand); }

.btn-success { background: var(--c-success); color: white; }
.btn-info    { background: var(--c-info); color: white; }
.btn-warn    { background: var(--c-warn); color: var(--bg-0); }
.btn-danger  { background: var(--c-danger); color: white; }
.btn-wa      { background: #25D366; color: white; }

.btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px 11px; }

/* =================================================================
   INPUTS
================================================================= */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--t-2);
    margin-bottom: 6px;
}
.field label .req { color: var(--c-danger); margin-right: 2px; }

.input, .select, .textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="password"],
input[type="search"], input[type="url"], input[type="file"],
select, textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-input);
    color: var(--t-1);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--t-3); }
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    background: var(--surface-input-f);
    box-shadow: 0 0 0 3px var(--brand-subtle);
}
input:disabled, select:disabled, textarea:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

textarea { resize: vertical; min-height: 80px; }

.input-group { display: grid; gap: 12px; }
.input-group.cols-2 { grid-template-columns: 1fr 1fr; }
.input-group.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.input-group.cols-4 { grid-template-columns: repeat(4, 1fr); }

.help-text { font-size: 0.78rem; color: var(--t-3); margin-top: 4px; }

/* Code/inline */
code {
    background: var(--surface-overlay);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: var(--t-1);
}

/* =================================================================
   TABLES
================================================================= */
.table-wrap {
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow-x: auto;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 600px;
}
.table th {
    text-align: right;
    padding: 13px 16px;
    background: var(--surface-inset);
    color: var(--t-3);
    font-weight: 700;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--t-2);
    vertical-align: middle;
}
.table tr:hover td { background: var(--brand-subtle); color: var(--t-1); }
.table tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 5px; justify-content: flex-end; }

/* =================================================================
   PILLS / BADGES
================================================================= */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--pill-bg, var(--surface-overlay-strong));
    color: var(--pill-c, var(--t-2));
}
.pill::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.pill-success { --pill-bg: rgba(34, 197, 94, 0.15);  --pill-c: #16a34a; }
.pill-info    { --pill-bg: rgba(96, 165, 250, 0.15); --pill-c: #2563eb; }
.pill-warn    { --pill-bg: rgba(251, 191, 36, 0.18); --pill-c: #d97706; }
.pill-danger  { --pill-bg: rgba(239, 68, 68, 0.15);  --pill-c: #dc2626; }
.pill-purple  { --pill-bg: rgba(167, 139, 250, 0.15); --pill-c: #7c3aed; }
.pill-pink    { --pill-bg: rgba(244, 114, 182, 0.15); --pill-c: #db2777; }
.pill-cyan    { --pill-bg: rgba(6, 182, 212, 0.15);   --pill-c: #0891b2; }
.pill-gold    { --pill-bg: var(--brand-subtle);       --pill-c: var(--brand-dark); }

[data-theme="dark"] .pill-success { --pill-c: #4ade80; }
[data-theme="dark"] .pill-info    { --pill-c: #60a5fa; }
[data-theme="dark"] .pill-warn    { --pill-c: #fbbf24; }
[data-theme="dark"] .pill-danger  { --pill-c: #f87171; }
[data-theme="dark"] .pill-purple  { --pill-c: #c084fc; }
[data-theme="dark"] .pill-pink    { --pill-c: #f472b6; }
[data-theme="dark"] .pill-cyan    { --pill-c: #22d3ee; }
[data-theme="dark"] .pill-gold    { --pill-c: var(--brand-light); }

/* =================================================================
   ALERTS
================================================================= */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: var(--r-md);
    margin-bottom: 18px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.22);
    color: #16a34a;
    font-size: 0.92rem;
}
[data-theme="dark"] .alert { color: #4ade80; }
.alert i { font-size: 1.1rem; }
.alert-info    { background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.22); color: #2563eb; }
.alert-warn    { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.22); color: #d97706; }
.alert-danger  { background: rgba(239, 68, 68, 0.08);  border-color: rgba(239, 68, 68, 0.22);  color: #dc2626; }
[data-theme="dark"] .alert-info    { color: #60a5fa; }
[data-theme="dark"] .alert-warn    { color: #fbbf24; }
[data-theme="dark"] .alert-danger  { color: #f87171; }

/* =================================================================
   TOAST
================================================================= */
.toast-host {
    position: fixed;
    top: 18px; left: 18px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 280px; max-width: 380px;
    padding: 13px 18px;
    background: var(--surface-card-h);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: var(--t-1);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 12px;
    animation: toastIn 0.32s var(--ease);
    border-right: 3px solid var(--brand);
}
.toast.success { border-right-color: var(--c-success); }
.toast.error   { border-right-color: var(--c-danger); }
.toast.info    { border-right-color: var(--c-info); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =================================================================
   TABS
================================================================= */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 12px 18px;
    color: var(--t-3);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--t-fast);
    white-space: nowrap;
    background: none;
    border-top: none; border-right: none; border-left: none;
    font-family: inherit;
    flex-shrink: 0;
}
.tab:hover { color: var(--t-1); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* =================================================================
   KANBAN
================================================================= */
.kanban {
    display: flex; gap: 14px;
    overflow-x: auto; padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}
.kanban::-webkit-scrollbar { height: 8px; }
.kanban::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.kanban-col {
    min-width: 280px; width: 280px;
    flex-shrink: 0;
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 14px;
    scroll-snap-align: start;
    backdrop-filter: blur(14px);
}
.kanban-col-head {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--col-color, var(--brand));
}
.kanban-col-head .title {
    font-size: 0.95rem; font-weight: 800;
    color: var(--col-color, var(--brand));
    display: flex; align-items: center; gap: 8px;
}
.kanban-col-head .count {
    background: var(--surface-overlay-strong);
    color: var(--t-1);
    font-size: 0.74rem;
    padding: 2px 9px;
    border-radius: 10px;
    font-weight: 700;
}
.kanban-items {
    display: flex; flex-direction: column; gap: 10px;
    min-height: 60px;
}
.kanban-card {
    background: var(--surface-overlay);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--t-fast);
}
.kanban-card:hover {
    background: var(--surface-overlay-strong);
    border-color: var(--brand);
    transform: translateY(-1px);
}

/* =================================================================
   MODAL
================================================================= */
.modal-bg {
    position: fixed; inset: 0;
    background: rgba(5, 8, 16, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s var(--ease);
}
.modal {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 28px;
    max-width: 540px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.32s var(--ease);
    color: var(--t-1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* =================================================================
   MISC
================================================================= */
.empty {
    padding: 50px 20px;
    text-align: center;
    color: var(--t-3);
}
.empty i {
    font-size: 2.5rem;
    color: var(--t-dim);
    margin-bottom: 14px;
}
.empty h4 { font-size: 1.05rem; color: var(--t-2); margin-bottom: 6px; }
.empty p { font-size: 0.88rem; max-width: 360px; margin: 0 auto; }

.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* =================================================================
   BOTTOM NAVIGATION (mobile)
================================================================= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 12px; left: 12px; right: 12px;
    z-index: 150;
    pointer-events: none;
}
.bottom-nav-inner {
    pointer-events: auto;
    height: 62px;
    display: flex;
    background: var(--surface-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--t-3);
    transition: var(--t-fast);
    padding: 6px 4px;
    text-decoration: none;
    position: relative;
}
.nav-item.active {
    color: var(--brand);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 30%; right: 30%;
    height: 3px;
    background: var(--brand);
    border-radius: 0 0 4px 4px;
}
.nav-item .icon { font-size: 1.15rem; }
.nav-item .label { font-size: 0.66rem; font-weight: 700; }

/* =================================================================
   MOBILE
================================================================= */
@media (max-width: 1024px) {
    :root { --sidebar-w: 0px; }
    .menu-toggle { display: inline-flex; }
    .main { margin-right: 0; }
    .sidebar { transform: translateX(100%); width: 280px; }
    .sidebar.open { transform: translateX(0); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5); }
    .topbar-search { display: none; }
    .input-group.cols-2,
    .input-group.cols-3,
    .input-group.cols-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .content { padding: 14px; padding-bottom: 100px; }
    .topbar { padding: 0 12px; height: 56px; gap: 6px; }
    .topbar-actions { gap: 4px; }
    .icon-btn { width: 36px; height: 36px; font-size: 0.95rem; }
    .icon-btn .badge { font-size: 0.55rem; padding: 1px 4px; min-width: 14px; }

    .input-group.cols-2,
    .input-group.cols-3,
    .input-group.cols-4 { grid-template-columns: 1fr; }

    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 14px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; font-size: 0.95rem; }
    .stat-value { font-size: 1.25rem; }
    .stat-label { font-size: 0.78rem; }
    .stat-trend { font-size: 0.7rem; }

    .page-head { gap: 10px; }
    .page-head h1 { font-size: 1.2rem; }
    .page-head .sub { font-size: 0.78rem; }
    .page-head .actions { width: 100%; }
    .page-head .actions .btn { flex: 1; min-width: 0; }
    .page-head .actions .btn .btn-icon { padding: 8px; }

    .card { padding: 14px; border-radius: 14px; }
    .card-head { margin-bottom: 12px; padding-bottom: 10px; }
    .card-head h3 { font-size: 0.92rem; }

    .btn { padding: 9px 14px; font-size: 0.86rem; }
    .btn-sm { padding: 6px 10px; font-size: 0.78rem; }
    .btn-lg { padding: 12px 18px; font-size: 0.95rem; }

    .tab { padding: 10px 14px; font-size: 0.84rem; }
    .tabs { margin-bottom: 14px; }

    .kanban-col { min-width: 260px; width: 260px; max-width: 85vw; }

    /* Tables get scroll */
    .table { font-size: 0.84rem; min-width: 700px; }
    .table th, .table td { padding: 10px 12px; }

    /* Bottom nav active */
    .bottom-nav { display: block; }

    /* Inputs avoid zoom on iOS */
    input, select, textarea { font-size: 16px !important; }

    /* Sidebar open backdrop */
    .sidebar.open ~ .main::before {
        content: '';
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 150;
    }

    .empty { padding: 36px 16px; }
    .empty i { font-size: 2rem; }
    .empty h4 { font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat { flex-direction: row; padding: 12px; }
    .stat-icon { width: 34px; height: 34px; font-size: 0.85rem; }
    .stat-value { font-size: 1.15rem; }
    .stat-label { font-size: 0.72rem; }

    .page-head h1 { font-size: 1.1rem; }
    .breadcrumb { font-size: 0.74rem; }

    .topbar { height: 54px; padding: 0 10px; }
    .icon-btn { width: 34px; height: 34px; font-size: 0.9rem; }

    .card { padding: 12px; }
}

/* =================================================================
   UTILITY
================================================================= */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--t-3); }
.text-brand { color: var(--brand); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warn); }
.text-danger { color: var(--c-danger); }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 0.84rem; } .fs-lg { font-size: 1.1rem; }
.hidden { display: none !important; }

/* =================================================================
   PREMIUM LAYER — Qawam signature
================================================================= */

/* 8-point star geometric pattern (subtle backdrop) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%233FB39A' stroke-width='0.4' opacity='0.5'><polygon points='60,8 75,30 100,32 82,52 90,80 60,68 30,80 38,52 20,32 45,30'/><circle cx='60' cy='60' r='2.5' fill='%233FB39A' opacity='0.4'/></g></svg>");
    background-size: 180px;
    mask: radial-gradient(ellipse 80% 70% at 50% 50%, black 0%, transparent 80%);
    -webkit-mask: radial-gradient(ellipse 80% 70% at 50% 50%, black 0%, transparent 80%);
}
[data-theme="light"] body::before { opacity: 0.18; }
.app, .topbar, .content { position: relative; z-index: 1; }

/* Premium serif accent for big numbers / luxury headers */
.luxe-num {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    letter-spacing: -1px;
}

/* Premium hero greeting */
.hero-greet {
    position: relative;
    padding: 26px 28px;
    background:
        linear-gradient(135deg, rgba(63, 179, 154, 0.10) 0%, rgba(63, 179, 154, 0.02) 50%, transparent 100%),
        var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    overflow: hidden;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.hero-greet::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--brand-light), var(--brand), var(--brand-dark));
    box-shadow: 0 0 24px var(--brand-glow);
}
.hero-greet::after {
    content: '';
    position: absolute;
    inset: -50% -20% auto auto;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(63, 179, 154, 0.15) 0%, transparent 60%);
    pointer-events: none;
    animation: floatGlow 8s ease-in-out infinite;
}
@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 20px); }
}
.hero-greet h1 {
    font-size: 1.85rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--t-1) 0%, var(--brand) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    line-height: 1.2;
}
.hero-greet .ornament {
    display: inline-block;
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, var(--brand), transparent);
    margin: 8px 0;
}

/* Luxe card — premium feel with shimmer border */
.luxe-card {
    position: relative;
    background: var(--surface-card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 22px;
    overflow: hidden;
    transition: var(--t-base);
    box-shadow: var(--shadow-sm);
}
.luxe-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent 30%, var(--brand-glow) 50%, transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: var(--t-base);
    pointer-events: none;
}
.luxe-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.luxe-card:hover::after { opacity: 1; }

/* Premium stat — luxury number display */
.stat-luxe .stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--t-1), var(--brand));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

/* Gold shimmer button (premium primary) */
.btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 1;
}
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary > * { position: relative; z-index: 2; }

/* Premium pill — ornamental */
.pill-luxe {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--surface-card);
    border: 1px solid var(--brand);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
}
.pill-luxe::before {
    content: '✦';
    font-size: 0.95rem;
    line-height: 1;
    color: var(--brand);
}

/* Premium kanban card */
.kanban-card {
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
    box-shadow: var(--shadow), 0 0 0 1px var(--brand-subtle);
}

/* Pipeline scroll arrow buttons */
.kanban-wrap {
    position: relative;
    margin: 0 -4px;
}
.kanban-scroll-btn {
    position: absolute;
    top: 24px;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--brand-grad);
    border: none;
    color: var(--bg-0);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px var(--brand-glow);
    z-index: 20;
    cursor: pointer;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
    font-size: 1rem;
    font-weight: 700;
}
.kanban-scroll-btn:hover {
    box-shadow: 0 10px 26px var(--brand-glow);
    transform: scale(1.1);
}
.kanban-scroll-btn:active {
    transform: scale(0.94);
}
/* prev = visually right in RTL (back in reading direction) */
.kanban-scroll-btn.prev { right: 8px; }
.kanban-scroll-btn.next { left: 8px; }
[dir="ltr"] .kanban-scroll-btn.prev { right: auto; left: 8px; }
[dir="ltr"] .kanban-scroll-btn.next { left: auto; right: 8px; }

@media (max-width: 768px) {
    .kanban-scroll-btn { width: 36px; height: 36px; font-size: 0.85rem; top: 22px; }
}

/* Sidebar premium accent */
.sidebar-brand {
    background: linear-gradient(135deg, transparent, rgba(63, 179, 154, 0.05));
    position: relative;
}
.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: -1px; right: 22px; left: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.5;
}

/* Premium login enhancements (apply if login uses these) */
.brand-mark, .sidebar-brand-logo {
    position: relative;
    overflow: hidden;
}
.brand-mark::before, .sidebar-brand-logo::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.4), transparent 30%);
    animation: shimmer 6s linear infinite;
    pointer-events: none;
}
@keyframes shimmer {
    to { transform: rotate(360deg); }
}

/* Card stagger animation on load */
.stagger > * { animation: fadeRise 0.5s var(--ease) both; }
.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; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
@keyframes fadeRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced topbar — premium look */
.topbar { position: sticky; }
.topbar::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 5%; right: 5%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-subtle), transparent);
}

/* Scrollbar premium */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* Page-head h1 — premium */
.page-head h1 {
    position: relative;
    display: inline-block;
}

/* Premium divider with ornament */
.luxe-divider {
    display: flex; align-items: center; gap: 14px;
    margin: 24px 0;
    color: var(--brand);
    font-size: 0.84rem;
    font-weight: 700;
}
.luxe-divider::before, .luxe-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-subtle), transparent);
}

/* =================================================================
   LTR SUPPORT (English)
================================================================= */
[dir="ltr"] body { font-family: 'Inter', system-ui, 'Cairo', sans-serif; direction: ltr; }

[dir="ltr"] .sidebar { right: auto; left: 0; border-left: none; border-right: 1px solid var(--line); }
[dir="ltr"] .nav-link { border-right-color: transparent; border-left: 3px solid transparent; }
[dir="ltr"] .nav-link.active { border-right-color: transparent; border-left-color: var(--brand); background: linear-gradient(-90deg, transparent, rgba(63, 179, 154, 0.15)); }
[dir="ltr"] .main { margin-right: 0; margin-left: var(--sidebar-w); }
[dir="ltr"] .table th { text-align: left; }
[dir="ltr"] .topbar-search input { padding: 0 40px 0 16px; }
[dir="ltr"] .topbar-search i { left: auto; right: 14px; }
[dir="ltr"] .stat::before { right: 0; left: 0; }
[dir="ltr"] .table-actions { justify-content: flex-end; }

[dir="ltr"] .toast-host { left: auto; right: 18px; }
@keyframes toastInLtr {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
[dir="ltr"] .toast { animation-name: toastInLtr; border-right: none; border-left: 3px solid var(--brand); }
[dir="ltr"] .toast.success { border-left-color: var(--c-success); }
[dir="ltr"] .toast.error   { border-left-color: var(--c-danger); }
[dir="ltr"] .toast.info    { border-left-color: var(--c-info); }

[dir="ltr"] .hero-greet::before { right: auto; left: 0; }
[dir="ltr"] .hero-greet::after  { inset: -50% auto auto -20%; }

[dir="ltr"] .breadcrumb i { transform: scaleX(-1); }
[dir="ltr"] .luxe-num,
[dir="ltr"] .stat-luxe .stat-value { font-family: 'Cormorant Garamond', serif; }

@media (max-width: 1024px) {
    [dir="ltr"] .sidebar { transform: translateX(-100%); }
    [dir="ltr"] .sidebar.open { transform: translateX(0); }
    [dir="ltr"] .main { margin-left: 0; }
}

/* =================================================================
   PRINT
================================================================= */
@media print {
    .sidebar, .topbar, .actions, .no-print, .bottom-nav { display: none !important; }
    .main { margin: 0; }
    body { background: white; color: black; }
    body::before { display: none; }
}

/* =================================================================
   DEMO MODE (banner + trial watermark)
================================================================= */
.demo-banner { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 16px; margin-bottom:16px; border-radius: var(--r-md); background: linear-gradient(90deg, rgba(63,179,154,0.18), rgba(63,179,154,0.06)); border:1px solid rgba(63,179,154,0.35); color: var(--t-1); font-size:0.86rem; }
.demo-banner i { color: var(--brand); }
.demo-banner .demo-cta { margin-inline-start:auto; display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:999px; background: var(--brand); color:#fff; font-weight:700; font-size:0.8rem; white-space:nowrap; box-shadow: 0 6px 16px var(--brand-glow); }
.demo-banner.trial { background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.35); }
.demo-banner.trial i { color: var(--c-success); }
.demo-mark { position:fixed; inset-inline-end:14px; bottom:76px; z-index:50; pointer-events:none; font-size:0.72rem; letter-spacing:.5px; color: var(--t-3); opacity:.55; background: var(--surface-card); border:1px solid var(--line); padding:4px 10px; border-radius:999px; }
@media (min-width: 1024px) { .demo-mark { bottom:14px; } }

/* =================================================================
   QAWAM v4 — raised sidebar cards, collapsible rail, static 3D cards
================================================================= */
.sidebar { border-left: none; box-shadow: -1px 0 0 rgba(255,255,255,0.05), -18px 0 40px -24px rgba(0,0,0,0.7); }
.sidebar-nav { padding: 10px 12px 18px; }
.nav-section { padding: 16px 12px 8px; }
.nav-link {
    margin: 4px 0; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06); border-right-width: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 6px 14px -10px rgba(0,0,0,0.8), 0 1px 0 rgba(0,0,0,0.35);
    color: rgba(248,250,252,0.82);
}
.nav-link:hover { background: linear-gradient(180deg, rgba(63,179,154,0.14), rgba(63,179,154,0.05)); border-color: rgba(63,179,154,0.35); transform: none; }
.nav-link.active {
    background: linear-gradient(180deg, rgba(63,179,154,0.28), rgba(63,179,154,0.10));
    border-color: rgba(63,179,154,0.55); border-right-color: rgba(63,179,154,0.55); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 22px -12px rgba(63,179,154,0.7), 0 1px 0 rgba(0,0,0,0.4);
}
.nav-link.active i { color: var(--brand-light); }
.nav-link .nt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-toggle {
    margin-inline-start: auto; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); color: rgba(248,250,252,0.7);
    display: inline-flex; align-items: center; justify-content: center; transition: var(--t-fast);
}
.sb-toggle:hover { color: #fff; border-color: rgba(63,179,154,0.5); background: rgba(63,179,154,0.15); }
.sb-toggle i { transition: transform var(--t-base); }
[dir="ltr"] .sb-toggle i { transform: rotate(180deg); }

/* rail state (desktop only) */
@media (min-width: 1025px) {
    html.sb-collapsed { --sidebar-w: 84px; }
    html.sb-collapsed .sidebar-brand { padding: 16px 12px; flex-direction: column; gap: 10px; }
    html.sb-collapsed .sidebar-brand-text, html.sb-collapsed .nav-section, html.sb-collapsed .nav-link .nt, html.sb-collapsed .user-meta { display: none; }
    html.sb-collapsed .sb-toggle { margin-inline-start: 0; }
    html.sb-collapsed .sb-toggle i { transform: rotate(180deg); }
    html.sb-collapsed[dir="ltr"] .sb-toggle i { transform: rotate(0deg); }
    html.sb-collapsed .nav-link { justify-content: center; padding: 12px 0; gap: 0; }
    html.sb-collapsed .nav-link i { width: auto; font-size: 1.15rem; }
    html.sb-collapsed .nav-badge { position: absolute; top: 4px; inset-inline-end: 6px; margin: 0; }
    html.sb-collapsed .nav-link { position: relative; }
    html.sb-collapsed .sidebar-foot { justify-content: center; padding: 12px 8px; }
    html.sb-collapsed .sidebar-foot .icon-btn { display: none; }
}

/* static 3D cards: depth from layered light and shadow, no motion */
.card, .glass, .stat {
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 0 rgba(0,0,0,0.25), 0 14px 32px -18px rgba(0,0,0,0.75);
    background-image: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0));
}
.card:hover, .stat:hover { transform: none; border-color: var(--line-strong); }
[data-theme="light"] .card, [data-theme="light"] .glass, [data-theme="light"] .stat {
    box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(15,23,42,0.06), 0 14px 32px -18px rgba(15,23,42,0.28);
    background-image: linear-gradient(180deg, #fff, #FBFDFC);
}
.stat-icon { box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 18px -10px var(--accent, var(--brand)); }
.btn-primary { box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 8px 18px -10px var(--brand-glow); }
a.stat { text-decoration: none; color: inherit; }

/* reports */
.rep-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rep-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-grid { display: grid; gap: 16px; margin-bottom: 18px; }
.rep-grid-2-1 { grid-template-columns: 2fr 1fr; }
.rep-grid-1-1 { grid-template-columns: 1fr 1fr; }
.chart-box { position: relative; height: 300px; }
.chart-box-sm { height: 260px; }
.chart-box-md { height: 320px; }
@media (max-width: 1024px) { .rep-grid-2-1, .rep-grid-1-1 { grid-template-columns: 1fr; } .chart-box { height: 260px; } }
/* locked sections on the public demo */
.nav-lock { margin-inline-start: auto; font-size: 0.7rem; color: rgba(248,250,252,0.35); }
html.sb-collapsed .nav-lock { display: none; }
.locked-wrap { position: relative; min-height: 520px; }
.locked-skeleton { filter: blur(6px); opacity: .55; pointer-events: none; user-select: none; }
.sk { background: linear-gradient(90deg, var(--surface-overlay) 25%, var(--surface-overlay-strong) 50%, var(--surface-overlay) 75%); background-size: 400px 100%; animation: shimmer 1.6s infinite linear; border-radius: 8px; }
.sk-line { height: 12px; margin: 6px 0; }
.sk-pill { height: 18px; width: 64px; border-radius: 999px; }
.stat-icon.sk { border: none; }
.sk-row { display: grid; grid-template-columns: 3fr 2fr 2fr 1fr 1fr; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-70 { width: 70%; }
.locked-card { position: absolute; inset: 0; margin: auto; width: min(520px, 92%); height: max-content; text-align: center; padding: 34px 28px; border-radius: var(--r-xl); background: var(--surface-card); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); backdrop-filter: blur(20px); }
.locked-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; font-size: 1.5rem; color: var(--brand-light); background: var(--brand-subtle); border: 1px solid rgba(63,179,154,0.35); box-shadow: 0 10px 24px -12px var(--brand-glow); }
.locked-card h2 { font-size: 1.25rem; margin-bottom: 8px; }
.locked-card p { color: var(--t-2); line-height: 1.8; margin-bottom: 18px; font-size: 0.92rem; }
.locked-open { margin-top: 16px; font-size: 0.78rem; color: var(--t-3); }

/* computed lead score */
.score-view{display:flex;align-items:center;gap:10px;height:42px}
.score-bar{flex:1;height:10px;border-radius:999px;background:var(--surface-overlay-strong);overflow:hidden}
.score-bar div{height:100%;background:var(--brand-grad);border-radius:999px}

/* auth mini pages + whatsapp panel */
.auth-mini{min-height:100vh;display:grid;place-items:center;padding:20px;background:var(--bg-1)}
.auth-mini-card{width:min(440px,100%);padding:28px}
.auth-mini-brand{display:flex;align-items:center;gap:10px;margin-bottom:14px}.auth-mini-brand img{width:40px;height:40px;object-fit:contain}.auth-mini-brand b{color:var(--brand);font-size:1.1rem}
.auth-mini h2{font-size:1.2rem;margin-bottom:6px}
.wa-panel{border-color:rgba(37,211,102,.25)}
.btn-wa{background:#25D366;color:#03191B;border:none}.btn-wa:disabled{opacity:.5;cursor:not-allowed}
.pill-success{background:rgba(34,197,94,.15);color:#4ade80}.pill-warn{background:rgba(251,191,36,.18);color:#d97706}.pill-info{background:rgba(96,165,250,.15);color:#60a5fa}
