/* Layout: navy sidebar + working area. Dashboard, leads table, pipeline board and follow-ups share one shell; editing happens in a side sheet. */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --fg: #131b2a; --muted: #5d6879; --line: #e2e6ee;
  --accent: #d98a10; --accent-fg: #1b1305; --ink: #1d3354; --ink-soft: #edf1f8;
  --ok: #1d8a52; --warn: #b87300; --bad: #c23b3b; --info: #2f6fd0;
  --side: #12203a; --side-fg: #b9c5d8; --side-hi: #ffffff; --side-act: rgba(255, 255, 255, 0.09);
  --bar: #d98a10; --bar-soft: #f6e3c3; --track: #eef1f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --font-d: "Space Grotesk", system-ui, sans-serif; --font-b: "Inter", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1119; --surface: #141b26; --fg: #e7ecf3; --muted: #97a2b3; --line: #243041;
    --accent: #f0a53a; --accent-fg: #1b1305; --ink: #c9d7ec; --ink-soft: #1b2535;
    --ok: #4cc486; --warn: #f0b44a; --bad: #ef7070; --info: #78a8f0;
    --side: #090e16; --side-fg: #9aa7ba; --side-act: rgba(255, 255, 255, 0.07);
    --bar: #f0a53a; --bar-soft: #4a3714; --track: #1d2737;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1119; --surface: #141b26; --fg: #e7ecf3; --muted: #97a2b3; --line: #243041;
  --accent: #f0a53a; --accent-fg: #1b1305; --ink: #c9d7ec; --ink-soft: #1b2535;
  --ok: #4cc486; --warn: #f0b44a; --bad: #ef7070; --info: #78a8f0;
  --side: #090e16; --side-fg: #9aa7ba; --side-act: rgba(255, 255, 255, 0.07);
  --bar: #f0a53a; --bar-soft: #4a3714; --track: #1d2737;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-b); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted, .note { color: var(--muted); }
.note { font-size: 12px; margin: 0; }
.site-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 20px 16px 28px; }
.site-foot a { color: inherit; text-decoration: underline; }
.shell:not([hidden]) ~ .site-foot { margin-left: 248px; }
.err { color: var(--bad); font-size: 13px; margin: 0; }
.boot { text-align: center; color: var(--muted); padding: 40px 16px; }
h1 { font-family: var(--font-d); font-size: 26px; margin: 0; letter-spacing: -0.015em; color: var(--fg); text-wrap: balance; }
h1 small { display: block; font-family: var(--font-b); font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.logo-lg { display: block; margin-bottom: 12px; }

/* shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 22px;
  background: var(--side); color: var(--side-fg); padding: 20px 14px; padding-top: max(20px, env(safe-area-inset-top, 0px));
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.side-brand img { display: block; flex: none; }
.side-brand b { display: block; color: var(--side-hi); font-family: var(--font-d); font-size: 16px; line-height: 1.2; }
.side-brand span { font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-i {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none;
  color: var(--side-fg); font-weight: 500; text-align: left; cursor: pointer; white-space: nowrap;
}
.nav-i:hover { background: var(--side-act); color: var(--side-hi); }
.nav-i[aria-selected="true"] { background: var(--side-act); color: var(--side-hi); box-shadow: inset 3px 0 0 var(--accent); }
.nav-i .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 12px; }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--side-hi); list-style: none; }
.acct::-webkit-details-marker { display: none; }
.acct:hover { background: var(--side-act); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: 13px; }
.acct-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.acct-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.acct-t small { color: var(--side-fg); font-size: 12px; text-transform: capitalize; }
.main { min-width: 0; display: flex; flex-direction: column; gap: 18px; padding: 26px 28px 32px; padding-right: max(28px, env(safe-area-inset-right, 0px)); }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.top .sub { margin: 2px 0 0; font-size: 13px; }
.hbtns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; box-shadow: var(--shadow); }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; box-shadow: none; }
.btn svg { width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* account menu */
.menu { position: relative; }
.menu-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 15; display: flex; flex-direction: column;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: var(--shadow-lg);
}
.menu-pop button { background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: var(--ink-soft); }

/* cards + dashboard */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-h h2 { font-family: var(--font-d); font-size: 16px; margin: 0; }
.card-h .sub { font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-align: left; }
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--muted); }
.kpi .k-l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .k-n { font-family: var(--font-d); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .k-s { font-size: 12px; color: var(--muted); }
.kpi .k-s.bad { color: var(--bad); font-weight: 600; }
.kpi .k-s.good { color: var(--ok); font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.span2-d { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid { grid-template-columns: 1fr; } .span2-d, .span-all { grid-column: auto; } }

/* column chart */
.chart { position: relative; height: 210px; display: grid; grid-template-rows: 1fr auto; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.cols { position: relative; display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 2px; }
.cols .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.cols .grid span { position: absolute; left: 0; top: -9px; font-size: 11px; color: var(--muted); background: var(--surface); padding-right: 4px; }
.colw { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; position: relative; z-index: 1; }
.colw .v { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.colw i { display: block; width: min(38px, 100%); background: var(--bar); border-radius: 4px 4px 0 0; min-height: 2px; }
.colw:hover i { filter: brightness(1.1); }
.colw.now i { background: var(--ink); }
.xl { display: flex; gap: 10px; padding: 0 2px; }
.xl span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
@media (max-width: 560px) { .cols, .xl { gap: 4px; } .xl span { font-size: 10px; } .xl span:nth-child(even) { visibility: hidden; } }

/* horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: 116px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 13px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.hb .lab { display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .lab i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hb .trk { height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; }
.hb .trk b { display: block; height: 100%; background: var(--bar); border-radius: 99px; }
.hb .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hb:hover .trk b { filter: brightness(1.1); }

/* attention list */
.mini { display: flex; flex-direction: column; }
.mini-i { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.mini-i:last-child { border-bottom: 0; }
.mini-i:hover .co { text-decoration: underline; }
.mini-i .co { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-i .when { font-size: 12px; font-weight: 600; }
.mini-i .when.over { color: var(--bad); }
.mini-i .when.today { color: var(--warn); }
.mini-i .sub { grid-column: 1 / -1; }
.mini .none { color: var(--muted); font-size: 13px; margin: 0; }

.tip { position: fixed; z-index: 40; pointer-events: none; background: var(--fg); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow-lg); white-space: nowrap; }

/* pipeline strip */
.pipe { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1100px) { .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.stage .n { font-family: var(--font-d); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage .l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stage .l i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.stage.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.alert { background: var(--ink-soft); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; }
.alert b { font-weight: 600; font-variant-numeric: tabular-nums; }
.alert .od { color: var(--bad); }

.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search { flex: 1 1 260px; min-width: 0; position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.tools select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.bulk { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--side); color: #fff; border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow-lg); }
.bulk label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: inherit; margin: 0; white-space: nowrap; }
.bulk label select { width: auto; padding: 4px 8px; }
.bulk .btn:not(.primary) { background: transparent; color: inherit; border-color: currentColor; }
.bulk select { background: #fff; color: #131b2a; border: 0; border-radius: 6px; padding: 4px 8px; }
th.pick, td.pick { width: 1%; padding-right: 0; cursor: pointer; }
.pick input { width: 16px; height: 16px; margin: 2px 0 0; cursor: pointer; accent-color: var(--accent); }
tr.picked td { background: var(--ink-soft); }

/* table */
.tablebox { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; box-shadow: var(--shadow); }
.tablebox.flat { box-shadow: none; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none; background: var(--surface); }
th[aria-sort="ascending"]::after { content: " ↑"; }
th[aria-sort="descending"]::after { content: " ↓"; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--ink-soft); }
tbody tr:last-child td { border-bottom: 0; }
td .co { font-weight: 600; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid currentColor; }
.prod { font-size: 12px; font-weight: 600; white-space: nowrap; }
.due-over { color: var(--bad); font-weight: 600; }
.due-today { color: var(--warn); font-weight: 600; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty h3 { font-family: var(--font-d); color: var(--fg); margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0; }
.perf { min-width: 520px; }
.perf th { cursor: default; }
.perf .num { text-align: right; }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--ink-soft); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 140px; border: 2px solid transparent; }
.col.over { border-color: var(--accent); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 6px; font-weight: 600; font-size: 13px; }
.col-h i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.col-h .count { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.kc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.kc:hover { border-color: var(--muted); }
.kc.dragging { opacity: 0.5; }
.kc .co { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.kc .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.kc .foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; }
.kc .who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
.kc .who b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--surface); font-size: 10px; flex: none; }
.col .none { color: var(--muted); font-size: 12px; text-align: center; padding: 14px 0; margin: 0; }

/* sign-in */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding-block: 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: radial-gradient(1200px 600px at 10% -10%, var(--ink-soft), transparent 60%), var(--bg);
}
.login-card { width: min(390px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.login-card p { margin: 4px 0 0; }

/* side sheets */
.scrim { position: fixed; inset: 0; background: rgba(8, 12, 20, 0.5); z-index: 20; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); z-index: 21; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.sheet-h h2 { font-family: var(--font-d); margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.sheet-b { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.sheet-f { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.sheet-f #saveBtn { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 440px) { .grid2 { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); min-width: 0; }
label input, label select, label textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); font-size: 14px; width: 100%; }
label input:focus, label select:focus, label textarea:focus { border-color: var(--info); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent); }
.sec { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; border-top: 1px solid var(--line); padding-top: 12px; }
.log { display: flex; flex-direction: column; gap: 8px; }
.log div { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.log time { display: block; font-size: 11px; color: var(--muted); }
.confirm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }

/* team */
.team { display: flex; flex-direction: column; gap: 8px; }
.member { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.member.off { opacity: 0.65; }
.m-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.m-act { display: flex; gap: 6px; flex-wrap: wrap; }
.m-pw { display: flex; gap: 6px; }
.m-pw input { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.adduser { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.adduser .grid2 { width: 100%; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: 13px; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg);
}
@media (prefers-reduced-motion: no-preference) {
  .sheet:not([hidden]) { animation: slide 0.18s ease-out; }
  .view:not([hidden]) { animation: fade 0.15s ease-out; }
}
@keyframes slide { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0.4; } to { opacity: 1; } }

.badge { background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; line-height: 18px; padding: 0 7px; font-variant-numeric: tabular-nums; font-weight: 600; }
.view { display: flex; flex-direction: column; gap: 16px; }
.span2 { grid-column: 1 / -1; }

/* follow-ups screen */
.fu-top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
label.inline select { width: auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.agents { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; box-shadow: var(--shadow); }
.agents table { min-width: 520px; }
.agents th { cursor: default; }
.agents .num { text-align: right; }
.agents tbody tr { cursor: pointer; }
.agents tr.on td { background: var(--ink-soft); font-weight: 600; }
.groups { display: flex; flex-direction: column; gap: 22px; }
.group h3 { font-family: var(--font-d); font-size: 16px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; }
.group h3 .count { font-family: var(--font-b); font-size: 13px; font-weight: 500; color: var(--muted); }
.group.over h3 { color: var(--bad); }
.group.today h3 { color: var(--warn); }
.fu-list { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.fu-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.fu-item:last-child { border-bottom: 0; }
.fu-item:hover { background: var(--ink-soft); }
.fu-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fu-line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.fu-line .co { font-weight: 600; overflow-wrap: anywhere; }
.fu-when { font-weight: 600; }
.fu-when.over { color: var(--bad); }
.fu-when.today { color: var(--warn); }
.fu-empty { margin: 0; padding: 12px 14px; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 12px; }
@media (max-width: 560px) { .fu-item { grid-template-columns: 1fr; } .fu-item .btn { justify-self: start; } }

/* follow-up log inside the lead sheet */
.fu-log { display: flex; flex-direction: column; gap: 10px; margin: -18px -20px 0; padding: 16px 20px; background: var(--ink-soft); border-bottom: 1px solid var(--line); }
.fu-log .sec, .fu-log + .sec { border-top: 0; padding-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  position: relative; display: inline-flex; flex-direction: row; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--fg); font-size: 13px; cursor: pointer;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip:has(input:focus-visible) { outline: 2px solid var(--info); outline-offset: 2px; }
.next { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.next .lbl { width: 100%; font-size: 12px; font-weight: 500; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.next input[type="date"] { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); }
#fuSave { align-self: flex-start; }

/* phones and small tablets: sidebar becomes a top bar with a scrolling menu */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; }
  .shell:not([hidden]) ~ .site-foot { margin-left: 0; }
  .side { position: sticky; top: 0; z-index: 12; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top, 0px)); }
  .side-brand { flex: 1; padding: 0; }
  .side-brand span { display: none; }
  .side-foot { margin: 0; flex-direction: row; border: 0; padding: 0; gap: 4px; align-items: center; }
  .side-foot .nav-i { width: auto; padding: 8px; }
  .side-foot .nav-i span, .acct-t { display: none; }
  .acct { padding: 4px; }
  .menu-pop { left: auto; right: 0; bottom: auto; top: calc(100% + 6px); min-width: 180px; }
  .nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; padding: 0 12px; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-i { width: auto; padding: 8px 12px; gap: 8px; }
  .nav-i[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .main { padding: 18px 16px 24px; }
  h1 { font-size: 22px; }
}
