/* Realty CRM — Signisys theme.
 *
 * Palette from signisys.com: orange #FE6000, deep orange #B84200, amber #FEA300,
 * navy #141425 / #1E1E36, slate #636380, silver #DDDDE8. Inter.
 *
 * Contrast: white on #FE6000 is 3.05:1 (fails WCAG AA), so the bright orange is
 * for accents only; buttons use #D65400→#B84200 and links #B84200 (5.5:1).
 */

:root {
  --brand: #FE6000; --brand-2: #FEA300; --brand-ink: #B84200;
  --brand-grad: linear-gradient(135deg, #D65400 0%, #B84200 100%);
  --brand-glow: linear-gradient(90deg, #FE8800, #FE6000 55%, #FE072A);
  --brand-soft: #FFF3EA; --brand-soft-2: #FFE4CC;
  --navy: #141425; --navy-2: #1E1E36;

  --bg: #F7F7FA; --surface: #FFFFFF; --surface-2: #F4F4F8;
  --line: #E4E4EC; --line-strong: #DDDDE8;
  --ink: #141425; --ink-2: #3A3A55; --muted: #636380;
  --bar: linear-gradient(90deg, #FE8800, #FE6000);

  --good: #16794A; --good-soft: #E6F6EE; --warn: #9A5B00; --warn-soft: #FFF4DE;
  --bad: #B91C1C; --bad-soft: #FDECEC; --info: #2B4FB8; --info-soft: #ECF1FD;

  --radius: 10px; --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 37, .04), 0 4px 16px rgba(20, 20, 37, .05);
  --shadow-lg: 0 20px 50px rgba(20, 20, 37, .18);
  --ring: 0 0 0 3px rgba(254, 96, 0, .22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 240px;
  /* Chrome colours themes may change (static/themes.css). */
  --topbar-bg: rgba(255, 255, 255, .88);
  --nav-ink: #C9C9DA; --nav-active-bg: rgba(254, 96, 0, .14); --nav-active-ink: #FF9A5A;
  --mark-grad: linear-gradient(135deg, #FE8800, #FE6000 60%, #E8390C); --mark-glow: rgba(254, 96, 0, .35);
  --wa-out-bg: #DCF8C6; --wa-out-ink: #13221B;
  color-scheme: light;
}
/* Auto (no data-theme): follow the device. A chosen theme sets data-theme (themes.css). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0E0E18; --surface: #161624; --surface-2: #1C1C2E;
    --line: #2A2A40; --line-strong: #34344E;
    --ink: #EDEDF3; --ink-2: #C9C9DA; --muted: #9A9AB5;
    --brand-ink: #FF8A3D; --brand-soft: #2A1C14; --brand-soft-2: #3A2416;
    --good: #5CCB8F; --good-soft: #12291D; --warn: #F0B659; --warn-soft: #2C2312;
    --bad: #FF8A80; --bad-soft: #321A1A; --info: #8FA8FF; --info-soft: #1A2138;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02); --shadow-lg: 0 20px 50px rgba(0, 0, 0, .5);
    --topbar-bg: rgba(22, 22, 36, .88); --wa-out-bg: #1F3B2D; --wa-out-ink: #E4F5EA;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; font-weight: 700; letter-spacing: -.02em; }
h1 .muted { font-weight: 500; }
h3 { font-size: 14.5px; margin: 0 0 14px; font-weight: 650; letter-spacing: -.005em; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
h3 .muted { font-size: 12.5px; font-weight: 500; }
.muted { color: var(--muted); font-weight: normal; }
.small-link { font-size: 12.5px; margin-left: auto; font-weight: 500; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.bad { color: var(--bad); font-weight: 650; }
.zero { color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; stroke-width: 2.2; }

/* ---------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
html, body { overflow-x: hidden; }
.main-col { min-width: 0; display: flex; flex-direction: column; }

.sidebar { background: var(--navy); color: var(--nav-ink); display: flex; flex-direction: column; position: sticky;
           top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.sidebar::before { content: ""; height: 3px; background: var(--brand-glow); flex: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 14px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--mark-grad);
              display: grid; place-items: center; box-shadow: 0 6px 18px var(--mark-glow); flex: none; }
.brand-mark svg.i { width: 19px; height: 19px; stroke: #fff; stroke-width: 2.2; }
.brand-text { line-height: 1.2; min-width: 0; }
.brand-text strong { display: block; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text span { font-size: 10.5px; color: #A6A6BF; letter-spacing: .09em; text-transform: uppercase; font-weight: 500; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #7C7C99; padding: 16px 22px 6px; font-weight: 650; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--nav-ink); font-weight: 500; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--nav-active-bg); color: var(--nav-active-ink); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.sidebar-foot { margin-top: auto; padding: 14px 20px 18px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: #8C8CA8; }
.sidebar-foot strong { color: #E4E4EC; display: block; font-size: 13px; }
.scrim { display: none; }

.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--topbar-bg);
          backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.crumb { font-size: 13px; color: var(--muted); font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb .sep { margin: 0 4px; opacity: .6; }
.crumb strong { color: var(--ink); font-weight: 600; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.userbox form { margin: 0; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line);
            background: var(--surface); color: var(--ink-2); cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 22px; border: 1px solid var(--line);
             background: var(--surface); color: var(--ink); }
.user-chip:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center;
          font-size: 12px; font-weight: 700; letter-spacing: .02em; flex: none; }
.user-chip .who { line-height: 1.15; }
.user-chip .who strong { display: block; font-size: 13px; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); font-weight: 500; }

main { width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 28px 72px; }

/* ---------------------------------------------------------------- page structure */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 2px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-strong);
       background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.3;
       transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--brand); text-decoration: none; background: var(--surface-2); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(214, 84, 0, .28); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(214, 84, 0, .36); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 7px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px;
        margin-bottom: 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h3 { padding: 16px 20px 0; }
.card.flush > .muted, .card.flush > p { padding: 0 20px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 18px; }

/* ---------------------------------------------------------------- KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; color: var(--ink);
       display: block; box-shadow: var(--shadow); position: relative; overflow: hidden; font-weight: 400; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-glow); opacity: 0; transition: opacity .15s; }
a.kpi:hover { border-color: var(--brand-soft-2); text-decoration: none; }
a.kpi:hover::before { opacity: 1; }
.kpi-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 650; }
.kpi-value { font-size: 26px; font-weight: 750; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-sub { color: var(--ink-2); font-size: 12.5px; }
.kpi.warn { border-color: rgba(154, 91, 0, .35); background: var(--warn-soft); }
.kpi.warn::before { opacity: 1; background: var(--warn); }

.progress { height: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin: 0 0 18px; }
.progress span { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
.target-cell { min-width: 120px; }
.target-cell .progress { margin: 4px 0 2px; }

.bars { width: 100%; border-collapse: collapse; }
.bars td { padding: 5px 0; }
.bar-label { width: 38%; color: var(--ink-2); padding-right: 10px !important; }
.bar-track { width: 52%; }
.bar { display: block; height: 10px; background: var(--bar); border-radius: 5px; }
.bars .num { width: 10%; padding-left: 10px !important; font-weight: 600; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 650; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
           background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
.grid td { border-bottom: 1px solid var(--line); padding: 10px 12px; vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr { transition: background .1s; }
.grid tbody tr:hover { background: var(--brand-soft); }
.grid td:first-child { min-width: 160px; }
.grid td.notes { max-width: 320px; color: var(--ink-2); }
.card:not(.flush) .grid th:first-child, .card:not(.flush) .grid td:first-child { padding-left: 8px; }
tr.overdue td:first-child { color: var(--bad); }
.tag-overdue { background: var(--bad-soft); color: var(--bad); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--brand-soft);
         color: var(--brand-ink); white-space: nowrap; vertical-align: middle; line-height: 1.5; }
.b-hot, .b-lost, .b-cancelled, .b-withdrawn, .b-inactive { background: var(--bad-soft); color: var(--bad); }
.b-warm, .b-negotiation, .b-under-negotiation, .b-on-hold, .b-token-received { background: var(--warn-soft); color: var(--warn); }
.b-won, .b-closed-won, .b-sold, .b-rented, .b-available, .b-active { background: var(--good-soft); color: var(--good); }
.b-cold { background: var(--surface-2); color: var(--ink-2); }
.b-admin { background: var(--info-soft); color: var(--info); }

/* ---------------------------------------------------------------- forms */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; padding: 12px 14px; background: var(--surface);
           border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.page-head .filters { margin: 0; padding: 8px 10px; }
.filters label { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; font-weight: 500; }
.filters input[type=search] { min-width: 220px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
                          border-radius: 8px; padding: 7px 10px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #C4C4D4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input:disabled { background: var(--surface-2); color: var(--muted); }

.entity-form fieldset { margin-left: 0; margin-right: 0; min-width: 0; }
.entity-form legend { font-weight: 650; padding: 3px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
                      color: var(--brand-ink); background: var(--brand-soft); border-radius: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; }
.form-grid label span { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.form-grid label.wide { grid-column: 1 / -1; }
.req { color: var(--bad); }
.form-actions { display: flex; gap: 8px; position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 75%, transparent);
                padding: 16px 0; z-index: 5; }

.fieldview { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.fieldview dl { display: grid; grid-template-columns: 45% 55%; margin: 0; row-gap: 8px; }
.fieldview dt { color: var(--muted); }
.fieldview dd { margin: 0; word-break: break-word; font-weight: 500; }
.pre { white-space: pre-wrap; }
.unit-line { margin: 2px 0 0; font-weight: 600; color: var(--ink-2); }

.flash { background: var(--good-soft); color: var(--good); padding: 11px 16px; border-radius: var(--radius); margin-bottom: 16px;
         font-weight: 500; border-left: 3px solid currentColor; }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; color: var(--ink-2); font-weight: 500; }
a.chip:hover { border-color: var(--brand); text-decoration: none; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { color: var(--brand-ink); }

/* ---------------------------------------------------------------- sign-in / setup */
.login-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-art { background: var(--navy); color: #fff; padding: 44px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; width: 640px; height: 640px; right: -240px; top: -200px;
                     background: radial-gradient(circle, rgba(254, 96, 0, .42), rgba(254, 96, 0, 0) 65%); }
.login-art::after { content: ""; position: absolute; width: 540px; height: 540px; left: -220px; bottom: -240px;
                    background: radial-gradient(circle, rgba(254, 163, 0, .2), rgba(254, 163, 0, 0) 65%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand { padding: 0; }
.login-art h2 { font-size: 38px; line-height: 1.15; letter-spacing: -.025em; font-weight: 300; margin: auto 0 16px; max-width: 540px; }
.login-art h2 strong { font-weight: 750; background: linear-gradient(90deg, #FEA300, #FE6000); -webkit-background-clip: text;
                       background-clip: text; color: transparent; }
.login-art p { color: #B7B7CC; max-width: 480px; font-size: 15px; margin: 0; }
.login-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 auto; }
.login-steps span { font-size: 12px; font-weight: 600; color: #E4E4EC; border: 1px solid rgba(255, 255, 255, .14);
                    background: rgba(255, 255, 255, .04); padding: 5px 11px; border-radius: 20px; }
.login-art .fine { font-size: 12px; color: #7C7C99; margin-top: 28px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); max-width: none; margin: 0; }
.login-form .inner { width: min(380px, 100%); }
.auth-box { max-width: 420px; margin: 40px auto; }
.login-form .auth-box { margin: 0; max-width: none; padding: 0; border: 0; box-shadow: none; background: none; }
.login-form h1 { font-size: 26px; }
.auth-box form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-box label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.auth-box input { padding: 10px 12px; }
.auth-box .btn.primary { justify-content: center; padding: 11px 14px; margin-top: 4px; }
.auth-box .small { font-size: 12.5px; margin-top: 18px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%);
             transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 20, 37, .4); z-index: 25; }
  .menu-btn { display: grid; }
  .grid-2 { grid-template-columns: 1fr; }
  .login-split { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px; }
  .login-art h2 { font-size: 26px; margin-top: 28px; }
  .login-steps { margin-bottom: 0; }
  .login-art .fine { display: none; }
}
@media (max-width: 720px) {
  main { padding: 18px 16px 56px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .user-chip .who, .crumb, .userbox .btn span { display: none; }
  .user-chip { padding: 3px; }
  .grid-2 { grid-template-columns: 1fr; }
  .filters input[type=search] { min-width: 0; flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 21px; }
  .page-head .filters { width: 100%; }
  .filters label, .filters input[type=date] { flex: 1 1 130px; min-width: 0; }
  .filters input, .filters select { max-width: 100%; }
  .fieldview dl { grid-template-columns: 1fr; row-gap: 2px; }
  .fieldview dd { margin-bottom: 8px; }
}
.dup-list { margin: 6px 0 8px; padding-left: 18px; }
.dup-list li { margin: 2px 0; }
.import-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.import-form .check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.import-help { margin: 0; padding-left: 18px; }
.import-help li { margin: 3px 0; }
.small { font-size: 12.5px; }
.sidebar-foot .version { display: block; margin-top: 8px; color: #7C7C99; font-size: 11.5px; font-weight: 500; }
.sidebar-foot .version:hover { color: #FF9A5A; text-decoration: none; }
.release h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-ink); margin: 14px 0 6px; }
.release ul { margin: 0; padding-left: 20px; }
.release li { margin: 4px 0; }
.release code { font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.release.current { border-color: var(--brand-soft-2); }
/* audit trail */
.changes { margin: 0; padding: 0; list-style: none; }
.changes li { margin: 2px 0; }
.changes .field { color: var(--muted); margin-right: 6px; }
.changes .field::after { content: ":"; }
.changes .old { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(185, 28, 28, .45); }
.changes .new { color: var(--good); font-weight: 600; }
.grid.audit td { font-size: 13px; }
.grid.audit details summary, .history details summary { cursor: pointer; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 14px 12px; }
.timeline > li::before { content: ""; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
                       background: var(--surface); border: 2px solid var(--brand); }
.timeline .t-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; }
.a-created { background: var(--good-soft); color: var(--good); }
.a-updated { background: var(--info-soft); color: var(--info); }
.a-deleted, .a-sign-in-failed { background: var(--bad-soft); color: var(--bad); }
.a-automatic, .a-imported { background: var(--brand-soft); color: var(--brand-ink); }
.a-signed-in, .a-password-changed, .a-password-set, .a-admin-created { background: var(--surface-2); color: var(--ink-2); }
/* platform console */
body.platform { background: var(--bg); }
.platform-top { display: flex; align-items: center; gap: 24px; padding: 0 28px; height: 64px; background: var(--navy); color: #fff; position: relative; }
.platform-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand-glow); }
.platform-top .brand { padding: 0; }
.platform-top nav { display: flex; gap: 4px; flex: 1; }
.platform-top nav a { color: #C9C9DA; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.platform-top nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.platform-top nav a.active { background: rgba(254, 96, 0, .14); color: #FF9A5A; }
.platform-top .who { display: flex; align-items: center; gap: 10px; color: #E4E4EC; font-size: 13px; font-weight: 600; }
.platform-top .who span { color: #8C8CA8; font-weight: 500; }
.platform-top .who form { margin: 0; }
.platform-top .linkbtn { color: #B7B7CC; }
body.platform main { max-width: 1300px; }
body.platform .auth-box { margin-top: 60px; }
@media (max-width: 720px) { .platform-top { padding: 0 16px; gap: 12px; height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; } .platform-top .who span { display: none; } }
.platform-top .who a { color: #E4E4EC; }
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.docs-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: 14px; font-size: 13px; }
.docs-toc a { color: var(--ink-2); padding: 3px 6px; border-radius: 6px; font-weight: 500; }
.docs-toc a.l3 { padding-left: 18px; font-weight: 400; color: var(--muted); }
.docs-toc a:hover { background: var(--brand-soft); text-decoration: none; }
.docs-body { line-height: 1.6; }
.docs-body h2 { font-size: 22px; margin: 4px 0 10px; } .docs-body h3 { font-size: 18px; margin: 26px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.docs-body h4 { font-size: 15px; margin: 18px 0 6px; } .docs-body h5 { font-size: 13.5px; margin: 14px 0 4px; }
.docs-body code { font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.docs-body pre { background: var(--navy); color: #E4E4EC; padding: 12px 14px; border-radius: 10px; overflow: auto; }
.docs-body pre code { background: none; padding: 0; color: inherit; }
.docs-body blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.docs-body .grid.doc td, .docs-body .grid.doc th { font-size: 13px; vertical-align: top; }
@media (max-width: 960px) { .docs-layout { grid-template-columns: 1fr; } .docs-toc { position: static; max-height: 240px; } }
.docs-body blockquote p { margin: 4px 0; }
.docs-toc code { font-size: 12px; background: none; padding: 0; }
/* toolkit */
.call-card { padding: 14px 16px; }
.call-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.call-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.call-form input[name=notes] { flex: 1; min-width: 160px; }
.wa-menu { position: relative; }
.wa-menu summary { list-style: none; } .wa-menu summary::-webkit-details-marker { display: none; }
.wa-menu .menu { position: absolute; right: 0; top: 42px; z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.wa-menu .menu a { padding: 8px 10px; border-radius: 7px; color: var(--ink); }
.wa-menu .menu a:hover { background: var(--brand-soft); text-decoration: none; }
.unit-grid { display: flex; flex-direction: column; gap: 6px; }
.unit-grid .floor { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.unit-grid .fl { width: 28px; color: var(--muted); font-size: 12px; padding-top: 10px; text-align: right; }
.unit { position: relative; }
.unit > summary { list-style: none; cursor: pointer; width: 74px; padding: 6px 4px; border-radius: 8px; text-align: center; font-weight: 650; font-size: 12.5px; border: 1px solid var(--line); }
.unit > summary::-webkit-details-marker { display: none; }
.unit > summary small { display: block; font-weight: 500; font-size: 10.5px; opacity: .8; }
.u-available > summary { background: var(--good-soft); color: var(--good); }
.u-on-hold > summary { background: var(--warn-soft); color: var(--warn); }
.u-booked > summary, .u-sold > summary { background: var(--bad-soft); color: var(--bad); }
.u-blocked > summary { background: var(--surface-2); color: var(--muted); }
.unit-pop { position: absolute; z-index: 25; top: 54px; left: 0; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.unit-pop form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.unit-pop select { max-width: 100%; } .unit-pop input[type=number] { width: 64px; }
.b-booked { background: var(--bad-soft); color: var(--bad); } .b-blocked { background: var(--surface-2); color: var(--muted); }
.snippet { background: var(--navy); color: #E4E4EC; padding: 10px 12px; border-radius: 8px; overflow: auto; font-size: 12px; white-space: pre; }
code.key { word-break: break-all; font-size: 13px; }
.stack-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.steps { padding-left: 18px; } .steps li { margin: 3px 0; }
.mt { margin-top: 14px; }
/* WhatsApp */
.nav .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.wa-chat h3 form { margin: 0 0 0 auto; }
.wa-thread { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface-2); border-radius: 10px; margin-bottom: 10px; }
.wa-msg { max-width: 78%; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow); }
.wa-msg.in { align-self: flex-start; background: var(--surface); border-top-left-radius: 2px; }
.wa-msg.out { align-self: flex-end; background: var(--wa-out-bg); color: var(--wa-out-ink); border-top-right-radius: 2px; }
.wa-msg small { display: block; text-align: right; font-size: 11px; opacity: .7; margin-top: 2px; }
.wa-msg.st-read .tick { color: #2B8FE0; } .wa-msg.st-failed { outline: 1px solid var(--bad); }
.wa-msg .wa-t { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; margin-bottom: 2px; }
.wa-reply { display: flex; gap: 8px; align-items: flex-end; } .wa-reply textarea { flex: 1; resize: vertical; }
.wa-tpl { margin-top: 10px; }
tr.unread td { background: var(--brand-soft); }
.inline-form { display: inline-flex; gap: 6px; margin: 0; }
.inline-form select { padding: 3px 6px; font-size: 12.5px; }
/* attendance */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; border-radius: 8px 8px 0 0; color: var(--ink-2); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; background: var(--surface-2); }
.btn.big { padding: 12px 28px; font-size: 15px; }
.month-nav { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.att { font-weight: 600; font-size: 12.5px; padding: 1px 8px; border-radius: 10px; }
.a-P { background: var(--good-soft); color: var(--good); } .a-L { background: var(--info-soft); color: var(--info); }
.a-W, .a-H { background: var(--surface-2); color: var(--muted); } .a-A { background: var(--bad-soft); color: var(--bad); }
.att-grid th, .att-grid td.att-cell { padding: 6px 4px; text-align: center; font-size: 12px; min-width: 24px; }
.att-grid th.we { color: var(--brand-ink); }
.att-cell.late { background: var(--warn-soft); color: var(--warn); }
.chip.small { padding: 2px 8px; font-size: 12px; }

/* ---------------------------------------------------------------- v2.5: leads list, labels, invoices */
.count-pill { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 20px;
              background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; text-align: center; }
.tabs a.on .count-pill { background: var(--brand-soft-2); color: var(--brand-ink); }
.seg { display: inline-flex; gap: 0; }
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.lbl { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; margin: 1px 3px 1px 0; border-radius: 20px;
       color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
th.pick, td.pick { width: 28px; padding-right: 0; }
.bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px;
            margin-bottom: 12px; background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-radius: var(--radius); }
.bulk-bar[hidden] { display: none; }
.icon-act { text-decoration: none; font-size: 15px; }
.icon-act:hover { text-decoration: none; filter: brightness(.8); }
.lead-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lead-cards[hidden] { display: none; }
.lead-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lead-card header { display: flex; align-items: center; gap: 8px; }
.lead-card .lc-name { font-weight: 650; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card p { margin: 0; }
.lead-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.lc-acts { display: inline-flex; gap: 6px; }
.score { display: inline-block; min-width: 42px; text-align: center; font-weight: 700; border-radius: 6px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.score.hi { background: var(--good-soft); color: var(--good); }
.score.mid { background: var(--warn-soft); color: var(--warn); }
.score.lo { background: var(--surface-2); color: var(--muted); }
.why { font-size: 12px; color: var(--muted); }
.ai-box { border-left: 3px solid var(--brand); padding: 8px 12px; background: var(--surface-2); border-radius: 0 8px 8px 0; margin: 8px 0; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; margin-right: 2px; }
.swatch.on { border-color: var(--ink); }
/* public lead form */
body.pub-form { background: var(--bg); }
.pub-form:lang(hi), .pub-form [lang=hi] { font-family: "Noto Sans Devanagari", var(--font); }
.pf-wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
.pf-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pf-head strong { display: block; font-size: 16px; }
.pf-head span:not(.brand-mark) { display: block; font-size: 12.5px; color: var(--muted); }
.pf-head .brand-mark svg.i { width: 19px; height: 19px; stroke: #fff; stroke-width: 2.2; }
.pf-lang { margin-left: auto; }
.pf-card h1 { font-size: 21px; }
.pf-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.pf-form label > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.pf-form input, .pf-form select, .pf-form textarea { width: 100%; font-size: 16px; }
.pf-choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pf-choice legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.pf-choice label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); }
.pf-choice input { width: auto; }
.pf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pf-send { width: 100%; padding: 12px; font-size: 16px; justify-content: center; }
.pf-foot { text-align: center; margin-top: 16px; }
:lang(hi) body, html[lang=hi] body { font-family: "Inter", "Noto Sans Devanagari", system-ui, sans-serif; }
/* invoices */
.inv-items input, .inv-items select { width: 100%; min-width: 0; }
.inv-items td:first-child { min-width: 220px; }
.inv-totals { margin-left: auto; min-width: 280px; border-collapse: collapse; }
.inv-totals td { padding: 4px 8px; }
.inv-totals tr.grand td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--ink); }
.invoice-sheet { background: #fff; color: #141425; max-width: 860px; margin: 0 auto 20px; padding: 32px 36px; border: 1px solid var(--line);
                 border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.invoice-sheet .muted { color: #636380; }
.invoice-sheet h2 { margin: 0 0 4px; font-size: 19px; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 16px; border-bottom: 3px solid #FE6000; }
.inv-meta { text-align: right; }
.inv-meta h1 { font-size: 20px; text-transform: uppercase; letter-spacing: .04em; color: #B84200; }
.inv-meta table { margin-left: auto; }
.inv-meta td { padding: 1px 0 1px 12px; }
.inv-bill { padding: 14px 0; }
.inv-lines { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
.inv-lines th { background: #F4F4F8; text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.inv-lines th, .inv-lines td { padding: 7px 8px; border-bottom: 1px solid #E4E4EC; vertical-align: top; }
.inv-foot { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; }
.inv-words { flex: 1; }
.inv-terms { margin-top: 18px; padding-top: 10px; border-top: 1px solid #E4E4EC; }
.inv-sign { display: flex; flex-direction: column; align-items: flex-end; gap: 42px; margin-top: 28px; }
.inv-sign .sign-line { border-top: 1px solid #141425; padding-top: 4px; min-width: 200px; text-align: center; }
@media print {
  @page { size: A4; margin: 12mm; }
  .sidebar, .topbar, .no-print, .flash, .scrim { display: none !important; }
  .layout { display: block; }
  body, main { background: #fff !important; padding: 0 !important; }
  .invoice-sheet { border: 0; padding: 0; max-width: none; margin: 0; }
}
.share-links { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-row .who { min-width: 140px; font-weight: 600; }
.share-row code { flex: 1; min-width: 200px; overflow-wrap: anywhere; }
.qr-box { display: inline-block; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.qr-box[hidden] { display: none; }
.lbl-row { margin-top: 3px; line-height: 1.2; }
.lbl .inline-form { display: inline; }
.lbl .linkbtn { margin-left: 4px; padding: 0 2px; color: inherit; font-weight: 700; }
.pin { font-size: 12px; margin-left: 4px; white-space: nowrap; }
/* plans & billing */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.u-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.u-bar { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.u-bar i { display: block; height: 100%; background: var(--bar); }
.u-bar i.full { background: var(--bad); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px; border: 2px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; background: var(--surface); }
.plan-card:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); }
.plan-card input { position: absolute; opacity: 0; }
.plan-card .price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.plan-card.rec .rec-tag { position: absolute; top: -10px; right: 12px; background: var(--brand-grad); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; }
.plan-banner { margin: 0 0 14px; }
.nav a.locked { opacity: .55; }
.nav a .lock { margin-left: auto; font-size: 11px; }
