: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: #c2410c; --warm: #b7791f; --cold: #3b6ea8; --dead: #6b7280;
}
* { 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; }
