:root {
  /* Nova Solutions brand: navy #030e21, teal #2f9b91, silver #b4bec3 (from the logo) */
  --navy: #030e21; --teal: #2f9b91; --teal-dark: #237a72; --silver: #b4bec3;
  --bg: #f4f6f8; --panel: #ffffff; --text: #0f1a2e; --muted: #5d6677; --line: #e1e5ea;
  --brand: var(--teal-dark); --brand-ink: #ffffff; --danger: #b42318;
  --hot: #b42a29; --warm: #8a5d00; --cold: #1c5cab; --dead: #6b6a64;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
header.top { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--navy); color: #fff; border-bottom: 3px solid var(--teal); }
header.top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
header.top .brand img { height: 34px; width: auto; display: block; }
header.top .brand .app-name { color: var(--teal); font-weight: 700; font-size: 18px; letter-spacing: .04em; border-left: 1px solid #2a3547; padding-left: 10px; }
header.top nav { display: flex; gap: 18px; flex: 1; }
header.top nav a { color: #dfe4ea; text-decoration: none; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
header.top nav a:hover, header.top nav a.active { color: #fff; border-bottom-color: var(--teal); }
header.top .muted { color: var(--silver); }
header.top button.link { color: #dfe4ea; }
header.top button.link:hover { color: #fff; text-decoration: underline; }
.auth-logo { text-align: center; margin: 48px auto -36px; }
.auth-logo img { width: 260px; max-width: 80%; height: auto; }
main { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.narrow { max-width: 420px; margin: 60px auto; }
h1 { font-size: 22px; margin: 0 0 16px; color: var(--navy); }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=search], input[type=date], input[type=datetime-local], input[type=number], input[type=email], input[type=password], select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
button, .btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 0; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button.link { background: none; color: var(--text); padding: 0; font-weight: 400; }
.errorlist { color: var(--danger); margin: 4px 0; padding-left: 18px; }
.messages { list-style: none; padding: 0; }
.messages li { padding: 10px 14px; border-radius: 6px; background: #e3f2f0; border-left: 4px solid var(--teal); margin-bottom: 8px; }
.muted { color: var(--muted); }
.band { display: inline-block; white-space: nowrap; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; }
.band-hot { background: var(--hot); } .band-warm { background: var(--warm); } .band-cold { background: var(--cold); } .band-dead { background: var(--dead); }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
@media (max-width: 700px) { header.top nav { display: none; } th:nth-child(n+5), td:nth-child(n+5) { display: none; } }

/* Matter screen */
h2 { font-size: 15px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.matter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.matter-head h1 { margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.4fr); gap: 16px; align-items: start; }
.grid section { display: grid; gap: 16px; }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); } dd { margin: 0; }
.money { font-weight: 700; font-variant-numeric: tabular-nums; }
table.compact td, table.compact th { padding: 6px 4px; }
.neg { color: var(--danger); }
.band-lg { font-size: 15px; padding: 6px 14px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eef1f5; color: var(--text); }
.pill-working { background: #dcf3e8; color: #0b5d3b; } .pill-voicemail, .pill-no_answer { background: #fdf1d8; color: #7a4d00; }
.pill-does_not_exist, .pill-wrong_person { background: #fde2e1; color: #8a1c14; }
.dead-row td { opacity: .6; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
button.secondary { background: #e7eef0; color: var(--text); }
button.small, .small { font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.log-call { border-color: var(--brand); }
details summary { cursor: pointer; margin-top: 10px; color: var(--brand); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ol.timeline { list-style: none; margin: 0; padding: 0; }
ol.timeline li { padding: 10px 0 10px 14px; border-left: 3px solid var(--line); margin-left: 4px; }
ol.timeline li.ev-promise { border-left-color: var(--warm); } ol.timeline li.ev-payment { border-left-color: #0b5d3b; }
ol.timeline li.ev-message { border-left-color: var(--cold); }
.messages li.error { background: #fde2e1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters input, .filters select { width: auto; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #f1f5f4; }
@media (max-width: 900px) { .grid, .row2, .row3 { grid-template-columns: 1fr; } }

/* Keep short columns on one line */
td.nowrap, th.nowrap { white-space: nowrap; }

th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
th a.sort:hover { color: var(--brand); text-decoration: underline; }

.next-action { margin-top: 6px; color: var(--brand); }
.arrangement { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-bottom: 12px; }
.debicheck { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-actions { display: inline-flex; gap: 6px; }
button.danger { background: #fde2e1; color: #8a1c14; }
.promise-row { padding: 6px 0; }
input[type=number] { width: 100%; }
strong.due { color: var(--hot); }
tr.waiting td { opacity: .65; }
.big-count { font-size: 18px; margin: 12px 0 6px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 6px 0; }
label.check input { width: auto; }
.narrow-wide { max-width: 560px; }
.team-actions form { display: inline-block; margin-right: 10px; }
button:hover, .btn:hover { filter: brightness(1.08); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---- Dashboards (palette validated with the dataviz checks: series + band colours) ---- */
:root {
  --series-rpc: #2a78d6;    /* categorical slot 1 */
  --series-other: #eb6834;  /* categorical slot 2 */
  --band-hot: #e34948; --band-warm: #eda100; --band-cold: #2a78d6; --band-dead: #bdbcb6;
  --grid: #e8ebef;
}
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.dash-head h1 { margin: 0; }
.period-filter { margin: 0; }
.pills { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.pill-link { padding: 6px 12px; text-decoration: none; color: var(--text); border-right: 1px solid var(--line); font-size: 14px; }
.pill-link:last-child { border-right: 0; }
.pill-link.active { background: var(--navy); color: #fff; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; font-size: 14px; }
label.inline input { width: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.dash-grid { grid-template-columns: minmax(0, 2.4fr) minmax(220px, 1fr); margin-bottom: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.chart-wrap { position: relative; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
svg.chart .axis-label { font-size: 11px; fill: var(--muted); }
svg.chart .mark-rpc { fill: var(--series-rpc); }
svg.chart .mark-other { fill: var(--series-other); }
svg.chart .hit { fill: transparent; cursor: default; }
svg.chart g.bar.hover .hit { fill: rgba(3, 14, 33, .05); }
.tooltip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(3,14,33,.12); padding: 8px 10px; font-size: 13px; line-height: 1.5; min-width: 150px; z-index: 5; }
.table-view summary { font-size: 13px; margin-top: 8px; }
.band-legend { margin: 4px 0 10px; }
.table-card { padding: 0; overflow-x: auto; }
table.portfolio th, table.portfolio td { white-space: nowrap; }
table.portfolio tfoot th { border-top: 2px solid var(--line); color: var(--text); }
.band-col { min-width: 140px; }
.band-bar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; background: transparent; }
.band-bar span { display: block; min-width: 3px; }
.band-fill-hot { background: var(--band-hot); } .band-fill-warm { background: var(--band-warm); }
.band-fill-cold { background: var(--band-cold); } .band-fill-dead { background: var(--band-dead); }
.band-nums { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
/* My day strip on the queue */
.myday { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.myday div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; min-width: 120px; }
.myday strong { display: block; font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; }
.myday span { font-size: 12px; color: var(--muted); }
.myday .due strong { color: var(--hot); }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
main.wide { max-width: 1480px; }
table.portfolio { font-size: 14px; }
table.portfolio th, table.portfolio td { padding: 8px 8px; }

/* Team page: the list gets the space, the invite form sits beside it */
.team-grid { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.team-card { padding: 8px 16px; }
.team-card td { vertical-align: middle; }
.team-actions { white-space: nowrap; }
@media (max-width: 900px) { .team-grid { grid-template-columns: 1fr; } }
