/* ---------------------------------------------------------------------------
   Visual refresh (Sept 2026). Loaded after rof.css and overrides it; nothing
   else depends on this file, so removing its <link> restores the previous
   look exactly. Brand colours are unchanged - this is surface, type and
   spacing only.
--------------------------------------------------------------------------- */

:root {
  --bg:         #f3f5f9;
  --line:       #e4e8ef;
  --line-soft:  #eef1f6;
  --surface-2:  #f8fafc;
  --row-hover:  #f5f8fc;
  --field-line: #d7dee8;
  --focus-ring: rgba(30, 78, 140, 0.16);
  --radius:     10px;
  --radius-lg:  14px;
  --shadow-xs:  0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm:  0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow:     0 6px 16px rgba(16, 24, 40, 0.07), 0 2px 4px rgba(16, 24, 40, 0.04);
  --tone-grey:  #94a3b8;
}
:root[data-theme="dark"] {
  --surface-2:  #1b2332;
  --row-hover:  #1d2636;
  --field-line: #323b4d;
  --focus-ring: rgba(79, 184, 245, 0.22);
  --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.30);
  --tone-grey:  #64748b;
}

body {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ------------------------------------------------------------- top bar */
.sidebar {
  inset-block-start: 0;
  z-index: 20;
  padding: 10px 28px;
  gap: var(--space-4);
}
.sidebar > nav { gap: 2px; }
.sidebar nav .navlink {
  letter-spacing: 0.005em;
}
.who-avatar {
  inline-size: 36px;
  block-size: 36px;
  font-size: var(--text-sm);
}

/* ------------------------------------------------------- page structure */
.main {
  max-inline-size: 1480px;
  margin-inline: auto;
  padding: 28px 32px 56px;
}
.main h2 {
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.rowhead { margin-block-end: var(--space-4); }
.rowhead .hint { margin-block-start: 4px; }

/* ---------------------------------------------------------------- cards */
.card,
.dash-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.dash-block { padding: 20px 22px; }
.dash-block-title,
.main .card h3,
.dash-mini h3 {
  font-size: 16px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* ---------------------------------------------------------- KPI tiles
   The thick left stripe gives way to a tone dot beside the label. */
.dash-tile {
  --tone: var(--tone-grey);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px 18px 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.dash-tile.dash-tone-blue  { --tone: var(--blue); }
.dash-tile.dash-tone-green { --tone: var(--status-valid); }
.dash-tile.dash-tone-amber { --tone: var(--status-due-soon); }
.dash-tile.dash-tone-red   { --tone: var(--status-expired); }
.dash-tile.clickable:hover {
  transform: translateY(-2px);
  border-color: var(--field-line);
  box-shadow: var(--shadow);
}
.dash-tile .dash-count {
  font-size: 32px;
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.dash-tile .dash-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
  margin-block-start: 2px;
}
.dash-tile.skeleton-tile { box-shadow: var(--shadow-xs); }
/* Tone shown as a small dot before the label rather than a coloured edge. */
.dash-tile .dash-label::before,
.dash-lead-tile .dash-lead-label::before {
  content: "";
  display: inline-block;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--tone);
  margin-inline-end: 7px;
  vertical-align: 1px;
}

.dash-lead-tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}
.dash-lead-tile { --tone: var(--tone-grey); }
.dash-lead-tile[class*="tone-"] { border-left-color: var(--line); }
.dash-lead-tile.tone-blue   { --tone: var(--blue); }
.dash-lead-tile.tone-yellow { --tone: var(--status-upcoming); }
.dash-lead-tile.tone-green  { --tone: var(--status-valid); }
.dash-lead-tile.tone-red    { --tone: var(--status-expired); }
:root[data-theme="dark"] .dash-tone-blue .dash-count { color: #8ab8ee; }
:root[data-theme="dark"] .dash-tile.dash-tone-blue,
:root[data-theme="dark"] .dash-lead-tile.tone-blue { --tone: #8ab8ee; }
.dash-lead-count { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

.dash-byline-track { border-radius: var(--radius-pill); }
.dash-byline-bar   { border-radius: var(--radius-pill); }

/* ---------------------------------------------------------- segmented tabs */
.tab-switch {
  background: #e8ecf2;
  padding: 4px;
  border-radius: 12px;
  gap: 2px;
}
:root[data-theme="dark"] .tab-switch { background: var(--surface-2); }
.tab-pill {
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--muted);
}
.tab-pill:hover { color: var(--ink); }
.tab-pill.current {
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .tab-pill.current { color: var(--ink); }

/* --------------------------------------------------------------- tables */
.table-scroll {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
thead th {
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 14px;
  border-block-end: 1px solid var(--line);
}
tbody td {
  padding: 12px 14px;
  border-block-end: 1px solid var(--line-soft);
  vertical-align: middle;
}
tbody tr:last-child td { border-block-end: 0; }
tbody tr:hover { background: var(--row-hover); }

/* -------------------------------------------------------------- buttons */
.primary, button.primary, .btn-primary {
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: var(--weight-semibold);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.primary:hover, button.primary:hover:not(:disabled) {
  box-shadow: 0 4px 10px rgba(30, 78, 140, 0.25);
}
.ghost, button.ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-xs);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ghost:hover, button.ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: #c3ccd9;
}
:root[data-theme="dark"] .ghost:hover,
:root[data-theme="dark"] button.ghost:hover:not(:disabled) { border-color: #465068; }
.ghost.small, button.small { border-radius: 8px; }
button:focus-visible, .primary:focus-visible, .ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* --------------------------------------------------------------- fields */
input[type="text"], input[type="email"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"],
input[type="password"], input[type="search"], input[type="url"],
input[type="tel"], select, textarea {
  background: var(--card);
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover:not(:disabled):not(:focus),
select:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) { border-color: #c3ccd9; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
input:disabled, select:disabled, textarea:disabled,
input[readonly], textarea[readonly] {
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
}

/* ------------------------------------------------------ pills and chips */
.status, .line-chip, .plat-chip, .statuswrap {
  border-radius: var(--radius-pill);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
}
.navcount { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- stepper */
.step {
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

/* ----------------------------------------------------- bulk-action bars */
.bulk-bar {
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

/* A bar that lives inside a table card becomes the card's toolbar strip. */
.table-scroll > .bulk-bar {
  position: static;
  margin: 0;
  border: 0;
  border-block-end: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: none;
  background: var(--card);
  padding: 10px 14px;
}
.lead-act .primary { white-space: nowrap; }

/* ---------------------------------------------------------- small screens */
@media (max-width: 720px) {
  .sidebar { padding: 8px 12px; position: static; }
  .main { padding: 18px 14px 40px; }
  .main h2 { font-size: 22px; }
}
