/* Speedgate Logistics Leads Centre
   Direction: freight-container. Corrugated ribs, container-orange, deep-water navy, precise instrument-panel data.
   One family (Archivo) used at two widths: expanded for display, normal for reading. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,100..900&display=swap');

:root {
  --paper: #eef2f6;
  --card: #ffffff;
  --ink: #0a1b2b;
  --ink-2: #566b80;
  --line: #dbe3ec;
  --line-2: #c9d4df;
  --harbour: #0b5c93;
  --harbour-d: #084a76;
  --navy: #0a2540;
  --amber: #ff6a1a;          /* container orange: the one signature colour */
  --amber-soft: #fff1e8;
  --danger: #c83a3a;
  --ok: #0f9d6e;
  --side: #07192b;
  --side-2: #0b2a44;
  --side-ink: #9fb4c7;
  --shadow-1: 0 1px 2px rgba(10, 27, 43, .05), 0 1px 1px rgba(10, 27, 43, .03);
  --shadow-2: 0 2px 4px rgba(10, 27, 43, .04), 0 14px 32px -16px rgba(10, 27, 43, .22);
  --shadow-3: 0 30px 80px -20px rgba(4, 14, 26, .45);
  --i-dashboard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E");
  --i-leads: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  --i-pipeline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M8 7v7M12 7v10M16 7v4'/%3E%3C/svg%3E");
  --i-tasks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --i-budget: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4'/%3E%3C/svg%3E");
  --i-reports: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9M13 17V5M8 17v-3'/%3E%3C/svg%3E");
  --i-team: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M19 8v6M22 11h-6'/%3E%3C/svg%3E");
  --i-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 16V3'/%3E%3Cpath d='M1 14h6M9 8h6M17 16h6'/%3E%3C/svg%3E");
  --i-clock: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='10'/%3E%3Cpath%20d='M12%206v6l4%202'/%3E%3C/svg%3E");
  --i-calx: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='18'%20rx='2'/%3E%3Cpath%20d='M16%202v4M8%202v4M3%2010h18M10%2014l4%204M14%2014l-4%204'/%3E%3C/svg%3E");
  --i-snow: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M2%2012h20M12%202v20M20%2016l-4-4%204-4M4%208l4%204-4%204M16%204l-4%204-4-4M8%2020l4-4%204%204'/%3E%3C/svg%3E");
  --i-trophy: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M6%209H4.5a2.5%202.5%200%200%201%200-5H6M18%209h1.5a2.5%202.5%200%200%200%200-5H18M4%2022h16M10%2014.66V17c0%20.55-.47.98-.97%201.21C7.85%2018.75%207%2020.24%207%2022M14%2014.66V17c0%20.55.47.98.97%201.21C16.15%2018.75%2017%2020.24%2017%2022M18%202H6v7a6%206%200%200%200%2012%200V2Z'/%3E%3C/svg%3E");
  --i-target: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='10'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='6'/%3E%3Ccircle%20cx='12'%20cy='12'%20r='2'/%3E%3C/svg%3E");
  --a1: #ff6a1a; --a2: #0b5c93;
  --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
  --radius: var(--r-lg);
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --head: 'Archivo', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #06121e; --card: #0d2132; --ink: #e8eff6; --ink-2: #92a8bc; --line: #1c3347; --line-2: #28465e;
    --harbour: #4aa3e0; --harbour-d: #6bb6ec; --navy: #1a4a78; --amber-soft: #2a1a10; --side: #040e18; --side-2: #08203a;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 14px 32px -16px rgba(0, 0, 0, .7);
  }
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font: 15px/1.55 var(--font); font-stretch: 100%; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: 28px; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 18px; font-stretch: 106%; } h3 { font-size: 15.5px; font-stretch: 104%; }
a { color: var(--harbour); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--amber) 80%, white); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--amber) 35%, transparent); }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.danger { color: var(--danger); } .ok { color: var(--ok); }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 2px 7px; border-radius: 6px; word-break: break-all; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 2px, transparent 2px 12px),
    linear-gradient(180deg, var(--side-2) 0%, var(--side) 55%);
  color: var(--side-ink); padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid rgba(255,255,255,.05);
}
.brand { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; align-items: center; padding: 2px 8px 22px; color: #fff; }
.brand::before {
  content: ''; grid-row: span 2; width: 40px; height: 40px; border-radius: 11px;
  background:
    linear-gradient(#fff, #fff) 12px 11px / 4px 18px no-repeat,
    linear-gradient(#fff, #fff) 24px 11px / 4px 18px no-repeat,
    linear-gradient(#fff, #fff) 12px 25px / 16px 3px no-repeat,
    linear-gradient(135deg, #ff8b3d, var(--amber) 55%, #e5530a);
  box-shadow: 0 8px 20px -6px rgba(255, 106, 26, .7), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand span { font: 700 16.5px/1.15 var(--head); font-stretch: 116%; letter-spacing: -.01em; align-self: end; }
.brand small { font: 500 12.5px var(--font); color: var(--side-ink); align-self: start; margin-top: 3px; letter-spacing: .01em; }
.nav { display: grid; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: linear-gradient(90deg, rgba(255,106,26,.2), rgba(255,106,26,.04)); color: #fff; font-weight: 600; }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--amber); box-shadow: 0 0 14px rgba(255,106,26,.8); }
.nav .dot { width: 18px; height: 18px; background: currentColor; opacity: .75; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; flex: none; border-radius: 0; }
.nav a.on .dot { background: var(--amber); opacity: 1; }
.nav a[href='#dashboard'] .dot { -webkit-mask-image: var(--i-dashboard); mask-image: var(--i-dashboard); }
.nav a[href='#leads'] .dot { -webkit-mask-image: var(--i-leads); mask-image: var(--i-leads); }
.nav a[href='#pipeline'] .dot { -webkit-mask-image: var(--i-pipeline); mask-image: var(--i-pipeline); }
.nav a[href='#tasks'] .dot { -webkit-mask-image: var(--i-tasks); mask-image: var(--i-tasks); }
.nav a[href='#budget'] .dot { -webkit-mask-image: var(--i-budget); mask-image: var(--i-budget); }
.nav a[href='#reports'] .dot { -webkit-mask-image: var(--i-reports); mask-image: var(--i-reports); }
.nav a[href='#team'] .dot { -webkit-mask-image: var(--i-team); mask-image: var(--i-team); }
.nav a[href='#settings'] .dot { -webkit-mask-image: var(--i-settings); mask-image: var(--i-settings); }
.me { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.me b { color: #fff; display: block; font-weight: 600; font-size: 14px; }
.me span { color: var(--side-ink); text-transform: capitalize; }
.me button { margin-top: 10px; }
.top .actions { display: flex; gap: 10px; align-items: center; }
.btn.menu-btn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 70; width: 276px; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-3); }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .main { padding: 0 14px 60px; } .top { margin: 0 -14px 18px; padding: 12px 14px; }
  h1 { font-size: 22px; }
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card);
  padding: 9px 16px; border-radius: var(--r-sm); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-1); transition: transform .12s, box-shadow .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--harbour); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn:active { transform: none; box-shadow: var(--shadow-1); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--navy) 88%, white), var(--navy)); border-color: var(--navy); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -6px rgba(10, 37, 64, .6); }
.btn.primary:hover { background: var(--navy); border-color: var(--navy); }
.btn.warn { color: var(--danger); } .btn.warn:hover { border-color: var(--danger); }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.side .btn { background: rgba(255,255,255,.05); color: var(--side-ink); border-color: rgba(255,255,255,.14); box-shadow: none; }
.side .btn:hover { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.09); transform: none; }
input, select, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--card); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--harbour) 55%, var(--line-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--harbour); box-shadow: 0 0 0 4px color-mix(in srgb, var(--harbour) 18%, transparent); }
input[readonly] { background: color-mix(in srgb, var(--ink) 4%, var(--card)); }
input[type=checkbox] { accent-color: var(--amber); width: 16px; height: 16px; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters > * { width: auto; min-width: 140px; } .filters input[type=search] { flex: 1; min-width: 220px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--ink); margin: 0; } .check input { width: 16px; }

/* ---------- cards, tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-2); }
.card + .card { margin-top: 18px; }
.card > h2, .card > .head { margin-bottom: 14px; }
.card .card { box-shadow: none; border-radius: var(--r-md); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px 15px; box-shadow: var(--shadow-2); overflow: hidden; }
.stat::after { content: ''; position: absolute; right: 16px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.stat b { display: block; padding-right: 20px; font: 800 28px/1.05 var(--head); font-stretch: 112%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.stat.info::after { background: var(--harbour); box-shadow: 0 0 0 4px color-mix(in srgb, var(--harbour) 18%, transparent); }
.stat.good::after { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.stat.alert { background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 6%, var(--card)), var(--card)); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.stat.alert b { color: var(--danger); }
.stat.alert::after { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 0%, transparent); } }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; } .cols2 > .card + .card { margin-top: 0; }
@media (max-width: 960px) { .cols2 { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: color-mix(in srgb, var(--ink) 3%, transparent); }
th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background .12s; } tbody tr.click:hover { background: color-mix(in srgb, var(--amber) 8%, transparent); }
tbody tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
td.num, th.num { text-align: right; }
.empty { padding: 36px 12px; text-align: center; color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 500; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.tag.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tag.danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 0 6px 4px; }

/* funnel + progress */
.bar { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--harbour), color-mix(in srgb, var(--harbour) 70%, #3cc6c0)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.warn > i { background: linear-gradient(90deg, #ffa04d, var(--amber)); } .bar.over > i { background: var(--danger); }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 44px; gap: 14px; align-items: center; margin: 9px 0; font-size: 14px; font-weight: 500; }
.funnel-row .bar { height: 14px; border-radius: 6px; } .funnel-row .bar > i { border-radius: 6px; }
.funnel-row b { font-variant-numeric: tabular-nums; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 276px; gap: 14px; overflow-x: auto; padding: 2px 2px 18px; align-items: start; scroll-snap-type: x proximity; }
.col { scroll-snap-align: start; background: color-mix(in srgb, var(--ink) 4.5%, transparent); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: var(--r-md); padding: 12px; min-height: 240px; transition: background .15s, border-color .15s; }
.col.over { background: color-mix(in srgb, var(--amber) 10%, transparent); border-color: var(--amber); border-style: dashed; }
.col h3 { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 10px; padding: 0 2px; }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; cursor: grab; border-left: 4px solid var(--line); box-shadow: var(--shadow-1); transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.kcard:active { cursor: grabbing; } .kcard b { display: block; font-weight: 600; } .kcard .small { margin-top: 3px; }

/* ---------- drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4, 14, 26, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 80; display: flex; justify-content: flex-end; }
.drawer { width: min(780px, 100%); background: var(--paper); height: 100%; overflow-y: auto; padding: 24px 26px 70px; animation: slide .28s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-3); border-left: 1px solid var(--line); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-wrap { position: fixed; inset: 0; background: rgba(4, 14, 26, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: 20px; padding: 26px; width: min(600px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-3); border: 1px solid var(--line); animation: pop .22s cubic-bezier(.2,.9,.3,1.1); }
.modal h2 { font-size: 21px; margin-bottom: 4px; } .modal > div > p { margin: 0 0 18px; }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin: 16px 0; padding: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 12px; }
.tabs button { flex: 1; background: none; border: 0; padding: 8px 12px; cursor: pointer; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--line-2); margin-left: 6px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); }
.timeline li.call, .timeline li.whatsapp, .timeline li.email { border-left-color: var(--harbour); } .timeline li.call::before, .timeline li.whatsapp::before, .timeline li.email::before { border-color: var(--harbour); }
.timeline li.stage_change { border-left-color: var(--amber); } .timeline li.stage_change::before { border-color: var(--amber); }
.timeline li.payment { border-left-color: var(--ok); } .timeline li.payment::before { border-color: var(--ok); background: var(--ok); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14px; } .kv dt { color: var(--ink-2); } .kv dd { margin: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.doc { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); } .doc:last-child { border-bottom: 0; }

/* ---------- toasts, bell ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 10px; }
.toast { /* restyled below: light card, coloured accent, icon */ }
.bell { position: relative; }
.bell .count { position: absolute; top: -8px; right: -8px; background: var(--amber); color: #1b0a00; border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 6px; min-width: 20px; text-align: center; box-shadow: 0 0 0 3px var(--paper); }
.pop { position: absolute; right: 0; top: 48px; width: min(380px, 92vw); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-3); z-index: 50; max-height: 70vh; overflow-y: auto; animation: pop .18s ease-out; }
.pop .n { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; } .pop .n:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.pop .n.unread { background: var(--amber-soft); box-shadow: inset 3px 0 0 var(--amber); }

/* ---------- login: the gate ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--paper); }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 100vh;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255,140,60,.22), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 3px, transparent 3px 16px),
    linear-gradient(180deg, #0b2a44, #06182a);
}
.login-art .mark { position: absolute; top: 44px; left: 56px; display: flex; align-items: center; gap: 12px; font: 700 17px var(--head); font-stretch: 116%; z-index: 1; }
.login-art .mark::before { content: ''; width: 38px; height: 38px; border-radius: 11px; background:
    linear-gradient(#fff, #fff) 11px 10px / 4px 18px no-repeat, linear-gradient(#fff, #fff) 23px 10px / 4px 18px no-repeat, linear-gradient(#fff, #fff) 11px 24px / 16px 3px no-repeat,
    linear-gradient(135deg, #ff8b3d, var(--amber) 55%, #e5530a); box-shadow: 0 8px 22px -6px rgba(255,106,26,.7); }
.login-art h1 { font-size: clamp(34px, 4.2vw, 58px); font-stretch: 122%; line-height: 1.02; max-width: 13ch; letter-spacing: -.035em; font-weight: 800; position: relative; }
.login-art p { color: var(--side-ink); max-width: 38ch; font-size: 16px; margin: 18px 0 0; position: relative; }
.road { position: absolute; left: 0; right: 0; top: 46%; height: 3px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.4) 0 28px, transparent 28px 56px); opacity: .35; }
.gate { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.door {
  position: absolute; top: 0; bottom: 0; width: 50.2%;
  background:
    linear-gradient(90deg, rgba(0,0,0,.28), transparent 6%, transparent 94%, rgba(0,0,0,.28)),
    repeating-linear-gradient(90deg, rgba(0,0,0,.2) 0 4px, rgba(255,255,255,.07) 4px 6px, transparent 6px 22px),
    linear-gradient(180deg, #ff7a2e, #f25a0d);
  box-shadow: inset 0 0 0 10px rgba(0,0,0,.12), inset 0 0 0 11px rgba(255,255,255,.12);
  animation-duration: 1.5s; animation-delay: .5s; animation-timing-function: cubic-bezier(.76, 0, .2, 1); animation-fill-mode: forwards;
}
.door.l { left: 0; animation-name: openL; } .door.r { right: 0; animation-name: openR; }
.door::after { content: ''; position: absolute; top: 12%; bottom: 12%; width: 18px; border-radius: 4px; background: linear-gradient(90deg, #c9d3dc, #f4f7fa 45%, #8a99a8); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.door.l::after { right: 34px; } .door.r::after { left: 34px; }
.door::before { content: 'SPEEDGATE'; position: absolute; top: 50%; font: 800 clamp(30px, 5vw, 70px)/1 var(--head); font-stretch: 125%; letter-spacing: .02em; color: rgba(0,0,0,.22); white-space: nowrap; }
.door.l::before { right: 70px; transform: translateY(-50%); } .door.r::before { left: 70px; transform: translateY(-50%); }
.door.l::before { content: 'SPEED'; } .door.r::before { content: 'GATE'; }
@keyframes openL { to { transform: translateX(-102%); } } @keyframes openR { to { transform: translateX(102%); } }
@media (prefers-reduced-motion: reduce) { .gate { display: none; } .stat.alert::after { animation: none; } }
.login-box { display: grid; place-items: center; padding: 28px; background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 0); background-size: 26px 26px; }
.login-box .card { width: min(420px, 100%); padding: 34px; border-radius: 22px; box-shadow: var(--shadow-3); animation: pop .5s cubic-bezier(.2,.9,.3,1.1) 1.6s backwards; }
.login-box .card h2 { font-size: 26px; font-stretch: 114%; }
.code-input { font: 800 30px var(--head); letter-spacing: .35em; text-align: center; }
@media (max-width: 800px) {
  .login-page { grid-template-columns: 1fr; } .login-art { padding: 28px; min-height: 340px; } .login-art .mark { top: 24px; left: 28px; }
  .login-art h1 { font-size: 32px; } .login-box .card { animation-delay: 1.2s; }
}


/* =====================================================================
   v2 - every page gets its own colour identity, a banner, and rich tiles
   ===================================================================== */
.main { padding: 0 34px 80px; min-width: 0; position: relative; background: var(--paper); }
.main::before { /* page-tinted atmosphere */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 105% -5%, color-mix(in srgb, var(--a2) 20%, transparent), transparent 70%),
    radial-gradient(760px 520px at -8% 105%, color-mix(in srgb, var(--a1) 14%, transparent), transparent 70%),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 0) 0 0 / 26px 26px;
}
.main > * { position: relative; z-index: 1; }
.main[data-page=dashboard] { --a1: #ff6a1a; --a2: #0b5c93; --h1: #0a2540; --h2: #0b5c93; }
.main[data-page=leads]     { --a1: #0f766e; --a2: #14b8c4; --h1: #0b4f58; --h2: #0e9aa7; }
.main[data-page=pipeline]  { --a1: #4338ca; --a2: #8b5cf6; --h1: #312e81; --h2: #6d4de0; }
.main[data-page=tasks]     { --a1: #be185d; --a2: #a855f7; --h1: #6b1d5c; --h2: #c026a3; }
.main[data-page=budget]    { --a1: #b45309; --a2: #f59e0b; --h1: #7c2d12; --h2: #d97706; }
.main[data-page=reports]   { --a1: #1d4ed8; --a2: #0ea5e9; --h1: #172554; --h2: #1d6fe0; }
.main[data-page=team]      { --a1: #047857; --a2: #34d399; --h1: #064e3b; --h2: #059669; }
.main[data-page=settings]  { --a1: #475569; --a2: #94a3b8; --h1: #1e293b; --h2: #51657a; }

.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 0 -34px 22px; padding: 14px 34px; background: color-mix(in srgb, var(--paper) 70%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.crumb { font-weight: 600; color: var(--ink-2); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.crumb i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }

/* banner */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 34px 38px; margin-bottom: 24px; color: #fff; min-height: 150px; display: flex; align-items: center;
  background:
    radial-gradient(520px 260px at 92% 0%, color-mix(in srgb, var(--a2) 70%, transparent), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 3px, transparent 3px 16px),
    linear-gradient(120deg, var(--h1), var(--h2));
  box-shadow: 0 30px 50px -28px color-mix(in srgb, var(--h1) 80%, black), inset 0 1px 0 rgba(255,255,255,.18); }
.hero h1 { font-size: clamp(28px, 3.4vw, 44px); font-stretch: 125%; font-weight: 800; letter-spacing: -.035em; line-height: 1; color: #fff; }
.hero p { margin: 12px 0 0; max-width: 54ch; color: rgba(255,255,255,.82); font-size: 16px; }
.hero::after { content: ''; position: absolute; right: 34px; top: 50%; width: 170px; height: 170px; transform: translateY(-50%) rotate(-10deg);
  background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.08)); -webkit-mask: var(--hi) center / contain no-repeat; mask: var(--hi) center / contain no-repeat; }
.hero::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--a1), var(--a2), transparent 85%); }
.main[data-page=dashboard] { --hi: var(--i-dashboard); } .main[data-page=leads] { --hi: var(--i-leads); } .main[data-page=pipeline] { --hi: var(--i-pipeline); }
.main[data-page=tasks] { --hi: var(--i-tasks); } .main[data-page=budget] { --hi: var(--i-budget); } .main[data-page=reports] { --hi: var(--i-reports); }
.main[data-page=team] { --hi: var(--i-team); } .main[data-page=settings] { --hi: var(--i-settings); }

/* dashboard tiles: each its own colour */
.main .stats { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px; margin-bottom: 22px; }
.main .stats .stat { --g: linear-gradient(150deg, #1d4ed8, #3b82f6); --glow: #1d4ed8; --ic: var(--i-team);
  color: #fff; border: 0; border-radius: 20px; min-height: 124px; padding: 18px 18px 16px; isolation: isolate;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 10px), radial-gradient(120px 90px at 100% 0%, rgba(255,255,255,.28), transparent 70%), var(--g);
  box-shadow: 0 22px 30px -18px var(--glow), 0 2px 4px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .2s, box-shadow .2s; }
.main .stats .stat:hover { transform: translateY(-3px); box-shadow: 0 28px 36px -18px var(--glow), 0 2px 4px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.3); }
.main .stats .stat::before { content: ''; position: absolute; right: -8px; bottom: -14px; width: 96px; height: 96px; z-index: -1; transform: rotate(-9deg);
  background: rgba(255,255,255,.2); -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.main .stats .stat b { color: #fff; font-size: 30px; text-shadow: 0 2px 10px rgba(0,0,0,.2); padding-right: 22px; }
.main .stats .stat span { color: rgba(255,255,255,.88); font-weight: 600; margin-top: 8px; max-width: 14ch; }
.main .stats .stat::after, .main .stats .stat.info::after, .main .stats .stat.good::after, .main .stats .stat.alert::after { background: #fff; right: 16px; top: 16px; box-shadow: 0 0 0 4px rgba(255,255,255,.28); }
.main .stats .stat.alert { background: repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 2px, transparent 2px 10px), radial-gradient(120px 90px at 100% 0%, rgba(255,255,255,.28), transparent 70%), var(--g); border: 0; }
.main .stats .stat.alert b { color: #fff; }
.main .stats .stat:nth-of-type(1) { --g: linear-gradient(150deg, #1e40af, #3b82f6); --glow: #2563eb; --ic: var(--i-team); }
.main .stats .stat:nth-of-type(2) { --g: linear-gradient(150deg, #c2410c, #fb923c); --glow: #ea580c; --ic: var(--i-clock); }
.main .stats .stat:nth-of-type(3) { --g: linear-gradient(150deg, #9f1239, #f43f5e); --glow: #e11d48; --ic: var(--i-calx); }
.main .stats .stat:nth-of-type(4) { --g: linear-gradient(150deg, #155e75, #22d3ee); --glow: #0891b2; --ic: var(--i-snow); }
.main .stats .stat:nth-of-type(5) { --g: linear-gradient(150deg, #065f46, #34d399); --glow: #059669; --ic: var(--i-trophy); }
.main .stats .stat:nth-of-type(6) { --g: linear-gradient(150deg, #5b21b6, #a78bfa); --glow: #7c3aed; --ic: var(--i-budget); }
.main .stats .stat:nth-of-type(7) { --g: linear-gradient(150deg, #a16207, #fbbf24); --glow: #d97706; --ic: var(--i-target); }

/* cards: tinted, with a page-colour spine */
.main .card { position: relative; overflow: hidden; border-radius: 20px; border-color: color-mix(in srgb, var(--a2) 18%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--a2) 7%, var(--card)), var(--card) 140px);
  box-shadow: 0 1px 2px rgba(10,27,43,.04), 0 24px 40px -26px color-mix(in srgb, var(--h1) 55%, transparent); }
.main .card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.main .card > h2, .main .card > .head > h2 { display: flex; align-items: center; gap: 10px; }
.main .card > h2::before, .main .card > .head > h2::before { content: ''; width: 8px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, var(--a1), var(--a2)); }
.main .card .card { box-shadow: none; }
.main .card a { color: var(--h2); font-weight: 600; }
.main th { background: color-mix(in srgb, var(--a2) 11%, transparent); color: color-mix(in srgb, var(--h1) 85%, var(--ink-2)); }
.main tbody tr.click:hover { background: color-mix(in srgb, var(--a2) 11%, transparent); }
.main tbody tr.click:hover td:first-child { box-shadow: inset 4px 0 0 var(--a1); }
.main .tabs button.on { box-shadow: var(--shadow-1); }
.main .btn.primary { background: linear-gradient(135deg, var(--h1), var(--h2)); border-color: transparent; box-shadow: 0 10px 22px -10px var(--h1), inset 0 1px 0 rgba(255,255,255,.25); }
.main .btn.primary:hover { filter: brightness(1.1); }
.top .btn.primary { background: linear-gradient(135deg, #ff7a2e, #f0560a); color: #1b0a00; box-shadow: 0 10px 22px -10px #f0560a, inset 0 1px 0 rgba(255,255,255,.4); }
.top .btn.primary:hover { filter: brightness(1.06); }
.main input:focus, .main select:focus, .main textarea:focus { border-color: var(--h2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 22%, transparent); }
.main input[type=checkbox] { accent-color: var(--a1); }
.main .bar > i { background: linear-gradient(90deg, var(--a1), var(--a2)); }

/* toolbars */
.main .filters { padding: 12px; background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid color-mix(in srgb, var(--a2) 20%, var(--line)); border-radius: 16px; box-shadow: var(--shadow-1); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* avatars + chips */
.av { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font: 700 13px var(--head); font-stretch: 112%; color: #fff; flex: none; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 12px -6px rgba(0,0,0,.4); }
.av.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; } .who > div { min-width: 0; }
.src { --s: #64748b; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: color-mix(in srgb, var(--s) 82%, var(--ink)); background: color-mix(in srgb, var(--s) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--s) 26%, transparent); }
.src::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--s); }
.src[data-src=meta] { --s: #1877f2; } .src[data-src=google] { --s: #e8453c; } .src[data-src=web] { --s: #0e9aa7; } .src[data-src=whatsapp] { --s: #16a34a; }
.src[data-src=phone] { --s: #64748b; } .src[data-src=walkin] { --s: #d97706; } .src[data-src=referral] { --s: #7c3aed; } .src[data-src=return_client] { --s: #e11d89; } .src[data-src=manual] { --s: #8a99a8; }
.role { padding: 3px 11px; border-radius: 99px; font-weight: 600; font-size: 12.5px; }

/* pipeline columns take the stage colour */
.col { --c: #7a8a96; position: relative; border-radius: 18px; padding: 14px 12px 12px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 14%, var(--card)), color-mix(in srgb, var(--c) 4%, transparent) 60%); border-color: color-mix(in srgb, var(--c) 26%, var(--line)); }
.col::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--c); }
.col h3 .tag { background: var(--c); color: #fff; font-weight: 700; min-width: 26px; text-align: center; }
.kcard { border-radius: 14px; border-left-width: 5px; background: var(--card); }

/* funnel */
.funnel-row .bar { height: 18px; border-radius: 9px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.funnel-row .bar > i { border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px -6px currentColor; background-image: linear-gradient(180deg, rgba(255,255,255,.25), transparent 60%); }
.funnel-row > b { font: 800 16px var(--head); font-stretch: 110%; }

/* budget platform tiles */
.plat { color: #fff; border: 0 !important; isolation: isolate; }
.plat::before { height: 0 !important; }
.plat.meta { background: radial-gradient(260px 180px at 100% 0%, rgba(255,255,255,.28), transparent 70%), repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 12px), linear-gradient(150deg, #0a2a8a, #1877f2) !important; box-shadow: 0 30px 40px -24px #1d4ed8 !important; }
.plat.google { background: radial-gradient(260px 180px at 100% 0%, rgba(255,255,255,.28), transparent 70%), repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 12px), linear-gradient(150deg, #9f1d16, #ea4335 60%, #f59e0b) !important; box-shadow: 0 30px 40px -24px #dc2626 !important; }
.main .plat h2, .main .plat h2::before { color: #fff; } .main .plat > .head > h2::before { background: #fff; }
.plat .muted, .plat .small { color: rgba(255,255,255,.82) !important; } .plat b { font: 800 30px var(--head); font-stretch: 112%; }
.plat .bar { background: rgba(255,255,255,.25); height: 14px; } .plat .bar > i { background: #fff; }
.plat .bar.warn > i { background: #ffe08a; } .plat .bar.over > i { background: #ffd0d0; }
.plat .btn { background: #fff; color: #10202c; border: 0; }
.plat input { background: rgba(255,255,255,.95); color: #10202c; border-color: transparent; }

/* drawer + modal pick up the brand accents */
.drawer { --a1: #ff6a1a; --a2: #0b5c93; background: radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--a2) 16%, transparent), transparent 70%), var(--paper); }
.drawer .head h2 { font-size: 24px; font-stretch: 114%; }
.drawer .card { border-radius: 18px; box-shadow: var(--shadow-2); position: relative; overflow: hidden; }
.drawer .card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.drawer .stats .stat { border: 0; color: #fff; border-radius: 16px; background: linear-gradient(150deg, #1e40af, #3b82f6); box-shadow: 0 16px 24px -16px #2563eb; }
.drawer .stats .stat.good { background: linear-gradient(150deg, #065f46, #34d399); box-shadow: 0 16px 24px -16px #059669; }
.drawer .stats .stat.alert { background: linear-gradient(150deg, #9f1239, #f43f5e); box-shadow: 0 16px 24px -16px #e11d48; }
.drawer .stats .stat b, .drawer .stats .stat.alert b { color: #fff; font-size: 26px; } .drawer .stats .stat span { color: rgba(255,255,255,.88); font-weight: 600; }
.drawer .stats .stat::after { background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.28); }
.modal { position: relative; overflow-y: auto; } /* must stay scrollable: 'hidden' here hid the Save button */
.modal::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #ff6a1a, #0b5c93); border-radius: 20px 20px 0 0; }

@media (max-width: 860px) {
  .main { padding: 0 14px 70px; } .top { margin: 0 -14px 16px; padding: 10px 14px; }
  .hero { padding: 24px 22px; min-height: 120px; border-radius: 20px; } .hero::after { width: 100px; height: 100px; right: 12px; opacity: .6; } .hero p { font-size: 14.5px; max-width: 26ch; }
  .main .stats { grid-template-columns: 1fr 1fr; gap: 12px; } .main .stats .stat b { font-size: 28px; }
}
@media (prefers-color-scheme: dark) {
  .main .card { background: linear-gradient(180deg, color-mix(in srgb, var(--a2) 14%, var(--card)), var(--card) 160px); }
  .main::before { opacity: .8; }
}

/* ---------- modal action row: always reachable, even in a long form ---------- */
.modal .row-actions { position: sticky; bottom: -26px; margin: 18px -26px -26px; padding: 14px 26px;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 18px -14px rgba(10,27,43,.5); z-index: 2; }
.modal .grid2, .modal .grid3 { margin-bottom: 4px; }

/* ================= 2026-11-03 additions ================= */

/* ---------- global search in the top bar ---------- */
.globalsearch { position: relative; display: flex; align-items: center; gap: 6px; flex: 1; max-width: 460px;
  background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 0 8px 0 34px; height: 40px; transition: border-color .15s, box-shadow .15s; }
.globalsearch:focus-within { border-color: color-mix(in srgb, var(--harbour) 55%, var(--line-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--harbour) 16%, transparent); }
.globalsearch svg { position: absolute; left: 11px; width: 16px; height: 16px; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; }
.globalsearch input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; height: 100%; padding: 0; font-size: 14px; }
@media (max-width: 760px) { .globalsearch { order: 3; max-width: none; width: 100%; margin-top: 8px; } }

/* ---------- row of small KPI tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-1); overflow: hidden; }
.tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--harbour), var(--amber)); opacity: .85; }
.tile > span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); font-weight: 600; }
.tile > b { display: block; margin-top: 4px; font: 800 24px/1.1 var(--head); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile > em { display: block; margin-top: 3px; font-size: 12px; font-style: normal; color: var(--ink-2); }
.tile.good::before { background: var(--ok); }
.tile.alert { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.tile.alert::before { background: var(--danger); }
.tile.alert > b { color: var(--danger); }

/* ---------- charts ---------- */
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin-bottom: 16px; }
.chart { margin: 6px 0 0; }
.chart svg text { font-family: var(--font); }
.chart-empty { display: grid; place-items: center; min-height: 120px; color: var(--ink-2); font-size: 13px; text-align: center; padding: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); align-items: center; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.spark { display: block; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; min-width: 150px; }
.donut-legend li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; font-size: 12.5px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend span { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar-track { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 7%, transparent); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; }
.hbar-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hbar-val small { display: block; font-weight: 400; color: var(--ink-2); font-size: 11px; }

.gbars { display: grid; gap: 10px; }
.gbar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.gbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.gbar-pair { display: grid; gap: 3px; }
.gbar-pair i { display: block; height: 8px; border-radius: 99px; min-width: 2px; }
.gbar-pair i.a { background: #0b5c93; } .gbar-pair i.b { background: #2c7a6b; }

.heat svg { width: 100%; height: auto; max-height: 120px; }
.heat .legend { gap: 4px; }
.heat .legend i { width: 12px; height: 12px; border-radius: 3px; }

.funnel-chart { display: grid; gap: 8px; }
.fstep { display: grid; grid-template-columns: minmax(78px, 28%) 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.fl { color: var(--ink-2); }
.ftrack { height: 16px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 6px; overflow: hidden; }
.ftrack i { display: block; height: 100%; border-radius: 6px; }
.fval { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.fval small { display: block; font-weight: 400; font-size: 10.5px; color: var(--ink-2); }

/* ---------- payment tracker ---------- */
.paygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.paycard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-1); transition: box-shadow .15s, transform .15s; }
.paycard:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.paycard.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.paycard .phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.paycard .phead b { font-size: 15px; }
.pbar { height: 9px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; margin: 12px 0 8px; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--harbour), var(--ok)); transition: width .4s ease; }
.paycard.done .pbar i { background: var(--ok); }
.pnums { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pnums b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.pnums span { font-size: 11.5px; color: var(--ink-2); }
.paycard .row-actions { flex-wrap: wrap; gap: 6px; }
@media (max-width: 520px) {
  .paygrid { grid-template-columns: 1fr; }
  .hbar, .gbar, .fstep { grid-template-columns: 1fr; gap: 4px; }
  .hbar-val, .fval { text-align: right; }
}

/* ---------- page-level hero action (Payments: + Add client) ---------- */
.hero { justify-content: space-between; gap: 18px; }
.hero-copy { position: relative; z-index: 2; }
.hero-actions { position: relative; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; }
.btn.light { background: #fff; color: var(--navy); border-color: transparent; font-weight: 700;
  box-shadow: 0 10px 22px -12px rgba(0,0,0,.5); }
.btn.light:hover { background: #fff; color: var(--navy); transform: translateY(-1px); }
@media (max-width: 700px) {
  .hero { flex-direction: column; align-items: flex-start; padding: 26px 22px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- payment tracker empty state ---------- */
.payempty { text-align: center; padding: 34px 22px; max-width: 640px; margin: 0 auto; }
.payempty h2 { font-size: 20px; }
.payempty p { max-width: 46ch; margin: 8px auto 16px; }

/* ================= SNACKBARS + DIALOGS (restyled) =================
   The old snackbar was a near-black slab (#0a2540) and every destructive action used
   window.confirm(), which is an unstyleable grey OS box. Everything here is in the brand
   palette: white card, orange/teal accents, dark text. */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 10px;
  max-width: min(400px, calc(100vw - 36px)); }
.toast { position: relative; display: grid; grid-template-columns: 30px 1fr 22px; align-items: start; gap: 10px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 12px 13px 13px; overflow: hidden;
  box-shadow: 0 18px 40px -22px rgba(10, 27, 43, .45), 0 2px 6px rgba(10, 27, 43, .08);
  animation: toastIn .26s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes toastIn { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.toast .ticon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.toast .ticon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.toast .tcopy { font-size: 13.5px; line-height: 1.45; }
.toast .tcopy b { display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.toast .tclose { background: none; border: 0; color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer;
  padding: 0; border-radius: 6px; }
.toast .tclose:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.toast .tbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--ok), #7bd8b4); transform-origin: left; animation: toastBar 4s linear forwards; }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.toast.err { border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); }
.toast.err .ticon { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.toast.err .tbar { background: linear-gradient(90deg, var(--danger), #f08a8a); animation-duration: 7s; }
.toast.err .tcopy b { color: var(--danger); }

/* ---------- confirm dialog ---------- */
.modal.confirm { width: min(460px, 100%); padding: 24px 24px 20px; text-align: left; }
.modal.confirm::before { background: linear-gradient(90deg, var(--amber), var(--harbour)); }
.modal.confirm .cicon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--harbour) 12%, transparent); color: var(--harbour); }
.modal.confirm .cicon.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.modal.confirm .cicon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal.confirm h2 { font-size: 19px; margin: 0 0 6px; }
.modal.confirm p { margin: 0 0 18px; font-size: 14px; line-height: 1.55; }
.modal.confirm .row-actions { position: static; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.btn.danger-solid { background: linear-gradient(135deg, #d84343, #b02a2a); border-color: transparent; color: #fff; font-weight: 700; }
.btn.danger-solid:hover { background: linear-gradient(135deg, #e25050, #bd3232); border-color: transparent; color: #fff; }

/* the notification popover was also flat: give it the same lift as the rest */
.pop { background: var(--card); box-shadow: 0 24px 50px -26px rgba(10, 27, 43, .5), 0 2px 8px rgba(10, 27, 43, .08);
  border-radius: 16px; overflow: hidden; }
.pop .head { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--harbour) 5%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; } .toast .tbar { animation: none; transform: none; }
}

/* ---------- payment tile: one obvious primary action, secondary row beneath ---------- */
.payactions { margin-top: 12px; display: grid; gap: 8px; }
.paycta { width: 100%; justify-content: center; gap: 8px; height: 42px; font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, var(--harbour), var(--harbour-d)); border-color: transparent;
  box-shadow: 0 12px 24px -14px rgba(11, 92, 147, .75); }
.paycta:hover { background: linear-gradient(135deg, var(--harbour-d), var(--harbour)); border-color: transparent; }
.paycta svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.paycta:disabled { opacity: .6; }
.paycard .row-actions { gap: 6px; }
.paycard .row-actions .btn { flex: 0 1 auto; }

/* the bar animates when a payment lands, so the change is unmistakable */
.pbar i { transition: width .55s cubic-bezier(.2, .8, .2, 1); }
.paycard.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 35%, transparent), var(--shadow-2); }
.paycard.pulse .pbar i { background: linear-gradient(90deg, var(--ok), #7bd8b4); }
@media (prefers-reduced-motion: reduce) { .pbar i { transition: none; } }

/* ---------- payment modal: what is owed, at a glance ---------- */
.paynow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 16px;
  background: color-mix(in srgb, var(--harbour) 6%, transparent); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; }
.paynow div > span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); font-weight: 600; }
.paynow div > b { display: block; margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------- payment history entries ---------- */
.payhist { align-items: flex-start; gap: 12px; }
.payhist .ph-main { min-width: 0; }
.payhist .ph-note { margin-top: 4px; font-size: 13px; line-height: 1.45;
  background: color-mix(in srgb, var(--amber) 9%, transparent); border-left: 3px solid var(--amber);
  border-radius: 0 8px 8px 0; padding: 6px 10px; }
@media (max-width: 520px) { .paynow { grid-template-columns: 1fr; } .payhist { flex-direction: column; } }
