@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* The Table portal, v4 design system. Brand: black and white with The Table blue (#1a6aff, thetableevents.com). */
:root {
  --ink: #0b0d12; --text: #1f2430; --muted: #5d6574; --faint: #8a91a0;
  --line: #e7e9ee; --line-2: #d9dce3; --canvas: #f6f7f9; --surface: #fff; --hover: #f2f4f7;
  --accent: #1a6aff; --accent-ink: #0f4fd6; --accent-bg: #ecf2ff; --accent-soft: #b9cffd;
  --side: #0d0f14; --side-2: #171a21; --side-text: #a7adba;
  --good: #0e7a4e; --good-bg: #e6f6ee; --bad: #c0362c; --bad-bg: #fdeceb;
  --warn: #a44a0b; --warn-bg: #fff3e5; --violet: #6b3fd6; --violet-bg: #f1ecfe;
  --teal: #0b7f8a; --teal-bg: #e3f5f6; --slate: #5d6574; --slate-bg: #eff1f4;
  --r: 12px; --r-sm: 8px;
  --sh: 0 1px 2px rgba(11,13,18,.04), 0 1px 1px rgba(11,13,18,.02);
  --sh-lg: 0 10px 30px rgba(11,13,18,.10), 0 2px 6px rgba(11,13,18,.05);
  --font: Inter, ui-sans-serif, "Segoe UI", Helvetica, Arial, sans-serif;
  --side-w: 232px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); background: var(--canvas); font: 14px/1.45 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 21px; line-height: 1.25; margin: 0; color: var(--ink); letter-spacing: -0.015em; font-weight: 650; }
h2 { font-size: 14px; margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 13px; margin: 0 0 6px; color: var(--ink); font-weight: 600; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .block { display: block; }
.good-text { color: var(--good); } .warn-text { color: var(--warn); } .bad-text { color: var(--bad); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--slate-bg); padding: 1px 5px; border-radius: 5px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 16px 12px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; text-decoration: none !important; }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 800; font-size: 15px; letter-spacing: -.02em; position: relative; }
.mark::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.mark.big { width: 44px; height: 44px; font-size: 21px; border-radius: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-weight: 650; font-size: 14px; }
.brand-text small { font-weight: 500; font-size: 11px; color: #7c8392; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #5f6676; padding: 12px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 7px 10px; border-radius: 8px; font-weight: 500; text-decoration: none; position: relative; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: var(--side-2); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav .badge { margin-left: auto; font-size: 11px; background: #272b35; color: #d6dae3; padding: 0 7px; border-radius: 10px; line-height: 18px; }
.side-foot { margin-top: auto; border-top: 1px solid #1f232c; padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #2b3140, #3b4252); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.me-text { min-width: 0; line-height: 1.2; }
.me-text strong { display: block; color: #fff; font-weight: 550; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text span { font-size: 11.5px; color: #7c8392; }
.me form { margin-left: auto; }
.icon-btn { background: none; border: 0; color: var(--side-text); cursor: pointer; padding: 6px; border-radius: 7px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--side-2); color: #fff; }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sync-note { font-size: 11px; color: #646b7a; padding: 6px 8px 0; }
.sync-note.bad { color: #f0a29b; }

.main { min-width: 0; display: flex; flex-direction: column; }
.envbar { background: #fff7e0; color: #8a5a00; text-align: center; font-size: 11.5px; line-height: 22px; font-weight: 550; border-bottom: 1px solid #f3e2b3; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 32px 28px; }
.mobilebar, .tabbar, .nav-toggle, .scrim { display: none; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--ink); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.meta-row svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px 18px; min-width: 0; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head .small { color: var(--muted); }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 14px 18px 0; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: 1fr 1fr; } .g-3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: 1.35fr 1fr; }
.g-side { grid-template-columns: 300px 1fr; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 13px 15px 12px; color: inherit; text-decoration: none !important; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--line-2); box-shadow: var(--sh-lg); }
.kpi-l { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-n { font-size: 21px; font-weight: 650; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-n small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.kpi-s { font-size: 11.5px; color: var(--faint); }
.kpi.warn .kpi-n { color: var(--warn); }
.kpi .bar { margin-top: 6px; }
.dotk { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.dotk.agreed { background: #dfe6f5; } .dotk.invoiced { background: var(--accent-soft); } .dotk.paid { background: var(--accent); } .dotk.warn { background: #f3b46b; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 12px 9px; color: var(--muted); font-weight: 550; font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.count { font-size: 11px; font-weight: 600; background: var(--slate-bg); color: var(--muted); border-radius: 10px; padding: 0 7px; line-height: 18px; }
.tabs a.on .count { background: var(--accent-bg); color: var(--accent-ink); }
.seg { display: inline-flex; background: var(--slate-bg); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 13px; text-decoration: none; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tab-panel:focus { outline: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 550; color: var(--muted); font-size: 11.5px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.tbl th:first-child { border-top-left-radius: var(--r); } .tbl th:last-child { border-top-right-radius: var(--r); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; background: #fafbfc; }
.tbl .open-row td { color: var(--faint); }
.tbl .sub { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.tbl a.rowlink { color: var(--ink); font-weight: 550; }
.tbl tr.clickable { cursor: pointer; }
.card.flush .tbl th:first-child, .card.flush .tbl td:first-child { padding-left: 18px; }
.card.flush .tbl th:last-child, .card.flush .tbl td:last-child { padding-right: 18px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pager button { border: 1px solid var(--line-2); background: #fff; border-radius: 7px; padding: 3px 9px; cursor: pointer; color: var(--text); font: inherit; }
.pager button:disabled { opacity: .4; cursor: default; }
.empty { color: var(--muted); padding: 18px; text-align: center; font-size: 13px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 550; background: var(--slate-bg); color: var(--slate); white-space: nowrap; line-height: 19px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.s-paid, .s-won, .s-attended, .s-customer, .s-confirmed, .s-complete { background: var(--good-bg); color: var(--good); }
.s-partially-paid, .s-deposit-paid { background: var(--teal-bg); color: var(--teal); }
.s-invoiced, .s-in-progress, .s-contacted, .s-replied\/interested { background: var(--accent-bg); color: var(--accent-ink); }
.s-signed, .s-design-partner\/trial, .s-host { background: var(--violet-bg); color: var(--violet); }
.s-verbal, .s-planning, .s-invited, .s-waitlist { background: var(--warn-bg); color: var(--warn); }
.s-lost, .s-cancelled, .s-declined, .s-no-show { background: var(--bad-bg); color: var(--bad); }
.s-barter { background: #f3efe6; color: #7a5b1e; }
.s-open, .s-none, .s-lead, .s-not-set { background: var(--slate-bg); color: var(--slate); }
.s-vip { background: #e9f8ef; color: #127a43; }

/* slot status dots and chart colours */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #d7dbe2; flex: none; }
.d-paid { background: var(--good); } .d-partially-paid { background: #14a3b0; } .d-invoiced { background: var(--accent); }
.d-signed { background: var(--violet); } .d-verbal { background: #f0932b; } .d-barter { background: #c4a35a; } .d-open { background: #e2e5ea; }
.ring { display: block; flex: none; }
.ring .trk { stroke: #eceef2; }
.ring .seg-paid { stroke: var(--good); } .ring .seg-partially-paid { stroke: #14a3b0; } .ring .seg-invoiced { stroke: var(--accent); }
.ring .seg-signed { stroke: var(--violet); } .ring .seg-verbal { stroke: #f0932b; } .ring .seg-barter { stroke: #c4a35a; } .ring .seg-open { stroke: #e6e8ec; }
.ring text { font: 650 9px var(--font); fill: var(--ink); }
.ring text.lo { font-size: 6px; font-weight: 500; fill: var(--muted); }
.ringbox { display: flex; align-items: center; gap: 10px; }
.ringbox .rb-t { line-height: 1.25; }
.ringbox .rb-t strong { display: block; color: var(--ink); font-size: 13px; }
.ringbox .rb-t span { font-size: 12px; color: var(--muted); }
.bar { display: block; width: 100%; height: 8px; }
.bar .b-agreed { fill: #e6ebf5; } .bar .b-invoiced { fill: var(--accent-soft); } .bar .b-paid { fill: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* chart rows (money by event) */
.chart-rows { display: flex; flex-direction: column; gap: 9px; }
.cr { display: grid; grid-template-columns: 190px 1fr 150px; gap: 12px; align-items: center; font-size: 12.5px; }
.cr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 500; }
.cr-name small { color: var(--faint); font-weight: 400; margin-left: 4px; }
.cr .bar { height: 10px; }
.cr-n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-n strong { color: var(--ink); font-weight: 600; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.li-link { display: flex; align-items: center; gap: 12px; padding: 10px 2px; color: inherit; text-decoration: none !important; }
.li-link:hover .li-title { color: var(--accent-ink); }
.li-main { min-width: 0; flex: 1; }
.li-title { color: var(--ink); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.li-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.li-end { margin-left: auto; text-align: right; flex: none; }
.datebox { width: 42px; flex: none; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 3px 0 4px; line-height: 1.05; background: #fff; }
.datebox b { display: block; font-size: 16px; color: var(--ink); font-weight: 650; }
.datebox span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); font-weight: 650; }
.datebox.tbd b { font-size: 11px; padding: 4px 0 1px; color: var(--muted); }
.attn-k { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 1px 7px; white-space: nowrap; flex: none; }
.attn-k.bad { color: var(--bad); background: var(--bad-bg); }
.attn-k.info { color: var(--accent-ink); background: var(--accent-bg); }
.ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--slate-bg); color: var(--muted); }
.ic svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.warn { background: var(--warn-bg); color: var(--warn); } .ic.bad { background: var(--bad-bg); color: var(--bad); } .ic.info { background: var(--accent-bg); color: var(--accent-ink); }
.chev { color: var(--faint); flex: none; }
.chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 6px; background: var(--slate-bg); color: var(--text); margin: 2px 4px 2px 0; text-decoration: none !important; white-space: nowrap; }
a.chip:hover { background: #e4e7ec; }
.sponsor-line { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; display: block; }

/* facts */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.facts.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts dt { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 3px; }
.facts dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.notes { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.notes-body { color: var(--text); }
.notes-body .ef-v, .notes-body > span { display: block; white-space: pre-wrap; max-height: 150px; overflow: auto; }

/* inline edit */
.ef { display: inline-block; max-width: 100%; position: relative; }
.ef > summary { list-style: none; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; border-radius: 6px; padding: 0 4px; margin: 0 -4px; }
.ef > summary::-webkit-details-marker { display: none; }
.ef > summary:hover { background: var(--hover); }
.ef-pen { font-size: 11px; color: var(--faint); font-weight: 500; opacity: 0; transition: opacity .12s; }
.ef > summary:hover .ef-pen, .ef[open] .ef-pen { opacity: 1; }
.ef-form { position: absolute; z-index: 40; top: calc(100% + 6px); left: -4px; min-width: 260px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--sh-lg); padding: 10px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.ef-form textarea { width: 380px; max-width: 70vw; }
.ef-v { white-space: pre-wrap; }
h1 .ef-pen { font-size: 12px; }

/* forms and buttons */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  font: inherit; font-size: 13px; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px; min-height: 32px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 550; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: 8px; padding: 6px 12px; min-height: 32px; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #262a33; }
.btn.accent { background: var(--accent); border-color: var(--accent); } .btn.accent:hover { background: var(--accent-ink); }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line-2); } .btn.ghost:hover { background: var(--hover); }
.btn.small { padding: 3px 10px; min-height: 28px; font-size: 12.5px; }
.btn.wide { width: 100%; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.btn:disabled { opacity: .5; cursor: default; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form.tight { gap: 6px; align-items: center; flex-wrap: nowrap; }
.inline-form .grow { flex: 1; min-width: 200px; }
.inline-form .grow select, .inline-form .grow input { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack input { width: 100%; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters label { flex-direction: row; align-items: center; gap: 6px; }
.form-strip { border-top: 1px solid var(--line); padding: 12px 18px; background: #fbfbfc; border-radius: 0 0 var(--r) var(--r); }

/* popover menus (details-based, no JS needed) */
.pop { position: relative; display: inline-block; }
.pop > summary { list-style: none; } .pop > summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; width: 360px; max-width: calc(100vw - 32px); background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--sh-lg); padding: 14px; }
.pop-body h3 { margin-bottom: 10px; }
.pop-body .inline-form { flex-direction: column; align-items: stretch; }
.pop-body .inline-form label, .pop-body .inline-form .grow { min-width: 0; }
.pop-body .inline-form input, .pop-body .inline-form select { width: 100%; }
.pop.left .pop-body { left: 0; right: auto; }

/* flash and toast */
.flash { padding: 9px 12px; border-radius: 9px; margin-bottom: 12px; font-size: 13px; border: 1px solid transparent; }
.flash.ok { background: var(--good-bg); color: var(--good); border-color: #c4ead6; }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: #f5c9c5; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #f6d9b5; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 90; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--sh-lg); font-size: 13px; transition: opacity .4s; }
.toast.error { background: var(--bad); } .toast.gone { opacity: 0; }
.info { font-size: 12px; color: var(--muted); margin-top: 10px; display: flex; gap: 6px; }
.info svg { width: 14px; height: 14px; flex: none; margin-top: 2px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.callout { background: var(--accent-bg); border: 1px solid #d3e0fd; color: #183a7a; border-radius: 10px; padding: 12px 14px; }
.copy-row { display: flex; gap: 8px; } .copy-row input { flex: 1; }

/* events list */
.ev-tbl td { padding-top: 10px; padding-bottom: 10px; }
.ev-name { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ev-name .li-main { max-width: 360px; }
.slotdots { display: inline-flex; gap: 3px; vertical-align: middle; }
.minibar { width: 120px; }
.minibar .bar { height: 6px; margin-top: 4px; }

/* master-detail (money by sponsor) */
.md { display: grid; grid-template-columns: 260px 1fr; min-height: 440px; }
.md-list { border-right: 1px solid var(--line); max-height: 520px; overflow-y: auto; padding: 6px; }
.md-list a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; }
.md-list a:hover { background: var(--hover); }
.md-list a.on { background: var(--accent-bg); color: var(--accent-ink); }
.md-list a .num { color: var(--muted); font-size: 12px; }
.md-list a.on .num { color: var(--accent-ink); }
.md-detail { padding: 16px 20px; min-width: 0; max-height: 520px; overflow-y: auto; }
.md-detail .kpis { grid-template-columns: repeat(4, 1fr); }
.md-detail .kpi { box-shadow: none; background: #fafbfc; padding: 10px 12px; }
.md-detail .kpi-n { font-size: 16px; }
.deal-block { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.deal-block .title-row a { font-weight: 600; color: var(--ink); }
.inv-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12.5px; }
.inv-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line); align-items: center; }

/* kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 12px; overflow-x: auto; align-items: stretch; padding-bottom: 4px; }
.col { background: #eff1f4; border-radius: 12px; display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 196px); min-height: 420px; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 11px 12px 8px; font-size: 12.5px; }
.col-h .pill { font-size: 12px; }
.col-body { padding: 0 8px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; box-shadow: var(--sh); }
.kcard[draggable=true] { cursor: grab; }
.kcard.dragging { opacity: .5; } .kcard.saving { opacity: .6; }
.kc-title { font-weight: 600; color: var(--ink); display: block; font-size: 13px; line-height: 1.3; }
.kc-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.kc-next { color: var(--muted); font-size: 12px; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.kc-move select { font-size: 11.5px; min-height: 26px; padding: 2px 6px; }
.kc-val { font-weight: 600; font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.empty-col { color: var(--faint); font-size: 12px; text-align: center; padding: 14px 0; }

/* auth pages */
body.solo { background: radial-gradient(1200px 600px at 50% -10%, #e9f0ff, var(--canvas)); }
.solo-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth { width: 100%; max-width: 400px; padding: 28px; border-radius: 16px; box-shadow: var(--sh-lg); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand strong { display: block; color: var(--ink); font-size: 16px; }
.auth-brand span { color: var(--muted); font-size: 13px; }
.auth h1 { margin-bottom: 6px; }
.auth .stack { margin-top: 16px; }
.auth .btn { min-height: 38px; }
.narrow { max-width: 520px; margin: 40px auto; }
.center { text-align: center; }
.qr { display: block; margin: 12px auto; width: 190px; height: 190px; }
code.key { font-size: 12.5px; word-break: break-all; }
.codes { columns: 2; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  body { font-size: 14px; }
  .shell { display: block; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 35; height: 52px; align-items: center; gap: 10px; padding: 0 12px; background: var(--side); color: #fff; }
  .mobilebar .brand { padding: 0; }
  .mobilebar .mb-title { font-weight: 600; font-size: 14px; color: #fff; }
  .mobilebar .menu-btn { margin-left: auto; color: #fff; cursor: pointer; padding: 8px; border-radius: 8px; display: grid; place-items: center; }
  .mobilebar .menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; height: 100%; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--sh-lg); z-index: 60; }
  .nav-toggle:checked ~ .side { transform: none; }
  .nav-toggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(11,13,18,.45); z-index: 55; }
  .nav a.on::before { display: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 34; background: #fff; border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 5px 0 3px; text-decoration: none; font-weight: 550; cursor: pointer; }
  .tabbar svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.on { color: var(--accent-ink); }
  .wrap { padding: 14px 14px 84px; }
  h1 { font-size: 19px; }
  .page-head { margin-bottom: 12px; align-items: flex-start; }
  .g-2, .g-3, .g-main, .g-side { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 12px; } .kpi-n { font-size: 17px; }
  .facts, .facts.cols-3 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { padding: 13px 14px; }
  .card.flush .card-head { padding: 12px 14px 0; }
  .tbl.stack-sm thead { display: none; }
  .tbl.stack-sm, .tbl.stack-sm tbody, .tbl.stack-sm tr, .tbl.stack-sm td { display: block; width: 100%; }
  .tbl.stack-sm tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .tbl.stack-sm tbody tr:last-child { border-bottom: 0; }
  .tbl.stack-sm td { border: 0; padding: 2px 0 !important; text-align: left; }
  .tbl.stack-sm td[data-l]:not(.lead-cell)::before { content: attr(data-l); color: var(--faint); font-size: 11px; display: inline-block; min-width: 110px; }
  .tbl.stack-sm td.hide-sm, .tbl th.hide-sm, .tbl td.hide-sm { display: none !important; }
  .tbl.stack-sm tfoot { display: block; } .tbl.stack-sm tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 12px; background: #fafbfc; }
  .tbl.stack-sm tfoot td { width: auto; }
  .cr { grid-template-columns: 1fr 110px; } .cr .bar { grid-column: 1 / -1; order: 3; }
  .md { grid-template-columns: 1fr; min-height: 0; }
  .md-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; display: flex; overflow-x: auto; gap: 4px; }
  .md-list a { flex: none; } .md-list a .num { display: none; }
  .md-detail { max-height: none; padding: 12px 14px; }
  .md-detail .kpis { grid-template-columns: 1fr 1fr; }
  .board { grid-auto-columns: 84%; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; height: calc(100vh - 250px); min-height: 360px; }
  .minibar { width: 100%; }
  .pop-body { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
  .ef-form { position: fixed; left: 12px; right: 12px; top: 90px; min-width: 0; }
  .ef-form textarea { width: 100%; max-width: none; }
  .ev-name .li-main { max-width: none; }
  .head-actions { width: 100%; }
}
.chev svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; display: block; }
a.cr { color: inherit; text-decoration: none !important; border-radius: 6px; } a.cr:hover .cr-name { color: var(--accent-ink); }
.avatar.big { width: 44px; height: 44px; font-size: 15px; } .tbl .avatar, .ev-name .avatar { background: linear-gradient(135deg, #dfe7f7, #c8d6f2); color: #1d3e86; }
.roles { padding-left: 16px; margin: 12px 0 0; } .roles li { margin-bottom: 4px; } .bad-row td { background: #fff8f7; }
.qr svg { width: 100%; height: auto; display: block; } .manual summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
/* v4 polish: events table widths */
.ev-tbl .minibar { width: 168px; }
.ev-tbl .minibar .tiny { white-space: nowrap; display: block; }
.ev-tbl .lead-cell .li-main { max-width: 340px; min-width: 0; }
.ev-tbl .sponsor-line { max-width: 230px; }
@media (max-width: 860px) { .ev-tbl .lead-cell .li-main, .ev-tbl .sponsor-line { max-width: none; } .ev-tbl .minibar { width: 100%; } }
.cr { grid-template-columns: 250px 1fr 180px; }
@media (max-width: 860px) { .cr { grid-template-columns: minmax(0, 1fr) auto; } }
.inline-form.tight select { flex: 1 1 auto; min-width: 0; max-width: 300px; }
@media (max-width: 860px) { .inline-form.tight select { width: 0; max-width: none; } .inline-form.tight { width: 100%; } }
.tabs { position: relative; }
.auth .mark { background: var(--side); color: #fff; }
.auth .stack + p, .auth form + p { margin-top: 14px; }
.ev-tbl .lead-cell .li-main { max-width: 300px; }
.ev-tbl .sponsor-line { max-width: 200px; }
.ev-tbl .minibar { width: 150px; }
.ev-tbl td, .ev-tbl th { padding-left: 10px; padding-right: 10px; }
.search-form input[type=search], form input[type=search] { min-width: 260px; }
/* v5: every scheduled event on the Overview, compact rows, scroll inside the card only if needed */
.g-main { align-items: start; }
.sched { display: flex; flex-direction: column; }
.sched .card-head h2 .count { margin-left: 6px; }
.ev-scroll { max-height: calc(100vh - 318px); min-height: 180px; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.list.compact .li-link { padding: 6px 2px; gap: 10px; }
.list.compact .datebox { width: 36px; padding: 2px 0 3px; border-radius: 8px; }
.list.compact .datebox b { font-size: 14px; }
.list.compact .datebox span { font-size: 9px; }
.list.compact .datebox.tbd b { font-size: 10px; padding: 3px 0 0; }
.list.compact .li-title { font-size: 13px; }
.list.compact .li-sub { font-size: 11.5px; }
.li-money { width: 150px; flex: none; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.li-money strong { color: var(--ink); font-weight: 600; }
.li-money .bar { height: 5px; margin-top: 3px; display: block; width: 100%; }
.li-slots { display: flex; align-items: center; gap: 6px; flex: none; width: 64px; justify-content: flex-end; }
.li-slots .ls-t { font-size: 12px; color: var(--ink); font-weight: 600; min-width: 26px; }
.sched .info { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .ev-scroll { max-height: none; overflow: visible; margin-right: 0; padding-right: 0; }
  .li-money { width: 96px; } .li-money .lm-t { display: none; }
  .li-slots { width: auto; }
}
.list.compact .li-link { padding: 4px 2px; }
.ev-scroll { max-height: calc(100vh - 350px); }
.sched .card-head { margin-bottom: 4px; }
.sched .info { margin-top: 6px; }
@media (max-width: 860px) { .ev-scroll { max-height: none; } }
@media (max-width: 860px) {
  .list.compact .li-link { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center; padding: 7px 2px; }
  .list.compact .li-link .datebox { grid-row: 1 / span 2; }
  .list.compact .li-slots { grid-column: 3; grid-row: 1 / span 2; }
  .list.compact .li-money { grid-column: 2; grid-row: 2; width: auto; display: flex; align-items: center; gap: 8px; }
  .list.compact .li-money .lm-t { display: inline; order: 2; }
  .list.compact .li-money .bar { width: 90px; margin: 0; flex: none; }
}
