@font-face {
  font-family: "Satoshi";
  src: url("../assets/fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  color-scheme: dark;
  --bg: #20201e;
  --bg2: #2e2e2c;
  --bg3: #3a3a38;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.1);
  --text: #f3f2ef;
  --muted: #a8a6a0;
  --muted2: #6f6d68;
  --accent: #8fb8b4;
  --accent2: #b3d6d3;
  --accent3: rgba(179,214,211,0.32);
  --positive: #9bc48a;
  --danger: #e07a6a;
  --warn: #d9b06a;
  --chrome: rgba(32,32,30,0.82);
  --shadow: 0 24px 64px rgba(0,0,0,0.55);
  --card-lilac: #d5c0d3;
  --card-lilac-ink: #2a2229;
  --card-mint: #d9dc9f;
  --card-mint-ink: #2a2c1a;
  --card-teal: #b3d6d3;
  --card-teal-ink: #1e2e2d;
  --card-coral: #d97f60;
  --card-coral-ink: #2c1812;
  --font: "Satoshi", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 20px;
  --header-h: 76px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3f0;
  --bg2: #ffffff;
  --bg3: #ebe9e4;
  --border: rgba(0,0,0,0.06);
  --border2: rgba(0,0,0,0.1);
  --text: #1e1e1c;
  --muted: #6b6964;
  --muted2: #8f8d87;
  --accent: #4f7f7b;
  --accent2: #6fa09c;
  --accent3: rgba(79,127,123,0.28);
  --positive: #4f7a42;
  --danger: #c45a48;
  --warn: #a67c2e;
  --chrome: rgba(244,243,240,0.88);
  --shadow: 0 20px 60px rgba(0,0,0,0.1);
  --card-lilac: #e4d4e2;
  --card-mint: #e4e6b8;
  --card-teal: #c8e4e1;
  --card-coral: #e8a48c;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

html[data-unlocked="0"] body > :not(#gate) { visibility: hidden; }
#gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(120% 120% at 50% 0%, #2c2c22 0%, #20201e 62%);
}
html[data-theme="light"][data-unlocked="0"] #gate {
  background: radial-gradient(120% 120% at 50% 0%, #ecead4 0%, #f4f3f0 62%);
}
#pin-setup {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(32,32,30,0.72);
  backdrop-filter: saturate(180%) blur(16px);
}
#pin-setup[hidden] { display: none !important; }
.gate-box {
  background: rgba(46,46,44,0.9);
  backdrop-filter: saturate(180%) blur(24px);
  border: 0.5px solid var(--border2);
  border-radius: 20px; padding: 40px 36px 36px; width: 360px; max-width: 100%;
  text-align: center; box-shadow: var(--shadow);
}
html[data-theme="light"] .gate-box { background: rgba(255,255,255,0.94); }
.gate-logo { width: 72px; height: auto; margin: 0 auto 20px; display: block; opacity: 0.95; }
.gate-kicker { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.gate-title { font-size: 22px; font-weight: 700; letter-spacing: -0.04em; margin-bottom: 22px; }
.gate-input {
  width: 100%; padding: 12px 14px; font-size: 15px; font-weight: 500; text-align: center;
  letter-spacing: 0.12em; background: var(--bg); border: 0.5px solid var(--border2);
  border-radius: 16px; margin-bottom: 14px; outline: none;
}
.gate-input:focus { border-color: var(--card-mint); }
.gate-input.err { border-color: var(--danger); background: rgba(224,122,106,0.14); }
.gate-btn {
  width: 100%; padding: 12px; background: var(--card-mint); border: 0;
  color: var(--card-mint-ink); font-size: 14px; font-weight: 700; border-radius: 16px; cursor: pointer;
}
.gate-err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

.header {
  border-bottom: 0.5px solid var(--border);
  padding: 16px 28px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 60;
  background: var(--chrome);
  backdrop-filter: saturate(180%) blur(20px);
  overflow: visible;
}
.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-logo { width: 28px; height: 28px; object-fit: contain; opacity: 0.95; flex-shrink: 0; }
.header-sub { font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px; }
.header-title { font-size: 17px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.12; }
.header-actions { display: flex; align-items: center; gap: 8px; position: relative; overflow: visible; }
.sync-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted2); white-space: nowrap;
}
.menu-pop {
  position: fixed; z-index: 90; top: 56px; right: 12px; left: auto;
  background: var(--bg2); border: 0.5px solid var(--border2); border-radius: 14px;
  padding: 6px; width: 260px; max-width: calc(100vw - 24px);
  box-sizing: border-box; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu-pop[hidden] { display: none; }
.export-nudge {
  position: fixed; z-index: 85;
  top: calc(var(--header-h) + 8px);
  right: max(12px, env(safe-area-inset-right));
  width: 228px; max-width: calc(100vw - 24px);
  background: var(--bg2); border: 0.5px solid var(--border2); border-radius: 14px;
  padding: 12px 14px 12px; box-shadow: var(--shadow);
  box-sizing: border-box;
}
.export-nudge[hidden] { display: none; }
.export-nudge-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 4px; padding-right: 22px;
}
.export-nudge-title { font-size: 14px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 6px; }
.export-nudge p { font-size: 12px; line-height: 1.35; color: var(--muted); margin-bottom: 10px; }
.export-nudge-go {
  width: 100%; border: 0; cursor: pointer; border-radius: 10px;
  padding: 8px 10px; font-size: 12px; font-weight: 700;
  background: var(--card-mint); color: var(--card-mint-ink);
}
.export-nudge-x {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1;
}
.export-nudge-x:hover { color: var(--text); background: var(--bg3); }
.menu-pop button, .menu-pop label {
  background: none; border: 0; color: var(--text); text-align: left;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.menu-pop button:hover, .menu-pop label:hover { background: var(--bg3); }
.icon-btn {
  background: var(--bg3); border: 0.5px solid var(--border2); color: var(--muted);
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent2); }

.tabs {
  display: flex; border-bottom: 0.5px solid var(--border); padding: 0 28px;
  position: sticky; top: var(--header-h); background: var(--chrome);
  backdrop-filter: saturate(180%) blur(20px); z-index: 40;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 14px 16px 13px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--muted); border: 0; border-bottom: 2px solid transparent; margin-bottom: -0.5px;
  background: none; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.main { padding: 20px 28px 110px; max-width: 1180px; margin: 0 auto; }
.page { display: none; }
.page.on { display: block; }

.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.cards-row.cards-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cards-row.cards-5 > .kpi { min-width: 0; }
.kpi { border-radius: var(--radius-lg); padding: 16px 18px 14px; border: 0; text-align: left; width: 100%; }
.kpi .c-label { font-size: 12px; opacity: .72; margin-bottom: 6px; font-weight: 500; }
.kpi .c-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .c-sub { font-size: 11px; opacity: .6; margin-top: 6px; }
.p-lilac { background: var(--card-lilac); color: var(--card-lilac-ink); }
.p-mint { background: var(--card-mint); color: var(--card-mint-ink); }
.p-teal { background: var(--card-teal); color: var(--card-teal-ink); }
.p-coral { background: var(--card-coral); color: var(--card-coral-ink); }

.section-label { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.section-desc { font-size: 12px; color: var(--muted2); line-height: 1.45; margin-bottom: 12px; }
.client-pane .section-label { margin-top: 16px; }
.client-pane .section-label:first-child { margin-top: 0; }
.sheet-call { font-size: 13px; margin: 2px 0 8px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search {
  flex: 1; min-width: 180px; background: var(--bg2); border: 0.5px solid var(--border2);
  border-radius: var(--radius); padding: 11px 14px; font-size: 14px; outline: none;
}
.search:focus { box-shadow: 0 0 0 2px var(--accent3); }
.btn {
  background: var(--card-mint); color: var(--card-mint-ink); border: 0;
  border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn.ghost { background: var(--bg3); color: var(--text); border: 0.5px solid var(--border2); font-weight: 600; }
.btn.danger { background: var(--danger); color: #1a1210; }

.segbar {
  display: flex; gap: 4px; padding: 4px; background: var(--bg3);
  border: 0.5px solid var(--border); border-radius: 999px; overflow-x: auto;
  margin-bottom: 16px; width: max-content; max-width: 100%;
}
.seg {
  background: none; border: 0.5px solid transparent; color: var(--muted);
  font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.seg.active { background: var(--bg2); color: var(--accent); border-color: var(--border2); }

.city-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 8px;
}
.city-tile {
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; text-align: left; color: inherit; font: inherit; cursor: pointer; appearance: none;
}
.city-tile:hover { border-color: var(--accent2); }
.city-tile-n { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.03em; }
.city-tile-k { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.crumb {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: -0.03em;
}
.crumb-back {
  background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0;
}
.agency-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tax-form { display: grid; gap: 12px; max-width: 520px; margin: 0 0 22px; }
.tax-form textarea { min-height: 88px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: grid; gap: 10px;
  grid-template-columns: 1.4fr 1fr 1fr 140px;
  align-items: center; cursor: pointer; text-align: left; width: 100%; color: inherit;
}
.row-who { grid-area: who; }
.row-place { grid-area: place; }
.row-sum {
  grid-area: sum; text-align: right; font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--muted);
}
.row-actions { grid-area: actions; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.row:has(.row-sum) {
  grid-template-areas: "who place sum actions";
}
.row:hover { border-color: var(--border2); }
.row .name { font-weight: 700; letter-spacing: -0.02em; }
.row .meta { font-size: 12px; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px; white-space: nowrap;
}
.b-ok { background: rgba(155,196,138,0.16); color: var(--positive); }
.b-warn { background: rgba(217,176,106,0.16); color: var(--warn); }
.b-bad { background: rgba(224,122,106,0.14); color: var(--danger); }
.b-mute { background: var(--bg3); color: var(--muted); }
.b-in { background: rgba(179,214,211,0.18); color: var(--accent2); }

.agenda { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.item {
  background: var(--bg2); border: 0.5px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer; text-align: left; width: 100%;
}
.item.overdue { border-left-color: var(--danger); }
.item.today { border-left-color: var(--warn); }
.item .when { font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }
.item .what { font-weight: 700; }
.item .who { font-size: 12px; color: var(--muted); margin-top: 3px; }

.empty { color: var(--muted2); font-size: 13px; padding: 18px 4px; }

.overlay {
  position: fixed; inset: 0; background: rgba(12,12,11,0.62); z-index: 80;
  display: none; align-items: center; justify-content: center; padding: 24px;
  pointer-events: none;
}
.overlay.on { display: flex; pointer-events: auto; }
.sheet {
  width: min(920px, 100%); max-height: 92vh; height: auto;
  background: var(--bg2); overflow: auto;
  padding: 0 28px 28px; border: 0.5px solid var(--border2);
  border-radius: 24px; box-shadow: var(--shadow);
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { width: 0; height: 0; }
.sheet-top {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg2); padding: 22px 0 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.sheet-top h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 4px 0 0; }
.sheet h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 16px; }
.form { display: grid; gap: 10px; }
.field label { display: block; font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg); border: 0.5px solid var(--border2);
  border-radius: 12px; padding: 10px 12px; font-size: 14px; outline: none;
  color: var(--text);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

.whenpick { background: transparent; border: 0; padding: 0; }
.when-read { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.when-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.when-head strong { font-size: 13px; text-transform: capitalize; }
.when-label {
  background: none; border: 0; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; padding: 4px 2px;
}
.when-label::after, .cal-title::after {
  content: "▾"; font-size: 0.72em; opacity: 0.4; margin-left: 5px;
}
.month-jump {
  margin: 0 auto 12px; padding: 10px 12px 12px;
  background: var(--bg); border: 0.5px solid var(--border2); border-radius: 16px;
  max-width: 440px;
}
.month-jump[hidden] { display: none; }
.when-body .month-jump { margin-bottom: 10px; }
.mj-year {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 10px;
}
.mj-year [data-mj-y] {
  font-size: 16px; font-weight: 700; letter-spacing: -0.03em;
  min-width: 4.5ch; text-align: center;
}
.mj-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mj-m {
  border: 0.5px solid var(--border2); background: var(--bg2); color: var(--text);
  border-radius: 10px; padding: 8px 4px; font-size: 12px; font-weight: 650; cursor: pointer;
}
.mj-m.on { background: var(--card-mint); color: var(--card-mint-ink); border-color: transparent; }
.when-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px;
}
.wp-wd { font-size: 10px; color: var(--muted2); text-align: center; letter-spacing: 0.04em; }
.wp-day {
  height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.wp-day.mute { opacity: .28; }
.wp-day.today { box-shadow: inset 0 0 0 1px var(--accent2); }
.wp-day.on { background: var(--card-mint); color: var(--card-mint-ink); }
.when-clock {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
.when-clock label {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.when-clock input[type="time"] {
  width: 100%;
  background: var(--bg);
  border: 0.5px solid var(--border2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  color-scheme: inherit;
}
.when-quick button, .when-head [data-when-nav] {
  border: 0.5px solid var(--border2); background: var(--bg2); color: var(--text);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.when-quick { display: flex; flex-wrap: wrap; gap: 6px; }

.sheet { isolation: isolate; }
.field textarea { min-height: 90px; resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.linked { margin-top: 22px; }
.phone { color: var(--accent2); text-decoration: none; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chip {
  border: 0.5px solid var(--border2); background: var(--bg3); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-size: 12px; font-weight: 650; cursor: pointer;
}
.chip.on { background: var(--card-mint); color: var(--card-mint-ink); border-color: transparent; }

.week-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 4px 0 14px;
}
.week-range {
  min-width: 220px; background: none; border: 0; color: var(--text);
  font-size: 16px; font-weight: 700; letter-spacing: -0.03em; cursor: pointer;
  text-transform: lowercase;
}
.week-wrap { overflow: visible; padding: 8px 4px 16px; }
.week {
  display: flex; gap: 8px; justify-content: center; overflow: visible;
  margin: 0 auto; max-width: 820px;
}
.daychip {
  flex: 1 1 0; max-width: 104px; background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 16px; padding: 10px 10px 12px; cursor: pointer; text-align: left; color: inherit;
}
.daychip.today:not(.on) { box-shadow: 0 0 0 1.5px var(--accent2); }
.daychip.on { background: var(--card-mint); color: var(--card-mint-ink); border-color: transparent; box-shadow: none; }

.rail.five,
.rail.five.center { justify-content: flex-start; padding: 8px 0; mask-image: none; -webkit-mask-image: none; }
.rail.five .rail-card { flex: 0 0 260px; min-width: 260px; max-width: none; }

.whenpick:not(.open) .when-body { display: none; }
.whenpick.open .when-body {
  margin-top: 8px; padding: 12px;
  background: var(--bg); border: 0.5px solid var(--border2); border-radius: 16px;
}
.when-toggle {
  width: 100%; text-align: left; background: var(--bg); border: 0.5px solid var(--border2);
  border-radius: 16px; padding: 12px 14px; cursor: pointer; color: inherit;
}
.when-toggle .when-read { margin: 0; }
.when-busy { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.wp-day.busy { position: relative; }
.wp-day.busy::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px;
  margin-left: -2px; border-radius: 99px; background: var(--card-coral);
}

.kpi[data-jump] { cursor: pointer; }
.sheet-actions.sticky {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--bg2); padding: 14px 0 6px; margin-top: 18px;
}
.sheet.sheet-fill {
  display: flex; flex-direction: column;
  height: min(780px, 92vh); overflow: hidden;
  padding-bottom: 12px;
}
.sheet.sheet-fill .sheet-top { flex-shrink: 0; position: relative; }
.sheet.sheet-fill .sheet-body { flex: 1; min-height: 0; overflow: auto; }
.sheet.sheet-fill .sheet-actions.sticky {
  position: relative; flex-shrink: 0; margin-top: 8px; padding: 10px 0 2px;
  box-shadow: 0 -12px 16px var(--bg2);
}
.pane-home {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 8px;
}
.pane-card {
  text-align: left; background: var(--bg); border: 0.5px solid var(--border2);
  border-radius: 16px; padding: 14px 14px 12px; cursor: pointer; color: inherit;
  min-height: 92px;
}
.pane-card:hover { border-color: var(--accent2); }
.pane-wide { grid-column: 1 / -1; min-height: 78px; }
.pane-k { font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.pane-v { font-size: 15px; font-weight: 700; letter-spacing: -0.03em; }
.pane-s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pane-bar {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.client-form { display: grid; gap: 10px; }
.client-form[hidden], .pane-home[hidden], .pane-bar[hidden] { display: none !important; }
.client-pane { display: none; }
.client-pane.on { display: grid; gap: 10px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 4px 0 12px; }
.step {
  background: var(--bg); border: 0.5px solid var(--border2); border-radius: 16px;
  padding: 14px 8px; cursor: pointer; color: inherit; text-align: center;
}
.step b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.step span { display: block; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 6px; }
.step.on { background: var(--card-mint); color: var(--card-mint-ink); border-color: transparent; }
.step.on span { color: inherit; opacity: 0.72; }
.peek { display: grid; gap: 10px; }
.peek-k { font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; }
.peek-v { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters select {
  background: var(--bg2); border: 0.5px solid var(--border2); border-radius: 999px;
  padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text);
}
.rep-month {
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: 16px;
  padding: 16px 16px 14px; margin-bottom: 28px;
}
.rep-month .cal-head { margin-bottom: 12px; }
.mchart {
  display: grid; grid-template-columns: repeat(12, minmax(28px, 1fr));
  gap: 6px; height: 120px; margin-bottom: 14px;
}
.mcol {
  display: grid; grid-template-rows: auto 1fr auto; gap: 4px; height: 100%;
  min-width: 0; background: none; border: 0; cursor: pointer; color: inherit; padding: 0;
}
.mcol-n { font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 12px; }
.mcol-track {
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(to top, var(--bg3), transparent 80%);
  border-radius: 6px;
}
.mcol-track i {
  display: block; width: 70%; max-width: 18px;
  border-radius: 5px 5px 2px 2px; background: var(--accent);
}
.mcol.on i { background: var(--card-mint); }
.mcol.fut { opacity: .55; }
.mcol-l { font-size: 9px; color: var(--muted); text-align: center; letter-spacing: 0.02em; }
.month-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.month-kpis > div {
  background: var(--bg); border-radius: 12px; padding: 10px 12px;
}
.month-kpis .c-label { font-size: 11px; color: var(--muted2); margin-bottom: 4px; }
.month-kpis .c-value { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.month-rail {
  display: flex; gap: 10px; overflow-x: auto; margin-top: 12px;
  padding-bottom: 4px; scrollbar-width: none;
}
.month-rail::-webkit-scrollbar { display: none; }
.month-rail .rail-card { flex: 0 0 220px; width: 220px; min-height: 110px; }
.vchart {
  display: grid; grid-template-columns: repeat(10, minmax(52px, 1fr));
  gap: 8px; height: 240px; overflow-x: auto;
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: 16px;
  padding: 16px 14px 12px; margin-bottom: 10px;
}
.vcol {
  display: grid; grid-template-rows: auto 1fr auto; gap: 6px; height: 100%;
  min-width: 0; background: none; border: 0; cursor: pointer; color: inherit; padding: 0;
}
.vcol-n { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vcol-track {
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(to top, var(--bg3), transparent 72%);
  border-radius: 8px;
}
.vcol-track i {
  display: block; width: 70%; max-width: 28px;
  border-radius: 6px 6px 2px 2px; background: var(--accent);
}
.vcol.wait i { background: var(--card-coral); }
.vcol.hot i { background: var(--card-mint); }
.vcol.mute i { background: var(--muted2); }
.vcol.zero i { background: var(--bg3); }
.vcol.zero { opacity: .45; }
.vcol-l { font-size: 10px; color: var(--muted); line-height: 1.2; text-align: center; }
.pipe-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.pipe-legend button {
  background: none; border: 0.5px solid var(--border2); border-radius: 999px;
  padding: 6px 12px; font-size: 12px; color: var(--muted); cursor: pointer;
}
.pipe-legend b { color: var(--text); font-weight: 700; }
.rep-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 8px; }
.chart-card {
  background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 16px; padding: 16px; margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.hbar {
  display: grid; grid-template-columns: minmax(72px, 120px) 1fr 78px;
  gap: 10px; align-items: center; width: 100%;
  background: none; border: 0; cursor: pointer; color: inherit; padding: 0; text-align: left;
}
div.hbar { cursor: default; }
.hbar-n { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 4px; }
.hbar-v { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.hbar.zero { opacity: .45; }
.donut-card { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 14px; }
.donut-card svg { width: 120px; height: 120px; }
.donut-leg { display: flex; flex-direction: column; gap: 8px; }
.d-row {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center;
  background: none; border: 0; cursor: pointer; color: inherit; text-align: left; font-size: 13px;
}
.d-sw { width: 8px; height: 8px; border-radius: 99px; display: block; }
.list-rows { display: grid; gap: 8px; margin-bottom: 12px; }
.list-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
}
.list-row input {
  width: 100%; background: var(--bg); border: 0.5px solid var(--border2);
  border-radius: 12px; padding: 10px 12px; font-size: 14px;
}
.list-lock { font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; }

@media (max-width: 860px) {
  .rep-stats, .rep-split { grid-template-columns: 1fr 1fr; }
  .vchart { grid-template-columns: repeat(10, 52px); }
  .mchart { grid-template-columns: repeat(12, 32px); overflow-x: auto; }
  .month-kpis { grid-template-columns: 1fr 1fr; }
  .donut-card { grid-template-columns: 96px 1fr; }
  .donut-card svg { width: 96px; height: 96px; }
  .hbar { grid-template-columns: 84px 1fr 64px; }
}

.daychip .wd { font-size: 11px; color: var(--muted2); letter-spacing: 0.06em; text-transform: uppercase; }
.daychip .dn { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin: 2px 0 8px; }
.daychip .dots { display: flex; gap: 4px; flex-wrap: wrap; min-height: 8px; }
.daychip.on .wd { color: inherit; opacity: .7; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); }
.dot.atto { background: var(--card-coral); }
.dot.visita { background: var(--card-mint); }
.dot.chiamata { background: var(--card-lilac); }
.dot.appunto { background: var(--card-teal); }

.rail {
  display: flex; gap: 10px; overflow-x: auto; margin: 0 -28px 8px;
  padding: 4px 28px 14px; scroll-snap-type: x proximity; scrollbar-width: none;
  scroll-padding-inline: 28px;
}
.rail::-webkit-scrollbar { display: none; }
.rail-card {
  flex: 0 0 260px; width: 260px; min-height: 132px; scroll-snap-align: start;
  background: var(--bg2); border: 0.5px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 14px 14px 12px; cursor: pointer; text-align: left; color: inherit;
  appearance: none; font: inherit;
}
.rail-card.overdue { border-left-color: var(--danger); }
.rail-card .when { font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }
.rail-card .what { font-weight: 700; }
.rail-card .who { font-size: 12px; color: var(--muted); margin-top: 4px; }
.quick-row { display: flex; gap: 6px; margin-top: 10px; }
.quick-row a, .quick-row button {
  font-size: 12px; font-weight: 700; padding: 7px 10px; border-radius: 999px;
  background: var(--bg3); border: 0.5px solid var(--border2); color: var(--text); cursor: pointer; text-decoration: none;
}

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.03em; text-transform: capitalize;
  background: none; border: 0; color: inherit; cursor: pointer; padding: 4px 2px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { font-size: 11px; color: var(--muted2); text-align: center; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 0 8px; }
.cal-cell {
  min-height: 78px; background: var(--bg2); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 8px 8px 6px; cursor: pointer; text-align: left; color: inherit;
}
.cal-cell.mute { opacity: .38; }
.cal-cell.on { outline: 2px solid var(--accent); }
.cal-cell.today { background: rgba(179,214,211,0.12); }
.cal-num { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.cal-pips { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-pip { font-size: 10px; line-height: 1.2; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fab-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab {
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--card-mint); color: var(--card-mint-ink);
  font-size: 28px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
}
.fab-menu {
  display: none; flex-direction: column; gap: 6px; align-items: flex-end;
}
.fab-wrap.open .fab-menu { display: flex; }
.fab-menu button {
  background: var(--bg2); color: var(--text); border: 0.5px solid var(--border2);
  border-radius: 999px; padding: 10px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.mini {
  font-size: 11px; font-weight: 700; padding: 6px 8px; border-radius: 999px;
  background: var(--bg3); border: 0.5px solid var(--border2); color: var(--text); text-decoration: none;
}

.money-block { margin-top: 18px; }
.money-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.money-tot {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  margin-top: 14px;
}
.money-tot > div {
  background: var(--bg); border: 0.5px solid var(--border2); border-radius: 14px;
  padding: 10px 12px; font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase;
}
.money-tot strong {
  display: block; margin-top: 4px; font-size: 16px; font-weight: 700;
  color: var(--text); letter-spacing: -0.03em; text-transform: none;
  font-variant-numeric: tabular-nums;
}

.bank-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  align-items: stretch;
}
.bank-card {
  display: flex; flex-direction: column;
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 0; text-align: left; width: 100%; min-width: 0; color: inherit; font: inherit;
  cursor: pointer; appearance: none; -webkit-appearance: none;
}
@supports (grid-template-rows: subgrid) {
  .bank-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 4;
  }
}
.bank-card:hover { border-color: var(--accent2); }
.bank-card-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 18px 18px 0; margin-bottom: 14px;
}
.bank-card h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.04em; margin: 0; }
.bank-edit { font-size: 11px; font-weight: 700; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; }
.bank-rates {
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 18px; margin: 0; flex: 1 1 auto;
}
.bank-rate {
  display: grid; grid-template-columns: minmax(0,1fr) max-content; gap: 4px 12px;
  align-items: baseline; padding-bottom: 8px; border-bottom: 0.5px solid var(--border);
}
.bank-rate span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.bank-rate b {
  font-size: 18px; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; text-align: right; justify-self: end;
}
.bank-rate i {
  grid-column: 1 / -1; font-style: normal; font-size: 11px; color: var(--muted2); line-height: 1.4;
}
.bank-facts {
  display: flex; flex-direction: column; gap: 10px;
  margin: 0; padding: 14px 18px 0;
  border-top: 0.5px solid var(--border);
}
.bank-facts.is-empty { border-top: 0; padding: 0 18px; }
.bank-facts div { display: grid; gap: 2px; }
.bank-facts dt { font-size: 11px; font-weight: 600; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; }
.bank-facts dd { font-size: 13px; line-height: 1.45; margin: 0; }
.bank-notes {
  margin: 0; padding: 14px 18px 16px 34px;
  color: var(--muted); font-size: 12px; line-height: 1.45;
}
.bank-notes.is-empty { padding: 0 18px 16px; list-style: none; min-height: 16px; }
.bank-empty { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.rate-edit-row, .fact-edit-row {
  display: grid; gap: 8px; align-items: center;
}
.rate-edit-row { grid-template-columns: 1fr 0.8fr 1.1fr auto; }
.fact-edit-row { grid-template-columns: 1fr 1.4fr auto; }
.rate-edit-row input, .fact-edit-row input {
  width: 100%; background: var(--bg); border: 0.5px solid var(--border2);
  border-radius: 12px; padding: 10px 12px; font-size: 14px;
}

@media (max-width: 1100px) {
  .cards-row.cards-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .cards-row, .cards-row.cards-5 { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr 1fr; }
  .row:has(.row-sum) {
    grid-template-areas:
      "who sum"
      "place actions";
  }
  .header, .tabs, .main { padding-left: 16px; padding-right: 16px; }
  .rail { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-padding-inline: 16px; }
  .grid-2, .grid-3, .money-grid, .money-tot { grid-template-columns: 1fr 1fr; }
  .cal-cell { min-height: 54px; padding: 6px; }
  .cal-pip { display: none; }
  .sheet { padding: 18px 16px 16px; max-height: 96vh; }
  .sheet.sheet-fill { height: 96vh; }
  .mchart { grid-template-columns: repeat(12, 32px); overflow-x: auto; }
  .month-kpis { grid-template-columns: 1fr 1fr; }
  .bank-grid { grid-template-columns: 1fr; }
  .steps { gap: 6px; }
  .step { padding: 10px 4px; }
  .step b { font-size: 18px; }
  .rate-edit-row { grid-template-columns: 1fr 1fr auto; }
  .rate-edit-row input:nth-child(3) { grid-column: 1 / -1; }
  .fact-edit-row { grid-template-columns: 1fr auto; }
}

/* Trackpad Mac: le file orizzontali non rimbalzano e non trascinano la pagina.
   Lo snap resta solo sul touch. */
.tabs, .segbar, .month-rail, .vchart, .mchart, .rail {
  overflow-y: hidden; overscroll-behavior-x: contain;
}
@media (hover: hover) and (pointer: fine) {
  .rail { scroll-snap-type: none; }
}

.consult-add { margin-top: 4px; }
.consult-month { margin-top: 18px; }
.consult-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 6px;
}
.consult-name {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600; text-align: left;
  cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.consult-inc { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.consult-inc input { width: 16px; height: 16px; accent-color: var(--card-mint); }

/* Payin: anno mese per mese */
.payin-head { justify-content: flex-start; gap: 14px; margin-bottom: 6px; }
.payin-title { display: flex; align-items: baseline; gap: 10px; }
.payin-title .c-label { font-size: 12px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; }
.payin-title strong { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.payin-table {
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 6px; margin-bottom: 28px;
}
.payin-tr {
  display: grid; grid-template-columns: 76px minmax(0, 1.3fr) 150px 64px minmax(0, 1.4fr);
  gap: 14px; align-items: center; padding: 6px 12px; border-radius: 12px;
}
.payin-tr + .payin-tr { border-top: 0.5px solid var(--border); }
.payin-th { font-size: 11px; color: var(--muted2); letter-spacing: 0.04em; text-transform: uppercase; padding: 10px 12px 8px; }
.payin-tr.now { background: var(--bg3); }
.payin-tr.now + .payin-tr { border-top-color: transparent; }
.payin-tr.fut .payin-m { color: var(--muted2); }
.payin-m { font-weight: 600; display: flex; flex-direction: column; line-height: 1.15; }
.payin-m small { font-size: 10px; font-weight: 500; color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; }
.payin-bar { display: block; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.payin-bar i { display: block; height: 100%; border-radius: inherit; background: var(--card-mint); transition: width .25s ease; }
.payin-pct { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.payin-in {
  width: 100%; background: transparent; border: 0.5px solid transparent; border-radius: 10px;
  padding: 8px 10px; font-size: 14px; outline: none; color: var(--text);
}
.payin-in:not(.payin-note) { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.payin-in:hover { border-color: var(--border2); }
.payin-in:focus { border-color: var(--card-mint); background: var(--bg); }
.payin-note { color: var(--muted); }
.payin-num-h { text-align: right; padding-right: 11px; }
.payin-in::placeholder { color: var(--muted2); font-weight: 400; }
.payin-tf { font-weight: 700; padding-top: 12px; padding-bottom: 12px; }
.payin-tf [data-payin-tot] { text-align: right; padding-right: 11px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .payin-tr { grid-template-columns: 48px minmax(0, 1fr) 46px; gap: 8px; padding: 6px 8px; }
  .payin-bar-col, .payin-th .payin-bar-col { display: none; }
  .payin-tr > span:last-child { grid-column: 1 / -1; }
  .payin-th > span:last-child, .payin-tf > span:last-child { display: none; }
}

/* PW Ufficio */
.pw-table {
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 6px; margin-bottom: 28px;
}
.pw-table > .empty { padding: 18px 12px; }
.pw-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1.1fr) 32px;
  gap: 10px; align-items: center; padding: 6px 8px; border-radius: 12px;
}
.pw-row + .pw-row { border-top: 0.5px solid var(--border); }
.pw-in {
  width: 100%; min-width: 0; background: transparent; border: 0.5px solid transparent; border-radius: 10px;
  padding: 8px 10px; font-size: 14px; outline: none; color: var(--text);
}
.pw-in:hover { border-color: var(--border2); }
.pw-in:focus { border-color: var(--accent); background: var(--bg); }
.pw-in::placeholder { color: var(--muted2); }
.pw-name { font-weight: 600; }
.pw-note { color: var(--muted); }
.pw-pass { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pw-secret { font-variant-numeric: tabular-nums; }
.pw-secret.masked { -webkit-text-security: disc; }
.pw-pass .mini { flex-shrink: 0; }
@media (max-width: 860px) {
  .pw-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 4px 8px; padding: 10px 6px; }
  .pw-row .pw-pass { grid-column: 1 / -1; grid-row: 2; }
  .pw-row .pw-note { grid-column: 1 / -1; grid-row: 3; }
}

/* Note generiche */
.note-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 28px; }
.note-list > .empty { grid-column: 1 / -1; }
.note-card {
  background: var(--bg2); border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px;
}
.note-top { display: flex; align-items: center; gap: 8px; }
.note-title, .note-body {
  width: 100%; min-width: 0; background: transparent; border: 0.5px solid transparent; border-radius: 10px;
  color: var(--text); outline: none; font: inherit;
}
.note-title { font-size: 15px; font-weight: 700; padding: 6px 8px; flex: 1; }
.note-body { font-size: 14px; line-height: 1.45; padding: 6px 8px; resize: none; min-height: 72px; overflow: hidden; }
.note-title:hover, .note-body:hover { border-color: var(--border2); }
.note-title:focus, .note-body:focus { border-color: var(--accent); background: var(--bg); }
.note-title::placeholder, .note-body::placeholder { color: var(--muted2); font-weight: 400; }
.note-date { font-size: 12px; color: var(--muted2); white-space: nowrap; }
.note-link { padding: 0 8px; }
@media (max-width: 860px) { .note-list { grid-template-columns: 1fr; } }
