/* =========================================================
   CULSYSTEM — Unified Design System
   One CSS file. All pages. Modern, neat, consistent.
   Author: Empacode Africa
   ========================================================= */

/* ---------- 0. Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* ---------- 1. Design tokens ---------- */
:root {
    /* Brand */
    --brand-primary:        #0F1B2D;
    --brand-primary-light:  #1E3554;
    --brand-primary-dark:   #060D17;
    --brand-accent:         #C5A256;
    --brand-accent-light:   #E5C679;
    --brand-accent-dark:    #9C7E3E;
    --brand-accent-2:       #D89E47;
    --brand-success:        #10B981;
    --brand-danger:         #DC2626;
    --brand-warning:        #F59E0B;
    --brand-info:           #2563EB;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #0F1B2D 0%, #1E3554 50%, #C5A256 100%);
    --grad-warm:    linear-gradient(135deg, #C5A256 0%, #D89E47 100%);
    --grad-cool:    linear-gradient(135deg, #1E3554 0%, #2563EB 100%);
    --grad-dark:    linear-gradient(135deg, #0F1B2D 0%, #1E3554 100%);
    --grad-soft:    linear-gradient(135deg, #FAF6F0 0%, #F5F0F4 50%, #EEF1F4 100%);

    /* Surfaces */
    --bg:             #F5F2EC;
    --bg-card:        #FFFFFF;
    --bg-sidebar:     #FFFFFF;
    --bg-soft:        #F8F6F1;
    --border:         #E8E4DC;
    --border-strong:  #D6D0C2;
    --text:           #0F1B2D;
    --text-soft:      #5A6473;
    --text-mute:      #8B8E96;

    /* Inputs */
    --input-bg:       #FAF8F3;
    --input-border:   #E0DACA;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 27, 45, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 27, 45, 0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(15, 27, 45, 0.08);
    --shadow-lg: 0 12px 28px rgba(15, 27, 45, 0.12);
    --shadow-xl: 0 24px 48px rgba(15, 27, 45, 0.16);

    /* Radius */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-2xl: 28px;
    --r-full: 999px;

    /* Spacing scale */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-7: 32px;
    --sp-8: 40px;
    --sp-9: 48px;

    /* Layout */
    --sidebar-w: 210px;
    --topbar-h:  52px;
    --content-max: 1400px;

    /* Typography */
    --font-sans:      'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display:   'Montserrat', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0A121E;
        --bg-card: #14202F;
        --bg-sidebar: #14202F;
        --bg-soft: #1A2A3D;
        --border: #233547;
        --border-strong: #2D4258;
        --text: #F4F0E8;
        --text-soft: #B5BCC8;
        --text-mute: #7A8290;
        --input-bg: #1E2D42;
        --input-border: #2D4258;
    }
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
    font-size: 13px; /* Scales all rem units proportionally for crisp, comfortable 100% zoom */
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-accent-dark); text-decoration: none; transition: color .2s; font-weight: 500; }
a:hover { color: var(--brand-accent); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .35em; line-height: 1.25; font-weight: 700; color: var(--brand-primary); }
h1 { font-size: 1.22rem; letter-spacing: -.02em; }
h2 { font-size: 1.02rem; letter-spacing: -.01em; }
h3 { font-size: .90rem; }
h4 { font-size: .80rem; }
p  { margin: 0 0 .75em; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.2rem 0; }
code, pre { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: .88em; }
::selection { background: var(--brand-accent); color: #fff; }

/* ---------- 3. App layout ---------- */
.app-wrap { display: flex; min-height: 100vh; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,27,45,.5); backdrop-filter: blur(2px); z-index: 49; }
.sidebar-backdrop.open { display: block; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
    z-index: 50;
    transition: transform .3s ease;
    display: flex; flex-direction: column;
}
.sidebar-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-header .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sidebar-header .brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand-accent); flex-shrink: 0; }
.sidebar-header .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.sidebar-header .brand .name { font-weight: 800; font-size: 1.05rem; color: var(--brand-primary); white-space: nowrap; }
.sidebar-header .brand .tagline { font-size: .68rem; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-section { padding: 10px 0 2px; }
.sidebar-section + .sidebar-section { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 6px; }
.sidebar-section .section-title {
    padding: 6px 22px;
    margin: 0;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-mute);
}
.sidebar-section.collapsed .sidebar-nav { display: none; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 20px;
    color: var(--text-soft);
    font-size: .85rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
    text-decoration: none;
}
.sidebar-nav li a:hover { background: var(--bg-soft); color: var(--brand-primary); }
.sidebar-nav li a.active {
    background: linear-gradient(90deg, rgba(197, 162, 86, .14), transparent);
    color: var(--brand-primary);
    border-left-color: var(--brand-accent);
    font-weight: 600;
}
.sidebar-nav .nav-icon {
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-nav .nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav .nav-icon svg * { fill: none !important; stroke: currentColor !important; }
.sidebar-nav .nav-new { margin-left: auto; background: var(--brand-accent); color: var(--brand-primary); border-radius: var(--r-full); padding: 1px 7px; font-size: .62rem; font-weight: 700; text-transform: uppercase; }

/* ---------- 4. Topbar ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 40;
    backdrop-filter: blur(8px);
    min-height: var(--topbar-h);
}
.topbar .menu-toggle {
    display: none;
    width: 38px; height: 38px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--brand-primary);
    font-size: 1.2rem;
    align-items: center; justify-content: center;
}
.topbar .topbar-title { flex: 1; min-width: 0; }
.topbar .page-title { font-size: 1.15rem; margin: 0; color: var(--brand-primary); font-weight: 700; line-height: 1.1; }
.topbar .page-title h1 { font-size: inherit; margin: 0; color: inherit; font-weight: inherit; }
.topbar .page-subtitle { font-size: .8rem; color: var(--text-mute); margin: 2px 0 0; line-height: 1.2; }
.topbar .topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
    position: relative;
    width: 40px; height: 40px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-soft);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .15s;
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg-card); color: var(--brand-primary); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg * { fill: none !important; stroke: currentColor !important; }
.icon-btn .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--brand-danger); color: #fff; font-size: .65rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg-card); }

/* CMO Switcher (topbar pill) */
.cmo-switcher {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #FFF8E5 0%, #FDF3D2 100%);
    border: 1px solid #E8D898;
    border-radius: var(--r-full);
    padding: 3px 4px 3px 12px;
    box-shadow: var(--shadow-xs);
    flex-wrap: wrap;
}
.cmo-switcher-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .4px;
    color: #8B6F1A; white-space: nowrap;
}
.cmo-switcher-label .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-warning); box-shadow: 0 0 0 3px rgba(245,158,11,.22); }
.cmo-switcher-select {
    appearance: none; -webkit-appearance: none;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%238893A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 8px center;
    background-size: 11px 11px;
    border: 1px solid #D6C887;
    border-radius: var(--r-full);
    padding: 5px 26px 5px 12px;
    font-size: .78rem; font-weight: 600;
    color: var(--text);
    font-family: inherit; cursor: pointer;
    line-height: 1.2; min-width: 180px; max-width: 320px;
}
.cmo-switcher-select:focus { outline: 0; border-color: var(--brand-warning); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }

/* User menu */
.user-menu {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-soft);
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer; user-select: none;
    transition: background .15s;
    margin-left: 4px;
}
.user-menu:hover { background: var(--bg-card); border-color: var(--border-strong); }
.user-menu .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; background-size: cover; background-position: center; }
.user-menu .meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.user-menu .name { font-size: .85rem; font-weight: 700; color: var(--brand-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.user-menu .role { font-size: .68rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.user-menu .chev { font-size: .7rem; color: var(--text-mute); }

.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 16px;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: 6px 0; z-index: 1000;
    display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 10px 16px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-dropdown-header .ud-name { font-weight: 600; color: var(--text); font-size: .92rem; }
.user-dropdown-header .ud-role { font-size: .7rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.user-dropdown-header .ud-cmo  { font-size: .78rem; color: var(--brand-primary); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.user-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: var(--text); text-decoration: none; font-size: .88rem; transition: background .12s; }
.user-dropdown-item:hover { background: var(--bg-soft); }
.user-dropdown-item.logout { color: var(--brand-danger); font-weight: 500; }
.user-dropdown-item.logout:hover { background: rgba(220,38,38,.08); }

.topbar { position: relative; }

/* ---------- 5. Content area ---------- */
.content {
    padding: 24px;
    flex: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
.content-inner {
    max-width: 1480px;
    margin: 0 auto;
}
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.page-header h1 { margin: 0; font-size: 1.4rem; }
.page-header .page-subtitle { color: var(--text-mute); font-size: .88rem; margin: 4px 0 0; }
.page-header .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 6. Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h2, .card-header h3 { margin: 0; color: var(--brand-primary); }
.card-header .subtitle { font-size: .8rem; color: var(--text-mute); }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-soft); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.card-hover { transition: transform .2s, box-shadow .2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card-gradient { background: var(--grad-primary); color: #fff; border: none; }
.card-gradient h2, .card-gradient h3 { color: #fff; }
.card-gradient .card-header { border-bottom-color: rgba(255,255,255,.15); }
.card-gradient p, .card-gradient .subtitle { color: rgba(255,255,255,.9); }

/* ---------- 7. Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    display: flex; gap: 14px; align-items: center;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
    min-width: 0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .icon {
    width: 48px; height: 48px;
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: var(--brand-primary);
    flex-shrink: 0;
    background: var(--bg-soft);
}
.stat-card .icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-card .icon svg * { fill: none !important; stroke: currentColor !important; }
.stat-card .icon.gradient   { background: var(--grad-primary); color: #fff; }
.stat-card .icon.gradient-2 { background: var(--grad-warm);    color: var(--brand-primary); }
.stat-card .icon.gradient-3 { background: var(--grad-cool);    color: #fff; }
.stat-card .icon.gradient-4 { background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-success) 100%); color: #fff; }
.stat-card .icon.gradient-5 { background: linear-gradient(135deg, var(--brand-danger)  0%, #F87171 100%); color: #fff; }
.stat-card .body { min-width: 0; flex: 1; }
.stat-card .label  { font-size: .72rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px; font-weight: 600; }
.stat-card .value  { font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--brand-primary); overflow: hidden; text-overflow: ellipsis; }
.stat-card .delta  { font-size: .7rem; color: var(--brand-success); margin-top: 4px; }
.stat-card .delta.down { color: var(--brand-danger); }

/* Stat cards: color-bordered variants (for quick visual scan) */
.stat-card.bd-blue   { border-top: 3px solid var(--brand-info); }
.stat-card.bd-green  { border-top: 3px solid var(--brand-success); }
.stat-card.bd-orange { border-top: 3px solid var(--brand-warning); }
.stat-card.bd-red    { border-top: 3px solid var(--brand-danger); }
.stat-card.bd-gold   { border-top: 3px solid var(--brand-accent); }

/* ---------- 8. Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 18px;
    border-radius: var(--r-md);
    font-size: .88rem;
    font-weight: 600;
    border: 1px solid transparent;
    background: var(--bg-soft);
    color: var(--text);
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-light); color: #fff; }
.btn-accent { background: var(--brand-accent); color: var(--brand-primary); }
.btn-accent:hover { background: var(--brand-accent-light); color: var(--brand-primary); }
.btn-success { background: var(--brand-success); color: #fff; }
.btn-danger  { background: var(--brand-danger);  color: #fff; }
.btn-info    { background: var(--brand-info);    color: #fff; }
.btn-warning { background: var(--brand-warning); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--brand-primary); }
.btn-outline:hover { background: var(--bg-soft); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-link { background: transparent; color: var(--brand-accent-dark); padding: 0; font-weight: 600; }
.btn-link:hover { text-decoration: underline; box-shadow: none; transform: none; }
.btn-gradient { background: var(--grad-primary); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 9. Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--brand-primary); margin-bottom: 6px; }
.form-group label .required { color: var(--brand-danger); }

.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="tel"], input[type="url"], input[type="search"], select, textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: .88rem;
    font-family: inherit;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--r-md);
    transition: all .15s;
    line-height: 1.4;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(197, 162, 86, .18);
    background: #fff;
}
.form-control:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .65; cursor: not-allowed; }
textarea { min-height: 110px; resize: vertical; }
input[type="file"] {
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-md);
    width: 100%;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-soft);
    transition: border-color .15s, background .15s;
}
input[type="file"]:hover { border-color: var(--brand-accent); background: var(--bg-soft); }
input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 5px 12px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--brand-primary);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
input[type="file"]::file-selector-button:hover { background: var(--brand-primary-light); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-primary); width: 16px; height: 16px; }
.form-text { font-size: .78rem; color: var(--text-mute); margin-top: 4px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
    .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}
.form-inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

/* Input with icon */
.input-icon { position: relative; }
.input-icon .icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-mute); pointer-events: none;
}
.input-icon .icon svg, .input-icon .icon img { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.input-icon input { padding-left: 42px; }
.input-icon .toggle-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--text-soft);
}

/* ---------- 10. Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-weight: 600; color: var(--text-soft); background: var(--bg-soft); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: none; }
.table-compact th, .table-compact td { padding: 9px 12px; }
.table-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.table-fixed { table-layout: fixed; }

/* Empty state for tables */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-mute); }
.empty-state .icon { font-size: 2.6rem; opacity: .35; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-soft); margin: 0 0 6px; font-size: 1rem; }
.empty-state p { font-size: .85rem; margin: 0 0 16px; }

/* ---------- 11. Badges ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    background: var(--bg-soft);
    color: var(--text-soft);
    white-space: nowrap;
    line-height: 1.4;
}
.badge-success { background: rgba(16,185,129,.12);  color: #047857; }
.badge-danger  { background: rgba(220,38,38,.12);   color: #B91C1C; }
.badge-warning { background: rgba(245,158,11,.15);  color: #92400E; }
.badge-info    { background: rgba(37,99,235,.12);   color: #1E40AF; }
.badge-primary { background: rgba(15,27,45,.1);     color: var(--brand-primary); }
.badge-accent  { background: rgba(197,162,86,.18);  color: var(--brand-accent-dark); }
.badge-dot { display: inline-flex; align-items: center; gap: 6px; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 12. Flash / alerts ---------- */
.flash {
    padding: 12px 16px;
    border-radius: var(--r-md);
    margin-bottom: 16px;
    font-size: .9rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    border: 1px solid;
    line-height: 1.4;
}
.flash-info    { background: rgba(37,99,235,.08);  color: #1E40AF; border-color: rgba(37,99,235,.25); }
.flash-success { background: rgba(16,185,129,.08); color: #047857; border-color: rgba(16,185,129,.25); }
.flash-warning { background: rgba(245,158,11,.1);  color: #92400E; border-color: rgba(245,158,11,.3); }
.flash-danger  { background: rgba(220,38,38,.08);  color: #B91C1C; border-color: rgba(220,38,38,.25); }
.flash-close { background: none; border: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.flash-close:hover { opacity: 1; }

/* ---------- 13. Auth pages (Login / Register / Forgot) ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--grad-soft);
    position: relative;
    flex-direction: column;
}
.auth-card {
    background: var(--bg-card);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-xl);
    padding: 40px 40px 32px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}
.auth-card.auth-card-wide { max-width: 880px; width: 100%; }
.auth-logo-wrap { text-align: center; margin-bottom: 24px; }
.auth-logo-outer { text-align: center; margin-bottom: 24px; z-index: 1; position: relative; }
.auth-logo { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto; display: block; box-shadow: var(--shadow-md); border: 2px solid var(--brand-accent); }
.auth-logo-outer .auth-logo { width: 96px; height: 96px; }
.auth-card h1 { text-align: left; font-size: 1.5rem; margin-bottom: 6px; color: var(--brand-primary); }
.auth-card .auth-tagline { text-align: left; color: var(--text-mute); font-size: .88rem; margin-bottom: 22px; }

.auth-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: var(--r-md); margin-bottom: 20px; }
.auth-tab { flex: 1; text-align: center; padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--text-soft); transition: all .15s; text-decoration: none; }
.auth-tab.active { background: var(--bg-card); color: var(--brand-primary); box-shadow: var(--shadow-xs); }

.auth-divider { text-align: center; color: var(--text-mute); font-size: .8rem; margin: 18px 0 14px; position: relative; }
.auth-divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.auth-divider span { background: var(--bg-card); padding: 0 12px; position: relative; }

.auth-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.role-tile {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: var(--bg-card);
}
.role-tile:hover { border-color: var(--brand-accent); transform: translateY(-1px); }
.role-tile.active { border-color: var(--brand-accent); background: rgba(197,162,86,.05); }
.role-tile .icon { font-size: 1.6rem; margin-bottom: 6px; color: var(--brand-primary); }
.role-tile .name { font-size: .82rem; font-weight: 600; }
.role-tile .desc { font-size: .7rem; color: var(--text-mute); }

.auth-footer { text-align: center; font-size: .85rem; color: var(--text-mute); margin-top: 22px; }
.auth-footer a { color: var(--brand-accent-dark); font-weight: 600; }
.auth-footer a:hover { color: var(--brand-accent); }

.auth-page-footer { margin-top: 28px; text-align: center; font-size: .78rem; color: var(--text-soft); z-index: 1; position: relative; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 18px; font-size: .8rem; }
.auth-row label { display: flex; align-items: center; gap: 6px; color: var(--brand-primary); font-weight: 500; cursor: pointer; margin: 0; }
.auth-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-primary); cursor: pointer; }
.auth-row a { color: var(--brand-accent-dark); font-weight: 500; }
.auth-row a:hover { color: var(--brand-accent); }

.btn-login {
    background: #fff; color: var(--brand-primary);
    border: 2px solid var(--brand-accent);
    border-radius: var(--r-full);
    font-weight: 700;
    padding: 10px 22px;
    font-size: .92rem;
    box-shadow: 0 4px 14px rgba(197,162,86,.25);
    transition: all .2s;
}
.btn-login:hover { background: var(--brand-accent); color: var(--brand-primary); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(197,162,86,.4); }

/* ---------- 14. Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15,27,45,.55);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn .2s;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: var(--r-xl);
    max-width: 540px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp .25s;
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h2, .modal-header h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 1.5rem; line-height: 1; color: var(--text-mute); cursor: pointer; padding: 0; }

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

/* ---------- 15. Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab {
    padding: 10px 18px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-soft);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    text-decoration: none;
    background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--brand-primary); }
.tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-accent); }

/* ---------- 16. Landing / public pages ---------- */
.landing { min-height: 100vh; background: var(--bg); }
.landing-nav {
    padding: 16px 32px;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.landing-nav .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.landing-nav .brand img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--brand-accent); }
.landing-nav .brand .name { font-weight: 800; font-size: 1.1rem; color: var(--brand-primary); }
.landing-nav .nav-links { display: flex; gap: 32px; align-items: center; flex: 1; justify-content: center; }
.landing-nav .nav-links a { color: var(--brand-primary); font-weight: 600; font-size: .9rem; text-decoration: none; transition: color .2s; }
.landing-nav .nav-links a:hover { color: var(--brand-accent-dark); }
.landing-nav .nav-actions { display: flex; gap: 10px; align-items: center; }

.btn-login-outline {
    background: #fff; color: var(--brand-primary);
    border: 1.5px solid var(--border-strong);
    padding: 8px 22px; border-radius: var(--r-full);
    font-weight: 700; font-size: .9rem;
    text-decoration: none; transition: all .18s;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-login-outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-register {
    background: var(--brand-accent); color: #fff;
    padding: 8px 22px; border-radius: var(--r-full);
    font-weight: 700; font-size: .9rem;
    text-decoration: none; transition: all .18s;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(197,162,86,.25);
}
.btn-register:hover { background: var(--brand-accent-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(197,162,86,.4); color: #fff; }

.landing-hero {
    display: grid; grid-template-columns: 1.1fr 1fr;
    gap: 40px; align-items: center;
    padding: 70px 32px 50px;
    max-width: 1280px; margin: 0 auto;
    background: #fff;
}
.landing-hero h1 {
    color: var(--brand-primary);
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.05; font-weight: 900; letter-spacing: -.025em;
    margin: 0 0 22px;
}
.landing-hero h1 .accent { color: var(--brand-accent); position: relative; }
.landing-hero h1 .accent::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 6px; background: rgba(197,162,86,.2); border-radius: 3px; z-index: -1; }
.landing-hero p.lead { color: var(--text-soft); font-size: 1rem; line-height: 1.65; max-width: 540px; margin: 0 0 32px; }
.landing-hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-self-license {
    background: var(--brand-primary); color: #fff;
    padding: 14px 28px; border-radius: var(--r-full);
    font-weight: 700; font-size: 1rem;
    text-decoration: none; transition: all .2s;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid var(--brand-accent);
    box-shadow: 0 8px 24px rgba(197,162,86,.25);
}
.btn-self-license:hover { background: var(--brand-primary-light); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(197,162,86,.4); color: #fff; }
.hero-illustration { position: relative; }
.hero-illustration img { width: 100%; height: auto; }

.landing-features {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 20px; max-width: 1280px; margin: 30px auto 0; padding: 0 32px 60px;
}
.feature-tile {
    background: #fff; border-radius: var(--r-lg);
    padding: 28px 20px; text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all .2s;
}
.feature-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-tile .icon { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--brand-accent); display: flex; align-items: center; justify-content: center; }
.feature-tile .icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; }
.feature-tile h3 { color: var(--brand-primary); font-size: 1rem; margin: 0; font-weight: 700; }

.landing-section { padding: 70px 32px; max-width: 1200px; margin: 0 auto; }
.landing-section h2 { text-align: center; font-size: 2rem; color: var(--brand-primary); margin-bottom: 12px; }
.landing-section .section-sub { text-align: center; color: var(--text-soft); font-size: 1rem; max-width: 700px; margin: 0 auto 50px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 26px 22px; box-shadow: var(--shadow-xs);
    transition: all .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-accent); }
.feature-card .icon {
    width: 52px; height: 52px; border-radius: var(--r-md);
    background: var(--grad-warm); color: var(--brand-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; margin-bottom: 16px;
}
.feature-card h3 { color: var(--brand-primary); font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-soft); font-size: .9rem; margin: 0; }

.stakeholder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.stakeholder-card {
    background: #fff; border-radius: var(--r-xl);
    padding: 32px 24px; text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all .2s;
}
.stakeholder-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stakeholder-card .icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--grad-warm); color: var(--brand-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; margin: 0 auto 18px;
}
.stakeholder-card h3 { color: var(--brand-primary); margin-bottom: 10px; }
.stakeholder-card p { color: var(--text-soft); font-size: .9rem; margin-bottom: 18px; }
.stakeholder-card .btn { background: var(--brand-primary); color: #fff; padding: 8px 20px; border-radius: var(--r-full); font-size: .85rem; text-decoration: none; }
.stakeholder-card .btn:hover { background: var(--brand-primary-light); color: #fff; }

.landing-cta { background: var(--grad-primary); color: #fff; text-align: center; padding: 60px 32px; }
.landing-cta h2 { color: #fff; }
.landing-cta p { color: rgba(255,255,255,.9); max-width: 600px; margin: 0 auto 24px; }
.landing-cta .btn-primary { background: var(--brand-accent); color: var(--brand-primary); }
.landing-cta .btn-primary:hover { background: var(--brand-accent-light); color: var(--brand-primary); }
.landing-cta .btn-outline { color: #fff; border-color: rgba(255,255,255,.4); }
.landing-cta .btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; }

.landing-footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 30px 32px; text-align: center; color: var(--text-mute); font-size: .85rem; }

@media (max-width: 980px) {
    .landing-hero { grid-template-columns: 1fr; padding: 40px 20px 20px; }
    .hero-illustration { order: -1; max-width: 480px; margin: 0 auto; }
    .landing-nav { padding: 12px 20px; }
    .landing-nav .nav-links { display: none; }
    .landing-features { grid-template-columns: 1fr 1fr; padding: 0 20px 40px; }
    .landing-section { padding: 50px 20px; }
    .landing-cta { padding: 50px 20px; }
    .landing-footer { padding: 24px 20px; }
}
@media (max-width: 520px) {
    .landing-features { grid-template-columns: 1fr; }
    .landing-nav .nav-actions { gap: 8px; }
    .btn-login-outline, .btn-register { padding: 8px 16px; font-size: .82rem; }
}

/* ---------- 17. Footer credit ---------- */
.footer-credit { padding: 16px 24px; text-align: center; color: var(--text-mute); font-size: .78rem; border-top: 1px solid var(--border); background: var(--bg-card); }
.footer-credit strong { color: var(--brand-primary); }

/* ---------- 18. Utility classes ---------- */
.text-muted  { color: var(--text-mute); }
.text-soft   { color: var(--text-soft); }
.text-success{ color: var(--brand-success); }
.text-danger { color: var(--brand-danger); }
.text-warning{ color: var(--brand-warning); }
.text-info   { color: var(--brand-info); }
.text-primary{ color: var(--brand-primary); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-sm     { font-size: .85rem; }
.text-xs     { font-size: .78rem; }
.text-lg     { font-size: 1.1rem; }
.text-xl     { font-size: 1.3rem; }
.fw-bold     { font-weight: 700; }
.fw-semi     { font-weight: 600; }
.fw-normal   { font-weight: 400; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.p-0  { padding: 0 !important; }
.p-2  { padding: var(--sp-2); }
.p-3  { padding: var(--sp-3); }
.p-4  { padding: var(--sp-4); }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.d-flex    { display: flex; }
.d-block   { display: block; }
.d-grid    { display: grid; }
.d-none    { display: none; }
.d-inline-flex { display: inline-flex; }

/* ── AI Intelligence Layer ───────────────────────────────────────────── */
.ai-card {
  background: linear-gradient(135deg, #f0f4ff 0%, #fdf4ff 100%);
  border: 1px solid #d8b4fe;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.ai-card--locked {
  background: #f8f8f8;
  border-color: #e5e7eb;
  opacity: 0.85;
}
.ai-card--empty {
  background: #f9fafb;
  border-color: #e5e7eb;
}
.ai-card__header {
  font-weight: 700;
  font-size: 0.9rem;
  color: #6d28d9;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-card--locked .ai-card__header { color: #9ca3af; }
.ai-card__body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #374151;
}
.ai-banner {
  background: linear-gradient(90deg, #5B2C9B 0%, #7c3aed 100%);
  color: #fff;
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.ai-banner .ai-banner__text { font-size: 0.9rem; }
.ai-banner .ai-banner__badge {
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.risk-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  margin-top: 4px;
}
.risk-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #16a34a, #dc2626);
}
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.align-center    { align-items: center; }
.align-start     { align-items: flex-start; }
.align-end       { align-items: flex-end; }
.flex-1     { flex: 1; }
.flex-wrap  { flex-wrap: wrap; }
.flex-col   { flex-direction: column; }
.w-100      { width: 100%; }
.no-decoration { text-decoration: none; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-wrap    { white-space: nowrap; }
.relative   { position: relative; }
.hidden     { display: none !important; }
.uppercase  { text-transform: uppercase; letter-spacing: .04em; }
.gradient-text { background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Grid helpers */
.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4, .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
    .grid-3, .grid-4, .dash-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ---------- 19. Marketplace / cards grid ---------- */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.market-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: all .2s;
    display: flex; flex-direction: column;
}
.market-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-accent); }
.market-card .cover { aspect-ratio: 16/9; background: var(--grad-warm); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--brand-primary); font-size: 1.5rem; }
.market-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.market-card .body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.market-card .title { font-weight: 700; font-size: 1rem; color: var(--brand-primary); }
.market-card .meta { font-size: .78rem; color: var(--text-mute); }
.market-card .desc { font-size: .85rem; color: var(--text-soft); flex: 1; }
.market-card .footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--bg-soft); }
.market-card .price { font-weight: 700; color: var(--brand-accent-dark); }

/* Marketplace page hero */
.mp-hero { background: var(--grad-primary); color: #fff; padding: 50px 24px 30px; text-align: center; }
.mp-hero h1 { color: #fff; font-size: 2rem; margin-bottom: 8px; }
.mp-hero p { color: rgba(255,255,255,.9); margin: 0 0 18px; }
.mp-search { max-width: 600px; margin: 0 auto; display: flex; gap: 6px; }
.mp-search input { flex: 1; padding: 12px 16px; border: 0; border-radius: var(--r-md); }
.mp-search button { padding: 12px 20px; background: var(--brand-accent); color: #fff; border: 0; border-radius: var(--r-md); font-weight: 700; cursor: pointer; }
.mp-cats { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mp-cat { padding: 8px 16px; background: var(--bg-soft); border-radius: var(--r-full); font-size: .85rem; font-weight: 600; color: var(--text-soft); text-decoration: none; white-space: nowrap; transition: all .15s; }
.mp-cat:hover { background: var(--bg-soft); color: var(--text); }
.mp-cat.active { background: var(--brand-primary); color: #fff; }
.mp-section { max-width: 1200px; margin: 30px auto; padding: 0 24px; }
.mp-empty { text-align: center; padding: 80px 20px; color: var(--text-mute); }
.mp-empty .icon { font-size: 3rem; margin-bottom: 12px; opacity: .4; }

/* ---------- 20. Progress / bars ---------- */
.progress { background: var(--bg-soft); border-radius: var(--r-full); height: 8px; overflow: hidden; }
.progress > .bar { height: 100%; background: var(--grad-warm); border-radius: var(--r-full); transition: width .4s; }
.progress.success > .bar { background: var(--brand-success); }
.progress.warning > .bar { background: var(--brand-warning); }
.progress.danger  > .bar { background: var(--brand-danger); }

/* ---------- 21. Pagination ---------- */
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.pagination a, .pagination span {
    padding: 7px 13px; border-radius: var(--r-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-soft); text-decoration: none; font-size: .85rem;
}
.pagination a:hover { background: var(--bg-soft); }
.pagination .current { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* ---------- 22. Toolbar / filter bar ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar .search-box { flex: 1; max-width: 320px; }

/* ---------- 23. POS / item tiles ---------- */
.item-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    display: flex; flex-direction: column; gap: 4px; align-items: center;
    min-height: 110px;
    justify-content: center;
}
.item-tile:hover { border-color: var(--brand-accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.item-tile.selected { border-color: var(--brand-accent); background: rgba(197,162,86,.08); }

.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.items-grid-tight { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.items-grid-wide { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.scroll-y-400 { max-height: 400px; overflow-y: auto; }
.scroll-y-500 { max-height: 500px; overflow-y: auto; }
.scroll-y-600 { max-height: 600px; overflow-y: auto; }

.empty-icon { font-size: 3.5rem; margin-bottom: 10px; opacity: .35; }

/* Print / invoice header */
.print-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.print-header h1, .print-header h2 { margin: 0 0 6px; }

/* Stat card size variants */
.stat-card-sm { padding: 14px 16px; }
.stat-card-sm .icon { width: 40px; height: 40px; font-size: 1.1rem; }
.stat-card-sm .icon.icon-sm { width: 40px; height: 40px; }
.value-sm { font-size: 1.2rem !important; }
.value-md { font-size: 1.4rem !important; }
.icon-sm { width: 40px; height: 40px; font-size: 1.1rem; }

/* Card variants */
.card-soft { background: var(--bg-soft); }
.card-emphasis { background: linear-gradient(135deg, #fff 0%, #f8f7fc 100%); border: 2px solid var(--brand-primary); }

/* Min-width helpers (used on table columns / selects) */
.mw-100 { min-width: 100px; } .mw-120 { min-width: 120px; } .mw-140 { min-width: 140px; }
.mw-160 { min-width: 160px; } .mw-180 { min-width: 180px; } .mw-200 { min-width: 200px; }
.mw-220 { min-width: 220px; } .mw-240 { min-width: 240px; } .mw-260 { min-width: 260px; }
.mw-280 { min-width: 280px; } .mw-300 { min-width: 300px; } .mw-340 { min-width: 340px; }

/* Width helpers (used on table columns) */
.w-30 { width: 30px; } .w-40 { width: 40px; } .w-50 { width: 50px; }
.w-60 { width: 60px; } .w-70 { width: 70px; } .w-80 { width: 80px; }
.w-100 { width: 100px; } .w-120 { width: 120px; } .w-140 { width: 140px; }
.w-160 { width: 160px; } .w-180 { width: 180px; } .w-200 { width: 200px; }
.w-220 { width: 220px; } .w-240 { width: 240px; } .w-280 { width: 280px; } .w-300 { width: 300px; }

/* search box width helper (replaces inline style on <input type=search>) */
input.search-box { width: 100%; max-width: 280px; }

/* Modal size helpers */
.modal.modal-sm { max-width: 420px; }
.modal.modal-md { max-width: 540px; }
.modal.modal-lg { max-width: 720px; }
.modal.modal-xl { max-width: 920px; }

/* Additional padding/margin helpers */
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }

/* Staff monitor map card overrides */
.card-map { margin: 0; }
.card-map .card-header { padding: 10px 14px; }
.card-map .card-header h3 { font-size: .95rem; margin: 0; }
.card-map .card-body { padding: 0 14px; }

/* Staff monitor popup styles (used in JS-generated HTML) */
.popup-title { font-weight: 700; font-size: 1rem; }
.popup-meta { color: #666; font-size: .78rem; }
.popup-detail { font-size: .85rem; margin-top: 8px; }
.popup-body { font-size: .9rem; }
.popup-coord { margin-top: 4px; }

/* color helpers */
.text-dark { color: #333; }
.bg-soft { background: var(--bg-soft); }
.bg-card { background: var(--bg-card); }

/* ---------- 24. Quick action / dashboard tiles ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-action {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 14px;
    text-align: center;
    text-decoration: none;
    color: var(--brand-primary);
    transition: all .15s;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.quick-action:hover { border-color: var(--brand-accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); color: var(--brand-primary); }
.quick-action .icon { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--brand-primary); }
.quick-action .icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick-action .label { font-size: .82rem; font-weight: 600; }

/* ---------- 25. Avatar group ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; background-size: cover; background-position: center; }
.avatar-sm { width: 28px; height: 28px; font-size: .72rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }

/* ---------- 26. Section / divider ---------- */
.section-divider { height: 1px; background: var(--border); margin: 24px 0; border: 0; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.section-title-row h2, .section-title-row h3 { margin: 0; }

/* ---------- 27. Tooltips (light CSS-only) ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: var(--brand-primary); color: #fff;
    padding: 4px 8px; border-radius: var(--r-sm);
    font-size: .72rem; white-space: nowrap; z-index: 100;
    margin-bottom: 6px;
}

/* ---------- 28. List group (simple) ---------- */
.list-group { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.list-group-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.list-group-item:last-child { border-bottom: none; }
.list-group-item:hover { background: var(--bg-soft); }

/* ---------- 29. Responsive ---------- */
@media (max-width: 1024px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); box-shadow: var(--shadow-xl); }
    .sidebar.open { transform: translateX(0); }
    .topbar .menu-toggle { display: inline-flex; }
    .main { width: 100%; }
    :root { --sidebar-w: 248px; }
}
@media (max-width: 768px) {
    .content { padding: 16px; }
    .topbar { padding: 10px 14px; gap: 8px; }
    .topbar .page-title h1 { font-size: 1rem; }
    .user-menu .name, .user-menu .role { display: none; }
    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.1rem; }
    .stat-card { padding: 14px 16px; }
    .stat-card .value { font-size: 1.15rem; }
    .stat-card .icon { width: 40px; height: 40px; }
    .card-header { padding: 14px 16px; }
    .card-body { padding: 16px; }
    .auth-card { padding: 32px 24px; max-width: 100%; width: 100%; }
    .auth-card.auth-card-wide { max-width: 100%; width: 100%; }
    .auth-card .auth-roles { grid-template-columns: 1fr; }
    .modal { border-radius: var(--r-lg); }
    .user-dropdown { right: 8px; min-width: 200px; }
    .cmo-switcher { display: none; }
    .page-header h1 { font-size: 1.2rem; }
}
@media (max-width: 480px) {
    .topbar-actions { gap: 6px; }
    .icon-btn { width: 34px; height: 34px; }
    .btn { padding: 8px 14px; font-size: .82rem; }
    .stat-grid { gap: 12px; }
}

/* Print-friendly */
@media print {
    .sidebar, .topbar, .btn, .no-print, .user-menu, .topbar-actions { display: none !important; }
    .content { padding: 0; }
    .card { border: 1px solid #ccc; box-shadow: none; }
}

/* ---------- 30. Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-accent); }

/* =========================================================
   CULSYSTEM v3 Design System
   Applied when body has class="v3"
   CMO dashboard and other premium pages use this.
   All v3 tokens override/extend the base design system.
   ========================================================= */

/* v3 color tokens (merge with base tokens via :root override) */
body.v3 {
    --v3-bg:                #F6F1E7;
    --v3-bg-soft:           #EFE9DA;
    --v3-card:              #FFFFFF;
    --v3-border:            #E5DECB;
    --v3-border-strong:    #D5CCB3;
    --v3-text:              #14213D;
    --v3-text-soft:        #4A5670;
    --v3-text-mute:        #8893A6;
    --v3-navy:              #14213D;
    --v3-navy-2:            #1B2C52;
    --v3-blue:              #3D7CC9;
    --v3-blue-dark:         #1F5BA8;
    --v3-blue-soft:         #DCE9F7;
    --v3-green:             #4DA77A;
    --v3-green-dark:        #2E8B5E;
    --v3-green-soft:        #DBF1E3;
    --v3-orange:            #E89B43;
    --v3-orange-dark:       #C97C25;
    --v3-orange-soft:       #FCE6CC;
    --v3-red:               #D8605A;
    --v3-red-dark:          #B1453F;
    --v3-red-soft:          #FBDBD8;
    --v3-yellow:            #E2A22C;
    --v3-yellow-dark:       #B17A12;
    --v3-yellow-soft:      #FBEFCB;
    --v3-yellow-soft-2:    #FEF5DB;
    --v3-sidebar-bg:        #FFFFFF;
    --v3-sidebar-text:      #14213D;
    --v3-sidebar-mute:       #6B7588;
    --v3-sidebar-border:    #ECE5D2;
    --v3-sidebar-active-bg: #EAF6EE;
    --v3-sidebar-active-fg: #1F4E2D;

    /* Use v3 bg as base bg for body.v3 */
    background: var(--v3-bg);
}

/* v3 layout overrides */
body.v3 .sidebar {
    width: 200px;
    background: var(--v3-sidebar-bg);
    border-right: 1px solid var(--v3-sidebar-border);
}
body.v3 .sidebar-header {
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--v3-sidebar-border);
    margin-bottom: 3px;
}
body.v3 .sidebar-header .brand { display: flex; align-items: center; gap: 10px; }
body.v3 .sidebar-header .logo {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--v3-navy); display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0; border: 2px solid var(--v3-navy);
}
body.v3 .sidebar-header .logo img { width: 100%; height: 100%; object-fit: cover; }
body.v3 .sidebar-header .brand-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.05; }
body.v3 .sidebar-header .brand .name { font-weight: 800; font-size: 1.02rem; color: var(--v3-text); line-height: 1.1; letter-spacing: -.3px; white-space: nowrap; }
body.v3 .sidebar-header .brand .tagline { color: var(--v3-text-mute); font-size: .68rem; font-weight: 500; line-height: 1.1; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.v3 .sidebar-section { padding: 3px 0 0; }
body.v3 .sidebar-section + .sidebar-section { border-top: 1px dashed var(--v3-sidebar-border); margin-top: 3px; padding-top: 3px; }
body.v3 .sidebar-section .section-title {
    display: block; padding: 5px 14px 3px; margin: 0;
    font-size: .60rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: var(--v3-text-mute); background: transparent; border: 0; width: 100%; text-align: left; cursor: default;
}
body.v3 .sidebar-section .section-title .chev { display: none; }
body.v3 .sidebar-nav { list-style: none; padding: 0; margin: 0 0 2px; }
body.v3 .sidebar-nav li a {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 14px;
    color: var(--v3-text-soft);
    text-decoration: none;
    font-size: .75rem; font-weight: 500;
    border-left: 3px solid transparent;
    transition: background .12s, color .12s, border-color .12s;
    position: relative; line-height: 1.2;
}
body.v3 .sidebar-nav li a:hover { color: var(--v3-text); background: var(--v3-bg-soft); }
body.v3 .sidebar-nav li a.active { background: var(--v3-sidebar-active-bg); color: var(--v3-sidebar-active-fg); border-left-color: var(--v3-green); font-weight: 600; }
body.v3 .sidebar-nav .nav-icon { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; color: var(--v3-text-mute); flex-shrink: 0; }
body.v3 .sidebar-nav .nav-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }
body.v3 .sidebar-nav .nav-icon svg * { fill: none !important; stroke: currentColor !important; }
body.v3 .sidebar-nav li a.active .nav-icon { color: var(--v3-green-dark); }
body.v3 .sidebar-nav li a:hover .nav-icon { color: var(--v3-navy); }
body.v3 .sidebar-nav .nav-new {
    margin-left: auto; font-size: .56rem; color: var(--v3-green-dark);
    background: var(--v3-green-soft); padding: 1px 5px; border-radius: 999px;
    font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}

/* v3 topbar overrides */
body.v3 .topbar {
    background: var(--v3-card);
    border-bottom: 1px solid var(--v3-border);
    padding: 6px 18px;
    min-height: 50px;
    gap: 14px;
}
body.v3 .topbar-title { min-width: 180px; }
body.v3 .topbar .page-title { display: block !important; font-size: 1.02rem; font-weight: 800; color: var(--v3-text); margin: 0; line-height: 1.1; letter-spacing: -.015em; }
body.v3 .topbar .page-title h1 { font-size: inherit; margin: 0; }
body.v3 .topbar .page-subtitle { font-size: .66rem; color: var(--v3-text-mute); margin: 2px 0 0; line-height: 1.2; font-weight: 500; }
body.v3 .topbar-actions { display: flex; align-items: center; gap: 8px; }
body.v3 .icon-btn {
    width: 32px; height: 32px;
    background: #fff; border: 1px solid var(--v3-border);
    color: var(--v3-text-soft); border-radius: 50%;
    position: relative; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .12s, border-color .12s;
}
body.v3 .icon-btn:hover { background: var(--v3-bg-soft); border-color: var(--v3-border-strong); }
body.v3 .icon-btn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
body.v3 .icon-btn svg * { fill: none !important; stroke: currentColor !important; }
body.v3 .icon-btn .badge {
    position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--v3-red); color: #fff; border-radius: 999px; border: 2px solid #fff;
    font-size: .60rem; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1;
}
body.v3 .user-menu {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 10px 3px 3px; border-radius: 999px;
    background: #fff; cursor: pointer; user-select: none;
    transition: background .12s;
    border: 1px solid var(--v3-border);
}
body.v3 .user-menu:hover { background: var(--v3-bg-soft); border-color: var(--v3-border-strong); }
body.v3 .user-menu .avatar {
    width: 30px; height: 30px; border-radius: 50%; background: var(--v3-navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem;
    flex-shrink: 0; background-size: cover; background-position: center; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--v3-green);
}
body.v3 .user-menu .name { color: var(--v3-text); font-weight: 700; font-size: .78rem; line-height: 1.15; white-space: nowrap; }
body.v3 .user-menu .role { color: var(--v3-text-mute); font-size: .62rem; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; margin-top: 1px; }
body.v3 .user-menu .chev { color: var(--v3-text-mute); font-size: .65rem; }
body.v3 .user-menu .meta { line-height: 1.15; }
body.v3 .cmo-switcher {
    background: linear-gradient(135deg, #FFF8E5 0%, #FDF3D2 100%);
    border: 1px solid #E8D898; border-radius: 999px; padding: 2px 3px 2px 10px;
    box-shadow: 0 1px 2px rgba(139,111,26,.06); flex-wrap: wrap;
}
body.v3 .cmo-switcher-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #8B6F1A; white-space: nowrap; }
body.v3 .cmo-switcher-label .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--v3-yellow); box-shadow: 0 0 0 3px rgba(226,162,44,.22); }
body.v3 .cmo-switcher-select {
    appearance: none; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238893A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 8px center;
    background-size: 10px; border: 1px solid #D6C887; border-radius: 999px; padding: 4px 22px 4px 10px;
    font-size: .72rem; font-weight: 600; color: var(--v3-text); font-family: inherit; cursor: pointer; line-height: 1.2; min-width: 160px;
}
body.v3 .cmo-switcher-select:focus { outline: 0; border-color: var(--v3-yellow); box-shadow: 0 0 0 3px rgba(245,158,11,.2); }

/* v3 content area */
body.v3 .content { padding: 14px 18px; flex: 1; }
body.v3 .content-inner { padding: 0; max-width: 1480px; margin: 0 auto; }

/* v3 stat grid: 4-column compact grid */
body.v3 .stat-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
@media (max-width: 1180px) { body.v3 .stat-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { body.v3 .stat-grid-4 { grid-template-columns: 1fr; } }

/* v3 stat cards: compact colored cards with top accent strip */
body.v3 .stat-card-v3 {
    position: relative;
    background: var(--v3-card);
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    padding: 9px 12px 10px;
    min-height: 82px;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(20,33,61,.03);
    transition: transform .12s, box-shadow .12s;
}
body.v3 .stat-card-v3:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(20,33,61,.06); }
body.v3 .stat-card-v3 .stat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
body.v3 .stat-card-v3 .stat-ic {
    width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    color: #fff;
}
body.v3 .stat-card-v3 .stat-ic svg,
body.v3 .stat-card-v3 .stat-ic svg * {
    width: 14px; height: 14px;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: #fff;
}
body.v3 .stat-card-v3 .label {
    font-size: .58rem; color: var(--v3-text-soft); font-weight: 700;
    text-transform: uppercase; letter-spacing: .3px; line-height: 1.2; margin: 0;
}
body.v3 .stat-card-v3 .value {
    font-family: 'Inter', sans-serif; font-size: 1.02rem; font-weight: 800;
    color: var(--v3-text); line-height: 1.1; margin: 3px 0 2px;
    letter-spacing: -.02em;
}
body.v3 .stat-card-v3 .sub { font-size: .64rem; color: var(--v3-text-soft); line-height: 1.25; margin: 0; }
body.v3 .stat-card-v3 .sub b { font-weight: 700; color: var(--v3-text); }
body.v3 .stat-card-v3 .sub em-red    { color: var(--v3-red-dark); font-style: normal; font-weight: 600; }
body.v3 .stat-card-v3 .sub em-green  { color: var(--v3-green-dark); font-style: normal; font-weight: 600; }
body.v3 .stat-card-v3 .sub em-yellow { color: var(--v3-yellow-dark); font-style: normal; font-weight: 600; }
body.v3 .stat-card-v3 .sub em-blue   { color: var(--v3-blue-dark); font-style: normal; font-weight: 600; }
body.v3 .stat-card-v3 .sub em-orange { color: var(--v3-orange-dark); font-style: normal; font-weight: 600; }
body.v3 .stat-card-v3 .alert-icon {
    position: absolute; top: 8px; right: 8px;
    width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; font-size: .62rem; font-weight: 700;
}
body.v3 .stat-card-v3 .alert-icon svg { width: 10px; height: 10px; stroke-width: 2.2; fill: none; }
body.v3 .stat-card-v3 .alert-icon svg * { fill: none !important; stroke: currentColor !important; }
body.v3 .stat-card-v3 .alert-icon.red    { color: #fff; background: var(--v3-red); }
body.v3 .stat-card-v3 .alert-icon.yellow { color: var(--v3-text); background: var(--v3-yellow); }
body.v3 .stat-card-v3 .alert-icon.orange { color: #fff; background: var(--v3-orange); }
body.v3 .stat-card-v3 .alert-icon.green  { color: #fff; background: var(--v3-green); }

/* Mini chart decorations */
body.v3 .stat-card-v3 .mini-chart {
    position: absolute; right: 10px; top: 26px;
    width: 60px; height: 24px; background-position: right top;
    background-repeat: no-repeat; background-size: contain; pointer-events: none;
}
body.v3 .stat-card-v3 .mini-chart.green-line {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 30' preserveAspectRatio='none'><path d='M0 24 L8 20 L16 22 L24 14 L32 16 L40 10 L48 12 L56 6 L64 2 L72 1' fill='none' stroke='%234DA77A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
body.v3 .stat-card-v3 .mini-chart.green-bars {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 30'><g fill='%234DA77A'><rect x='2' y='18' width='5' height='12'/><rect x='12' y='12' width='5' height='18'/><rect x='22' y='14' width='5' height='16'/><rect x='32' y='4' width='5' height='26'/><rect x='42' y='10' width='5' height='20'/><rect x='52' y='1' width='5' height='29'/><rect x='62' y='6' width='5' height='24'/></g></svg>");
}
body.v3 .stat-card-v3 .mini-chart.blue-line {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 30' preserveAspectRatio='none'><path d='M0 16 L8 18 L16 14 L24 20 L32 10 L40 14 L48 4 L56 12 L64 6 L72 10' fill='none' stroke='%233D7CC9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
body.v3 .stat-card-v3 .mini-chart.green-progress { background: var(--v3-green); height: 5px; border-radius: 3px; width: 78px; top: auto; bottom: 14px; right: 14px; }
body.v3 .stat-card-v3 .mini-chart.green-progress.dim { background: linear-gradient(90deg, var(--v3-green) 0% 70%, rgba(77,167,122,.2) 70% 100%); }

/* v3 stat card color variants */
body.v3 .stat-card-v3.green  .stat-ic { background: var(--v3-green); }
body.v3 .stat-card-v3.blue  .stat-ic { background: var(--v3-blue); }
body.v3 .stat-card-v3.orange .stat-ic { background: var(--v3-orange); }
body.v3 .stat-card-v3.red   .stat-ic { background: var(--v3-red); }
body.v3 .stat-card-v3.yellow .stat-ic { background: var(--v3-yellow); }
body.v3 .stat-card-v3.teal  .stat-ic { background: #0D9488; }

/* v3 cards */
body.v3 .card {
    background: var(--v3-card);
    border: 1px solid var(--v3-border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(20,33,61,.03);
    margin-bottom: 12px;
    overflow: hidden;
}
body.v3 .card-header {
    padding: 9px 15px;
    border-bottom: 1px solid var(--v3-border);
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; background: var(--v3-card); flex-wrap: wrap;
}
body.v3 .card-header h2,
body.v3 .card-header h3 {
    font-size: .86rem; font-weight: 700; color: var(--v3-text);
    margin: 0; letter-spacing: -.01em;
}
body.v3 .card-header .subtitle { font-size: .66rem; color: var(--v3-text-mute); margin-top: 1px; font-weight: 500; }
body.v3 .card-header .view-all {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--v3-text); background: #fff;
    border: 1px solid var(--v3-border); border-radius: 999px;
    padding: 3px 9px; font-size: .66rem; font-weight: 600;
    text-decoration: none; transition: background .12s, border-color .12s;
}
body.v3 .card-header .view-all:hover { background: var(--v3-bg-soft); border-color: var(--v3-border-strong); color: var(--v3-text); }
body.v3 .card-body { padding: 11px 15px; }

/* v3 filter pills */
body.v3 .filter-pills-v3 {
    display: inline-flex; gap: 3px; padding: 2px;
    background: var(--v3-bg-soft); border-radius: 999px; border: 1px solid var(--v3-border);
}
body.v3 .filter-pill-v3 {
    border: 0; background: transparent; color: var(--v3-text-soft);
    font-size: .72rem; font-weight: 600; padding: 4px 11px;
    border-radius: 999px; cursor: pointer;
    transition: background .12s, color .12s;
}
body.v3 .filter-pill-v3.active { color: #fff; background: var(--v3-navy); }
body.v3 .filter-pill-v3.active.green { background: var(--v3-green-dark); }
body.v3 .filter-pill-v3.active.gold { background: var(--v3-yellow-dark); }
body.v3 .filter-pill-v3.active.mute { background: var(--v3-text-soft); }

/* v3 tables */
body.v3 .table-v3 {
    width: 100%; border-collapse: collapse; font-size: .74rem;
}
body.v3 .table-v3 thead th {
    text-align: left; font-size: .60rem; text-transform: uppercase;
    letter-spacing: .4px; color: var(--v3-text-mute); font-weight: 700;
    padding: 7px 11px; border-bottom: 1px solid var(--v3-border);
    background: var(--v3-bg-soft);
}
body.v3 .table-v3 thead th.text-right { text-align: right; }
body.v3 .table-v3 thead th.text-center { text-align: center; }
body.v3 .table-v3 tbody td {
    padding: 7px 11px; border-bottom: 1px solid var(--v3-border);
    vertical-align: middle; color: var(--v3-text);
}
body.v3 .table-v3 tbody tr:last-child td { border-bottom: none; }
body.v3 .table-v3 tbody tr:hover { background: #FCFAF4; }
body.v3 .table-v3 .biz-cell { display: inline-flex; align-items: center; gap: 6px; }
body.v3 .table-v3 .biz-cell .pin {
    width: 18px; height: 18px; border-radius: 4px;
    background: var(--v3-blue-soft); color: var(--v3-blue-dark);
    display: inline-flex; align-items: center; justify-content: center;
}
body.v3 .table-v3 .biz-cell .pin svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2; fill: none; }

/* v3 status pills */
body.v3 .pill {
    display: inline-block; padding: 2px 7px; border-radius: 999px;
    font-size: .64rem; font-weight: 700; text-transform: capitalize; line-height: 1.25;
}
body.v3 .pill.green  { background: var(--v3-green-soft);  color: var(--v3-green-dark); }
body.v3 .pill.red    { background: var(--v3-red-soft);    color: var(--v3-red-dark); }
body.v3 .pill.gold   { background: var(--v3-yellow-soft); color: var(--v3-yellow-dark); }
body.v3 .pill.yellow { background: var(--v3-yellow-soft-2); color: var(--v3-yellow-dark); }
body.v3 .pill.navy   { background: #DDE7F2; color: #1F3B6B; }
body.v3 .pill.mute   { background: #ECEEF2; color: #5A6473; }
body.v3 .pill.outline { background: transparent; color: var(--v3-text-soft); border: 1px solid var(--v3-border-strong); }

/* v3 chart */
body.v3 .chart-wrap-v3 { position: relative; width: 100%; height: 260px; padding: 10px 16px 16px; }
body.v3 .chart-svg-v3 { width: 100%; height: 100%; display: block; }
body.v3 .chart-tooltip-v3 {
    position: absolute; background: var(--v3-navy); color: #fff;
    padding: 5px 8px; border-radius: 5px; font-size: .70rem; font-weight: 600;
    transform: translate(-50%, -120%); pointer-events: none; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 5; display: none;
}
body.v3 .chart-tooltip-v3::after {
    content: ''; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--v3-navy);
}

/* v3 dashboard row layout */
body.v3 .dash-row {
    display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; margin-bottom: 12px;
}
@media (max-width: 1100px) { body.v3 .dash-row { grid-template-columns: 1fr; } }

body.v3 .quick-row {
    display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-bottom: 6px;
}
@media (max-width: 1100px) { body.v3 .quick-row { grid-template-columns: 1fr; } }

body.v3 .quick-card {
    background: var(--v3-card); border: 1px solid var(--v3-border);
    border-radius: 10px; padding: 11px 15px 13px;
    box-shadow: 0 1px 2px rgba(20,33,61,.03);
}
body.v3 .quick-card-head h3 { font-size: .86rem; font-weight: 700; color: var(--v3-text); margin: 0; }
body.v3 .quick-card-head .sub { font-size: .66rem; color: var(--v3-text-mute); margin: 1px 0 8px; font-weight: 500; }
body.v3 .quick-card .actions { display: flex; flex-wrap: wrap; gap: 6px; }
body.v3 .qa-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    font-size: .74rem; font-weight: 600; color: #fff;
    text-decoration: none; border: 0; cursor: pointer;
    transition: filter .12s, transform .04s; line-height: 1.2;
    box-shadow: 0 1px 2px rgba(20,33,61,.06);
}
body.v3 .qa-btn:hover { filter: brightness(.95); color: #fff; }
body.v3 .qa-btn:active { transform: translateY(1px); }
body.v3 .qa-btn svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }
body.v3 .qa-btn svg * { fill: none !important; stroke: currentColor !important; }
body.v3 .qa-btn.teal    { background: #0D9488; }
body.v3 .qa-btn.navy    { background: var(--v3-navy); }
body.v3 .qa-btn.brown   { background: #6E5031; }
body.v3 .qa-btn.gold    { background: var(--v3-yellow); color: #5C4310; }
body.v3 .qa-btn.magenta { background: #B6246A; }
body.v3 .qa-btn.outline { background: #fff; color: var(--v3-text); border: 1px solid var(--v3-border-strong); }
body.v3 .qa-btn.outline:hover { background: var(--v3-bg-soft); color: var(--v3-text); }

/* v3 footer credit */
body.v3 .footer-credit {
    text-align: center; font-size: .68rem; color: var(--v3-text-mute);
    padding: 8px 20px 10px; width: 100%;
}
body.v3 .footer-credit strong { color: var(--v3-text); font-weight: 600; }

/* v3 utility overrides */
body.v3 .text-muted { color: var(--v3-text-mute); }
body.v3 .text-sm    { font-size: .84rem; }
body.v3 .text-xs    { font-size: .74rem; }
body.v3 .text-right { text-align: right; }
body.v3 .text-center { text-align: center; }
body.v3 .fw-bold { font-weight: 700; }
body.v3 .d-flex { display: flex; }
body.v3 .gap-1  { gap: 6px; }
body.v3 .gap-2  { gap: 10px; }
body.v3 .flex-1 { flex: 1; }
body.v3 .flex-wrap { flex-wrap: wrap; }
body.v3 .align-center { align-items: center; }
body.v3 .justify-between { justify-content: space-between; }
body.v3 .mb-0 { margin-bottom: 0; }
body.v3 .mb-1 { margin-bottom: 6px; }
body.v3 .mb-2 { margin-bottom: 12px; }
body.v3 .mb-3 { margin-bottom: 18px; }
body.v3 .mt-2 { margin-top: 12px; }
body.v3 .mt-3 { margin-top: 18px; }

/* v3 mobile sidebar */
@media (max-width: 768px) {
    body.v3 .sidebar { transform: translateX(-100%); position: fixed; height: 100vh; z-index: 100; }
    body.v3 .sidebar.open { transform: translateX(0); }
    body.v3 .topbar .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--v3-border); background: #fff; border-radius: 8px; color: var(--v3-text); cursor: pointer; }
    body.v3 .user-menu .meta { display: none; }
    body.v3 .user-menu .chev { display: none; }
    body.v3 .cmo-switcher { display: none; }
    body.v3 .content-inner { padding: 16px 16px 0; }
}

/* ── Executive Intelligence & Predictive Analytics (v3 Theme) ── */
.ai-section-wrap {
  margin-bottom: 12px;
}
.ai-banner {
  background: var(--v3-card);
  border: 1px solid var(--v3-border);
  border-radius: 10px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(20,33,61,.03);
}
.ai-banner__title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-banner__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--v3-navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.ai-banner__title {
  font-size: .86rem;
  font-weight: 700;
  color: var(--v3-text);
  margin: 0;
  line-height: 1.2;
}
.ai-banner__sub {
  font-size: .66rem;
  color: var(--v3-text-mute);
  margin-top: 1px;
  font-weight: 500;
}
.ai-banner__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .66rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.ai-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 1024px) {
  .ai-grid { grid-template-columns: 1fr; }
}
.ai-card {
  background: var(--v3-card);
  border: 1px solid var(--v3-border);
  border-radius: 10px;
  padding: 10px 13px;
  box-shadow: 0 1px 2px rgba(20,33,61,.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .12s, box-shadow .12s;
}
.ai-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20,33,61,.06);
}
.ai-card--locked,
.ai-card--empty {
  background: var(--v3-bg-soft);
  border-color: var(--v3-border);
}
.ai-card__header {
  font-size: .80rem;
  font-weight: 700;
  color: var(--v3-text);
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--v3-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -.01em;
}
.ai-card__header .head-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-card__header .head-ic {
  font-size: .88rem;
}
.ai-card--locked .ai-card__header {
  color: var(--v3-text-mute);
}
.ai-card__body {
  font-size: .74rem;
  color: var(--v3-text);
  flex: 1;
}

/* Component & Value List */
.ai-kv-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ai-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: var(--v3-bg);
  border-radius: 6px;
  font-size: .72rem;
  gap: 6px;
}
.ai-kv-row .kv-label {
  color: var(--v3-text-soft);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ai-kv-row .kv-val {
  color: var(--v3-text);
  font-weight: 700;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

/* Forecast Bars / Chart List */
.ai-chart-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-chart-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px;
  background: var(--v3-bg);
  border-radius: 6px;
}
.ai-chart-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .72rem;
}
.ai-chart-row-head .month-name {
  font-weight: 600;
  color: var(--v3-text);
}
.ai-chart-row-head .month-val {
  font-weight: 700;
  color: var(--v3-navy);
}
.ai-bar-track {
  width: 100%;
  height: 5px;
  background: #D9D2C1;
  border-radius: 999px;
  overflow: hidden;
}
.ai-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--v3-blue);
}
.ai-bar-fill.green {
  background: var(--v3-green-dark);
}
.ai-bar-fill.gold {
  background: var(--v3-orange-dark);
}

/* Smart Action Checklist */
.ai-alert-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ai-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  background: var(--v3-bg);
  border-radius: 6px;
  font-size: .72rem;
}
.ai-alert-item .alert-msg {
  color: var(--v3-text);
  font-weight: 500;
  line-height: 1.25;
}

/* Strategic Recommendation Callout */
.ai-takeaway {
  margin-top: 7px;
  padding: 6px 8px;
  background: #FAF7F0;
  border: 1px dashed var(--v3-border-strong);
  border-radius: 6px;
  font-size: .68rem;
  color: var(--v3-text-soft);
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.3;
}
.ai-takeaway strong {
  color: var(--v3-text);
}

.risk-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  margin-top: 4px;
  overflow: hidden;
}
.risk-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #16a34a, #f59e0b, #dc2626);
}


