:root {
  --bg: #f6f4ef; --panel: #ffffff; --panel-2: #fbfaf7; --text: #17161c; --muted: #6f6c78; --faint: #9a97a3;
  --border: #e7e3da; --line: #dcd8ce;
  --accent: #5b47ff; --accent-ink: #3a2bc2; --accent-soft: #eeebff;
  --ok: #1a8a57; --ok-soft: #e3f5ec; --warn: #b8740a; --warn-soft: #fdf1dc; --bad: #d63a34; --bad-soft: #fde8e7;
  --hot: #d6402f; --hot-soft: #fde6e1; --cold: #2f6fb0; --cold-soft: #e3eefa;
  --radius: 16px; --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111015; --panel: #1a1920; --panel-2: #16151b; --text: #eeedf2; --muted: #9b98a6; --faint: #6f6c7a;
    --border: #2a2832; --line: #34313d; --accent: #8b7bff; --accent-ink: #c3baff; --accent-soft: #241f45;
    --ok: #4cc58a; --ok-soft: #12291e; --warn: #e8a640; --warn-soft: #2e2410; --bad: #f06a63; --bad-soft: #321615;
    --hot: #ff7a66; --hot-soft: #36170f; --cold: #6aa8e8; --cold-soft: #13243a; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, .display { font-family: var(--display); letter-spacing: -0.02em; }
h1 { font-size: 40px; line-height: 1.05; margin: 0; font-weight: 700; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h2.mt { margin-top: 22px; }
code { font: 12px ui-monospace, Consolas, monospace; background: var(--panel-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); } .faint { color: var(--faint); font-size: 12px; } .warn-text { color: var(--warn); font-weight: 500; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .row.tight { gap: 6px; margin-top: 4px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--muted); }
.brand img { height: 30px; }
#nav { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
#nav a { padding: 7px 16px; border-radius: 999px; font-weight: 500; color: var(--muted); white-space: nowrap; }
#nav a.active { background: var(--text); color: var(--bg); }
#nav a:not(.active):hover { color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { position: relative; }
#search { width: 210px; border-radius: 999px; padding-left: 14px; background: var(--panel); }
#results { position: absolute; right: 0; top: 44px; width: 380px; max-height: 420px; overflow: auto; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.35); padding: 6px; z-index: 30; }
#results a { display: grid; grid-template-columns: 84px 1fr; gap: 0 8px; padding: 8px 10px; border-radius: 8px; }
#results a:hover { background: var(--accent-soft); color: var(--text); }
#results .kind { grid-row: span 2; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); align-self: center; }
#results .muted { padding: 10px; }
.bellwrap { position: relative; font-size: 18px; padding: 4px; }
#bell { position: absolute; top: -2px; right: -6px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }
.me { display: flex; align-items: center; gap: 6px; }
.me { position: relative; }
#avatar { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid transparent; justify-content: center; font-weight: 600; font-size: 13px; }
#avatar:hover, #avatar[aria-expanded=true] { border-color: var(--accent); }
#menu { position: absolute; right: 0; top: 46px; width: 250px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.35); padding: 6px; z-index: 30; }
#menu .menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
#menu .menu-head span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
#menu a, #menu button { display: flex; width: 100%; padding: 9px 12px; border-radius: 8px; border: 0; background: none; font-weight: 500; justify-content: flex-start; color: var(--text); }
#menu a:hover, #menu button:hover { background: var(--accent-soft); color: var(--text); }
#subnav { position: sticky; top: 57px; z-index: 15; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
#subnav > div { max-width: 1240px; margin: 0 auto; padding: 0 28px; display: flex; gap: 22px; }
#subnav a { padding: 11px 2px 10px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
#subnav a.on { color: var(--text); border-bottom-color: var(--accent); }
#subnav a:hover { color: var(--text); }

main { padding: 30px 28px 80px; max-width: 1240px; margin: 0 auto; }
main:has(.board) { max-width: none; }

/* ---------- hero, kpis, for-you ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.hero .lede { color: var(--muted); font-size: 16px; margin-top: 10px; } .hero .lede b { color: var(--text); font-weight: 600; }
.stats { display: flex; gap: 28px; }
.stat .v { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12px; }
.foryou { margin-bottom: 18px; } .foryou h2 { font-size: 15px; }
.fy-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.fy { flex: 0 0 250px; background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.fy.warn { border-left-color: var(--warn); } .fy.bad { border-left-color: var(--bad); }
.fy span { color: var(--muted); font-size: 12px; } .fy button { position: absolute; right: 10px; top: 10px; }
.fy b { padding-right: 56px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.kpi .l { color: var(--muted); font-size: 12px; } .kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi .v { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- toolbar & filters ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { width: 260px; border-radius: 999px; background: var(--panel); }
.toolbar .primary { margin-left: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border-radius: 999px; font-weight: 500; color: var(--muted); padding: 6px 13px; }
.filters button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters button .n { opacity: .6; margin-left: 5px; }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
label.check input { width: auto; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(7, minmax(178px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: color-mix(in srgb, var(--panel) 45%, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 320px; }
.col > header { padding: 4px 6px 12px; }
.col > header > div:first-child { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 15px; }
.col > header::before { content: ""; display: block; height: 4px; border-radius: 4px; margin-bottom: 10px; background: var(--c, var(--accent)); }
.col-0 { --c: #a9a6b0; } .col-1 { --c: #d6402f; } .col-2 { --c: #8b7bff; } .col-3 { --c: #5b47ff; } .col-4 { --c: #b8740a; } .col-5 { --c: #2f6fb0; } .col-6 { --c: #1a8a57; }
.count { font-family: Inter, system-ui, sans-serif; font-size: 12px; font-weight: 600; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; color: var(--muted); }
.col-sub { color: var(--muted); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cards { display: flex; flex-direction: column; gap: 9px; }
.col-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 24px 0; border: 1.5px dashed var(--border); border-radius: 12px; }
.dcard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  transition: transform .15s, border-color .15s, box-shadow .15s; }
.dcard:hover, .dcard:focus-visible { transform: translateY(-2px); border-color: var(--c); box-shadow: 0 8px 22px -14px rgba(23,22,28,.45); outline: none; }
.dcard.closed { opacity: .5; }
.dtop { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dname { font-weight: 600; line-height: 1.3; }
.dtop .badge { font-size: 11px; padding: 1px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dmeta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbottom { display: flex; justify-content: space-between; align-items: center; }
.dval { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.mini { display: flex; gap: 3px; }
.mini i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.mini i.done { background: var(--accent); } .mini i.now { background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--accent); }
.mini i.wait { background: var(--warn); } .mini i.bad { background: var(--bad); } .mini i.won { background: var(--ok); }
.dfoot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 3px; }
.who { width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border); font-size: 10px; font-weight: 600; display: grid; place-items: center; color: var(--muted); flex: none; }
.dact { margin-left: auto; }

/* ---------- drawer ---------- */
#drawer .scrim { position: fixed; inset: 0; background: rgba(17,16,21,.32); z-index: 40; opacity: 0; transition: opacity .2s; }
#drawer aside { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--panel); z-index: 41; overflow-y: auto;
  padding: 28px 28px 40px; border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .22s ease-out; display: flex; flex-direction: column; gap: 6px; }
#drawer.open .scrim { opacity: 1; } #drawer.open aside { transform: none; }
#drawer .close { position: absolute; top: 20px; right: 20px; }
.dr-title { font-size: 26px; margin: 4px 0 0; line-height: 1.15; padding-right: 40px; }
.dr-value { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 14px; }
.dr-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- journey (dot trail) ---------- */
.journey { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); }
.stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); text-align: center; }
.stop::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; border-top: 2px dashed var(--line); z-index: 0; }
.stop:first-child::before { display: none; }
.stop i { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 10px; color: #fff; }
.stop.done { color: var(--text); }
.stop.done::before, .stop.now::before, .stop.wait::before, .stop.bad::before, .stop.won::before { border-top: 2px solid var(--accent); }
.stop.done i { background: var(--accent); border-color: var(--accent); } .stop.done i::after { content: "✓"; }
.stop.now { color: var(--accent-ink); font-weight: 600; } .stop.now i { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.stop.now i::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.stop.wait { color: var(--warn); font-weight: 600; }
.stop.wait i { border-color: var(--warn); background: linear-gradient(90deg, var(--warn) 50%, var(--panel) 50%); box-shadow: 0 0 0 5px var(--warn-soft); }
.stop.bad { color: var(--bad); font-weight: 600; } .stop.bad i { background: var(--bad); border-color: var(--bad); box-shadow: 0 0 0 5px var(--bad-soft); } .stop.bad i::after { content: "✕"; }
.stop.won { color: var(--ok); font-weight: 600; } .stop.won i { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); } .stop.won i::after { content: "✓"; }
@media (prefers-reduced-motion: no-preference) {
  .stop.now i, .stop.wait i { animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
}
.journey-lg { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 10px 16px; margin-bottom: 16px; }
.stagepath .stop { cursor: pointer; } .stagepath .stop:hover span { color: var(--accent); }

/* ---------- generic layout ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head h1 .ver { font-size: 18px; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; } .crumbs a { color: var(--accent-ink); }
.sub { color: var(--muted); font-size: 13px; margin-top: 6px; } .sub a { color: var(--accent-ink); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 4px 8px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid > .card, .grid > div > .card:last-child { margin-bottom: 0; }
.grid > div > .card { margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.g-side.r { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); }
.g-doc { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); align-items: start; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
td a { font-weight: 500; }
.table-wrap { overflow-x: auto; }
tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: none; }
.empty { text-align: center; color: var(--muted); padding: 34px 20px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; font-family: Inter, system-ui, sans-serif; letter-spacing: 0; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.grey { background: var(--border); color: var(--muted); }
.badge.hot { background: var(--hot-soft); color: var(--hot); } .badge.hot::before { content: "🔥"; background: none; width: auto; height: auto; font-size: 10px; }
.badge.warm { background: var(--warn-soft); color: var(--warn); } .badge.cold { background: var(--cold-soft); color: var(--cold); }
.score { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 7px; border-radius: 999px; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--accent) calc(var(--s) * 1%), var(--border)); color: var(--text); }

button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--panel); color: var(--text); padding: 8px 15px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, filter .15s; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--text); color: var(--text); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.1); border-color: var(--accent); color: #fff; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; } button.ok:hover { color: #fff; filter: brightness(1.1); }
button.danger { color: var(--bad); } button.ghost { border-color: transparent; background: none; color: var(--muted); }
button.small, .btn.small { padding: 3px 10px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }

input, select, textarea { font: inherit; padding: 8px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
select.auto { width: auto; border-radius: 999px; }
.invalid { border-color: var(--bad) !important; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
label.f i { color: var(--bad); font-style: normal; } label.f small { color: var(--faint); font-weight: 400; }
label.f .check { color: var(--text); font-size: 14px; padding: 8px 0; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
dialog.wide .form { grid-template-columns: repeat(3, 1fr); }
.form .full { grid-column: 1 / -1; }
.fsec { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--accent-ink); border-bottom: 1px solid var(--border); padding: 10px 0 4px; }
.fsec:first-child { padding-top: 0; }
.ferr { color: var(--bad); font-weight: 500; margin-top: 12px; }
.intro { margin: 0 0 14px; font-size: 13px; }

dl.fields { display: grid; grid-template-columns: 140px 1fr; gap: 9px 12px; margin: 0; }
dl.fields dt { color: var(--muted); font-size: 13px; } dl.fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.banner { padding: 13px 18px; border-radius: 12px; margin-bottom: 16px; background: var(--accent-soft); color: var(--accent-ink); }
.banner a { text-decoration: underline; } .banner.ok { background: var(--ok-soft); color: var(--ok); } .banner.warn { background: var(--warn-soft); color: var(--warn); } .banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner .linkrow { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text); font-size: 13px; }
.banner .btn { text-decoration: none; }

/* contacts */
.people { display: flex; flex-direction: column; }
.person { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: none; } .person.dim { opacity: .55; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; }
.pinfo { min-width: 0; } .pact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.channels { display: inline-flex; gap: 4px; } .channels span { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.timeline li:last-child { border-bottom: none; }
.timeline .ic { text-align: center; } .timeline li.ev .ic { color: var(--accent); font-size: 18px; line-height: 1; }
.timeline li.open { background: var(--warn-soft); border-radius: 8px; padding: 8px 6px; }
.tl-body { color: var(--muted); margin: 2px 0; white-space: pre-wrap; }

/* lead score */
.bigscore { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.bigscore .score { min-width: 70px; height: 70px; border-radius: 50%; font-size: 26px; font-family: var(--display); }
.parts { list-style: none; padding: 0; margin: 0 0 10px; } .parts li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

/* quotes */
.versions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; color: var(--text); background: var(--panel); }
.chip.on, .chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip input { width: auto; } .chips { display: flex; gap: 8px; flex-wrap: wrap; }
table.lines input { width: 100px; text-align: right; padding: 6px 8px; } table.lines input.sm { width: 70px; }
.addline { display: grid; grid-template-columns: 2.4fr 110px 140px 90px auto; gap: 8px; padding: 12px 10px; background: var(--panel-2); border-radius: 12px; margin-top: 8px; }
.totals { margin: 16px 0 0 auto; max-width: 360px; display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; }
.totals .grand { font-family: var(--display); font-size: 24px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.doc { display: block; padding: 6px 0; } .doc:hover { color: var(--accent); }
.msgs { list-style: none; padding: 0; margin: 0; } .msgs li { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; } .msgs li:last-child { border: none; }
details summary { cursor: pointer; } details pre { white-space: pre-wrap; font: 12px/1.5 Inter, sans-serif; color: var(--muted); margin: 6px 0 0; max-width: 520px; }

/* agreements */
.pdf { padding: 0; overflow: hidden; }
.pdfbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; } .pdf iframe { width: 100%; height: 760px; border: 0; display: block; background: #fff; }
.chain { list-style: none; margin: 0; padding: 0; }
.chain li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 0 0 16px; position: relative; }
.chain li::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; border-left: 2px solid var(--line); }
.chain li:last-child::before { display: none; }
.chain li i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); margin-top: 1px; }
.chain li.approved i { background: var(--ok); border-color: var(--ok); } .chain li.pending i { border-color: var(--warn); background: var(--warn-soft); }
.chain li.rejected i { background: var(--bad); border-color: var(--bad); } .chain li.cancelled { opacity: .5; }
.chain .quote { font-style: italic; color: var(--muted); font-size: 13px; margin-top: 2px; }
.round.old { opacity: .6; margin-bottom: 10px; }
.signers { list-style: none; margin: 0; padding: 0; } .signers li { padding: 8px 0; border-bottom: 1px solid var(--border); } .signers li:last-child { border: none; }

/* analytics */
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.hbars .hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hbars .track { height: 10px; } .hbars .bar { display: block; height: 10px; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbars li:hover .bar { filter: brightness(1.15); }
.hbars .hv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.col-b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.cbar { width: 70%; max-width: 44px; background: var(--accent); border-radius: 4px 4px 0 0; }
.cv { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; } .cl { font-size: 11px; color: var(--muted); transform: translateY(18px); height: 0; }

/* dialogs & toast */
dialog { border: 1px solid var(--border); border-radius: 20px; padding: 0; width: min(580px, 94vw); background: var(--panel); color: var(--text); max-height: 92vh; }
dialog.wide { width: min(880px, 96vw); }
dialog::backdrop { background: rgba(17,16,21,.42); backdrop-filter: blur(3px); }
dialog form { display: flex; flex-direction: column; max-height: 92vh; }
dialog form > header { padding: 20px 24px 6px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
dialog form > .body { padding: 12px 24px 20px; overflow-y: auto; }
dialog form > footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--panel-2); }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px; max-width: min(640px, 92vw); z-index: 99; font-weight: 500; text-align: center; }
#toast.err { background: var(--bad); color: #fff; border-radius: 14px; }

@media (max-width: 1100px) {
  .g-side, .g-side.r, .g-doc { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; } nav { order: 3; width: 100%; }
}
@media (max-width: 760px) {
  .topbar { padding: 10px 16px; gap: 10px; } .top-right { gap: 6px; } #search { width: 140px; } .me select { max-width: 110px; }
  #results { width: min(340px, 92vw); }
  main { padding: 20px 16px 60px; } h1 { font-size: 30px; } .head h1 { font-size: 24px; }
  .board { grid-template-columns: repeat(7, 240px); }
  .form, dialog.wide .form { grid-template-columns: 1fr; } .addline { grid-template-columns: 1fr 1fr; }
  dl.fields { grid-template-columns: 110px 1fr; } .g2 { grid-template-columns: 1fr; }
  .stop span { font-size: 10px; } .person { grid-template-columns: 40px 1fr; } .pact { grid-column: 1 / -1; justify-content: flex-start; }
  .hbars li { grid-template-columns: 100px 1fr 60px; }
}

/* ---------- tabs ---------- */
.tabs { margin-top: 4px; }
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabbar button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 10px 14px; color: var(--muted); font-weight: 500; margin-bottom: -1px; }
.tabbar button:hover { color: var(--text); border-color: transparent; border-bottom-color: var(--line); }
.tabbar button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabbar .n { margin-left: 6px; font-size: 11px; background: var(--border); color: var(--muted); border-radius: 999px; padding: 1px 7px; }
.tabbar button.on .n { background: var(--accent-soft); color: var(--accent-ink); }
.tab-intro { margin: 0 0 6px; font-size: 13px; }
.tab-intro:empty { display: none; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.facts span { font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.fields-2 dl.fields { grid-template-columns: 140px 1fr 140px 1fr; }
@media (max-width: 900px) { .fields-2 dl.fields { grid-template-columns: 120px 1fr; } }

/* ---------- home ---------- */
.home-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 6px 0 22px; }
.home-hero h1 { font-size: 42px; margin-top: 4px; }
.home-hero .lede { font-size: 16px; margin-top: 8px; color: var(--text); }
.home-hero .lede .faint { margin-left: 6px; }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
.kpi.link { transition: border-color .15s, transform .15s; } .kpi.link:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }
.g-home { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
.attn, .tasks { list-style: none; margin: 0; padding: 0; }
.attn li > a, .attn li > div { display: grid; grid-template-columns: 10px 1fr 14px; gap: 12px; align-items: center; padding: 11px 6px; border-bottom: 1px solid var(--border); border-radius: 6px; }
.attn li:last-child > a, .attn li:last-child > div { border-bottom: 0; }
.attn li > a:hover { background: var(--panel-2); color: var(--text); }
.attn i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.attn li.warn i { background: var(--warn); } .attn li.bad i { background: var(--bad); } .attn li.ok i { background: var(--ok); }
.attn span, .tasks span { display: flex; flex-direction: column; min-width: 0; }
.attn small, .tasks small { color: var(--muted); font-size: 12.5px; }
.attn em { font-style: normal; color: var(--faint); font-size: 20px; }
.tasks li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tasks li:last-child { border-bottom: 0; }
.tick { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: none; margin-top: 2px; }
.tick:hover { border-color: var(--ok); background: var(--ok-soft); }
.empty.small { padding: 24px 10px; }
.glance { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.glance .g { border-top: 4px solid var(--c); background: var(--panel-2); border-radius: 0 0 10px 10px; padding: 12px; display: flex; flex-direction: column; }
.glance .g b { font-family: var(--display); font-size: 26px; } .glance .g span { font-size: 12.5px; color: var(--muted); } .glance .g small { font-size: 12px; color: var(--text); font-weight: 600; }
.glance:hover { color: var(--text); }
@media (max-width: 1100px) { .g-home { grid-template-columns: 1fr; } .kpis.four { grid-template-columns: repeat(2, 1fr); } .glance { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) { #subnav { top: 104px; } #subnav > div { padding: 0 16px; } .home-hero h1 { font-size: 32px; } .glance { grid-template-columns: repeat(2, 1fr); } }

/* ---------- users & access ---------- */
.achip { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 2px 10px; margin: 2px 4px 2px 0; white-space: nowrap; }
.achip b { font-weight: 600; } .achip b::after { content: " ·"; font-weight: 400; }
.row.end { justify-content: flex-end; flex-wrap: nowrap; }
pre.code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; font: 12.5px/1.5 ui-monospace, Consolas, monospace; overflow-x: auto; white-space: pre; }
.perms ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.banner a { color: inherit; }
