/* Dove PM — Monday.com-style board.
   Design tokens lifted from dove-outreach/src/server/public/styles.css so the
   CRM and the PM system read as one product. Tweak them here. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #323338;
  --muted: #676879;
  --line: #d0d4e4;
  --line-soft: #e6e9f2;
  --brand: #5034ff;          /* Monday purple-blue */
  --brand-soft: #ecebff;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(29, 30, 44, 0.06);

  /* Monday status palette */
  --st-green: #00c875;
  --st-orange: #fdab3d;
  --st-red: #e2445c;
  --st-blue: #579bfc;
  --st-darkblue: #0086c0;
  --st-purple: #a25ddc;
  --st-gray: #c4c4c4;
  --st-darkgray: #808080;
  --st-lime: #9cd326;
  --st-pink: #ff5ac4;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- app shell: sidebar + main ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column;
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--st-purple) 100%);
}
.brand { font-weight: 700; font-size: 16px; }
.brand em { color: var(--brand); font-style: normal; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; text-align: left;
  padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--ink);
}
.sidebar-nav button:hover { background: var(--line-soft); }
.sidebar-nav button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-ico { width: 18px; text-align: center; opacity: .75; }
.nav-badge {
  margin-left: auto; background: var(--st-red); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px;
}
.sidebar-foot { margin-top: auto; padding: 10px; }
.link-button { background: none; border: none; color: var(--muted); font-size: 13px; padding: 0; }
.link-button:hover { color: var(--ink); }
.main { flex: 1; min-width: 0; padding: 26px 32px 90px; max-width: 1240px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.page-head h1 { font-size: 24px; }
.spacer { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.count-pill {
  background: var(--brand); color: #fff; border-radius: 999px;
  font-size: 13px; padding: 2px 10px; font-weight: 600;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 4px; padding: 7px 16px;
  font-size: 13px; font-weight: 500; text-decoration: none;
}
.btn:hover { border-color: var(--muted); background: var(--line-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #3f28cc; }
.btn.approve { background: var(--st-green); border-color: var(--st-green); color: #fff; }
.btn.ghost { color: var(--muted); border-color: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- stat cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 12px; margin: 14px 0 26px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border-top: 4px solid var(--st-blue);
}
.stat-card.c-purple { border-top-color: var(--st-purple); }
.stat-card.c-green  { border-top-color: var(--st-green); }
.stat-card.c-orange { border-top-color: var(--st-orange); }
.stat-card.c-dblue  { border-top-color: var(--st-darkblue); }
.stat-card.c-pink   { border-top-color: var(--st-pink); }
.stat-card.c-gray   { border-top-color: var(--st-gray); }
.stat-number { font-size: 30px; font-weight: 700; display: block; font-variant-numeric: tabular-nums; }
.stat-number.none { font-size: 20px; color: var(--muted); font-weight: 500; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Monday-style board groups ---------- */
.board-group { margin: 0 0 26px; }
.board-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.board-group-title { font-weight: 700; font-size: 15px; }
.board-group-count { color: var(--muted); font-size: 12px; }
/* CSP blocks inline styles, so the group colour is a class, not a variable. */
.g-blue    .board-group-title { color: var(--st-blue); }
.g-orange  .board-group-title { color: var(--st-orange); }
.g-purple  .board-group-title { color: var(--st-purple); }
.g-dblue   .board-group-title { color: var(--st-darkblue); }
.g-pink    .board-group-title { color: var(--st-pink); }
.g-green   .board-group-title { color: var(--st-green); }
.g-lime    .board-group-title { color: var(--st-lime); }
.g-gray    .board-group-title { color: var(--st-darkgray); }
.g-blue   .table td:first-child { border-left: 6px solid var(--st-blue); }
.g-orange .table td:first-child { border-left: 6px solid var(--st-orange); }
.g-purple .table td:first-child { border-left: 6px solid var(--st-purple); }
.g-dblue  .table td:first-child { border-left: 6px solid var(--st-darkblue); }
.g-pink   .table td:first-child { border-left: 6px solid var(--st-pink); }
.g-green  .table td:first-child { border-left: 6px solid var(--st-green); }
.g-lime   .table td:first-child { border-left: 6px solid var(--st-lime); }
.g-gray   .table td:first-child { border-left: 6px solid var(--st-gray); }

/* ---------- tables ---------- */
/* Fixed layout so every group's columns line up down the whole board, the way
   Monday's do — otherwise each group sizes itself to its own content. */
.board-table { table-layout: fixed; }
.board-table .c-proj { width: auto; }
.board-table .c-date { width: 84px; }
.board-table .c-ph { width: 8.6%; }
.board-table .c-money { width: 86px; }
.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.table tr:last-child td { border-bottom: none; }
.table tr.row:hover td { background: #f5f6fe; cursor: pointer; }
.table .thead td, .table .thead:hover td {
  font-weight: 500; color: var(--muted); font-size: 12px;
  background: var(--surface); border-bottom: 1px solid var(--line); cursor: default;
}
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a { color: var(--brand); text-decoration: none; font-weight: 500; }
.board-name { font-weight: 600; }
.board-sub { color: var(--muted); font-size: 12px; }

/* ---------- Monday board cells ---------- */
.chev { color: var(--muted); font-size: 12px; margin-right: 2px; }
.board-group-head { cursor: pointer; user-select: none; }
/* rounded stage blocks inside each phase cell, Monday-style */
.board-table td.c-ph { padding: 8px 3px; }
.ph-box {
  display: block; border-radius: 7px; text-align: center; color: #fff;
  font-size: 11.5px; font-weight: 600; padding: 8px 6px; min-height: 32px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-box.blue     { background: var(--st-blue); }
.ph-box.orange   { background: var(--st-orange); }
.ph-box.red      { background: var(--st-red); }
.ph-box.purple   { background: var(--st-purple); }
.ph-box.darkblue { background: var(--st-darkblue); }
.ph-box.green, .ph-box.done { background: var(--st-green); }
.ph-box.lime     { background: var(--st-lime); }
.ph-box.pink     { background: var(--st-pink); }
.ph-box.darkgray { background: var(--st-darkgray); }
.ph-box.todo     { background: #eef0f6; }

/* date pills */
.dpill {
  display: inline-block; min-width: 62px; text-align: center;
  padding: 4px 10px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 600;
}
.dpill.green { background: var(--st-green); }
.dpill.gold  { background: #cab641; }
.dpill.red   { background: var(--st-red); }
.dpill.none  { background: var(--line-soft); color: var(--muted); }

/* add-row + summary row */
.addrow td { color: var(--muted); font-size: 13px; cursor: pointer; padding: 9px 14px; }
.addrow:hover td { color: var(--brand); background: #f5f6fe; }
.sumrow td { background: #fafbfe; border-top: 1px solid var(--line); }
.sumrow:hover td { background: #fafbfe; }
.empty-cell { color: var(--muted); text-align: center; padding: 18px; }
.dist { display: flex; height: 22px; border-radius: 4px; overflow: hidden; }
.dist .seg { display: block; }
.dist .seg.blue{background:var(--st-blue)} .dist .seg.orange{background:var(--st-orange)}
.dist .seg.red{background:var(--st-red)} .dist .seg.purple{background:var(--st-purple)}
.dist .seg.darkblue{background:var(--st-darkblue)} .dist .seg.green{background:var(--st-green)}
.dist .seg.lime{background:var(--st-lime)} .dist .seg.pink{background:var(--st-pink)}
.dist .seg.darkgray{background:var(--st-darkgray)}
.seg.f1{flex:1} .seg.f2{flex:2} .seg.f3{flex:3} .seg.f4{flex:4} .seg.f5{flex:5} .seg.f6{flex:6}
.seg.f7{flex:7} .seg.f8{flex:8} .seg.f9{flex:9} .seg.f10{flex:10} .seg.f11{flex:11} .seg.f12{flex:12}

/* ---------- Monday status labels: solid colour blocks ---------- */
.badge {
  display: inline-block; min-width: 132px; text-align: center;
  font-size: 12px; font-weight: 500; padding: 5px 12px;
  border-radius: 4px; color: #fff; background: var(--st-gray); white-space: nowrap;
}
.badge.blue     { background: var(--st-blue); }
.badge.orange   { background: var(--st-orange); }
.badge.red      { background: var(--st-red); }
.badge.purple   { background: var(--st-purple); }
.badge.darkblue { background: var(--st-darkblue); }
.badge.green    { background: var(--st-green); }
.badge.lime     { background: var(--st-lime); }
.badge.pink     { background: var(--st-pink); }
.badge.gray     { background: var(--st-gray); color: var(--ink); }
.badge.darkgray { background: var(--st-darkgray); }

/* ---------- progress + flags ---------- */
.bar { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--st-green); }
.bar > i.w0{width:0}    .bar > i.w5{width:5%}   .bar > i.w10{width:10%} .bar > i.w15{width:15%}
.bar > i.w20{width:20%} .bar > i.w25{width:25%} .bar > i.w30{width:30%} .bar > i.w35{width:35%}
.bar > i.w40{width:40%} .bar > i.w45{width:45%} .bar > i.w50{width:50%} .bar > i.w55{width:55%}
.bar > i.w60{width:60%} .bar > i.w65{width:65%} .bar > i.w70{width:70%} .bar > i.w75{width:75%}
.bar > i.w80{width:80%} .bar > i.w85{width:85%} .bar > i.w90{width:90%} .bar > i.w95{width:95%}
.bar > i.w100{width:100%}
.flag { font-size: 12px; font-weight: 600; color: var(--st-red); white-space: nowrap; }
.flag.wait { color: var(--st-orange); }
.flag.work { color: var(--st-green); }
.empty-state {
  background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted);
}

/* ---------- CRM banner ---------- */
.notice {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 5px solid var(--st-orange); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.notice h3 { font-size: 14px; margin-bottom: 8px; }
.notice-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.notice-row:first-of-type { border-top: 0; }
.notice-row .name { font-weight: 600; flex: 1; }

/* ---------- needs-you list ---------- */
.attn-row { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.attn-row:last-child { border-bottom: 0; }
.attn-row.clickable { cursor: pointer; }
.attn-row.clickable:hover { background: #f5f6fe; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.late { background: var(--st-red); }
.dot.money { background: var(--st-orange); }
.dot.waiting { background: var(--st-purple); }
.dot.retro { background: var(--st-gray); }
.attn-row .grow { flex: 1; }
.attn-row .why { color: var(--muted); font-size: 13px; }
.panel {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 26px; overflow: hidden;
}
.panel > h2 {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line-soft);
}
.panel-body { padding: 18px 16px; }
.src-note { color: var(--muted); font-size: 12.5px; margin-top: -14px; margin-bottom: 26px; }

/* ---------- insights ---------- */
.stage-name { min-width: 190px; display: flex; align-items: center; gap: 6px; }
.stage-num { min-width: 52px; font-weight: 600; }
.stage-n { min-width: 62px; text-align: right; }
.dwell { min-width: 92px; text-align: right; }
.grow2 { flex: 1; text-align: right; }
.meter { display: block; height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--st-darkblue); }
.meter > i.client { background: var(--st-orange); }
.meter > i.w0{width:0}    .meter > i.w5{width:5%}   .meter > i.w10{width:10%} .meter > i.w15{width:15%}
.meter > i.w20{width:20%} .meter > i.w25{width:25%} .meter > i.w30{width:30%} .meter > i.w35{width:35%}
.meter > i.w40{width:40%} .meter > i.w45{width:45%} .meter > i.w50{width:50%} .meter > i.w55{width:55%}
.meter > i.w60{width:60%} .meter > i.w65{width:65%} .meter > i.w70{width:70%} .meter > i.w75{width:75%}
.meter > i.w80{width:80%} .meter > i.w85{width:85%} .meter > i.w90{width:90%} .meter > i.w95{width:95%}
.meter > i.w100{width:100%}
.flag.ok { color: var(--st-green); }
.panel-note { padding: 10px 16px 14px; color: var(--muted); font-size: 12.5px; }
.retro-block { padding: 4px 0 10px; }
.retro-block h4 { font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px 4px; }

/* ---------- documents ---------- */
.doc { border:1px solid var(--line-soft); border-radius:6px; padding:2px 12px; margin-top:8px; }
.doc.open { border-color:var(--line); background:var(--bg); }
.doc-num { min-width:170px; cursor:pointer; }
.doc-edit { border-top:1px solid var(--line-soft); padding:12px 0 10px; }
.doc-item { display:flex; gap:8px; margin-top:6px; }
.doc-item input { padding:7px 10px; border:1px solid var(--line); border-radius:4px; background:#fff; }
.doc-item .grow { flex:1; }
.doc-amt { width:110px; }
.feat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:0 12px; margin-bottom:8px; }

/* ---------- site performance ---------- */
.sub-head { font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.funnel { display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.funnel-step {
  flex: 1; min-width: 96px; background: var(--bg);
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 10px 12px;
}
.funnel-step .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.funnel-step .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.funnel-step .sub { font-size: 11.5px; color: var(--muted); min-height: 16px; }
.funnel-arrow { align-self: center; color: var(--line); font-size: 16px; }
.roi {
  display: flex; align-items: center; gap: 16px; margin: 4px 0 16px;
  background: #eefaf3; border: 1px solid #bfe8d2; border-left: 5px solid var(--st-green);
  border-radius: var(--radius); padding: 14px 18px;
}
.roi-big { font-size: 34px; font-weight: 800; color: var(--st-green); line-height: 1; }
.roi-text { font-size: 13.5px; }
.metric-table { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.metric-name { min-width: 168px; font-weight: 500; }
.metric-val { min-width: 92px; font-weight: 600; }
.src-tag.has { color: var(--st-darkblue); background: #e3f2f8; }
.src-tag.none { color: var(--muted); background: var(--line-soft); }
.delta { font-size: 11.5px; font-weight: 700; margin-left: 4px; }
.delta.up { color: var(--st-green); }
.delta.down { color: var(--st-red); }
.more { margin: 10px 0; }
.more summary { cursor: pointer; font-size: 13px; color: var(--brand); }
.more .fields { margin-top: 10px; }
.snippet {
  background: #23242b; color: #d6e4ff; font-family: ui-monospace, Menlo, monospace;
  font-size: 12px; padding: 10px 12px; border-radius: 6px;
  overflow-x: auto; white-space: pre; user-select: all;
}

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(29,30,44,.4); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); z-index: 31;
  background: var(--bg); border-left: 1px solid var(--line); overflow-y: auto;
  box-shadow: -14px 0 40px rgba(29,30,44,.16);
}
.dhead { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: 18px 24px; z-index: 2; }
.dhead .row1 { display: flex; align-items: center; gap: 12px; }
.dhead h2 { font-size: 19px; flex: 1; }
.dbody { padding: 22px 24px 60px; }
.section { margin-bottom: 26px; }
.section > h3 {
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.f label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.f input, .f select, .f textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 4px; background: #fff;
}
.f input:focus, .f select:focus, .f textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.f textarea { min-height: 64px; resize: vertical; }
.f .ro { padding: 8px 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.f.mb { margin-bottom: 10px; }

/* Monday-style checkbox rows */
.check { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 4px; }
.check:hover { background: var(--line-soft); }
.check input { width: 16px; height: 16px; accent-color: var(--st-green); flex: none; }
.check span.t { flex: 1; }
.check.done span.t { color: var(--muted); text-decoration: line-through; }
.own-tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  color: var(--brand); background: var(--brand-soft); border: 0;
  border-radius: 3px; padding: 1px 5px; vertical-align: middle;
}
.own-tag.over { color: #8a5a00; background: #fff3e0; cursor: pointer; }
.own-tag.over:hover { background: #ffe6bd; }
.src-tag {
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; flex: none;
  border-radius: 3px; padding: 2px 6px; min-width: 34px; text-align: center;
}
.src-tag.crm { color: var(--st-purple); background: #f5ebfb; }
.src-tag.pm { color: var(--st-darkblue); background: #e3f2f8; }
.tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px;
}
.tgroup { margin-bottom: 16px; }
.tgroup h4 { font-size: 13px; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.tgroup h4 .count { color: var(--muted); font-weight: 500; font-size: 12px; }
.locked { color: var(--muted); font-size: 12.5px; padding: 4px 8px; }
/* Monday-style stage map: phase rows, stage cells */
.mile-grid { display: flex; flex-direction: column; gap: 5px; }
.mile-row { display: flex; align-items: stretch; gap: 10px; }
.mile-phase {
  width: 118px; flex: none; display: flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.g-blue   .mile-phase { color: var(--st-blue); }
.g-orange .mile-phase { color: var(--st-orange); }
.g-purple .mile-phase { color: var(--st-purple); }
.g-dblue  .mile-phase { color: var(--st-darkblue); }
.g-pink   .mile-phase { color: var(--st-pink); }
.g-green  .mile-phase { color: var(--st-green); }
.g-lime   .mile-phase { color: var(--st-lime); }
.g-gray   .mile-phase { color: var(--st-darkgray); }
.mile-cells { display: flex; flex: 1; gap: 4px; min-width: 0; }
.mile-cell {
  flex: 1; min-width: 0; text-align: center; font-size: 11.5px; font-weight: 600;
  padding: 8px 6px; border-radius: 4px; background: var(--line-soft); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mile-cell.past, .mile-cell.now { color: #fff; }
.mile-cell.blue     { background: var(--st-blue); }
.mile-cell.orange   { background: var(--st-orange); }
.mile-cell.red      { background: var(--st-red); }
.mile-cell.purple   { background: var(--st-purple); }
.mile-cell.darkblue { background: var(--st-darkblue); }
.mile-cell.green    { background: var(--st-green); }
.mile-cell.lime     { background: var(--st-lime); }
.mile-cell.pink     { background: var(--st-pink); }
.mile-cell.darkgray { background: var(--st-darkgray); }
.mile-cell.now { outline: 2px solid var(--brand); outline-offset: 1px; box-shadow: var(--shadow); }
.mile-cell.todo { background: var(--line-soft); color: var(--muted); }
@media (max-width: 620px) {
  .mile-row { flex-direction: column; gap: 3px; }
  .mile-phase { width: auto; }
  .mile-cells { flex-wrap: wrap; }
  .mile-cell { flex: 1 1 40%; }
}
.line { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.line:first-of-type { border-top: 0; }
.line .grow { flex: 1; }
.line .when { color: var(--muted); font-size: 12px; }
.note-body { white-space: pre-wrap; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.inline-form input.grow { flex: 1; min-width: 140px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.hint.flush { margin-top: 0; }
.section.mt { margin-top: 18px; }
.modal {
  position: fixed; z-index: 31; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(600px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--bg); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(29,30,44,.3);
}
.modal-body { padding: 20px 24px 26px; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-top: 5px solid var(--brand); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px; width: min(380px, 92vw);
}
.login .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login h1 { font-size: 20px; margin-bottom: 20px; }
.login label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.login input {
  width: 100%; margin-top: 5px; padding: 9px 10px; font-weight: 400;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.login input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.login .acct { color: var(--muted); cursor: default; }
.login button {
  width: 100%; margin-top: 6px; padding: 10px; border: 0; border-radius: 4px;
  background: var(--brand); color: #fff; font-weight: 600;
}
.login button:hover { background: #3f28cc; }
.login .err { color: var(--st-red); font-size: 13px; margin-bottom: 10px; }

@media (max-width: 900px) {
  /* seven phase columns can't compress — the group scrolls sideways instead */
  .board-group { overflow-x: auto; }
  .board-table { min-width: 860px; }
  .sidebar { width: 64px; padding: 14px 8px; }
  .sidebar .brand, .sidebar-nav button span.lbl, .sidebar-foot { display: none; }
  .nav-ico { font-size: 16px; }
  .main { padding: 18px 14px 60px; }
  .hide-sm { display: none; }
}
