/* =====================================================================
   COST PULSE — Design System  (v1.0)
   ---------------------------------------------------------------------
   Principles: clarity, deference, depth.
   · Content first — chrome recedes, numbers lead.
   · One accent (Pulse teal) for anything interactive; bronze marks value.
   · Light by default, a true dark mode, and "Auto" that follows the device.
   · Generous whitespace, hairline separators, soft layered shadows.
   · Motion that explains (springs on sheets, fades on content) and
     disappears entirely for people who prefer reduced motion.
   Brand: navy #13294B · pulse #0B7A99/#2BB5D3 · bronze #A8804A · steel
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. TOKENS
   --------------------------------------------------------------------- */
:root{
  --font-body:-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-display:-apple-system,BlinkMacSystemFont,"SF Pro Display","Inter",system-ui,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-serif:"Instrument Serif","New York","Iowan Old Style",Georgia,serif;
  --font-mono:ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;

  /* brand constants (theme-independent) */
  --navy:#13294B; --navy-2:#1C3A68; --navy-deep:#0B1830;
  --pulse:#0B7A99; --pulse-bright:#2BB5D3; --pulse-glow:#5FE0F0;
  --bronze:#A8804A; --steel:#8E9AAE;

  /* light (default) */
  --bg:#F5F5F7;
  --bg-2:#ECECF0;
  --ink:#FFFFFF;                 /* opaque raised surface (modals, menus) */
  --surface:#FFFFFF;             /* cards */
  --surface-2:#F5F5F7;           /* insets, inputs, hovers */
  --surface-3:#E8E8ED;           /* tracks, pressed */
  --material:rgba(250,250,252,.78);     /* translucent bars */
  --material-strong:rgba(255,255,255,.92);
  --border:rgba(0,0,0,.075);
  --border-2:rgba(0,0,0,.13);
  --separator:rgba(60,60,67,.12);
  --text:#1D1D1F;
  --text-2:#424245;
  --muted:#6E6E73;
  --faint:#AEAEB2;

  --primary:#0B7A99;             /* accent for text, icons, rings */
  --primary-fill:#0B7A99;        /* accent for filled controls */
  --primary-hover:#09677F;
  --primary-deep:#13294B;
  --primary-soft:rgba(11,122,153,.10);
  --on-primary:#FFFFFF;

  --gold:#946B2F;                /* value / money (bronze) */
  --gold-deep:#7A5520;
  --gold-soft:rgba(168,128,74,.13);

  --ok:#248A3D;     --okbg:rgba(52,199,89,.13);
  --warn:#B25000;   --warnbg:rgba(255,149,0,.14);
  --danger:#D70015; --dangerbg:rgba(255,59,48,.11);
  --info:#0066CC;
  --violet:#6E4FD6;

  --shadow-xs:0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:0 1px 2px rgba(0,0,0,.04),0 4px 14px -6px rgba(0,0,0,.08);
  --shadow:0 2px 6px rgba(0,0,0,.04),0 18px 44px -18px rgba(16,24,40,.22);
  --shadow-lg:0 10px 30px -10px rgba(16,24,40,.18),0 40px 90px -30px rgba(16,24,40,.32);
  --ring:0 0 0 4px rgba(11,122,153,.22);

  --radius:18px; --radius-sm:12px; --radius-lg:24px; --radius-xl:32px;
  --ease:cubic-bezier(.25,.1,.25,1);
  --spring:cubic-bezier(.32,.72,0,1);
  --maxw:1240px;
  --side-w:260px; --top-h:60px; --tab-h:64px;
  --safe-b:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
[data-theme="dark"]{
  --bg:#000000;
  --bg-2:#0C0C0E;
  --ink:#1C1C1E;
  --surface:#141416;
  --surface-2:#1E1E21;
  --surface-3:#2C2C2F;
  --material:rgba(22,22,24,.72);
  --material-strong:rgba(28,28,30,.94);
  --border:rgba(255,255,255,.08);
  --border-2:rgba(255,255,255,.15);
  --separator:rgba(84,84,88,.45);
  --text:#F5F5F7;
  --text-2:#D1D1D6;
  --muted:#98989D;
  --faint:#636366;

  --primary:#4CC9E3;
  --primary-fill:#1497B6;
  --primary-hover:#18A9CA;
  --primary-deep:#9DB4DA;
  --primary-soft:rgba(76,201,227,.14);
  --on-primary:#FFFFFF;

  --gold:#D6B07A;
  --gold-deep:#B8925C;
  --gold-soft:rgba(214,176,122,.14);

  --ok:#30D158;     --okbg:rgba(48,209,88,.15);
  --warn:#FF9F0A;   --warnbg:rgba(255,159,10,.15);
  --danger:#FF453A; --dangerbg:rgba(255,69,58,.15);
  --info:#64B5FF;
  --violet:#A78BFA;

  --shadow-xs:none;
  --shadow-sm:0 0 0 .5px rgba(255,255,255,.06),0 6px 18px -8px rgba(0,0,0,.7);
  --shadow:0 0 0 .5px rgba(255,255,255,.07),0 24px 60px -24px rgba(0,0,0,.9);
  --shadow-lg:0 0 0 .5px rgba(255,255,255,.09),0 40px 100px -30px rgba(0,0,0,.95);
  --ring:0 0 0 4px rgba(76,201,227,.28);
  color-scheme:dark;
}
/* legacy aliases used by older module markup */
:root,[data-theme]{--ok-soft:var(--okbg);--danger-soft:var(--dangerbg);--warn-soft:var(--warnbg);--grid-line:var(--border)}

/* ---------------------------------------------------------------------
   2. BASE
   --------------------------------------------------------------------- */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth;scroll-padding-top:80px}
body{
  font-family:var(--font-body);font-size:15px;line-height:1.5;letter-spacing:-.006em;
  color:var(--text);background:var(--bg);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;
  font-feature-settings:"kern" 1,"cv11" 1;
  overflow-x:hidden;
}
img,svg,video{max-width:100%}
button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit}
button{background:none;border:0;padding:0;cursor:pointer}
a{color:inherit;text-decoration:none}
p{margin:0}
hr{border:0;height:1px;background:var(--separator);margin:20px 0}
code{font-family:var(--font-mono);font-size:.88em;background:var(--surface-2);border:1px solid var(--border);padding:1px 6px;border-radius:6px}
::selection{background:rgba(43,181,211,.28)}
:focus{outline:none}
:focus-visible{outline:none;box-shadow:var(--ring);border-radius:10px}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:rgba(128,128,135,.35);border-radius:10px;border:3px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background-color:rgba(128,128,135,.55)}
::-webkit-scrollbar-track{background:transparent}

/* legacy atmosphere elements: retired in favour of calm, flat canvases */
.atmos,.grain,.orb{display:none!important}

/* ---------------------------------------------------------------------
   3. TYPOGRAPHY
   --------------------------------------------------------------------- */
h1,h2,h3,h4,h5{font-family:var(--font-display);font-weight:700;letter-spacing:-.022em;line-height:1.1;margin:0;color:var(--text)}
h3{font-weight:650;letter-spacing:-.018em}
h4{font-weight:600;letter-spacing:-.012em}
.mono{font-family:var(--font-body);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;letter-spacing:-.01em}
.code{font-family:var(--font-mono)}
.eyebrow{font-size:12px;font-weight:600;letter-spacing:.02em;color:var(--primary);text-transform:none;display:inline-block}
.muted{color:var(--muted)}
.tcolor{color:var(--text-2)}
.strong{font-weight:600;color:var(--text)}
.t-sub{font-size:12px;color:var(--muted);line-height:1.4}
.lede,.lead{color:var(--text-2)}
.center{text-align:center;margin-left:auto;margin-right:auto}
.serif{font-family:var(--font-serif);font-weight:400;letter-spacing:-.01em}

/* ---------------------------------------------------------------------
   4. BUTTONS
   --------------------------------------------------------------------- */
.btn{
  -webkit-appearance:none;appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;
  font-family:var(--font-body);font-size:14px;font-weight:550;letter-spacing:-.01em;line-height:1;white-space:nowrap;
  height:38px;padding:0 16px;border-radius:999px;border:1px solid transparent;cursor:pointer;user-select:none;
  transition:background-color .2s var(--ease),border-color .2s var(--ease),color .2s var(--ease),transform .15s var(--ease),box-shadow .2s var(--ease),opacity .2s;
  -webkit-tap-highlight-color:transparent;text-decoration:none;
}
.btn svg{width:16px;height:16px;flex:none}
.btn:active{transform:scale(.97)}
.btn[disabled],.btn.disabled{opacity:.45;pointer-events:none}
.btn-primary{background:var(--primary-fill);color:var(--on-primary)}
.btn-primary:hover{background:var(--primary-hover)}
.btn-navy{background:var(--navy);color:#fff}
.btn-navy:hover{background:var(--navy-2)}
[data-theme="dark"] .btn-navy{background:#F5F5F7;color:#13294B}
.btn-ghost{background:var(--surface);color:var(--text);border-color:var(--border-2);box-shadow:var(--shadow-xs)}
.btn-ghost:hover{background:var(--surface-2);border-color:var(--border-2)}
[data-theme="dark"] .btn-ghost{background:var(--surface-2);border-color:var(--border)}
[data-theme="dark"] .btn-ghost:hover{background:var(--surface-3)}
.btn-gold{background:var(--navy);color:#fff}
.btn-gold:hover{background:var(--navy-2)}
[data-theme="dark"] .btn-gold{background:#F5F5F7;color:var(--navy)}
.btn-plain{background:none;border:0;color:var(--primary);height:auto;padding:4px 2px;border-radius:6px}
.btn-plain:hover{opacity:.75}
.btn-danger{background:var(--dangerbg);color:var(--danger)}
.btn-sm{height:32px;padding:0 13px;font-size:13px;gap:6px}
.btn-sm svg{width:15px;height:15px}
.btn-xs{height:27px;padding:0 10px;font-size:12px;gap:5px}
.btn-xs svg{width:13px;height:13px}
.btn-lg{height:48px;padding:0 24px;font-size:16px}
.btn-icon{width:38px;padding:0}
.btn-block{width:100%}

.icon-btn,.theme-btn{
  width:36px;height:36px;border-radius:50%;display:grid;place-items:center;flex:none;position:relative;
  color:var(--text-2);background:transparent;border:0;cursor:pointer;transition:background-color .2s,color .2s,transform .15s;
}
.icon-btn:hover,.theme-btn:hover{background:var(--surface-3);color:var(--text)}
.icon-btn:active,.theme-btn:active{transform:scale(.92)}
.icon-btn svg,.theme-btn svg{width:19px;height:19px}
.icon-btn .ping{position:absolute;top:6px;right:7px;width:8px;height:8px;border-radius:50%;background:#FF3B30;box-shadow:0 0 0 2px var(--material-strong)}
.x{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--surface-3);color:var(--muted);cursor:pointer;transition:.2s}
.x:hover{color:var(--text);background:var(--border-2)}
.x svg{width:14px;height:14px}

/* ---------------------------------------------------------------------
   5. SURFACES
   --------------------------------------------------------------------- */
.glass{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);position:relative}
.card{padding:22px;border-radius:var(--radius)}
.pad-sm{padding:16px}
.glass.interactive,a.glass{transition:transform .25s var(--ease),box-shadow .25s var(--ease),border-color .25s}
.glass.interactive:hover,a.glass:hover{box-shadow:var(--shadow)}
.divider{height:1px;background:var(--separator);margin:20px 0}
.section-title{font-family:var(--font-display);font-size:17px;font-weight:650;letter-spacing:-.018em;margin:0;display:flex;align-items:center;gap:8px;color:var(--text)}
.section-title svg{width:17px;height:17px;color:var(--muted)}

/* layout helpers */
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.between{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.grow{flex:1;min-width:0}
.hide{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ---------------------------------------------------------------------
   6. CHIPS / BADGES
   --------------------------------------------------------------------- */
.chip{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 10px;border-radius:999px;font-size:12px;font-weight:550;white-space:nowrap;
  background:var(--surface-3);color:var(--text-2);border:0;line-height:1}
.chip svg{width:12px;height:12px}
.chip.dot::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.chip.ok{background:var(--okbg);color:var(--ok)}
.chip.warn{background:var(--warnbg);color:var(--warn)}
.chip.danger{background:var(--dangerbg);color:var(--danger)}
.chip.teal,.chip.info{background:var(--primary-soft);color:var(--primary)}
.chip.gold{background:var(--gold-soft);color:var(--gold)}
.badge{font-size:11px;font-weight:600;padding:2px 7px;border-radius:999px;background:var(--surface-3);color:var(--text-2);font-variant-numeric:tabular-nums}
.flow-tag{font-size:11.5px;padding:3px 9px;border-radius:7px;background:var(--surface-2);border:1px solid var(--border);color:var(--text-2)}

/* ---------------------------------------------------------------------
   7. FORMS
   --------------------------------------------------------------------- */
.field{margin-bottom:16px}
.field label{display:block;font-size:13px;font-weight:550;color:var(--text-2);margin:0 0 7px 2px}
.field .hint,.hint{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.45}
.field input,.field select,.field textarea,select,
input[type=text],input[type=email],input[type=password],input[type=number],input[type=date],input[type=tel],input[type=url],input[type=search],input[type=month],input[type=time],textarea{
  width:100%;min-height:42px;padding:10px 13px;border-radius:11px;font-size:15px;line-height:1.35;
  color:var(--text);background:var(--surface-2);border:1px solid transparent;outline:none;
  transition:border-color .18s,box-shadow .18s,background-color .18s;-webkit-appearance:none;appearance:none;
}
textarea{resize:vertical;min-height:96px}
.field input:hover,.field select:hover,.field textarea:hover,select:hover{background:var(--surface-3)}
.field input:focus,.field select:focus,.field textarea:focus,select:focus,
input[type=text]:focus,input[type=email]:focus,input[type=password]:focus,input[type=number]:focus,input[type=date]:focus,input[type=tel]:focus,input[type=search]:focus,textarea:focus{
  background:var(--surface);border-color:var(--primary);box-shadow:var(--ring)}
[data-theme="dark"] .field input:focus,[data-theme="dark"] select:focus,[data-theme="dark"] textarea:focus{background:var(--ink)}
input::placeholder,textarea::placeholder{color:var(--faint)}
select{cursor:pointer;padding-right:36px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 11px center;background-size:16px 16px}
select option,select optgroup{background:var(--ink);color:var(--text)}
input[type=checkbox],input[type=radio]{accent-color:var(--primary-fill);width:18px;height:18px;vertical-align:-3px;cursor:pointer}
input[type=file]{font-size:13px;color:var(--muted)}
input[type=file]::file-selector-button{font:inherit;font-weight:550;font-size:13px;margin-right:10px;height:32px;padding:0 13px;border-radius:999px;border:1px solid var(--border-2);background:var(--surface);color:var(--text);cursor:pointer}
.inline-select{width:auto;min-width:200px;min-height:36px;padding-top:7px;padding-bottom:7px;font-size:14px;border-radius:999px;padding-left:15px}
.auth-error{background:var(--dangerbg);color:var(--danger);padding:11px 14px;border-radius:12px;font-size:13.5px;margin-bottom:16px;font-weight:500}
.cell-edit{width:100px;min-height:32px;padding:5px 9px;border-radius:8px;background:var(--surface-2);border:1px solid transparent;
  font:550 13px var(--font-body);font-variant-numeric:tabular-nums;text-align:right;color:var(--text);transition:.15s}
.cell-edit:focus{outline:none;background:var(--surface);border-color:var(--primary);box-shadow:var(--ring)}

/* toggle (iOS switch) */
.toggle{width:46px;height:28px;border-radius:999px;background:var(--surface-3);position:relative;cursor:pointer;flex:none;transition:background-color .25s var(--ease);border:0;padding:0}
.toggle .knob{position:absolute;top:2px;left:2px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.2),0 0 0 .5px rgba(0,0,0,.04);transition:transform .3s var(--spring)}
.toggle.on{background:#34C759}
.toggle.on .knob{transform:translateX(18px)}

/* segmented control / tabs */
.tabs{display:inline-flex;gap:2px;padding:3px;border-radius:11px;background:var(--surface-3);max-width:100%;overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}
.tabs::-webkit-scrollbar{display:none}
.tab{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 14px;border-radius:8px;font-size:13px;font-weight:550;color:var(--text-2);white-space:nowrap;cursor:pointer;transition:background-color .2s,color .2s,box-shadow .2s}
.tab svg{width:15px;height:15px}
.tab:hover{color:var(--text)}
.tab.active{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.1),0 0 0 .5px rgba(0,0,0,.04)}
[data-theme="dark"] .tab.active{background:#636366;color:#fff}

/* ---------------------------------------------------------------------
   8. DATA DISPLAY
   --------------------------------------------------------------------- */
/* KPI */
.kpi{padding:18px 18px 16px;border-radius:var(--radius);overflow:hidden;transition:box-shadow .25s}
.kpi:hover{box-shadow:var(--shadow)}
.kpi .top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.kpi .ic{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary)}
.kpi .ic.g{background:var(--gold-soft);color:var(--gold)}
.kpi .ic svg{width:18px;height:18px}
.kpi .val{font-family:var(--font-display);font-size:28px;font-weight:700;letter-spacing:-.028em;margin-top:14px;line-height:1.05;font-variant-numeric:tabular-nums}
.kpi .lab{font-size:13px;color:var(--text-2);margin-top:4px;font-weight:500}
.kpi .delta{font-size:12px;font-weight:600;display:inline-flex;align-items:center;gap:2px;padding:3px 8px;border-radius:999px}
.kpi .delta svg{width:12px;height:12px}
.kpi .delta.up{color:var(--ok);background:var(--okbg)}
.kpi .delta.down{color:var(--danger);background:var(--dangerbg)}

/* table */
.tbl-wrap{overflow-x:auto;border-radius:14px;border:1px solid var(--border);background:var(--surface);-webkit-overflow-scrolling:touch}
.card .tbl-wrap,.glass .tbl-wrap{border-radius:12px}
table.tbl{width:100%;border-collapse:separate;border-spacing:0;font-size:14px;min-width:560px}
.tbl thead th{position:sticky;top:0;z-index:1;text-align:left;font-size:12px;font-weight:600;color:var(--muted);letter-spacing:0;text-transform:none;
  padding:11px 16px;background:var(--surface);border-bottom:1px solid var(--separator);white-space:nowrap}
.tbl tbody td{padding:13px 16px;border-bottom:1px solid var(--separator);vertical-align:middle}
.tbl tbody tr:last-child td{border-bottom:0}
.tbl tbody tr{transition:background-color .15s}
.tbl tbody tr:hover{background:var(--surface-2)}
.tbl tbody tr[onclick],.tbl tbody tr.clickable{cursor:pointer}
.tbl tbody tr.no-hover:hover{background:none}
.tbl tfoot td{padding:12px 16px;background:var(--surface-2);font-weight:600;border-top:1px solid var(--separator)}
.tbl .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.tbl .strong{font-weight:600}
.tbl .sec-row td{background:var(--surface-2);font-weight:650;font-size:13px}
.tbl.boq td{padding:9px 14px}
.avatar{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;font-weight:650;font-size:12.5px;flex:none;background:var(--surface-3);color:var(--text-2)}
.avatar svg{width:17px;height:17px}
.cell{display:flex;align-items:center;gap:11px;min-width:0}

/* progress bar */
.bar{height:6px;border-radius:999px;background:var(--surface-3);overflow:hidden;min-width:70px;flex:1}
.bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--pulse),var(--pulse-bright));transition:width .8s var(--spring)}
.bar.gold i{background:linear-gradient(90deg,var(--gold-deep),var(--gold))}
.ring{transform:rotate(-90deg)}
.ring circle{fill:none;stroke-width:9;stroke-linecap:round}
.ring .bg{stroke:var(--surface-3)}
.ring .fg{stroke:var(--primary);transition:stroke-dashoffset 1s var(--ease)}

/* mini column chart */
.chart{display:flex;align-items:flex-end;gap:10px;height:170px;padding-top:12px}
.chart .col{flex:1;display:flex;flex-direction:column;align-items:center;gap:8px;height:100%;justify-content:flex-end;min-width:0}
.chart .col .stack{width:100%;max-width:38px;display:flex;align-items:flex-end;justify-content:center;gap:3px;height:100%}
.chart .bar2{flex:1;border-radius:6px 6px 3px 3px;background:var(--primary-fill);min-height:3px;transition:height 1s var(--spring)}
.chart .bar2.g{background:var(--gold);opacity:.55}
.chart .lbl{font-size:11px;color:var(--muted);font-weight:500}

.legend{display:flex;flex-direction:column;gap:10px}
.legend .li{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--text-2)}
.legend .sw{width:10px;height:10px;border-radius:3px;flex:none}
.legend .li .v{margin-left:auto;white-space:nowrap;padding-left:8px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums}

/* list rows (iOS grouped list feel) */
.lrow{display:flex;align-items:center;gap:13px;padding:12px 0;border-top:1px solid var(--separator);min-width:0}
.lrow:first-child,.section-title+.lrow,.lrow.first{border-top:0}
.lrow .ic{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none;background:var(--surface-2);color:var(--text-2)}
.lrow .ic svg{width:17px;height:17px}
.lrow .gr{flex:1;min-width:0}
.lrow .ti{font-size:14px;font-weight:600;line-height:1.35;overflow-wrap:anywhere}
.lrow .su{font-size:12.5px;color:var(--muted);margin-top:1px;line-height:1.4}
.lrow .rt{font-size:13px;color:var(--text-2);text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
a.lrow{border-radius:12px;margin:0 -10px;padding-left:10px;padding-right:10px;transition:background-color .15s}
a.lrow:hover{background:var(--surface-2)}

/* kanban / pipeline */
.pipeline{display:grid;grid-template-columns:repeat(5,minmax(200px,1fr));gap:14px;overflow-x:auto}
.pcol,.kcol{background:var(--surface-2);border-radius:var(--radius);padding:12px;min-width:200px;border:1px solid var(--border)}
.kanban{display:flex;gap:14px;overflow-x:auto;padding-bottom:10px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
.kcol{flex:0 0 268px;min-width:268px;scroll-snap-align:start}
.pcol .ph,.khead{display:flex;align-items:center;justify-content:space-between;margin:2px 4px 12px;font-size:13px;font-weight:650;color:var(--text)}
.khead .mono{background:var(--surface);border-radius:999px;padding:1px 9px;font-size:11.5px;color:var(--muted)}
.pcard,.kcard{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:13px;margin-bottom:10px;box-shadow:var(--shadow-xs);transition:box-shadow .2s,transform .2s}
.pcard:hover,.kcard:hover{box-shadow:var(--shadow-sm);transform:translateY(-1px)}
.pcard .cn{font-size:14px;font-weight:600}
.pcard .cv{font-size:13px;color:var(--gold);font-weight:600;margin-top:4px;font-variant-numeric:tabular-nums}
.pcard .cm{font-size:12px;color:var(--muted);margin-top:7px;display:flex;justify-content:space-between}
.kactions{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}
.kactions form{margin:0}
.kbtn{width:100%;height:28px;border-radius:8px;background:var(--surface-2);color:var(--text-2);display:grid;place-items:center;transition:.15s}
.kbtn svg{width:14px;height:14px}
.kbtn:hover{background:var(--surface-3);color:var(--text)}
.kbtn[disabled]{opacity:.3;cursor:not-allowed}
.kbtn.primary:hover{background:var(--primary-soft);color:var(--primary)}
.kbtn.ok:hover{background:var(--okbg);color:var(--ok)}
.kbtn.danger:hover{background:var(--dangerbg);color:var(--danger)}
.kactions form:first-child .kbtn svg{transform:rotate(180deg)}

/* empty states */
.empty{text-align:center;padding:52px 20px;color:var(--muted)}
.empty svg{width:40px;height:40px;opacity:.35;margin-bottom:12px}
.empty-drop{text-align:center;padding:56px 24px;border:1.5px dashed var(--border-2);border-radius:var(--radius)}
.empty-drop .empty-ic{display:inline-grid;place-items:center;width:60px;height:60px;border-radius:18px;background:var(--primary-soft);color:var(--primary);margin-bottom:16px}
.empty-drop .empty-ic svg{width:28px;height:28px}

/* insights */
.insight-list{display:flex;flex-direction:column;gap:2px}
.insight{display:flex;align-items:center;gap:14px;padding:12px;border-radius:14px;transition:background-color .15s;border-left:0!important}
.insight:hover{background:var(--surface-2)}
.insight .ic{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;flex:none}
.insight .ic svg{width:18px;height:18px}
.insight .gr{flex:1;min-width:0}
.insight .ti{font-size:14px;font-weight:600;line-height:1.35}
.insight .su{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.45}

/* certificate block */
.cert-doc{background:var(--surface-2);border-radius:14px;padding:18px 20px}

/* project cards (app) */
.proj-card{overflow:hidden;display:block;transition:transform .3s var(--ease),box-shadow .3s var(--ease)}
.proj-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.pc-img{position:relative;height:160px;overflow:hidden;background:linear-gradient(140deg,var(--navy),var(--pulse))}
.pc-img img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .8s var(--ease)}
.proj-card:hover .pc-img img{transform:scale(1.04)}
.pc-img .chip{background:rgba(255,255,255,.88);color:#1D1D1F;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.proj-hero{position:relative;min-height:240px;display:flex;align-items:flex-end;padding:28px;background-size:cover;background-position:center;color:#fff;border-radius:var(--radius-lg);overflow:hidden;border:0}
.proj-hero h2{color:#fff}
.proj-hero .muted{color:rgba(255,255,255,.78)}

/* portal hero */
.portal-hero{background:linear-gradient(135deg,var(--navy) 0%,#123E63 55%,var(--pulse) 140%);border-radius:var(--radius-lg);padding:30px 32px;color:#fff;position:relative;overflow:hidden;border:0}
.portal-hero::after{content:"";position:absolute;inset:0;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120'%3E%3Cpath d='M0 80 H120 L135 55 L150 95 L168 20 L184 70 L198 58 L400 58' fill='none' stroke='%235FE0F0' stroke-opacity='.25' stroke-width='2'/%3E%3C/svg%3E") right center/60% auto no-repeat;pointer-events:none}
.portal-hero>*{position:relative;z-index:1}
.portal-hero h2{color:#fff}
.portal-hero .muted,.portal-hero .t-sub{color:rgba(255,255,255,.75)}

/* documents */
.doc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.doc-card{display:flex;flex-direction:column;padding:16px;transition:box-shadow .2s,transform .2s}
.doc-card.has-file{cursor:pointer}
.doc-card:hover{box-shadow:var(--shadow);transform:translateY(-2px)}
.doc-card-top{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}
.doc-ic{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;flex:none;background:var(--primary-soft);color:var(--primary);position:relative}
.doc-ic svg{width:20px;height:20px}
.doc-ic.kind-pdf{background:var(--dangerbg);color:var(--danger)}
.doc-ic.kind-xls{background:var(--okbg);color:var(--ok)}
.doc-ic.kind-doc{background:rgba(0,102,204,.11);color:var(--info)}
.doc-ic.kind-img{background:var(--gold-soft);color:var(--gold)}
.doc-ic.kind-zip{background:var(--surface-3);color:var(--text-2)}
.doc-ext{position:absolute;bottom:-5px;right:-6px;font-size:8.5px;font-weight:700;padding:2px 4px;border-radius:5px;background:var(--surface);color:var(--text-2);box-shadow:0 0 0 1px var(--border-2);line-height:1}
.doc-name{font-size:14px;font-weight:600;line-height:1.4;margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.8em}
.doc-meta{margin-bottom:14px}
.doc-proj{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.doc-proj svg{width:13px;height:13px}
.doc-card-foot{display:flex;align-items:center;justify-content:space-between;margin-top:auto;padding-top:12px;border-top:1px solid var(--separator)}
.doc-actions{opacity:.6;transition:opacity .2s}
.doc-card:hover .doc-actions{opacity:1}
.doc-search{display:flex;align-items:center;gap:8px;background:var(--surface-3);border-radius:999px;padding:0 14px;height:36px;transition:box-shadow .2s,background-color .2s}
.doc-search:focus-within{background:var(--surface);box-shadow:var(--ring)}
.doc-search svg{width:15px;height:15px;color:var(--muted);flex:none}
.doc-search input{background:none!important;border:0!important;box-shadow:none!important;min-height:0;padding:0;font-size:14px;width:180px;max-width:42vw}
.dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;position:relative;padding:28px 20px;margin-bottom:16px;
  border:1.5px dashed var(--border-2);border-radius:16px;background:var(--surface-2);cursor:pointer;transition:.2s}
.dropzone:hover,.dropzone.drag{border-color:var(--primary);background:var(--primary-soft)}
.dz-ic{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;background:var(--surface);color:var(--primary);box-shadow:var(--shadow-xs)}
.dz-ic svg{width:21px;height:21px}
.dz-main{font-size:14px;font-weight:600}
.dz-sub{font-size:12px;color:var(--muted)}

/* ---------------------------------------------------------------------
   9. ANALYTICS
   --------------------------------------------------------------------- */
.ana-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.ana-modes{display:inline-flex;background:var(--surface-3);border-radius:11px;padding:3px;gap:2px}
.ana-mode{height:30px;display:inline-flex;align-items:center;padding:0 16px;border-radius:8px;font-size:13px;font-weight:550;color:var(--text-2);transition:.2s}
.ana-mode.active{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.1)}
[data-theme="dark"] .ana-mode.active{background:#636366;color:#fff}
.ana-pickrow{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:22px}
.ana-chip{height:30px;display:inline-flex;align-items:center;padding:0 13px;border-radius:999px;font-size:13px;font-weight:550;color:var(--text-2);background:var(--surface);border:1px solid var(--border-2);transition:.18s}
.ana-chip.sm{height:28px;padding:0 11px;font-size:12.5px}
.ana-chip:hover{color:var(--text);background:var(--surface-2)}
.ana-chip.active{background:var(--text);color:var(--bg);border-color:transparent}
.ana-sep{width:1px;height:20px;background:var(--border-2);margin:0 6px}
.ana-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:12px;margin-bottom:20px}
.ana-kpi{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:15px 16px;box-shadow:var(--shadow-sm);position:relative;overflow:hidden}
.ana-kpi::before{content:"";position:absolute;left:16px;top:0;width:24px;height:3px;border-radius:0 0 3px 3px}
.ana-kpi.accent-rev::before{background:var(--ok)}
.ana-kpi.accent-exp::before{background:var(--danger)}
.ana-kpi.accent-net::before{background:var(--primary)}
.ana-kpi.accent-inv::before{background:var(--info)}
.ana-kpi.accent-coll::before{background:var(--gold)}
.ana-kpi.accent-cli::before{background:var(--violet)}
.ana-k-lab{font-size:11.5px;font-weight:600;color:var(--muted);margin:6px 0 8px;text-transform:none;letter-spacing:0}
.ana-k-val{font-family:var(--font-display);font-size:clamp(18px,1.55vw,23px);white-space:nowrap;font-weight:700;letter-spacing:-.025em;line-height:1.05;font-variant-numeric:tabular-nums}
.ana-k-val.ok{color:var(--ok)} .ana-k-val.danger{color:var(--danger)} .ana-k-val.info{color:var(--info)} .ana-k-val.gold{color:var(--gold)}
.ana-k-sub{font-size:11.5px;margin-top:8px;display:flex;align-items:center;gap:6px;color:var(--muted)}
.ana-d{font-weight:650;font-size:11.5px}
.ana-d.pos{color:var(--ok)} .ana-d.neg{color:var(--danger)} .ana-d.flat{color:var(--muted)}
.ana-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px;align-items:stretch}
.ana-forecast{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:16px;padding:12px 15px;background:var(--gold-soft);border-radius:12px;font-size:13px}
.ana-client{margin-bottom:15px}
.ana-client:last-child{margin-bottom:0}
.ana-heat{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.ana-heat-cell{display:flex;flex-direction:column;gap:4px;padding:12px;border-radius:12px;border:1px solid var(--border);transition:.15s;min-height:60px;justify-content:center}
.ana-heat-cell:hover{transform:translateY(-1px);box-shadow:var(--shadow-sm)}
.ana-heat-cell.sel{box-shadow:0 0 0 2px var(--primary)}
.ana-heat-cell .hm{font-size:11.5px;font-weight:600;color:var(--text-2)}
.ana-heat-cell .hv{font-size:14px;font-weight:650;font-variant-numeric:tabular-nums}
.ana-insights{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.ana-ins{padding:15px;border-radius:16px;display:block;transition:.2s;border:0}
.ana-ins.good{background:var(--okbg)} .ana-ins.warn{background:var(--warnbg)} .ana-ins.urgent{background:var(--dangerbg)} .ana-ins.info{background:var(--primary-soft)}
a.ana-ins:hover{transform:translateY(-2px)}
.ana-ins-top{display:flex;align-items:center;gap:9px;margin-bottom:7px}
.ana-ins-ic{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;flex:none;background:var(--surface)}
.ana-ins-ic svg{width:14px;height:14px}
.ana-ins.good .ana-ins-ic{color:var(--ok)} .ana-ins.warn .ana-ins-ic{color:var(--warn)} .ana-ins.urgent .ana-ins-ic{color:var(--danger)} .ana-ins.info .ana-ins-ic{color:var(--primary)}
.ana-ins-ti{font-size:13.5px;font-weight:650}
.ana-ins-tx{font-size:12px;color:var(--text-2);line-height:1.5}
.ledger{display:flex;flex-direction:column}
.ledger-row{display:grid;grid-template-columns:150px 1fr 130px;align-items:center;gap:14px;padding:9px 0;border-bottom:1px solid var(--separator)}
.ledger-row:last-child{border-bottom:0}
.ledger-row.idle{opacity:.4}
.ledger-label{display:flex;flex-direction:column;gap:2px;min-width:0}
.lr-period{font-size:13px;font-weight:600}
.lr-meta{font-size:11px;color:var(--muted)}
.lr-meta.dim{font-style:italic}
.ledger-bars{display:flex;align-items:center;height:26px}
.lb-side{flex:1;display:flex;align-items:center;height:16px;overflow:hidden}
.lb-exp{justify-content:flex-end;flex-direction:row-reverse}
.lb-fill{height:100%;border-radius:4px;transition:width .6s var(--spring)}
.lb-exp .lb-fill{border-radius:4px 0 0 4px}
.lb-rev .lb-fill{border-radius:0 4px 4px 0}
.lb-center{width:1px;align-self:stretch;background:var(--border-2);flex:none}
.lb-val{font-size:10.5px;color:var(--text-2);padding:0 6px;white-space:nowrap;font-variant-numeric:tabular-nums}
.ledger-net{text-align:right;display:flex;flex-direction:column;gap:1px}
.ledger-net .mono{font-size:13px}
.ledger-net .dim{color:var(--muted)}
.ln-sub{font-size:10px;color:var(--muted)}

/* ---------------------------------------------------------------------
   10. COMMUNICATIONS
   --------------------------------------------------------------------- */
.comms-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:20px}
.cstat{display:flex;align-items:center;gap:11px;padding:13px 14px;background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-sm)}
.cs-ic{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none}
.cs-ic svg{width:17px;height:17px}
.cs-v{font-family:var(--font-display);font-size:19px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.cs-l{font-size:11.5px;color:var(--muted);margin-top:3px}
.comms-compose{display:grid;grid-template-columns:1.2fr .8fr;gap:20px;align-items:start}
.comms-preview-wrap{position:sticky;top:calc(var(--top-h) + 20px)}
.contact-select{width:100%;margin-bottom:10px}
.chan-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.chan{display:flex;align-items:center;gap:9px;padding:10px 12px;border-radius:13px;cursor:pointer;background:var(--surface-2);border:1.5px solid transparent;transition:.18s;position:relative;min-width:0}
.chan input{position:absolute;opacity:0;pointer-events:none}
.chan .ci{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;flex:none;background:var(--surface);color:var(--text-2)}
.chan .ci svg{width:16px;height:16px}
.chan .cl{font-size:13.5px;font-weight:600;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chan .cs{width:8px;height:8px;border-radius:50%;flex:none;margin-left:auto}
.chan:hover{background:var(--surface-3)}
.chan:has(input:checked),.chan.active{background:var(--primary-soft);border-color:var(--primary)}
.chan:has(input:checked) .ci,.chan.active .ci{background:var(--primary-fill);color:#fff}
.chan:has(input:checked) .cl,.chan.active .cl{color:var(--text)}
.tpl-list{display:flex;flex-direction:column;gap:8px}
.tpl-card{display:flex;align-items:center;gap:12px;width:100%;text-align:left;cursor:pointer;padding:11px 13px;border-radius:13px;background:var(--surface-2);border:0;transition:.18s;position:relative}
.tpl-card:hover{background:var(--surface-3)}
.tpl-ic{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;flex:none;background:var(--primary-soft);color:var(--primary)}
.tpl-ic svg{width:16px;height:16px}
.tpl-body{display:flex;flex-direction:column;gap:1px;min-width:0}
.tpl-name{font-size:13.5px;font-weight:600}
.tpl-ch{font-size:11.5px;color:var(--muted)}
.tpl-go{margin-left:auto;color:var(--muted);opacity:0;transition:.18s}
.tpl-go svg{width:15px;height:15px}
.tpl-card:hover .tpl-go{opacity:1;color:var(--primary)}
.tpl-chip{cursor:pointer;padding:7px 12px;border-radius:999px;background:var(--surface-2);font-size:12.5px;transition:.15s;white-space:nowrap}
.tpl-chip:hover{background:var(--primary-soft);color:var(--primary)}
.msg-row,.comms-msg{display:flex;gap:13px;padding:14px 0;border-bottom:1px solid var(--separator)}
.msg-row:last-child,.comms-msg:last-child{border-bottom:0}
.msg-ic,.comms-msg .ch{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;flex:none;background:var(--surface-2);color:var(--text-2)}
.msg-ic svg{width:17px;height:17px}
.msg-main{flex:1;min-width:0}
.contact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.contact-card{padding:15px;border-radius:16px;background:var(--surface-2);transition:.18s}
.contact-card:hover{background:var(--surface-3)}
.contact-line{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text-2);margin-top:6px}
.contact-line svg{width:14px;height:14px;color:var(--muted);flex:none}
.cp-label{display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:14px}
.cp-label svg{width:15px;height:15px}
.cp-hint{font-size:12px;text-align:center;margin-top:14px;line-height:1.5;color:var(--muted)}
.phone-frame{max-width:300px;margin:0 auto;border-radius:44px;overflow:hidden;border:10px solid #1D1D1F;background:#0b141a;box-shadow:var(--shadow-lg);position:relative}
.phone-frame::before{content:"";position:absolute;top:9px;left:50%;transform:translateX(-50%);width:84px;height:24px;background:#000;border-radius:20px;z-index:3}
.phone-top{display:flex;align-items:center;gap:10px;padding:44px 16px 12px;background:#1f2c33;color:#fff}
.phone-frame.sms .phone-top{background:#F2F2F7;color:#000}
.phone-frame.sms .phone-name{color:#000}
.phone-ic{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;flex:none;background:rgba(255,255,255,.14)}
.phone-frame.sms .phone-ic{background:#C7C7CC;color:#fff}
.phone-frame.wa .phone-ic{color:#25D366}
.phone-ic svg{width:18px;height:18px}
.phone-name{font-size:14px;font-weight:600;line-height:1.2;color:#fff}
.phone-sub{font-size:11px;opacity:.65}
.phone-screen{min-height:240px;max-height:360px;overflow-y:auto;padding:16px 12px;background:#0b141a;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.phone-frame.sms .phone-screen{background:#fff}
.bubble{max-width:82%;padding:8px 12px;border-radius:18px 18px 4px 18px;font-size:13.5px;line-height:1.4;color:#e9edef;background:#005c4b;word-break:break-word}
.phone-frame.sms .bubble{background:#0A84FF;color:#fff}
.bubble.empty{background:rgba(127,127,127,.15);color:rgba(127,127,127,.9);font-style:italic}
.bubble-time{font-size:10px;color:rgba(127,127,127,.8);margin-right:4px}
.email-frame{max-width:380px;margin:0 auto;border-radius:16px;overflow:hidden;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow)}
.ef-head{padding:14px 16px;border-bottom:1px solid var(--separator)}
.ef-row{display:flex;gap:10px;font-size:12.5px;margin-bottom:5px}
.ef-row:last-child{margin-bottom:0}
.ef-k{color:var(--muted);width:56px;flex:none}
.ef-v{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ef-body{padding:18px 16px;font-size:13.5px;line-height:1.6;min-height:140px}
.tender-notify{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:12px 14px;border-radius:14px;margin-bottom:8px;background:var(--surface-2)}
.tender-notify.win{background:var(--okbg)}
.tender-notify .tn-main{display:flex;align-items:center;gap:12px;min-width:0}
.tender-notify .tn-acts{display:flex;gap:6px;flex-wrap:wrap}

/* ---------------------------------------------------------------------
   11. OVERLAYS — modal / sheet, toasts, menus, notifications
   --------------------------------------------------------------------- */
.modal-bg{position:fixed;inset:0;z-index:300;display:flex;align-items:center;justify-content:center;padding:24px;
  background:rgba(0,0,0,.32);backdrop-filter:blur(6px) saturate(120%);-webkit-backdrop-filter:blur(6px) saturate(120%);
  opacity:0;visibility:hidden;transition:opacity .28s var(--ease),visibility 0s linear .28s}
.modal-bg.show{opacity:1;visibility:visible;transition:opacity .28s var(--ease)}
.modal{width:100%;max-width:560px;max-height:min(88vh,860px);overflow-y:auto;overscroll-behavior:contain;border-radius:22px;padding:24px 24px 22px;
  background:var(--ink);box-shadow:var(--shadow-lg);transform:translateY(16px) scale(.97);opacity:0;transition:transform .45s var(--spring),opacity .25s var(--ease)}
.modal-bg.show .modal{transform:none;opacity:1}
.modal h3{font-size:20px;margin-bottom:4px}
.modal .mh,.modal .modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:20px}
.modal .mh p,.modal .modal-head p{color:var(--muted);font-size:13.5px;margin-top:2px}
.modal .modal-body{display:block}
.modal form>.btn-primary:last-child,.modal form .btn-primary[type=submit]{min-width:120px}
.sheet-grabber{display:none}

.toast-wrap{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:400;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;width:max-content;max-width:calc(100vw - 32px)}
.toast{pointer-events:auto;display:flex;align-items:center;gap:12px;min-width:260px;max-width:420px;padding:11px 18px 11px 12px;border-radius:999px;
  background:var(--material-strong);backdrop-filter:blur(30px) saturate(180%);-webkit-backdrop-filter:blur(30px) saturate(180%);
  box-shadow:var(--shadow-lg);border:1px solid var(--border);animation:toastIn .55s var(--spring) both}
.toast .t-ic{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--primary-soft);color:var(--primary)}
.toast.ok .t-ic{background:var(--okbg);color:var(--ok)}
.toast.gold .t-ic{background:var(--warnbg);color:var(--warn)}
.toast .t-ic svg{width:16px;height:16px}
.toast .tt{font-size:14px;font-weight:600;line-height:1.25}
.toast .ts{font-size:12.5px;color:var(--muted);line-height:1.35}
.toast.out{animation:toastOut .35s var(--ease) forwards}
@keyframes toastIn{from{opacity:0;transform:translateY(-24px) scale(.92)}to{opacity:1;transform:none}}
@keyframes toastOut{to{opacity:0;transform:translateY(-16px) scale(.95)}}

.menu{position:absolute;z-index:250;min-width:240px;padding:6px;border-radius:14px;background:var(--material-strong);
  backdrop-filter:blur(30px) saturate(180%);-webkit-backdrop-filter:blur(30px) saturate(180%);border:1px solid var(--border);box-shadow:var(--shadow-lg);
  transform-origin:top right;animation:menuIn .22s var(--ease)}
.menu[hidden]{display:none}
@keyframes menuIn{from{opacity:0;transform:scale(.96) translateY(-4px)}to{opacity:1;transform:none}}
.menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border-radius:9px;font-size:14px;color:var(--text);text-align:left;transition:background-color .12s}
.menu-item:hover{background:var(--primary-fill);color:#fff}
.menu-item:hover .muted{color:rgba(255,255,255,.8)}
.menu-item svg{width:17px;height:17px;flex:none;opacity:.8}
.menu-sep{height:1px;background:var(--separator);margin:6px 8px}
.menu-head{display:flex;align-items:center;gap:11px;padding:8px 10px 10px}
.menu-label{font-size:12px;font-weight:600;color:var(--muted);padding:6px 10px 4px}
.seg{display:flex;gap:2px;padding:3px;margin:2px 6px 6px;border-radius:10px;background:var(--surface-3)}
.seg button{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:7px 4px;border-radius:8px;font-size:11.5px;font-weight:550;color:var(--text-2);transition:.18s}
.seg button svg{width:16px;height:16px}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.12)}
[data-theme="dark"] .seg button.on{background:#636366;color:#fff}

/* notifications */
.notif-wrap{position:relative}
.notif-dropdown{position:absolute;top:calc(100% + 10px);right:-8px;width:380px;max-width:calc(100vw - 24px);border-radius:18px;overflow:hidden;z-index:260;padding:0;
  background:var(--material-strong);backdrop-filter:blur(30px) saturate(180%);-webkit-backdrop-filter:blur(30px) saturate(180%);border:1px solid var(--border);box-shadow:var(--shadow-lg);
  transform-origin:top right;animation:menuIn .22s var(--ease)}
.notif-dropdown[hidden]{display:none}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px}
.notif-head .strong{font-size:16px;font-family:var(--font-display);font-weight:700}
.notif-body{max-height:min(420px,60vh);overflow-y:auto;padding:0 6px 6px}
.notif-item{position:relative;display:flex;align-items:stretch;border-radius:12px;transition:background-color .15s}
.notif-item:hover{background:var(--surface-2)}
.notif-item .ni-link{display:flex;gap:11px;padding:10px 6px 10px 10px;flex:1;min-width:0}
.notif-item .ni-ic{flex:none;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary)}
.notif-item.urgent .ni-ic{background:var(--dangerbg);color:var(--danger)}
.notif-item.warn .ni-ic{background:var(--warnbg);color:var(--warn)}
.notif-item .ni-ic svg{width:16px;height:16px}
.notif-item .ni-tx{min-width:0}
.notif-item .ni-ti{display:block;font-size:13.5px;font-weight:600;line-height:1.35}
.notif-item .ni-su{display:block;font-size:12px;color:var(--muted);margin-top:2px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.notif-item.is-read{opacity:.55}
.notif-item.is-read .ni-ti{font-weight:500}
.notif-item .ni-acts{display:flex;flex-direction:column;justify-content:center;gap:4px;padding:0 8px 0 2px;opacity:0;transition:opacity .15s}
.notif-item:hover .ni-acts{opacity:1}
@media (hover:none){.notif-item .ni-acts{opacity:1}}
.ni-act{width:24px;height:24px;border-radius:50%;background:var(--surface-3);color:var(--muted);display:grid;place-items:center}
.ni-act:hover{color:var(--text)}
.ni-act svg{width:11px;height:11px}
.ni-toggle .dot-read{width:8px;height:8px;border-radius:50%;background:var(--primary-fill);display:block}
.notif-item.is-read .ni-toggle .dot-read{background:transparent;box-shadow:inset 0 0 0 1.5px var(--muted)}
.notif-allread{font-size:13px;font-weight:550;color:var(--primary)}
.notif-allread:hover{opacity:.75}
.notif-empty{padding:34px 16px;text-align:center;color:var(--muted);font-size:13.5px}
.notif-empty svg{width:16px;height:16px;vertical-align:-3px;margin-right:5px;color:var(--ok)}
.notif-foot{display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;font-size:13px;font-weight:550;color:var(--primary);border-top:1px solid var(--separator)}
.notif-foot svg{width:14px;height:14px}
.notif-foot:hover{background:var(--surface-2)}

/* command palette */
.cmdk-bg{position:fixed;inset:0;z-index:350;background:rgba(0,0,0,.28);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);display:flex;justify-content:center;align-items:flex-start;padding:12vh 16px 16px;
  opacity:0;visibility:hidden;transition:opacity .2s,visibility 0s linear .2s}
.cmdk-bg.show{opacity:1;visibility:visible;transition:opacity .2s}
.cmdk{width:100%;max-width:620px;border-radius:18px;overflow:hidden;background:var(--material-strong);backdrop-filter:blur(40px) saturate(180%);-webkit-backdrop-filter:blur(40px) saturate(180%);
  border:1px solid var(--border);box-shadow:var(--shadow-lg);transform:scale(.97);transition:transform .3s var(--spring)}
.cmdk-bg.show .cmdk{transform:none}
.cmdk-in{display:flex;align-items:center;gap:12px;padding:0 18px;height:58px;border-bottom:1px solid var(--separator)}
.cmdk-in svg{width:20px;height:20px;color:var(--muted);flex:none}
.cmdk-in input{flex:1;border:0!important;background:none!important;box-shadow:none!important;font-size:18px;padding:0;min-height:0;letter-spacing:-.01em}
.cmdk-list{max-height:min(420px,56vh);overflow-y:auto;padding:6px}
.cmdk-group{font-size:12px;font-weight:600;color:var(--muted);padding:10px 12px 4px}
.cmdk-item{display:flex;align-items:center;gap:12px;padding:9px 12px;border-radius:10px;font-size:14.5px;cursor:pointer}
.cmdk-item .ci{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:var(--surface-3);color:var(--text-2);flex:none}
.cmdk-item .ci svg{width:15px;height:15px}
.cmdk-item .hint{margin:0 0 0 auto;font-size:12px}
.cmdk-item.sel{background:var(--primary-fill);color:#fff}
.cmdk-item.sel .ci{background:rgba(255,255,255,.2);color:#fff}
.cmdk-item.sel .hint{color:rgba(255,255,255,.8)}
.cmdk-foot{display:flex;gap:16px;padding:10px 16px;border-top:1px solid var(--separator);font-size:12px;color:var(--muted)}
kbd{font-family:var(--font-body);font-size:11px;font-weight:600;min-width:20px;height:20px;padding:0 5px;display:inline-grid;place-items:center;border-radius:5px;background:var(--surface-3);color:var(--text-2);box-shadow:inset 0 -1px 0 var(--border-2)}

/* ---------------------------------------------------------------------
   12. APP SHELL
   --------------------------------------------------------------------- */
.app{display:flex;min-height:100vh;min-height:100dvh}
.sidebar{position:sticky;top:0;height:100vh;height:100dvh;width:var(--side-w);flex:none;display:flex;flex-direction:column;z-index:120;
  background:var(--bg-2);border-right:1px solid var(--separator)}
[data-theme="dark"] .sidebar{background:#0E0E10}
.side-brand{display:flex;align-items:center;gap:11px;padding:18px 18px 14px;min-height:var(--top-h)}
.side-brand .glyph{width:34px;height:34px;border-radius:9px;flex:none;box-shadow:0 2px 6px rgba(19,41,75,.25)}
.side-brand .t{font-family:var(--font-display);font-size:16px;font-weight:700;letter-spacing:-.02em;line-height:1.1;color:var(--text)}
.side-brand small{display:block;font-size:11.5px;color:var(--muted);font-weight:500;letter-spacing:0;margin-top:1px;white-space:nowrap}
.side-scroll{flex:1;overflow-y:auto;padding:4px 12px 12px;scrollbar-width:thin}
.nav-group{font-size:11.5px;font-weight:600;color:var(--muted);padding:16px 10px 5px;letter-spacing:0}
.nav-item{display:flex;align-items:center;gap:11px;height:34px;padding:0 10px;margin:1px 0;border-radius:9px;font-size:14px;font-weight:500;color:var(--text);
  transition:background-color .15s,color .15s;position:relative}
.nav-item svg{width:18px;height:18px;flex:none;color:var(--primary);opacity:.95}
.nav-item:hover{background:rgba(0,0,0,.045)}
[data-theme="dark"] .nav-item:hover{background:rgba(255,255,255,.06)}
.nav-item.active{background:rgba(0,0,0,.075);font-weight:600}
[data-theme="dark"] .nav-item.active{background:rgba(255,255,255,.1)}
.nav-item .badge{margin-left:auto;background:transparent;color:var(--muted);font-weight:500}
.nav-item.active .badge{color:var(--text-2)}
.side-foot{padding:10px 12px 14px;border-top:1px solid var(--separator)}
.side-user{display:flex;align-items:center;gap:11px;padding:8px;border-radius:12px;transition:background-color .15s;width:100%;text-align:left}
.side-user:hover{background:rgba(0,0,0,.045)}
[data-theme="dark"] .side-user:hover{background:rgba(255,255,255,.06)}
.av{width:34px;height:34px;border-radius:50%;flex:none;display:grid;place-items:center;font-weight:650;font-size:13px;color:#fff;
  background:linear-gradient(145deg,var(--navy-2),var(--pulse))}
.side-user .nm{font-size:14px;font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-user .rl{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-user>div{min-width:0;flex:1}
.side-user .chev{width:16px;height:16px;color:var(--muted)}

.main{flex:1;min-width:0;display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
.topbar{position:sticky;top:0;z-index:100;height:var(--top-h);display:flex;align-items:center;gap:10px;padding:0 24px;
  background:var(--material);backdrop-filter:blur(24px) saturate(180%);-webkit-backdrop-filter:blur(24px) saturate(180%);
  border-bottom:1px solid transparent;transition:border-color .25s}
.topbar.scrolled{border-bottom-color:var(--separator)}
.topbar .menu-btn{display:none}
.tb-title{min-width:0;flex:1;display:flex;align-items:baseline;gap:10px}
.page-title{font-family:var(--font-display);font-size:17px;font-weight:650;letter-spacing:-.018em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  opacity:0;transform:translateY(4px);transition:opacity .25s,transform .25s}
.topbar.scrolled .page-title{opacity:1;transform:none}
.page-sub{display:none}
.search-trigger{display:flex;align-items:center;gap:9px;height:36px;padding:0 12px;min-width:250px;border-radius:10px;background:var(--surface-3);color:var(--muted);font-size:14px;cursor:pointer;transition:background-color .15s}
.search-trigger:hover{background:var(--border-2)}
.search-trigger svg{width:16px;height:16px;flex:none}
.search-trigger kbd{margin-left:auto;background:var(--surface);box-shadow:none}
.tb-actions{display:flex;align-items:center;gap:4px}
.tb-av{width:32px;height:32px;font-size:12px;margin-left:6px;cursor:pointer;transition:transform .15s}
.tb-av:active{transform:scale(.92)}
.content{flex:1;min-width:0;width:100%;max-width:1440px;margin:0 auto;padding:6px 32px 48px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:10px 0 22px}
.page-head h1{font-size:34px;font-weight:700;letter-spacing:-.03em;line-height:1.08}
.page-head p{color:var(--muted);font-size:15px;margin-top:5px}

/* page entrance */
.content>*{animation:rise .5s var(--ease) both}
.content>*:nth-child(2){animation-delay:.03s}.content>*:nth-child(3){animation-delay:.06s}.content>*:nth-child(4){animation-delay:.09s}.content>*:nth-child(5){animation-delay:.12s}
@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.reveal{opacity:1}

/* mobile tab bar */
.tabbar{display:none}
.sidebar-scrim{position:fixed;inset:0;z-index:115;background:rgba(0,0,0,.3);opacity:0;visibility:hidden;transition:opacity .3s,visibility 0s linear .3s}
.sidebar-scrim.show{opacity:1;visibility:visible;transition:opacity .3s}

/* "More" sheet (mobile nav) */
.more-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px 4px}
.more-tile{display:flex;flex-direction:column;align-items:center;gap:7px;padding:10px 2px;border-radius:14px;font-size:11.5px;font-weight:500;text-align:center;color:var(--text);line-height:1.2}
.more-tile .mi{width:52px;height:52px;border-radius:15px;display:grid;place-items:center;background:var(--surface-2);color:var(--primary)}
.more-tile .mi svg{width:24px;height:24px}
.more-tile.active .mi{background:var(--primary-fill);color:#fff}
.more-tile:active{transform:scale(.95)}

.skip-link{position:absolute;left:-9999px;top:8px;z-index:500;background:var(--primary-fill);color:#fff;padding:10px 16px;border-radius:999px;font-weight:600;font-size:13px}
.skip-link:focus{left:8px}

/* brand images */
.brand-word{height:18px;width:auto;display:block}
.brand-word.on-dark,[data-theme="dark"] .brand-word.on-light{display:none}
[data-theme="dark"] .brand-word.on-dark{display:block}

/* ---------------------------------------------------------------------
   13. RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width:1280px){
  .comms-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .ana-insights{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* tablet: icon rail */
@media (max-width:1180px) and (min-width:821px){
  :root{--side-w:76px}
  .sidebar .side-brand{justify-content:center;padding:16px 0 10px}
  .sidebar .side-brand>div{display:none}
  .side-scroll{padding:4px 10px}
  .nav-group{height:1px;padding:0;margin:10px 8px;background:var(--separator);font-size:0}
  .nav-item{justify-content:center;height:44px;padding:0;border-radius:12px}
  .nav-item span:not(.badge),.nav-item .badge{display:none}
  .nav-item svg{width:21px;height:21px}
  .nav-item[data-tip]:hover::after{content:attr(data-tip);position:absolute;left:calc(100% + 10px);top:50%;transform:translateY(-50%);white-space:nowrap;
    background:var(--text);color:var(--bg);font-size:12.5px;font-weight:550;padding:6px 10px;border-radius:8px;pointer-events:none;box-shadow:var(--shadow)}
  .side-user{justify-content:center;padding:6px}
  .side-user>div,.side-user .chev{display:none}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .content{padding:6px 24px 40px}
  .search-trigger{min-width:200px}
}
@media (max-width:1024px){
  .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .comms-compose{grid-template-columns:1fr}
  .ana-grid2{grid-template-columns:1fr}
  .grid-2[style*="grid-template-columns"]{grid-template-columns:1fr!important}
}
/* phone & small tablet portrait: tab bar + sheets */
@media (max-width:820px){
  body{font-size:15.5px}
  .sidebar{position:fixed;left:0;top:0;bottom:0;transform:translateX(-102%);transition:transform .45s var(--spring);box-shadow:var(--shadow-lg);width:290px}
  .sidebar.open{transform:none}
  .topbar{padding:0 12px 0 16px;height:52px}
  :root{--top-h:52px}
  .topbar .page-title{font-size:16px;text-align:center}
  .tb-title{justify-content:flex-start}
  .tb-brand{display:flex!important}
  .search-trigger{min-width:0;width:36px;padding:0;justify-content:center;background:transparent;border-radius:50%}
  .search-trigger span,.search-trigger kbd{display:none}
  .search-trigger svg{width:19px;height:19px;color:var(--text-2)}
  .content{padding:0 16px calc(var(--tab-h) + var(--safe-b) + 28px)}
  .page-head{padding:6px 0 18px}
  .page-head h1{font-size:30px}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .grid-3,.grid-2{grid-template-columns:1fr!important}
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:110;height:calc(var(--tab-h) + var(--safe-b));padding:6px 4px var(--safe-b);
    background:var(--material-strong);backdrop-filter:blur(24px) saturate(180%);-webkit-backdrop-filter:blur(24px) saturate(180%);border-top:1px solid var(--separator)}
  .tabbar a,.tabbar button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:3px;padding-top:4px;font-size:10.5px;font-weight:550;color:var(--muted);-webkit-tap-highlight-color:transparent}
  .tabbar svg{width:25px;height:25px}
  .tabbar .on{color:var(--primary)}
  .tabbar a:active,.tabbar button:active{transform:scale(.94)}
  .toast-wrap{top:max(10px,env(safe-area-inset-top))}
  /* modal → bottom sheet */
  .modal-bg{align-items:flex-end;padding:0}
  .modal{max-width:none;border-radius:22px 22px 0 0;max-height:92vh;max-height:92dvh;padding:8px 20px calc(24px + var(--safe-b));transform:translateY(100%);opacity:1;transition:transform .5s var(--spring)}
  .modal-bg.show .modal{transform:none}
  .sheet-grabber{display:block;width:38px;height:5px;border-radius:5px;background:var(--border-2);margin:0 auto 14px}
  .modal .mh,.modal .modal-head{margin-bottom:16px}
  .notif-dropdown{position:fixed;top:calc(var(--top-h) + 6px);right:8px;left:8px;width:auto;max-width:none}
  .cmdk-bg{padding:10px 10px 0;align-items:flex-start}
  .kpi .val{font-size:23px}
  .kpi{padding:15px}
  .insight{flex-wrap:wrap;align-items:flex-start;padding:12px 4px}
  .insight .gr{flex:1 1 calc(100% - 52px)}
  .insight>.btn{margin-left:50px}
  .between>span.ic:last-child{display:none!important}
  .comms-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ana-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ana-insights{grid-template-columns:1fr}
  .ana-heat{grid-template-columns:repeat(3,1fr)}
  .chan-row{grid-template-columns:1fr}
  .kcol{flex:0 0 84vw;min-width:84vw}
  .ledger-row{grid-template-columns:90px 1fr 84px;gap:8px}
  .lb-val{display:none}
  .card{padding:18px}
  .between>.tabs{max-width:100%}
  /* responsive tables → stacked cards (opt-out with .no-cards) */
  .tbl-wrap.as-cards{border:0;background:none;overflow:visible;border-radius:0}
  .as-cards table.tbl{min-width:0}
  .as-cards .tbl thead{display:none}
  .as-cards .tbl tbody{display:flex;flex-direction:column;gap:10px}
  .as-cards .tbl tbody tr{display:block;background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:6px 14px;box-shadow:var(--shadow-xs)}
  .as-cards .tbl tbody tr:hover{background:var(--surface)}
  .as-cards .tbl tbody td{display:grid;grid-template-columns:minmax(76px,38%) 1fr;column-gap:12px;row-gap:2px;justify-items:end;align-items:center;padding:9px 0;border-bottom:1px solid var(--separator);text-align:right}
  .as-cards .tbl tbody td:last-child{border-bottom:0}
  .as-cards .tbl tbody td::before{content:attr(data-label);font-size:12.5px;color:var(--muted);font-weight:500;text-align:left;grid-column:1;grid-row:1/span 6;justify-self:start}
  .as-cards .tbl tbody td[data-label=""]::before{display:none}
  .as-cards .tbl tbody td[data-label=""]{grid-template-columns:1fr}
  .as-cards .tbl tbody td:first-child{grid-template-columns:1fr;justify-items:start;text-align:left;padding-top:11px}
  .as-cards .tbl tbody td:first-child::before{display:none}
  .as-cards .tbl tbody td .bar{max-width:140px}
  .as-cards .tbl tbody td[colspan]{justify-content:center}
  .as-cards .tbl tfoot{display:block}
  .as-cards .tbl tfoot tr{display:flex;justify-content:space-between;flex-wrap:wrap;border-radius:14px;margin-top:10px;background:var(--surface-2)}
  .as-cards .tbl tfoot td{border:0;background:none}
}
@media (max-width:520px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kpi .val{font-size:21px}
  .kpi .delta{display:none}
  .between{gap:10px}
  .tabs{width:100%}
  .tab{flex:1;justify-content:center;padding:0 10px}
}
@media (min-width:821px){ .tb-brand{display:none!important} }

/* ---------------------------------------------------------------------
   14. ACCESSIBILITY & PRINT
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
@media (prefers-contrast:more){
  :root{--border:rgba(0,0,0,.25);--separator:rgba(0,0,0,.3);--muted:#4A4A4F}
}
@media print{
  .sidebar,.topbar,.tabbar,.sidebar-scrim,.skip-link,.btn,.tabs,.ana-bar,.ana-pickrow,.notif-wrap,.toast-wrap,.cmdk-bg,.modal-bg{display:none!important}
  body{background:#fff!important;color:#000!important}
  .main,.content{margin:0!important;padding:0!important;max-width:none}
  .glass,.kpi,.ana-kpi{box-shadow:none!important;border:1px solid #ddd!important;break-inside:avoid}
  .content>*{animation:none!important}
  @page{margin:1.5cm}
}
.proj-hero .chip{background:rgba(255,255,255,.9)!important;color:#1D1D1F!important}
/* inline icons inside running text */
p>svg,.muted>svg,li>svg,.hint>svg,label>svg,small>svg,span.muted svg{width:15px;height:15px;vertical-align:-3px;flex:none}

/* ---------------------------------------------------------------------
   PROJECT DETAIL (app) — v1.0.1
   --------------------------------------------------------------------- */
.ph-back{display:inline-flex;align-items:center;gap:3px;font-size:15px;font-weight:500;color:var(--primary);margin:10px 0 14px}
.ph-back svg{width:17px;height:17px}
.ph-back:hover{opacity:.75}
.ph-hero{position:relative;border-radius:26px;overflow:hidden;min-height:300px;display:flex;align-items:flex-end;color:#fff;
  background:linear-gradient(135deg,var(--navy),#123E63 60%,var(--pulse));box-shadow:var(--shadow);isolation:isolate}
.ph-cover{position:absolute;inset:0;z-index:-1}
.ph-cover img{width:100%;height:100%;object-fit:cover;display:block}
.ph-hero::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(0,0,0,.05) 0%,rgba(0,0,0,.25) 40%,rgba(5,12,26,.85) 100%),linear-gradient(90deg,rgba(5,12,26,.55),transparent 60%)}
.ph-in{width:100%;display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:28px 30px}
.ph-main{min-width:0}
.ph-chips{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.ph-chips .chip{background:rgba(255,255,255,.18);color:#fff;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.ph-chips a.chip:hover{background:rgba(255,255,255,.28)}
.ph-hero h1{color:#fff;font-size:clamp(28px,3.4vw,40px);letter-spacing:-.032em;line-height:1.08}
.ph-meta{color:rgba(255,255,255,.82);font-size:14.5px;margin-top:8px;line-height:1.45}
.ph-meta svg{width:15px;height:15px;vertical-align:-2px;margin-right:2px}
.ph-actions{display:flex;gap:8px;margin-top:20px;flex-wrap:wrap}
.ph-btn-1{background:#fff;color:#1D1D1F}
.ph-btn-1:hover{background:#EDEDF0}
.ph-btn-2{background:rgba(255,255,255,.16);color:#fff;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.ph-btn-2:hover{background:rgba(255,255,255,.26)}
.ph-more{width:38px;padding:0}
.ph-ring{position:relative;width:96px;height:96px;flex:none}
.ph-ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.ph-ring circle{fill:none;stroke-width:6;stroke-linecap:round}
.ph-ring .r-bg{stroke:rgba(255,255,255,.2)}
.ph-ring .r-fg{stroke:#5FE0F0;transition:stroke-dashoffset 1.2s var(--spring)}
.ph-ring>div{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.ph-ring b{font-size:22px;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.ph-ring span{font-size:10.5px;color:rgba(255,255,255,.7)}
.ph-tabs{margin:20px 0 18px}
.ph-tabs .badge{background:rgba(127,127,127,.18);margin-left:2px}
.ph-pane[hidden]{display:none}
.ph-pane{animation:rise .35s var(--ease)}
.ph-next{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:16px;margin-bottom:16px;background:var(--primary-soft);color:var(--text);transition:filter .2s}
.ph-next:hover{filter:brightness(.97)}
.ph-next .ic{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:var(--primary-fill);color:#fff;flex:none}
.ph-next .ic svg{width:19px;height:19px}
.ph-next .go{color:var(--primary)} .ph-next .go svg{width:18px;height:18px}
.ph-split{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)}
.stepper{list-style:none;margin:0 0 22px;padding:0;display:grid;grid-template-columns:repeat(6,1fr);position:relative}
.stepper::before{content:"";position:absolute;left:8%;right:8%;top:15px;height:2px;background:var(--surface-3)}
.stepper li{position:relative;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}
.stepper .sd{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:650;background:var(--surface);color:var(--muted);box-shadow:inset 0 0 0 2px var(--surface-3);position:relative;z-index:1}
.stepper .sd svg{width:15px;height:15px}
.stepper li.done .sd{background:var(--primary-fill);color:#fff;box-shadow:none}
.stepper li.now .sd{color:var(--primary);box-shadow:inset 0 0 0 2px var(--primary),0 0 0 5px var(--primary-soft)}
.stepper .sl{font-size:12px;color:var(--muted);font-weight:500}
.stepper li.done .sl,.stepper li.now .sl{color:var(--text)}
.stepper li.now .sl{font-weight:650}
.facts{display:grid;grid-template-columns:1fr 1fr;gap:0 24px;margin:0;border-top:1px solid var(--separator)}
.facts>div{padding:12px 0;border-bottom:1px solid var(--separator);min-width:0}
.facts dt{font-size:12px;color:var(--muted)}
.facts dd{margin:2px 0 0;font-weight:600;font-size:14.5px;overflow-wrap:anywhere}
.facts dd a{color:var(--primary)}
.ph-feebox{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:14px;padding:12px 14px;border-radius:12px;background:var(--gold-soft);font-size:13px}
.ph-feebox b{color:var(--gold);font-variant-numeric:tabular-nums}
.ph-hint{display:flex;gap:12px;padding:14px;border-radius:14px;background:var(--surface-2);font-size:13.5px;line-height:1.55;color:var(--text-2)}
.ph-hint>svg{width:18px;height:18px;color:var(--primary);flex:none;margin-top:2px}
.ph-hint a,.ph-hint .btn-plain{color:var(--primary);font-weight:500;font-size:inherit;padding:0}
a.vrow .ti{font-weight:600}
.ph-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.ph-photo{margin:0;border-radius:16px;overflow:hidden;background:var(--surface-2);position:relative;border:1px solid var(--border)}
.ph-photo img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.ph-photo .pp-badges{position:absolute;top:10px;left:10px;display:flex;gap:5px;flex-wrap:wrap}
.ph-photo .pp-badges .chip{background:rgba(0,0,0,.5);color:#fff;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.ph-photo figcaption{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 6px 6px 12px}
.pp-cap{font-size:13px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ph-check{display:flex;align-items:center;gap:10px;font-size:14px;cursor:pointer}
.timeline{list-style:none;margin:0;padding:0;position:relative}
.timeline li{display:flex;gap:14px;position:relative;padding-bottom:18px}
.timeline li:not(:last-child)::before{content:"";position:absolute;left:17px;top:38px;bottom:2px;width:2px;background:var(--separator)}
.tl-ic{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--surface-2);color:var(--text-2)}
.tl-ic svg{width:16px;height:16px}
.tl-progress .tl-ic{background:var(--primary-soft);color:var(--primary)}
.tl-stage .tl-ic{background:var(--gold-soft);color:var(--gold)}
.tl-b{padding-top:6px;min-width:0}
.tl-b .ti{font-size:14.5px;font-weight:600}
.tl-b .su{font-size:13.5px;color:var(--text-2);margin-top:3px;line-height:1.5}
.tl-t{font-size:12px;color:var(--muted);margin-top:4px}
.menu-item.danger{color:var(--danger)}
.menu-item.danger:hover{background:var(--danger);color:#fff}
@media (max-width:1024px){ .ph-split{grid-template-columns:1fr!important} }
@media (max-width:820px){
  .ph-back{margin:4px 0 12px}
  .ph-hero{border-radius:22px;min-height:340px}
  .ph-in{flex-direction:column-reverse;align-items:flex-start;padding:20px}
  .ph-ring{position:absolute;top:16px;right:16px;width:76px;height:76px}
  .ph-ring b{font-size:17px}
  .ph-actions .ph-btn-1{flex:1}
  .ph-tabs{width:100%;position:sticky;top:calc(var(--top-h) + 6px);z-index:20;box-shadow:0 6px 16px -10px rgba(0,0,0,.3)}
  .ph-tabs .tab{flex:1;justify-content:center;padding:0 10px}
  .stepper .sl{font-size:10.5px}
  .stepper .sd{width:28px;height:28px}
  .facts{grid-template-columns:1fr}
  .ph-gallery{grid-template-columns:1fr 1fr;gap:10px}
}
/* client detail header */
.ch-hero{display:flex;align-items:center;gap:20px;padding:24px;border-radius:24px}
.ch-av{width:76px;height:76px;border-radius:50%;flex:none;display:grid;place-items:center;font-size:26px;font-weight:650;color:#fff;letter-spacing:-.02em;background:linear-gradient(145deg,var(--navy-2),var(--pulse))}
.ch-main{flex:1;min-width:0}
.ch-main h1{font-size:clamp(24px,2.6vw,32px);letter-spacing:-.03em}
.ch-main p{font-size:14.5px;margin-top:4px}
.ch-chips{display:flex;gap:6px;margin-top:10px}
.ch-actions{display:flex;gap:8px}
.ch-act{display:flex;flex-direction:column;align-items:center;gap:6px;width:72px;font-size:12px;font-weight:550;color:var(--primary)}
.ch-act span{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--primary-soft);transition:background-color .2s,transform .15s}
.ch-act span svg{width:20px;height:20px}
.ch-act:hover span{background:var(--primary-fill);color:#fff}
.ch-act:active span{transform:scale(.92)}
@media (max-width:820px){
  .ch-hero{flex-direction:column;text-align:center;gap:12px;padding:24px 16px}
  .ch-chips{justify-content:center}
  .ch-actions{width:100%;justify-content:space-around;margin-top:6px}
}
/* comms: email preview mirrors the real branded email */
.email-frame{background:#F2F2F5;border-color:var(--border)}
.email-frame .ef-head{background:var(--surface)}
.ef-canvas{padding:16px 14px 18px;background:#F2F2F5;color:#1D1D1F}
.ef-brand{display:flex;align-items:center;gap:8px;margin:0 4px 10px;font:600 11px Georgia,serif;letter-spacing:1.2px;text-transform:uppercase;color:#13294B}
.ef-brand img{width:22px;height:auto}
.ef-card{background:#fff;border-radius:12px;overflow:hidden}
.ef-bar{height:3px;background:linear-gradient(90deg,#13294B,#0B7A99 55%,#5FE0F0)}
.email-frame .ef-body{color:#1D1D1F;padding:16px;min-height:110px;font-size:13px;line-height:1.6}
.ef-sig{display:flex;align-items:center;gap:9px;margin:0 16px;padding:12px 0 14px;border-top:1px solid #E8E8ED;font-size:11.5px;color:#424245}
.ef-sig b{display:block;color:#1D1D1F;font-size:12px}
.ef-sig small{font-size:10.5px}
.ef-av{width:28px;height:28px;border-radius:50%;background:#13294B;color:#fff;display:grid;place-items:center;font-size:10px;font-weight:700;flex:none}

/* ---- v1.1: fee phase segmented control + WHT field ---- */
.ph-seg{display:inline-flex;padding:3px;border-radius:11px;background:var(--surface-3);gap:2px;max-width:100%}
.ph-seg label{position:relative;cursor:pointer}
.ph-seg input{position:absolute;opacity:0;pointer-events:none}
.ph-seg span{display:block;padding:7px 14px;border-radius:8px;font-size:13px;font-weight:550;color:var(--text-2);white-space:nowrap;transition:background .18s,color .18s}
.ph-seg input:checked+span{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.ph-seg input:focus-visible+span{outline:2px solid var(--primary);outline-offset:1px}
.wht-row{display:flex;align-items:center;gap:10px;min-height:42px}
.wht-on{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--text);white-space:nowrap}
.wht-rate{position:relative;width:86px}
.wht-rate input{padding-right:26px;text-align:right}
.wht-rate i{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-style:normal;color:var(--text-3);font-size:13px}
.wht-rate input:disabled{opacity:.45}
.phase-chip{display:inline-flex;align-items:center;white-space:nowrap;height:20px;padding:0 8px;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.01em;background:var(--surface-3);color:var(--text-2)}
.phase-chip.pre{background:rgba(19,41,75,.08);color:var(--navy,#13294B)}
[data-theme=dark] .phase-chip.pre{background:rgba(160,185,230,.14);color:#AFC3E6}
.phase-chip.post{background:var(--primary-soft);color:var(--primary)}
.fee-meter{display:flex;height:8px;border-radius:999px;background:var(--surface-3);overflow:hidden;margin:4px 0 14px}
.fee-meter i{display:block;height:100%}
.fee-meter i.s{background:var(--ok)}
.fee-meter i.v{background:var(--primary);opacity:.55}
/* finance filter bar */
.fin-filter{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px;margin-bottom:18px;border-radius:14px}
.fin-filter select{width:auto;min-width:150px;max-width:240px;height:36px;padding:0 30px 0 12px;font-size:13px}
.ff-seg{display:inline-flex;padding:3px;border-radius:10px;background:var(--surface-3);gap:2px}
.ff-seg label{position:relative;cursor:pointer}
.ff-seg input{position:absolute;opacity:0;pointer-events:none}
.ff-seg span{display:block;padding:6px 13px;border-radius:8px;font-size:13px;font-weight:550;color:var(--text-2);white-space:nowrap}
.ff-seg input:checked+span{background:var(--surface);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.12)}
.ff-seg input:focus-visible+span{outline:2px solid var(--primary)}
.ff-clear{display:inline-flex;align-items:center;gap:5px;font-size:12.5px;color:var(--text-3);padding:6px 8px;border-radius:8px}
.ff-clear:hover{color:var(--text);background:var(--surface-2)}
.ff-clear svg{width:13px;height:13px}
.fee-hint{font-size:12.5px;line-height:1.5;padding:10px 12px;border-radius:11px;background:var(--primary-soft);color:var(--text-2);margin:-2px 0 14px}
.fee-hint b{color:var(--text)}
.fee-hint.warn{background:var(--gold-soft)}
@media (max-width:700px){.fin-filter{padding:8px}.ff-seg{width:100%}.ff-seg label{flex:1}.ff-seg span{text-align:center;padding:7px 6px}.fin-filter select{flex:1;min-width:0;max-width:none}}
/* project fees */
.fee-phases{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.fee-phase .fp-val{font-size:28px;font-weight:650;letter-spacing:-.02em;margin-top:14px;font-variant-numeric:tabular-nums}
.fee-phase .fp-sub{font-size:12px;color:var(--text-3);margin-bottom:12px}
.fee-phase .fp-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.fee-phase .fp-grid span{display:block;font-size:11.5px;color:var(--text-3)}
.fee-phase .fp-grid b{display:block;font-size:15px;font-variant-numeric:tabular-nums;margin-top:2px}
.fee-phase .fp-grid small{display:block;font-size:11px;color:var(--text-3);margin-top:1px}
.fee-phase .fp-bal{display:flex;justify-content:space-between;align-items:baseline;margin-top:14px;padding-top:12px;border-top:1px solid var(--border-2);font-size:13px}
.fee-phase .fp-bal b{font-size:16px;font-variant-numeric:tabular-nums}
.fee-phase.off{background:var(--surface-2)}
.fee-phase .fp-off{display:flex;gap:12px;align-items:flex-start;margin-top:16px;font-size:13px;line-height:1.5}
.fee-phase .fp-off svg{width:18px;height:18px;flex:none;color:var(--text-3);margin-top:2px}
.fee-fs{border:1px solid var(--border);border-radius:14px;padding:14px;margin:0 0 12px}
.fee-eng{display:flex;gap:12px;align-items:flex-start;cursor:pointer}
.fee-eng b{display:block;font-size:14px}
.fee-eng small{display:block;font-size:12px;color:var(--text-3);margin-top:1px}
.fee-body{margin-top:14px}
.fee-fs.off .fee-body{display:none}
.fee-calc{font-size:13px;color:var(--text-2);padding:9px 12px;border-radius:10px;background:var(--surface-2)}
.fee-calc b{color:var(--text)}
.tl-filter{width:auto;height:34px;font-size:13px;padding:0 28px 0 10px}
.timeline .tl-t b{color:var(--text-2);font-weight:600}
@media (max-width:820px){.fee-phases{grid-template-columns:1fr}}
/* retention picker */
.ret-box{padding:14px;border:1px solid var(--border);border-radius:14px;margin:4px 0 14px}
.ret-lbl{display:block;font-size:12.5px;font-weight:600;color:var(--text-2);margin-bottom:8px}
.ret-seg{display:flex;flex-wrap:wrap}
.ret-seg span{padding:7px 11px;font-size:12.5px}
.ret-in{margin-top:12px}
.ret-in .field{margin-bottom:0}
.ret-box[data-mode=auto] .ret-in,.ret-box[data-mode=none] .ret-in{display:none}
.ret-box[data-mode=percent] .ret-amt,.ret-box[data-mode=amount] .ret-pct{display:none}
.ret-out{font-size:12.5px;color:var(--text-2);margin-top:10px}
.ret-out:empty{display:none}
.ret-out b{color:var(--text)}
.ret-adv{margin-top:10px;font-size:12.5px}
.ret-adv summary{cursor:pointer;color:var(--primary)}
@media (max-width:600px){.ret-seg{display:grid;grid-template-columns:1fr 1fr}.ret-seg span{text-align:center}}
.fee-fs [hidden],.prj-wrap[hidden],.fee-hint[hidden]{display:none!important}
.wht-on input[type=checkbox],.lvl-pick input,.prj-pick input,.fee-eng input,.ret-box input[type=checkbox]{-webkit-appearance:auto;appearance:auto;width:18px!important;height:18px!important;min-height:0;padding:0!important;margin:0;border:0;background:none;box-shadow:none;flex:none}
.wht-rate input{height:42px}
