/* ───────────────────────────────────────────────────────────
   Engage design system — tokens, layout and components.
   Loads after Bootstrap 5; light and dark themes via [data-theme].
   ─────────────────────────────────────────────────────────── */

:root {
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --border: #e6e8ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;
  --success: #079455; --success-bg: #ecfdf3; --success-border: #abefc6;
  --warning: #b54708; --warning-bg: #fffaeb; --warning-border: #fedf89;
  --danger: #d92d20;  --danger-bg: #fef3f2;  --danger-border: #fecdca;
  --info: #175cd3;    --info-bg: #eff8ff;    --info-border: #b2ddff;
  --violet: #6938ef;  --violet-bg: #f4f3ff;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-w: 248px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand-50: rgba(99, 102, 241, .14);
  --brand-100: rgba(99, 102, 241, .24);
  --bg: #0b0e14;
  --surface: #12161f;
  --surface-2: #161b26;
  --surface-3: #1d2330;
  --border: #252c3a;
  --border-strong: #333b4d;
  --text: #f2f4f7;
  --text-2: #b0b8c6;
  --text-3: #6f7a8c;
  --success: #47cd89; --success-bg: rgba(71, 205, 137, .12); --success-border: rgba(71, 205, 137, .3);
  --warning: #fdb022; --warning-bg: rgba(253, 176, 34, .12); --warning-border: rgba(253, 176, 34, .3);
  --danger: #f97066;  --danger-bg: rgba(249, 112, 102, .12); --danger-border: rgba(249, 112, 102, .3);
  --info: #53b1fd;    --info-bg: rgba(83, 177, 253, .12);   --info-border: rgba(83, 177, 253, .3);
  --violet: #a48afb;  --violet-bg: rgba(164, 138, 251, .14);
  --shadow-xs: none;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ── Base ── */
html, body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3, h4, h5 { color: var(--text); font-weight: 650; letter-spacing: -0.015em; }
hr { border-color: var(--border); opacity: 1; }
.text-2 { color: var(--text-2) !important; }
.text-3 { color: var(--text-3) !important; }
.small-caps { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--text-3); }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── App shell ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040; transition: transform .2s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; font-size: 16px; color: var(--text); }
/* The Engage mark is favicon.svg, the same file as domodomu.com's img/brand/engage.svg. */
.brand-mark { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; box-shadow: 0 4px 10px -2px rgba(79, 70, 229, .5); }
.sidebar-firm { margin: 0 12px 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--text-3); padding: 14px 10px 6px; }
.nav-link-e {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px; transition: background .12s, color .12s;
}
.nav-link-e i { font-size: 18px; color: var(--text-3); transition: color .12s; }
.nav-link-e:hover { background: var(--surface-3); color: var(--text); }
.nav-link-e.active { background: var(--brand-50); color: var(--brand); }
.nav-link-e.active i { color: var(--brand); }
.nav-link-e .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.nav-link-e .count.alert { background: var(--danger-bg); color: var(--danger); }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1030; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border);
}
.search-trigger {
  display: flex; align-items: center; gap: 8px; width: min(420px, 100%); height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3); font-size: 13px; cursor: pointer; box-shadow: var(--shadow-xs);
}
.search-trigger:hover { border-color: var(--border-strong); }
.kbd { margin-left: auto; font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); font-family: var(--font); }
.content { padding: 28px; max-width: 1400px; width: 100%; margin: 0 auto; }
.content-narrow { max-width: 920px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; color: var(--text-2); background: transparent; position: relative; }
.icon-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.icon-btn i { font-size: 19px; }
.dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--brand-100); color: var(--brand); flex-shrink: 0; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; border-radius: 12px; }
.mobile-only { display: none !important; }
.backdrop-e { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .mobile-only { display: grid !important; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px; }
  .backdrop-e.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1035; }
}

/* ── Page header ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0; }
.page-head .sub { color: var(--text-2); margin-top: 4px; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-2); }

/* ── Cards ── */
.card-e { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-e + .card-e { margin-top: 16px; }
.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, .card-head h2 { font-size: 15px; margin: 0; }
.card-head .hint { color: var(--text-3); font-size: 12.5px; }
.card-body-e { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.section-gap > * + * { margin-top: 16px; }

/* ── KPI tiles ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-label i { font-size: 16px; color: var(--text-3); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi a.stretched { position: absolute; inset: 0; }

/* ── Buttons ── */
.btn { white-space: nowrap; font-weight: 550; font-size: 13.5px; border-radius: 10px; padding: 7px 14px; display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.btn i { font-size: 17px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-sm i { font-size: 15px; }
.btn-lg { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-light-e { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.btn-light-e:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger-e { background: var(--surface); border: 1px solid var(--danger-border); color: var(--danger); }
.btn-danger-e:hover { background: var(--danger-bg); color: var(--danger); }
.btn-success-e { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success-e:hover { filter: brightness(.95); color: #fff; }
.btn-group-e { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Forms ── */
.form-label { font-weight: 550; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.form-control, .form-select { background-color: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); font-size: 14px; padding: 8px 12px; box-shadow: var(--shadow-xs); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); background-color: var(--surface); color: var(--text); }
.form-control::placeholder { color: var(--text-3); }
.form-text { color: var(--text-3); font-size: 12.5px; }
.form-check-input { border-color: var(--border-strong); background-color: var(--surface); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.3em; height: 1.25em; }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-2); border-radius: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field-error, .field-validation-error { color: var(--danger); font-size: 12.5px; }
.input-validation-error { border-color: var(--danger) !important; }

/* ── Tables ── */
.table-e { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-e th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; text-align: left; }
.table-e td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.table-e tr:last-child td { border-bottom: 0; }
.table-e tbody tr { transition: background .1s; }
.table-e tbody tr.clickable { cursor: pointer; }
.table-e tbody tr:hover td { background: var(--surface-2); }
.table-e .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-3); }

/* ── Badges ── */
.badge-e { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 550; border: 1px solid transparent; white-space: nowrap; line-height: 1.6; }
.badge-e::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-e.no-dot::before { display: none; }
.b-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.b-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.b-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.b-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.b-neutral { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
.b-violet { background: var(--violet-bg); color: var(--violet); }
.b-brand { background: var(--brand-50); color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 500; }

/* ── Tabs / filters ── */
.tabs-e { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs-e a { padding: 9px 12px; color: var(--text-2); font-weight: 550; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs-e a:hover { color: var(--text); }
.tabs-e a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs-e .count { font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented a, .segmented button, .segmented label { padding: 5px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; font-size: 13px; border: 0; background: transparent; cursor: pointer; }
.segmented .active, .segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.toolbar .search input { padding-left: 34px; height: 36px; }

/* ── Empty states ── */
.empty { text-align: center; padding: 48px 20px; }
.empty .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-50); color: var(--brand); display: inline-grid; place-items: center; font-size: 26px; margin-bottom: 14px; }
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { color: var(--text-2); max-width: 420px; margin: 0 auto 16px; }

/* ── Lists / timeline ── */
.list-e { list-style: none; margin: 0; padding: 0; }
.list-e > li { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-e > li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 28px; }
.timeline li::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-size: 11px; border: 2px solid var(--surface); }
.timeline .tl-dot.success { background: var(--success-bg); color: var(--success); }
.timeline .tl-dot.danger { background: var(--danger-bg); color: var(--danger); }
.timeline .tl-dot.brand { background: var(--brand-50); color: var(--brand); }
.timeline .tl-dot.warning { background: var(--warning-bg); color: var(--warning); }
.timeline .tl-title { font-weight: 550; font-size: 13.5px; }
.timeline .tl-meta { font-size: 12px; color: var(--text-3); }

/* ── Status bar (live) ── */
.statusbar { display: flex; align-items: flex-start; gap: 0; padding: 18px 20px 14px; overflow-x: auto; }
.status-step { flex: 1; min-width: 110px; position: relative; text-align: center; }
.status-step::after { content: ""; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--border); }
.status-step:last-child::after { display: none; }
.status-step.done::after { background: var(--success); }
.status-step .ring { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); font-size: 16px; border: 2px solid var(--border); position: relative; z-index: 1; }
.status-step.done .ring { background: var(--success); color: #fff; border-color: var(--success); }
.status-step.current .ring { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-100); }
.status-step.failed .ring { background: var(--danger); color: #fff; border-color: var(--danger); }
.status-step .lbl { font-size: 12.5px; font-weight: 600; color: var(--text); }
.status-step .when { font-size: 11.5px; color: var(--text-3); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--success); }
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(7, 148, 85, .5); } 70% { box-shadow: 0 0 0 7px rgba(7, 148, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(7, 148, 85, 0); } }

/* ── Callouts ── */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.callout i { font-size: 19px; margin-top: 1px; }
.callout.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info); }
.callout.warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning); }
.callout.danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.callout.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.callout.brand { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }
.callout .callout-body { color: var(--text); }
.callout .callout-body strong { color: inherit; }

/* ── Definition grid ── */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--text-3); font-weight: 500; }
.dl dd { margin: 0; color: var(--text); }

/* ── Proposal builder ── */
.pkg { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
.pkg-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.pkg-head input.pkg-name { font-weight: 600; border: 1px solid transparent; background: transparent; box-shadow: none; padding: 4px 8px; flex: 1; min-width: 160px; }
.pkg-head input.pkg-name:hover, .pkg-head input.pkg-name:focus { border-color: var(--border-strong); background: var(--surface); }
.item-row { display: grid; grid-template-columns: minmax(180px, 2.4fr) 130px 130px 110px 80px 36px; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); align-items: start; }
.item-row:last-child { border-bottom: 0; }
.item-row .form-control, .item-row .form-select { padding: 6px 9px; font-size: 13px; }
@media (max-width: 991.98px) { .item-row { grid-template-columns: 1fr 1fr; } .item-row > :first-child { grid-column: 1 / -1; } }
.sticky-side { position: sticky; top: 76px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.summary-total { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

/* ── Command palette ── */
.cmdk { position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); }
.cmdk.open { display: flex; }
.cmdk-box { width: min(620px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmdk-input input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 15px; color: var(--text); }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--text); cursor: pointer; }
.cmdk-item i { color: var(--text-3); font-size: 18px; }
.cmdk-item .meta { margin-left: auto; font-size: 12px; color: var(--text-3); }
.cmdk-item.sel, .cmdk-item:hover { background: var(--brand-50); color: var(--brand); }
.cmdk-item.sel i { color: var(--brand); }
.cmdk-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 10px 12px 4px; font-weight: 600; }

/* ── Toasts & dropdowns ── */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 2100; display: flex; flex-direction: column; gap: 10px; }
.toast-e { min-width: 280px; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 10px; animation: slidein .25s ease; }
.toast-e.success { border-left-color: var(--success); }
.toast-e.danger { border-left-color: var(--danger); }
.toast-e.warning { border-left-color: var(--warning); }
@keyframes slidein { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.dropdown-menu { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; font-size: 13.5px; }
.dropdown-item { border-radius: 8px; padding: 7px 10px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dropdown-item i { color: var(--text-3); font-size: 17px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-3); color: var(--text); }
.dropdown-divider { border-color: var(--border); }
.notif-menu { width: 360px; max-height: 460px; overflow-y: auto; padding: 0; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item.unread { background: var(--brand-50); }
.sev { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: 16px; }
.sev-0 { background: var(--info-bg); color: var(--info); }
.sev-1 { background: var(--success-bg); color: var(--success); }
.sev-2 { background: var(--warning-bg); color: var(--warning); }
.sev-3 { background: var(--danger-bg); color: var(--danger); }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border); }
.btn-close { filter: var(--btn-close-filter, none); }
:root[data-theme="dark"] .btn-close { filter: invert(1); }

/* ── Charts ── */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 10px 0 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 44px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #8b5cf6)); min-height: 3px; position: relative; }
.bar.muted { background: var(--brand-100); }
.bar-col .lbl { font-size: 11px; color: var(--text-3); }
.bar-col .val { font-size: 11px; color: var(--text-2); font-weight: 600; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter.success > span { background: var(--success); }
.meter.danger > span { background: var(--danger); }

/* ── Auth ── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(1000px 600px at 0% 0%, #6366f1 0%, #4338ca 40%, #1e1b4b 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { color: #fff; font-size: 34px; line-height: 1.15; max-width: 460px; }
.auth-side p { color: rgba(255, 255, 255, .78); font-size: 15px; max-width: 440px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; color: rgba(255, 255, 255, .9); }
.auth-feature i { font-size: 20px; background: rgba(255, 255, 255, .14); padding: 7px; border-radius: 10px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ── Public (client-facing) pages ── */
.public { background: var(--bg); min-height: 100vh; }
.public-top { background: var(--surface); border-bottom: 1px solid var(--border); }
.public-top .inner { max-width: 880px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 12px; }
.firm-logo { height: 34px; max-width: 160px; object-fit: contain; }
.firm-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.public-body { max-width: 880px; margin: 0 auto; padding: 24px 20px 64px; }
.public-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.hero-band { height: 6px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.prose p { line-height: 1.65; color: var(--text-2); }
.prose h3, .prose h4 { margin-top: 18px; font-size: 15px; }
.prose ul { padding-left: 18px; color: var(--text-2); }
.option-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: border-color .12s, box-shadow .12s; height: 100%; position: relative; background: var(--surface); display: block; }
.option-card:hover { border-color: var(--border-strong); }
.option-card.selected, .option-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.option-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.option-card:has(input:disabled) { cursor: not-allowed; }
.option-card .rec { position: absolute; top: -11px; right: 12px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--brand); color: #fff; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps .s { flex: 1; height: 4px; border-radius: 99px; background: var(--border); }
.steps .s.on { background: var(--brand); }
.sig-pad { border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); width: 100%; height: 170px; touch-action: none; cursor: crosshair; display: block; }
.sig-typed { font-family: "Caveat", "Segoe Script", "Brush Script MT", cursive; font-size: 38px; padding: 10px 14px; border-bottom: 2px solid var(--border-strong); min-height: 70px; color: var(--text); }
.pay-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-choice label { border: 2px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); }
.pay-choice input { margin-top: 3px; }
.pay-choice input:checked + div { color: var(--text); }
.pay-choice label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.portal-nav { display: flex; gap: 4px; overflow-x: auto; }
.portal-nav a { padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.portal-nav a.active, .portal-nav a:hover { background: var(--surface-3); color: var(--text); }
.impersonation-bar { background: #fef0c7; color: #93370d; text-align: center; font-size: 13px; padding: 7px; font-weight: 550; }
:root[data-theme="dark"] .impersonation-bar { background: #4e1d09; color: #fedf89; }

/* ── Misc ── */
.divider-label { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin: 16px 0; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.code-block { background: #0b1020; color: #d6deeb; border-radius: 10px; padding: 14px 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.integration-tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; height: 100%; }
.int-logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; flex-shrink: 0; font-size: 15px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.ai-glow { background: linear-gradient(135deg, var(--brand-50), var(--violet-bg)); border: 1px solid var(--brand-100); }
.spark { color: var(--violet); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.check-list .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--surface-3); color: var(--text-3); }
.check-list .ck.done { background: var(--success); color: #fff; }
.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: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
[x-cloak], .d-hidden { display: none !important; }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .main { margin: 0; } }
.validation-summary-valid { display: none !important; }
