/* =====================================================================
   GMB Toolkit — app design system
   Tokens → base → shell (sidebar / topbar / bottom nav) → components
   ===================================================================== */

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f7;
    --border: #e4e8f0;
    --border-strong: #d3d9e4;
    --ink: #0b1324;
    --text: #344054;
    --muted: #667085;
    --faint: #98a2b3;

    --primary: #2f6bff;
    --primary-600: #2457e0;
    --primary-50: #eef3ff;
    --primary-100: #dce6ff;
    --accent: #12b5a5;
    --accent-50: #e6f8f6;
    --grad: linear-gradient(135deg, #2f6bff 0%, #12b5a5 100%);

    --green: #12a150;   --green-50: #e7f7ee;
    --amber: #d98b06;   --amber-50: #fff5e0;
    --red: #e5484d;     --red-50: #fdecec;
    --blue: #2f6bff;    --blue-50: #eef3ff;
    --purple: #7c5cff;  --purple-50: #f1edff;
    --gray-50: #f2f4f7;
    --star: #fbbc04;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow: 0 8px 24px -6px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .04);
    --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);
    --ring: 0 0 0 4px rgba(47, 107, 255, .16);

    --sidebar-w: 252px;
    --sidebar-w-collapsed: 76px;
    --topbar-h: 64px;
    --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1020; --surface: #121a2b; --surface-2: #162036; --surface-3: #1c2740;
        --border: #233049; --border-strong: #2f3d5a; --ink: #eef2fb; --text: #c9d2e3; --muted: #8e9bb3; --faint: #6b7891;
        --primary: #5b8bff; --primary-600: #7aa1ff; --primary-50: #18254a; --primary-100: #1f3163;
        --accent-50: #0f2e2d; --green-50: #0f2a1d; --amber-50: #2e2410; --red-50: #33171a; --blue-50: #18254a; --purple-50: #241d45; --gray-50: #1c2740;
        --shadow: 0 8px 24px -6px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0b1020; --surface: #121a2b; --surface-2: #162036; --surface-3: #1c2740;
    --border: #233049; --border-strong: #2f3d5a; --ink: #eef2fb; --text: #c9d2e3; --muted: #8e9bb3; --faint: #6b7891;
    --primary: #5b8bff; --primary-600: #7aa1ff; --primary-50: #18254a; --primary-100: #1f3163;
    --accent-50: #0f2e2d; --green-50: #0f2a1d; --amber-50: #2e2410; --red-50: #33171a; --blue-50: #18254a; --purple-50: #241d45; --gray-50: #1c2740;
    --shadow: 0 8px 24px -6px rgba(0, 0, 0, .5); --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
    font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
[x-cloak] { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .ink { color: var(--ink); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.bold { font-weight: 700; } .semibold { font-weight: 600; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:24px}.mt-6{margin-top:32px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:24px}
.flex { display: flex; } .inline-flex { display: inline-flex; } .items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; }
.flex-1 { flex: 1; min-width: 0; } .flex-wrap { flex-wrap: wrap; } .shrink-0 { flex-shrink: 0; }
.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:24px}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.w-full { width: 100%; }
.hidden { display: none !important; }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.icon-sm svg.lucide, svg.lucide.icon-sm { width: 15px; height: 15px; }
.icon-lg svg.lucide, svg.lucide.icon-lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- shell */
.app { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface);
    border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 60;
    transition: width .2s ease, transform .25s ease;
}
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.brand-mark {
    width: 36px; height: 36px; border-radius: 11px; background: var(--grad); color: #fff;
    display: grid; place-items: center; box-shadow: 0 6px 16px -4px rgba(47, 107, 255, .5); flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; font-size: 16px; color: var(--ink); letter-spacing: -.02em; white-space: nowrap; }
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; white-space: nowrap; }
.nav-link {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-bottom: 2px; border-radius: 10px;
    color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; position: relative;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--primary-50); color: var(--primary); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-link .nav-count { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav-link .nav-tag { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--purple-50); color: var(--purple); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.plan-card { padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .sidebar .brand-name,
.sidebar-collapsed .sidebar .nav-section,
.sidebar-collapsed .sidebar .nav-label,
.sidebar-collapsed .sidebar .nav-count,
.sidebar-collapsed .sidebar .nav-tag,
.sidebar-collapsed .sidebar .plan-card { display: none; }
.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding: 10px; }
.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.topbar {
    position: sticky; top: 0; z-index: 50; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
    padding: 0 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 17px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }

.bottom-nav { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--shadow-lg); }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(8, 12, 24, .45); z-index: 55; }
    .sidebar-collapsed .sidebar .brand-name, .sidebar-collapsed .sidebar .nav-label, .sidebar-collapsed .sidebar .nav-section,
    .sidebar-collapsed .sidebar .plan-card { display: revert; }
    .main, .sidebar-collapsed .main { margin-left: 0; }
    .topbar { padding: 0 14px; }
    .content { padding: 16px 16px 96px; }
    .bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--surface);
        border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        justify-content: space-around;
    }
    .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 4px 0; position: relative; }
    .bottom-nav a.active { color: var(--primary); }
    .bottom-nav .fab { width: 48px; height: 48px; border-radius: 16px; background: var(--grad); color: #fff; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 10px 20px -6px rgba(47, 107, 255, .6); }
    .bottom-nav .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
    .hide-mobile { display: none !important; }
}
@media (min-width: 1025px) { .show-mobile { display: none !important; } }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px;
    border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
    font: 600 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
    box-shadow: var(--shadow-xs); text-decoration: none;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn svg.lucide { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px -4px rgba(47, 107, 255, .55); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-gradient { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 16px -6px rgba(47, 107, 255, .6); }
.btn-gradient:hover { background: var(--grad); filter: brightness(1.06); color: #fff; }
.btn-ai { background: linear-gradient(135deg, #7c5cff, #2f6bff); border: 0; color: #fff; }
.btn-ai:hover { background: linear-gradient(135deg, #7c5cff, #2f6bff); filter: brightness(1.08); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-soft { background: var(--primary-50); border-color: transparent; color: var(--primary); box-shadow: none; }
.btn-soft:hover { background: var(--primary-100); color: var(--primary); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.95); color: #fff; background: var(--red); }
.btn-danger-soft { background: var(--red-50); border-color: transparent; color: var(--red); box-shadow: none; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: var(--green); color: #fff; filter: brightness(.95); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-hover { transition: box-shadow .2s, transform .2s, border-color .2s; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.card-gradient { background: var(--grad); color: #fff; border: 0; }
.card-gradient h1, .card-gradient h2, .card-gradient h3 { color: #fff; }

/* stat tiles */
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.1; }
.stat-foot { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--green); background: var(--green-50); }
.delta.down { color: var(--red); background: var(--red-50); }
.delta.flat { color: var(--muted); background: var(--gray-50); }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-purple { background: var(--purple-50); color: var(--purple); }
.tone-teal { background: var(--accent-50); color: var(--accent); }
.tone-gray { background: var(--gray-50); color: var(--muted); }

/* ---------------------------------------------------------------- badges / chips */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge svg.lucide { width: 12px; height: 12px; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-purple { background: var(--purple-50); color: var(--purple); }
.badge-gray { background: var(--gray-50); color: var(--muted); }
.badge-teal { background: var(--accent-50); color: var(--accent); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .count { font-size: 11px; opacity: .75; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink); }
.label .opt { font-weight: 500; color: var(--faint); }
.help { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12px; color: var(--red); font-weight: 600; }
.input, .select, .textarea {
    width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--ink); font: 500 14px/1.4 var(--font); transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input-sm, .select-sm { height: 34px; font-size: 13px; border-radius: 9px; }
.input-group { position: relative; }
.input-group > svg.lucide, .input-group > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-group .input { padding-left: 38px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.counter { font-size: 11.5px; color: var(--faint); text-align: right; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; color: var(--text); }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(17px); }
.option-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.option-card:hover { border-color: var(--border-strong); }
.option-card.selected, .option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.color-input { width: 44px; height: 40px; padding: 3px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }

/* ---------------------------------------------------------------- tables / lists */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
a.list-item { color: inherit; }
a.list-item:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: var(--font); }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: var(--surface-3); color: var(--muted); font-size: 11px; padding: 0 6px; border-radius: 99px; }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a, .segmented button { padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--muted); border: 0; background: none; cursor: pointer; font-family: var(--font); white-space: nowrap; }
.segmented .active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ---------------------------------------------------------------- avatars / stars / ring */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; background: var(--grad); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-sq { border-radius: 12px; }
.stars { display: inline-flex; gap: 1px; color: var(--star); letter-spacing: 0; line-height: 1; }
.stars .off { color: var(--border-strong); }
.ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-val { position: absolute; text-align: center; line-height: 1; }
.ring .ring-val b { display: block; font-weight: 800; color: var(--ink); }
.ring .ring-val small { font-size: 10px; color: var(--muted); font-weight: 600; }
.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.progress.green > span { background: var(--green); } .progress.amber > span { background: var(--amber); } .progress.red > span { background: var(--red); }

/* ---------------------------------------------------------------- alerts / empty / toast */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--green-50); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-error { background: var(--red-50); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-info { background: var(--blue-50); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.alert-warn { background: var(--amber-50); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert .alert-body { color: var(--text); }
.empty { text-align: center; padding: 48px 24px; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty-icon svg.lucide { width: 28px; height: 28px; }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 380px; background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 13.5px; animation: toast-in .25s ease; }
.toast.success svg.lucide { color: #4ade80; } .toast.error svg.lucide { color: #f87171; } .toast.info svg.lucide { color: #93c5fd; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------------------- dropdown / modal / drawer */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 80; }
.menu-left { left: 0; right: auto; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text); font: 600 13.5px var(--font); background: none; border: 0; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--ink); }
.menu .menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu .menu-head { padding: 8px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 12, 24, .5); z-index: 120; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-lg { max-width: 820px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* notifications */
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 10px; color: var(--text); }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--primary-50); }
.notif-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.bell-dot { position: absolute; top: 6px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }

/* location switcher */
.loc-switch { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 6px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; max-width: 280px; font: 600 13px var(--font); color: var(--ink); }
.loc-switch:hover { border-color: var(--primary); }
.loc-badge { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--grad); flex-shrink: 0; }

/* ---------------------------------------------------------------- review cards */
.review { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; }
.review-text { color: var(--ink); margin: 8px 0 0; white-space: pre-line; }
.reply-box { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border-left: 3px solid var(--primary); }
.reply-box.owner { border-left-color: var(--green); }

/* ---------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-h { padding: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-d { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.cal-d.other { background: var(--surface-2); }
.cal-d.other .cal-n { color: var(--faint); }
.cal-d.today .cal-n { background: var(--primary); color: #fff; }
.cal-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; color: var(--ink); }
.cal-ev { display: block; margin-top: 4px; padding: 3px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.festival { background: var(--amber-50); color: var(--amber); }

/* ---------------------------------------------------------------- misc */
.kbd { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface-2); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; font-weight: 600; margin: 16px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.preview-phone { border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.thumb { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--surface-3); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.check-row:last-child { border-bottom: 0; }
.check-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.check-ic svg.lucide { width: 15px; height: 15px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sticky-top { position: sticky; top: calc(var(--topbar-h) + 16px); }
.demo-banner { background: linear-gradient(90deg, #7c5cff, #2f6bff); color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 16px; text-align: center; }
.demo-banner a { color: #fff; text-decoration: underline; }

@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .form-row { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .span-2 { grid-column: auto; }
    .stat { padding: 14px; } .stat-value { font-size: 21px; }
    .card-body { padding: 16px; } .card-head { padding: 14px 16px; }
    h1 { font-size: 21px; }
    .page-head { align-items: stretch; }
    .modal-backdrop { align-items: end; padding: 0; }
    .modal { border-radius: 22px 22px 0 0; max-height: 92vh; }
    .cal-d { min-height: 64px; padding: 3px; } .cal-ev { font-size: 0; height: 6px; padding: 0; }
    .toasts { left: 12px; right: 12px; } .toast { max-width: none; }
}

@media print {
    .sidebar, .topbar, .bottom-nav, .no-print, .demo-banner { display: none !important; }
    .main { margin: 0 !important; } .content { padding: 0; max-width: none; }
    body { background: #fff; } .card { box-shadow: none; break-inside: avoid; }
}
