/* ================================================================
   Command Centre
   Distinctive palette: graphite surfaces + sunset-amber accent +
   supporting teal for data. Feels like dawn on the highway.
   ================================================================ */

:root, [data-theme="light"] {
  /* Surfaces — warm off-white paper */
  --bg:              #f4f1ec;
  --surface:         #ffffff;
  --surface-2:       #faf7f2;
  --surface-offset:  #eeeae2;
  --surface-sunken:  #e6e2d9;
  --border:          #d9d3c7;
  --divider:         #e5dfd2;

  /* Text */
  --text:            #1a1a1c;
  --text-muted:      #6b6a64;
  --text-faint:      #a6a49b;
  --text-inverse:    #faf7f2;

  /* Sunset Amber (primary) — for CTAs & highlights */
  --amber:           #e07a1f;
  --amber-hover:     #c96612;
  --amber-active:    #a3510c;
  --amber-soft:      #fbe6d1;

  /* Highway Teal (secondary/data) */
  --teal:            #0f6e73;
  --teal-hover:      #0a555a;
  --teal-soft:       #cfe4e5;

  /* Status */
  --success:         #2f7d3b;
  --success-soft:    #d2e7d5;
  --danger:          #b02a37;
  --danger-soft:     #f2d4d7;
  --warning:         #b8791a;
  --warning-soft:    #f6e2c1;
  --info:            #2c5aa0;
  --info-soft:       #d3dff0;

  /* Chart series */
  --c1: #e07a1f;
  --c2: #0f6e73;
  --c3: #2c5aa0;
  --c4: #b02a37;
  --c5: #7a4b9c;
  --c6: #b8791a;

  --shadow-sm: 0 1px 2px rgba(30, 24, 12, 0.06);
  --shadow-md: 0 4px 14px rgba(30, 24, 12, 0.08);
  --shadow-lg: 0 20px 40px rgba(30, 24, 12, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg:              #0e0e10;
  --surface:         #17171a;
  --surface-2:       #1c1c20;
  --surface-offset:  #212126;
  --surface-sunken:  #0a0a0c;
  --border:          #2b2b31;
  --divider:         #23232a;

  --text:            #ecebe6;
  --text-muted:      #9c9a92;
  --text-faint:      #5f5d57;
  --text-inverse:    #17171a;

  --amber:           #f38f34;
  --amber-hover:     #ffa752;
  --amber-active:    #ffb872;
  --amber-soft:      #3b2718;

  --teal:            #4fb2b8;
  --teal-hover:      #66c9cf;
  --teal-soft:       #1a3538;

  --success:         #6dc07a;
  --success-soft:    #1e3a24;
  --danger:          #e97682;
  --danger-soft:     #3c1e22;
  --warning:         #e2a558;
  --warning-soft:    #3a2a15;
  --info:            #7ea8dc;
  --info-soft:       #1e2a3d;

  --c1: #f38f34;
  --c2: #4fb2b8;
  --c3: #7ea8dc;
  --c4: #e97682;
  --c5: #b891d8;
  --c6: #e2a558;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* ---------- Reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
}

.mono, .num {
  font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums lining-nums;
}

button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hover); }

::selection { background: var(--amber-soft); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Dashboard shell ---------- */

.dashboard {
  --sidebar-w: 240px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  height: 100dvh;
  transition: grid-template-columns 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.dashboard.dashboard-collapsed {
  --sidebar-w: 60px;
}

.sidebar {
  grid-row: 1 / -1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
  position: relative;
}

/* Collapse button in sidebar (visible when expanded, hidden when collapsed) */
.sidebar-collapse-btn {
  margin-left: auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: var(--surface-offset); color: var(--text); border-color: var(--border); }
.sidebar-collapse-btn svg { width: 14px; height: 14px; }

/* Expand button in header (hidden by default, visible only when collapsed on desktop) */
.icon-btn.sidebar-expand-btn { display: none; }
.dashboard-collapsed .icon-btn.sidebar-expand-btn { display: grid; }

/* ---------- Collapsed sidebar state (desktop only, icons-only rail) ---------- */
.dashboard-collapsed .sidebar-brand {
  padding: 20px 8px 16px;
  justify-content: center;
}
.dashboard-collapsed .sidebar-brand-text,
.dashboard-collapsed .sidebar-collapse-btn,
.dashboard-collapsed .sidebar-foot,
.dashboard-collapsed .nav-group-label {
  display: none;
}
.dashboard-collapsed .sidebar-nav {
  padding: 12px 6px;
  align-items: center;
  gap: 4px;
}
.dashboard-collapsed .nav-item {
  justify-content: center;
  padding: 10px 8px;
  width: 44px;
  gap: 0;
  font-size: 0;               /* collapses text-node label to zero width */
  overflow: hidden;
}
.dashboard-collapsed .nav-item svg {
  width: 18px; height: 18px; opacity: 0.9;
  flex-shrink: 0;
}

.sidebar-brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--text);
  color: var(--surface);
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.sidebar-brand-text .name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.sidebar-brand-text .sub  { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

.sidebar-nav {
  padding: 12px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 14px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface-offset); color: var(--text); }
.nav-item.active {
  background: var(--surface-offset);
  color: var(--text);
  border-color: var(--border);
}
.nav-item.active .nav-dot { background: var(--amber); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }

.sidebar-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--divider);
  font-size: 11px;
  color: var(--text-faint);
}
.sidebar-foot strong { color: var(--text-muted); font-weight: 600; }

/* ---------- Header ---------- */

.header {
  grid-column: 2;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface), transparent 5%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.header-title .h1 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.header-title .sub { font-size: 11px; color: var(--text-muted); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-offset);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.pill.live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--success), transparent 75%);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-offset);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
}
.icon-btn:hover { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Main ---------- */

.main {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  scroll-behavior: smooth;
}

/* Page sections (SPA) */
.view { display: none; animation: fadein 260ms ease-out; }
.view.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}
.section-head h2 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.015em;
}
.section-head p {
  font-size: 13px; color: var(--text-muted); margin-top: 2px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.card-title-lg {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.005em;
  margin-bottom: 14px;
}
.card-sub { font-size: 12px; color: var(--text-muted); }

/* ---------- KPI grid ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--amber);
}
.kpi.teal::before   { background: var(--teal);    }
.kpi.success::before{ background: var(--success); }
.kpi.danger::before { background: var(--danger);  }
.kpi.info::before   { background: var(--info);    }

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  color: var(--text);
}
.kpi-value.mono { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.kpi-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-meta .delta { font-weight: 600; }
.kpi-meta .delta.up { color: var(--success); }
.kpi-meta .delta.down { color: var(--danger); }

/* ---------- Grids ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-12 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-12 { grid-template-columns: 1fr; }
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--divider);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data thead th {
  background: var(--surface-offset);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.strong { font-weight: 600; color: var(--text); }
table.data tfoot td {
  padding: 12px;
  background: var(--surface-offset);
  font-weight: 700;
  color: var(--text);
  border-top: 2px solid var(--border);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-offset);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.info    { background: var(--info-soft);    color: var(--info);    border-color: transparent; }
.badge.amber   { background: var(--amber-soft);   color: var(--amber-active); border-color: transparent; }
.badge.teal    { background: var(--teal-soft);    color: var(--teal-hover);   border-color: transparent; }

/* ---------- Progress ---------- */

.progress {
  width: 100%;
  height: 8px;
  background: var(--surface-sunken);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--amber-hover));
  border-radius: 999px;
  transition: width 400ms ease;
}
.progress.teal > span    { background: linear-gradient(90deg, var(--teal), var(--teal-hover)); }
.progress.success > span { background: var(--success); }
.progress.danger > span  { background: var(--danger); }

/* ---------- Calculator ---------- */

.calc-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-offset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  width: fit-content;
}
.calc-tab {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.calc-tab:hover { color: var(--text); }
.calc-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-panel { display: none; }
.calc-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .calc-panel.active { grid-template-columns: 1fr; } }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex; justify-content: space-between; align-items: center;
}
.field label .hint { color: var(--text-faint); text-transform: none; letter-spacing: 0; font-weight: 400; }

.input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 14px;
  transition: var(--transition);
  font-variant-numeric: tabular-nums;
}
.input:focus {
  outline: none;
  border-color: var(--amber);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--amber-soft);
}
.input.prefix-currency {
  padding-left: 24px;
}
.input-wrap { position: relative; }
.input-wrap::before {
  content: "$";
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 13px;
  pointer-events: none;
}
.input-wrap.no-prefix::before { content: none; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.result-panel {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--divider);
  gap: 12px;
}
.result-row:last-child { border-bottom: none; }
.result-row .k { font-size: 12px; color: var(--text-muted); }
.result-row .v {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 14px;
}
.result-row.highlight .v { color: var(--amber); font-size: 16px; }
.result-row.total {
  border-top: 2px solid var(--text);
  border-bottom: none;
  margin-top: 8px;
  padding-top: 14px;
}
.result-row.total .k { font-size: 13px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; }
.result-row.total .v { font-size: 20px; color: var(--amber); }
.result-row.positive .v { color: var(--success); }
.result-row.negative .v { color: var(--danger); }

.divider-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 14px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}

/* ---------- Chart canvases ---------- */

.chart-wrap {
  position: relative;
  width: 100%;
}
.chart-wrap.h-200 { height: 200px; }
.chart-wrap.h-260 { height: 260px; }
.chart-wrap.h-320 { height: 320px; }

/* ---------- Utility ---------- */

.flex { display: flex; }
.flex.between { justify-content: space-between; }
.flex.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.tabular { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-amber { color: var(--amber); }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }

/* ---------- Scrollbar polish ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---------- Mobile: sidebar collapses ---------- */
@media (max-width: 900px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 260ms ease;
    z-index: 20;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .header, .main { grid-column: 1; }
  .mobile-menu-toggle { display: grid !important; }
  /* On mobile the desktop collapse UI is not applicable; force expanded chrome */
  .dashboard.dashboard-collapsed { grid-template-columns: 1fr; }
  .dashboard.dashboard-collapsed .sidebar-brand,
  .dashboard.dashboard-collapsed .sidebar-brand-text,
  .dashboard.dashboard-collapsed .sidebar-foot,
  .dashboard.dashboard-collapsed .nav-group-label { display: flex; }
  .dashboard.dashboard-collapsed .nav-group-label { display: block; }
  .dashboard.dashboard-collapsed .nav-item { width: auto; justify-content: flex-start; padding: 8px 12px; gap: 10px; font-size: 13px; color: var(--text-muted); overflow: visible; }
  .dashboard.dashboard-collapsed .sidebar-collapse-btn { display: grid; }
  .dashboard.dashboard-collapsed .sidebar-expand-btn { display: none; }
}
.mobile-menu-toggle { display: none; }

/* ---------- Enquiries: Kanban board ---------- */
.badge.purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; border-color: transparent; }
[data-theme="dark"] .badge.purple { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; }

.input.input-sm {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
  min-width: 150px;
}

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 4px 8px;
  border-bottom: 1px dashed var(--divider);
}
.kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.kanban-col-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-xs);
  cursor: default;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kanban-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--amber);
}
.kanban-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-card-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  line-height: 1.25;
}
.kanban-card-veh {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}
.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--divider);
  font-size: 11px;
  color: var(--text-muted);
}
.kanban-card-budget {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 600;
  color: var(--text);
}
.kanban-card-next {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* Temperature dot */
.temp-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.temp-dot.hot  { background: var(--danger); box-shadow: 0 0 0 2px rgba(220,53,69,0.15); }
.temp-dot.warm { background: var(--amber);  box-shadow: 0 0 0 2px rgba(224,122,31,0.15); }
.temp-dot.cold { background: var(--text-faint); }

.kanban-empty {
  padding: 14px 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  font-style: italic;
}

/* ---------- HubSpot sync banner ---------- */
.hs-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-left: 3px solid var(--amber, #ff7a1a);
}
.hs-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hs-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success, #10b981);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  animation: hs-pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes hs-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }
  50%      { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.05); }
}
.hs-banner-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.hs-banner-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms ease;
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--amber, #ff7a1a);
  color: var(--amber, #ff7a1a);
}
.link {
  color: var(--amber, #ff7a1a);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.link:hover { text-decoration: underline; }

/* Kanban card as anchor */
a.kanban-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.kanban-card:hover .kanban-card-next {
  color: var(--amber, #ff7a1a);
}

/* Purple KPI accent */
.kpi-purple { border-left-color: #8b5cf6; }

/* ---------- Sheets sync banner (Calculators) ---------- */
.hs-banner.sheets-banner {
  border-left-color: var(--teal, #0ea5a4);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal, #0ea5a4);
  border-radius: 8px;
  background: var(--surface, rgba(14,165,164,0.03));
}
.hs-banner.sheets-banner .sheets-dot {
  background: var(--teal, #0ea5a4);
  box-shadow: 0 0 0 4px rgba(14, 165, 164, 0.15);
}
.hs-banner-right {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.hs-banner.sheets-banner.status-dirty {
  border-left-color: var(--amber, #ff7a1a);
}
.hs-banner.sheets-banner.status-dirty .sheets-dot {
  background: var(--amber, #ff7a1a);
  box-shadow: 0 0 0 4px rgba(255, 122, 26, 0.15);
}
.hs-banner.sheets-banner.status-error {
  border-left-color: #ef4444;
}
.hs-banner.sheets-banner.status-error .sheets-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* Highlight edited inputs */
.input.dirty {
  border-color: var(--amber, #ff7a1a) !important;
  background: rgba(255, 122, 26, 0.04);
}

/* Budget breakdown tables (inline-editable rows) */
.budget-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.budget-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.budget-row:last-child { border-bottom: none; }
.budget-row.budget-total {
  border-top: 2px solid var(--border, rgba(255,255,255,0.12));
  border-bottom: none;
  padding-top: 12px;
  margin-top: 4px;
  font-weight: 600;
}
.budget-row-label {
  font-size: 14px;
  color: var(--text, #e5e7eb);
}
.budget-row-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  margin-top: 2px;
}
.budget-row-input {
  width: 140px;
  padding: 6px 10px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: var(--surface-2, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.10));
  border-radius: 6px;
  color: var(--text, #e5e7eb);
  font-size: 14px;
}
.budget-row-input:focus {
  outline: none;
  border-color: var(--teal, #14b8a6);
  background: rgba(20, 184, 166, 0.05);
}
.budget-row-input.dirty {
  border-color: var(--amber, #ff7a1a);
  background: rgba(255, 122, 26, 0.06);
}
.budget-row-input.negative { color: #ef4444; }

/* Editable cells in liabilities data table */
.data td.editable {
  position: relative;
  padding: 4px 8px;
}
.data td.editable .cell-input {
  width: 100%;
  min-width: 90px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  text-align: inherit;
  font-variant-numeric: tabular-nums;
}
.data td.editable .cell-input:hover {
  border-color: var(--border, rgba(255,255,255,0.12));
}
.data td.editable .cell-input:focus {
  outline: none;
  border-color: var(--teal, #14b8a6);
  background: rgba(20, 184, 166, 0.05);
}
.data td.editable .cell-input.dirty {
  border-color: var(--amber, #ff7a1a);
  background: rgba(255, 122, 26, 0.06);
}

/* CODB frequency dropdown */
.data td.editable .cell-select {
  width: 100%;
  min-width: 100px;
  padding: 4px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 22px;
  opacity: 0.9;
}
.data td.editable .cell-select:hover {
  border-color: var(--border, rgba(255,255,255,0.12));
}
.data td.editable .cell-select:focus {
  outline: none;
  border-color: var(--teal, #14b8a6);
  background-color: rgba(20, 184, 166, 0.05);
}
.data td.editable .cell-select.dirty {
  border-color: var(--amber, #ff7a1a);
  background-color: rgba(255, 122, 26, 0.06);
}
.data td.editable .cell-select option { color: #111; }

/* CODB category row header (spans full width above group) */
.data tbody tr.codb-cat-header td {
  background: rgba(20, 184, 166, 0.04);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #9ca3af);
  padding: 10px 12px 4px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}

/* --- Cash Flow Projection view --- */
.text-warning { color: var(--warning, #d97706); }
.muted-link { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--border); }
.muted-link:hover { color: var(--text); }
table.data.compact th, table.data.compact td { padding: 6px 10px; font-size: 13px; }
table.data.compact tr.total-row td { border-top: 1px solid var(--border); padding-top: 10px; }
table.data.compact tr:hover td { background: transparent; }
.cashflow-table th, .cashflow-table td { font-size: 13px; padding: 8px 10px; white-space: nowrap; }
.cashflow-table td:first-child { min-width: 90px; }
.cashflow-table td.editable .cell-input { width: 100px; text-align: right; padding: 4px 8px; }
#cashflow-table { overflow-x: auto; }

/* --- Valuations view --- */
.val-form { display: flex; flex-direction: column; gap: 14px; }
.val-form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.val-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.val-field-narrow { flex: 0 0 130px; min-width: 130px; }
.val-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.val-field input, .val-field select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
}
.val-field input:focus, .val-field select:focus { outline: none; border-color: var(--accent, var(--primary, #0d9488)); }
.val-form-sources { align-items: center; gap: 20px; padding-top: 8px; border-top: 1px dashed var(--border); }
.val-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.val-check input { margin: 0; }
.src-tag { font-size: 10px; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.src-tag-ok { background: rgba(13, 148, 136, 0.15); color: #0d9488; }
.src-tag-warn { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.src-tag-manual { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.val-saved-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--border); }
.val-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.val-chip {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.val-chip:hover { border-color: var(--primary, #0d9488); color: var(--primary, #0d9488); }
.val-chip.active { background: var(--primary, #0d9488); color: white; border-color: var(--primary, #0d9488); }
.val-stat-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.val-stat-item:last-child { border-bottom: none; }
.val-stat-item strong { font-variant-numeric: tabular-nums; }
.val-source-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.val-source-item:last-child { border-bottom: none; }
.val-source-status { font-size: 11px; padding: 2px 6px; border-radius: 3px; }
.val-source-status.ok { background: rgba(13, 148, 136, 0.15); color: #0d9488; }
.val-source-status.warn { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.val-source-status.err { background: rgba(220, 38, 38, 0.15); color: #dc2626; }
.val-source-status.manual { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.valuations-table th, .valuations-table td { font-size: 12px; padding: 8px 8px; }
.valuations-table td.desc-cell { max-width: 260px; }
.valuations-table td.extras-cell { max-width: 180px; font-size: 11px; color: var(--muted); }
.valuations-table a.listing-link { color: var(--primary, #0d9488); text-decoration: none; }
.valuations-table a.listing-link:hover { text-decoration: underline; }
.valuations-table .platform-tag { font-size: 10px; padding: 2px 6px; border-radius: 3px; background: var(--surface); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.03em; }
.valuations-table .seller-dealer { color: #d97706; font-weight: 600; }
.valuations-table .seller-private { color: #0d9488; font-weight: 600; }
#valuations-table { overflow-x: auto; }
.val-fbm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.val-fbm-comp {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px;
}
.mt-3 { margin-top: 12px; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: 1fr; } }

/* Primary CTA (used in Valuations banner) */
.btn-primary-cta {
  background: var(--primary, #0d9488);
  color: white !important;
  border-color: var(--primary, #0d9488) !important;
}
.btn-primary-cta:hover {
  background: color-mix(in oklab, var(--primary, #0d9488) 85%, black);
  border-color: color-mix(in oklab, var(--primary, #0d9488) 85%, black) !important;
}

/* Deep-link buttons in the Valuations search form */
.val-deeplink {
  background: transparent;
  border: 1px dashed color-mix(in oklab, var(--fg, #333) 25%, transparent);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--fg, #333);
  cursor: pointer;
}
.val-deeplink:hover {
  border-color: var(--primary, #0d9488);
  color: var(--primary, #0d9488);
}
.val-deeplink-hint {
  font-size: 11px;
  color: color-mix(in oklab, var(--fg, #333) 55%, transparent);
  margin-left: 8px;
}
td.nowrap { white-space: nowrap; }

/* ============ Market Trends view ============ */
.trends-range-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.trends-range-tabs {
  display: inline-flex;
  gap: 4px;
  background: color-mix(in oklab, var(--fg, #333) 6%, transparent);
  padding: 4px;
  border-radius: 8px;
}
.trends-range-tab {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: color-mix(in oklab, var(--fg, #333) 65%, transparent);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.trends-range-tab:hover {
  color: var(--fg, #333);
}
.trends-range-tab.active {
  background: white;
  color: var(--primary, #0d9488);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.trends-range-hint {
  font-size: 12px;
  color: color-mix(in oklab, var(--fg, #333) 55%, transparent);
  margin-left: auto;
}
.chart-wrap { position: relative; height: 260px; }
.chart-wrap-tall { height: 320px; }
.trends-table th, .trends-table td { padding: 10px 12px; font-size: 13px; }
.trends-arrow-up { color: #16a34a; }
.trends-arrow-down { color: #dc2626; }
.trends-arrow-flat { color: color-mix(in oklab, var(--fg, #333) 45%, transparent); }
.watchlist-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.watchlist-badge-on { background: color-mix(in oklab, #16a34a 18%, transparent); color: #15803d; }
.watchlist-badge-off { background: color-mix(in oklab, var(--fg, #333) 10%, transparent); color: color-mix(in oklab, var(--fg, #333) 60%, transparent); }

/* Credit usage panel */
.credit-card { margin-bottom: 16px; }
.credit-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.credit-window-tabs { display: inline-flex; background: var(--surface-2, #f4f4f6); border-radius: 8px; padding: 3px; gap: 2px; }
.credit-window-tab { border: 0; background: transparent; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--text-2, #64707a); border-radius: 6px; cursor: pointer; transition: all 0.15s; }
.credit-window-tab:hover { color: var(--text-1, #1a1a1c); }
.credit-window-tab.active { background: var(--surface-1, #fff); color: var(--text-1, #1a1a1c); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.credit-summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.credit-stat { background: var(--surface-2, #f8f8fa); border: 1px solid var(--border-1, #e5e6e9); border-radius: 8px; padding: 10px 12px; }
.credit-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2, #64707a); margin-bottom: 4px; font-weight: 600; }
.credit-stat-value { font-size: 20px; font-weight: 600; color: var(--text-1, #1a1a1c); font-variant-numeric: tabular-nums; }
.credit-stat-value.credit-stat-activity { font-size: 13px; font-weight: 500; line-height: 1.35; }
.credit-stat-sub { font-size: 11px; color: var(--text-2, #64707a); margin-top: 3px; }
.credit-entry-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; background: var(--surface-2, #f8f8fa); border: 1px dashed var(--border-1, #d1d3d8); border-radius: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.credit-entry-label { display: flex; flex-direction: column; gap: 2px; }
.credit-entry-hint { font-size: 11px; color: var(--text-2, #64707a); }
.credit-entry-controls { display: inline-flex; gap: 8px; align-items: center; }
.credit-entry-controls input[type="number"] { width: 100px; padding: 7px 10px; border: 1px solid var(--border-1, #d1d3d8); border-radius: 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.credit-entry-controls input[type="text"] { width: 220px; padding: 7px 10px; border: 1px solid var(--border-1, #d1d3d8); border-radius: 6px; font-size: 14px; }
.credit-history-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--border-1, #e5e6e9); border-radius: 8px; }
.credit-history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.credit-history-table thead th { position: sticky; top: 0; background: var(--surface-2, #f4f4f6); text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2, #64707a); border-bottom: 1px solid var(--border-1, #e5e6e9); font-weight: 600; }
.credit-history-table tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border-1, #eff0f2); font-variant-numeric: tabular-nums; }
.credit-history-table tbody tr:last-child td { border-bottom: 0; }
.credit-history-table tbody tr:hover { background: var(--surface-2, #f8f8fa); }
.credit-history-empty { padding: 20px; text-align: center; color: var(--text-2, #64707a); font-size: 13px; }
.credit-actual-input-inline { width: 70px; padding: 4px 6px; border: 1px solid var(--border-1, #d1d3d8); border-radius: 4px; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.credit-note-input-inline { width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; background: transparent; }
.credit-note-input-inline:hover, .credit-note-input-inline:focus { border-color: var(--border-1, #d1d3d8); background: var(--surface-1, #fff); outline: none; }

@media (max-width: 900px) {
  .credit-summary-row { grid-template-columns: repeat(2, 1fr); }
  .credit-entry-row { flex-direction: column; align-items: stretch; }
  .credit-entry-controls { flex-wrap: wrap; }
  .credit-entry-controls input[type="text"] { flex: 1; min-width: 140px; }
}

/* Credit panel v2 additions */
.credit-controls { display: inline-flex; gap: 12px; align-items: center; }
.credit-status-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2, #64707a); cursor: pointer; user-select: none; }
.credit-status-toggle input { margin: 0; cursor: pointer; }
.credit-summary-row-5 { grid-template-columns: repeat(5, 1fr); }
.credit-stat-hero { background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(13, 148, 136, 0.02) 100%); border-color: rgba(13, 148, 136, 0.3); }
.credit-stat-hero .credit-stat-value { color: #0d9488; }
.credit-platform-row { display: flex; align-items: center; gap: 16px; padding: 10px 12px; background: var(--surface-2, #f8f8fa); border: 1px solid var(--border-1, #e5e6e9); border-radius: 8px; margin-bottom: 12px; }
.credit-platform-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2, #64707a); font-weight: 600; white-space: nowrap; min-width: 180px; }
.credit-platform-bars { flex: 1; display: flex; height: 24px; border-radius: 4px; overflow: hidden; background: var(--surface-1, #fff); border: 1px solid var(--border-1, #e5e6e9); }
.credit-platform-bar { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; transition: all 0.2s; }
.credit-platform-bar.platform-ccs { background: #0d9488; }
.credit-platform-bar.platform-trv { background: #d97706; }
.credit-platform-bar.platform-gumtree { background: #7c3aed; }
.credit-platform-bar.platform-fb { background: #2563eb; }
.credit-platform-bar.platform-empty { background: transparent; color: var(--text-2, #64707a); flex: 1; text-align: center; font-size: 12px; font-weight: 500; }
.credit-platform-legend { display: flex; gap: 12px; margin-left: auto; font-size: 11px; color: var(--text-2, #64707a); flex-wrap: wrap; }
.credit-platform-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.credit-platform-legend-swatch { width: 8px; height: 8px; border-radius: 2px; }
.credit-status-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.credit-status-badge.status-ok { background: rgba(13, 148, 136, 0.12); color: #0d7c72; }
.credit-status-badge.status-partial { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.credit-status-badge.status-failed { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }

@media (max-width: 1200px) {
  .credit-summary-row-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .credit-summary-row-5 { grid-template-columns: repeat(2, 1fr); }
  .credit-platform-row { flex-direction: column; align-items: stretch; }
  .credit-platform-label { min-width: 0; }
  .credit-controls { flex-wrap: wrap; }
}

/* ============================================================
 *  LISTINGS BUILDER
 * ============================================================ */
.form-field { display:flex; flex-direction:column; gap:6px; }
.form-field label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-field .input, .form-field textarea.input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
}
.form-field textarea.input { resize: vertical; min-height: 120px; }
.form-field .input:focus {
  outline: none;
  border-color: var(--accent, #EB4724);
  box-shadow: 0 0 0 3px rgba(235, 71, 36, 0.15);
}

.feature-group {
  border: 1px solid var(--divider);
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--surface);
}
.feature-group summary {
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feature-group summary::before {
  content: '';
  width: 8px; height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
  margin-right: 4px;
}
.feature-group[open] summary::before { transform: rotate(45deg); }
.feature-group-label { font-size: 13px; color: var(--fg); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 12px;
  padding: 0 14px 14px;
}
.feature-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.feature-check:hover { background: var(--hover, rgba(0,0,0,0.03)); }
.feature-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--accent, #EB4724);
  cursor: pointer;
}
.feature-check span { line-height: 1.3; }

.listing-preview {
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--divider);
  max-height: 600px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}
.listing-preview h2 { font-size: 22px; margin: 0 0 8px; font-weight: 700; }
.listing-preview h3 { font-size: 15px; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.listing-preview table { width: 100%; border-collapse: collapse; }
.listing-preview table th {
  text-align: left; padding: 6px 12px 6px 0;
  font-weight: 500; color: var(--muted);
  vertical-align: top;
  width: 130px;
}
.listing-preview table td { padding: 6px 0; }
.listing-preview ul { padding-left: 20px; }
.listing-preview li { padding: 2px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, filter 0.1s;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
}
.btn:hover { filter: brightness(0.98); }
.btn.primary {
  background: var(--accent, #EB4724);
  color: white;
  border-color: var(--accent, #EB4724);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost {
  background: transparent;
  border-color: var(--divider);
}
.btn.ghost:hover { background: rgba(0,0,0,0.03); }
.btn.ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ==========================================================
   MOISTURE & WATER INGRESS INSPECTIONS
   ========================================================== */
.btn-icon {
  width: 32px; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1;
}

/* Master section toggle panel */
.section-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px 14px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--divider);
  border-radius: 8px;
  margin-bottom: 16px;
}
.section-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer;
  color: var(--text);
}
.section-toggle input { margin: 0; }

/* Individual inspection section card */
.insp-section {
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent, #EB4724);
  border-radius: 8px;
  margin-bottom: 14px;
  background: var(--surface, #fff);
  transition: border-left-color 0.15s ease, opacity 0.15s ease;
}
.insp-section.insp-off {
  border-left-color: var(--divider);
  opacity: 0.55;
}
.insp-section.insp-off .insp-section-body {
  display: none;
}
.insp-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
  gap: 12px;
}
.insp-section.insp-off .insp-section-head {
  border-bottom: none;
}
.insp-section-title {
  font-size: 15px; font-weight: 600; color: var(--text);
}
.insp-section-sub {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.insp-toggle-inline {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap;
}
.insp-toggle-inline input { margin: 0; }
.insp-section-body {
  padding: 14px 16px;
}

/* Field grid */
.insp-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 14px;
}
.insp-field-grid .form-field.wide-2 { grid-column: span 2; }
.insp-field-grid .form-field.full { grid-column: 1 / -1; }
.form-field label {
  display: block; font-size: 11.5px;
  color: var(--text-muted); margin-bottom: 3px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.form-field textarea.input {
  min-height: 70px; font-family: inherit; resize: vertical;
}

/* Point-by-point inspection rows */
.insp-rows {
  display: flex; flex-direction: column; gap: 6px;
}
.insp-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px; align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--divider);
}
.insp-row:last-child { border-bottom: none; }
.insp-row-label { font-size: 13px; color: var(--text); }

/* Reading log */
.reading-log {
  display: flex; flex-direction: column; gap: 4px;
  overflow-x: auto;
}
.reading-header,
.reading-row {
  display: grid;
  grid-template-columns: 2fr 0.6fr 0.9fr 1fr 1fr 2fr 34px;
  gap: 8px; align-items: center;
}
.reading-header {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.03em; padding: 8px 0 4px;
  border-bottom: 1px solid var(--divider);
}
.reading-row .input { padding: 5px 8px; font-size: 13px; }

/* Damage rows */
.damage-rows {
  display: flex; flex-direction: column; gap: 4px;
  overflow-x: auto;
}
.damage-header,
.damage-row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1fr 1.4fr 1.4fr 34px;
  gap: 8px; align-items: center;
}
.damage-header {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.03em; padding: 8px 0 4px;
  border-bottom: 1px solid var(--divider);
}
.damage-row .input { padding: 5px 8px; font-size: 13px; }

/* Recommendations */
.rec-rows {
  display: flex; flex-direction: column; gap: 4px;
}
.rec-header,
.rec-row {
  display: grid;
  grid-template-columns: 40px 3fr 1.3fr 34px;
  gap: 8px; align-items: center;
}
.rec-header {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.03em; padding: 8px 0 4px;
  border-bottom: 1px solid var(--divider);
}
.rec-pri {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent, #EB4724); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.rec-row .input { padding: 5px 8px; font-size: 13px; }

/* Repair items */
.repair-items {
  display: flex; flex-direction: column; gap: 8px;
}
.repair-item-row {
  display: flex; gap: 12px; align-items: center;
}
.repair-item-row .input { flex: 1; padding: 5px 8px; font-size: 13px; }

/* Photo dropzone */
.dropzone {
  border: 2px dashed var(--divider);
  border-radius: 8px;
  background: rgba(0,0,0,0.015);
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-top: 8px;
  padding: 12px;
}
.dropzone-hover {
  border-color: var(--accent, #EB4724);
  background: rgba(235, 71, 36, 0.05);
}
.dropzone-body {
  min-height: 80px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  cursor: pointer; text-align: center;
  color: var(--text-muted); font-size: 13px;
}
.dropzone-body .dropzone-hint {
  font-size: 11px; color: var(--text-muted); opacity: 0.7;
}
.dropzone-input { display: none; }
.dropzone-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.dropzone-previews:empty { margin-top: 0; }
.photo-thumb {
  position: relative;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.photo-thumb img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  display: block;
}
.photo-caption-wrap {
  padding: 8px;
  border-top: 1px solid var(--divider);
  display: flex; flex-direction: column; gap: 6px;
}
.photo-caption-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
  gap: 8px; flex-wrap: wrap;
}
.photo-caption-pos {
  display: inline-flex; gap: 2px;
  background: rgba(0,0,0,0.04);
  border-radius: 4px; padding: 2px;
}
.photo-caption-pos .pos-opt {
  position: relative;
  padding: 3px 8px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.03em;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.photo-caption-pos .pos-opt input {
  position: absolute; opacity: 0; pointer-events: none;
  width: 100%; height: 100%; top: 0; left: 0;
}
.photo-caption-pos .pos-opt:hover { color: var(--text); }
.photo-caption-pos .pos-opt.active {
  background: var(--accent, #EB4724); color: #fff;
}
.photo-thumb textarea.photo-caption {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--divider);
  border-radius: 6px;
  font-size: 12.5px; line-height: 1.4;
  font-family: inherit; color: var(--text);
  background: var(--surface, #fff);
  resize: vertical; min-height: 60px;
}
.photo-thumb textarea.photo-caption:focus {
  outline: none;
  border-color: var(--accent, #EB4724);
  box-shadow: 0 0 0 2px rgba(235,71,36,0.15);
}
.photo-remove {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: white; border: none;
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.photo-remove:hover { background: var(--accent, #EB4724); }

/* Status bar */
.inspection-toolbar {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface, #fff);
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.inspection-toolbar-left {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
#inspection-loader { min-width: 260px; }
#inspection-status {
  font-size: 12px; color: var(--text-muted);
  padding: 6px 10px; background: rgba(0,0,0,0.03); border-radius: 6px;
}

/* Small responsive tweaks */
@media (max-width: 900px) {
  .insp-row { grid-template-columns: 1fr; gap: 4px; }
  .reading-header, .damage-header, .rec-header { display: none; }
  .reading-row, .damage-row {
    grid-template-columns: 1fr 1fr 34px;
    grid-auto-flow: dense;
  }
  .rec-row { grid-template-columns: 40px 1fr 34px; }
}

/* Prevent min-content overflow in inspections view grids */
#view-inspections > div[style*="grid"] { min-width: 0; }
#view-inspections > div[style*="grid"] > * { min-width: 0; }
#view-inspections .card { min-width: 0; max-width: 100%; }
#view-inspections .insp-section-body { min-width: 0; overflow: hidden; }
#view-inspections .insp-section-body > div[style*="grid"] { min-width: 0; }
#view-inspections .reading-log,
#view-inspections .damage-rows { min-width: 0; overflow-x: auto; }

/* ==========================================================
   DEBTS & LOANS
   ========================================================== */
#view-debts { min-width: 0; }
#view-debts .card { min-width: 0; max-width: 100%; }

/* KPI accent card */
.kpi-card-accent {
  background: linear-gradient(135deg, rgba(235,71,36,0.08), rgba(235,71,36,0.02));
  border-color: rgba(235,71,36,0.4);
}
.kpi-card-accent .kpi-value { color: var(--accent, #EB4724); }

/* Strategy controls row */
.debts-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}
.debts-extra-row {
  display: flex; gap: 8px;
}
.debts-extra-row .input { flex: 1; }

/* Strategy summary panels */
.debts-strategy-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.strategy-panel {
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.015);
}
.strategy-panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.strategy-panel-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.strategy-panel-row strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.strategy-panel-accent {
  border-left: 3px solid var(--accent, #EB4724);
}
.strategy-panel-savings {
  background: linear-gradient(135deg, rgba(20,39,55,0.05), transparent);
  border-color: rgba(20,39,55,0.2);
}
.strategy-panel-savings .strategy-panel-title { color: var(--navy, #142737); }

/* Debts table */
.debts-table-wrap {
  border: 1px solid var(--divider);
  border-radius: 8px;
  overflow: hidden;
}
.debts-header, .debts-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.1fr 0.9fr 0.6fr 0.9fr 0.9fr 1.4fr 34px;
  gap: 6px;
  align-items: center;
}
.debts-header {
  padding: 10px 10px;
  background: rgba(0,0,0,0.03);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--divider);
}
.debts-header .num, .debts-row .num { text-align: right; }
.debts-rows {
  display: flex; flex-direction: column;
}
.debts-row {
  padding: 6px 10px;
  border-bottom: 1px solid var(--divider);
}
.debts-row:last-child { border-bottom: none; }
.debts-row .input {
  padding: 5px 8px;
  font-size: 13px;
  min-width: 0;
  width: 100%;
}
.debts-row > * { min-width: 0; }
.debts-row .input.num { text-align: right; font-variant-numeric: tabular-nums; }
.debts-empty {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Chart wrapper */
.debts-chart-wrap {
  height: 300px;
  margin-top: 12px;
  position: relative;
}

/* Milestones */
.debts-milestones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.milestone {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: rgba(0,0,0,0.015);
}
.milestone-num {
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent, #EB4724);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.milestone-name { font-size: 13px; font-weight: 600; color: var(--text); }
.milestone-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Schedule table */
.debts-schedule-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--divider);
  border-radius: 8px;
}
.debts-schedule {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.debts-schedule th, .debts-schedule td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
}
.debts-schedule th {
  background: rgba(0,0,0,0.03);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  position: sticky; top: 0; z-index: 1;
}
.debts-schedule th.num, .debts-schedule td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.debts-schedule td.mono {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.debts-schedule td.strong { font-weight: 600; }
.debts-schedule tr:last-child td { border-bottom: none; }
.debts-schedule td.cell-extra {
  background: rgba(235,71,36,0.08);
  color: var(--accent, #EB4724);
  font-weight: 600;
}
.debts-schedule td.cell-cleared {
  background: rgba(52,168,83,0.08);
  color: #2e7d3d;
  font-weight: 600;
}

/* Responsive tweaks */
@media (max-width: 1100px) {
  .debts-header, .debts-row {
    grid-template-columns: 1.5fr 1fr 1fr 0.9fr 0.6fr 0.9fr 0.9fr 34px;
  }
  .debts-header > div:nth-child(8),
  .debts-row > *:nth-child(8) { display: none; } /* hide notes column */
}
@media (max-width: 800px) {
  .debts-header { display: none; }
  .debts-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }
  .debts-row > *:nth-child(9) { grid-column: 1 / -1; text-align: right; }
}

/* Strategy toggle (avalanche / snowball) */
.debts-strategy-toggle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.strategy-opt {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  cursor: pointer;
  background: rgba(0,0,0,0.015);
  transition: border-color 0.15s, background 0.15s;
}
.strategy-opt input[type="radio"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent, #EB4724);
  width: 16px; height: 16px;
  cursor: pointer;
}
.strategy-opt:hover { border-color: var(--accent, #EB4724); }
.strategy-opt:has(input:checked) {
  border-color: var(--accent, #EB4724);
  background: rgba(235,71,36,0.06);
  box-shadow: 0 0 0 1px var(--accent, #EB4724) inset;
}
.strategy-opt-body { flex: 1; min-width: 0; }
.strategy-opt-title {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.strategy-opt-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}
.strategy-opt .badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(235,71,36,0.12);
  color: var(--accent, #EB4724);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.strategy-opt .badge-muted {
  background: rgba(20,39,55,0.1);
  color: var(--navy, #142737);
}

/* Extra-payment slider */
.debts-extra-row {
  align-items: center;
  flex-wrap: wrap;
}
.debts-slider {
  flex: 1;
  min-width: 180px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 4px;
  background: var(--divider);
  outline: none;
  cursor: pointer;
}
.debts-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent, #EB4724);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.debts-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent, #EB4724);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ============================================================================
 * RETAIL JOBS
 * ==========================================================================*/
#view-retail .retail-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--divider, #e6e6e6);
  border-radius: 12px;
  margin-bottom: 16px;
}
#view-retail .retail-toolbar-left,
#view-retail .retail-toolbar-right {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
#view-retail .retail-loader { min-width: 260px; max-width: 380px; }
#view-retail .retail-status {
  font-size: 12px; color: var(--text-muted, #667780);
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-alt, #f6f6f6);
  border: 1px dashed var(--divider, #e6e6e6);
}
#view-retail .retail-body { display: flex; flex-direction: column; gap: 16px; }
#view-retail .retail-card { padding: 18px 20px; }
#view-retail .retail-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 14px;
}
#view-retail .retail-card-actions {
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
#view-retail .retail-total-pill {
  font-size: 12px; color: var(--text-muted, #667780);
  background: var(--surface-alt, #f6f6f6);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--divider, #e6e6e6);
}
#view-retail .retail-total-pill span { font-weight: 600; color: var(--text, #142737); }

#view-retail .retail-grid { display: grid; gap: 12px; }
#view-retail .retail-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  #view-retail .retail-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #view-retail .retail-grid-3 { grid-template-columns: 1fr; }
}

/* Field labels — reuse existing .field but ensure spacing */
#view-retail .field { display: flex; flex-direction: column; gap: 4px; }
#view-retail .field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted, #667780); font-weight: 600;
}

/* Tables */
#view-retail .retail-table-wrap {
  overflow-x: auto; border: 1px solid var(--divider, #e6e6e6);
  border-radius: 8px;
}
#view-retail .retail-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
#view-retail .retail-table th {
  text-align: left; font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted, #667780);
  background: var(--surface-alt, #f6f6f6);
  padding: 8px 10px; border-bottom: 1px solid var(--divider, #e6e6e6);
  white-space: nowrap;
}
#view-retail .retail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--divider, #eee);
  vertical-align: middle;
}
#view-retail .retail-table tbody tr:last-child td { border-bottom: none; }
#view-retail .retail-table .retail-empty td {
  text-align: center; padding: 24px 8px;
  color: var(--text-muted, #667780); font-size: 13px;
}
#view-retail .retail-table td.tc { text-align: center; }

/* Inputs inside table cells */
#view-retail .input-cell {
  width: 100%; padding: 6px 8px; font-size: 13px;
  border: 1px solid transparent; background: transparent;
  border-radius: 4px;
}
#view-retail .input-cell:hover { background: var(--surface-alt, #fafafa); }
#view-retail .input-cell:focus {
  background: #fff; border-color: var(--accent, #EB4724);
  outline: none;
}
#view-retail .input-num { text-align: right; font-variant-numeric: tabular-nums; }

#view-retail .icon-btn-danger {
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted, #667780);
  width: 24px; height: 24px; border-radius: 4px;
  cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
#view-retail .icon-btn-danger:hover {
  color: #c62828; background: rgba(198, 40, 40, 0.08);
  border-color: rgba(198, 40, 40, 0.2);
}

#view-retail .check-inline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted, #667780);
  cursor: pointer;
}

/* Approval block */
#view-retail .retail-approval-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 800px) {
  #view-retail .retail-approval-grid { grid-template-columns: 1fr; }
}
#view-retail .retail-approval-block {
  padding: 14px; border: 1px solid var(--divider, #e6e6e6);
  border-radius: 10px;
  background: var(--surface-alt, #fafafa);
}
#view-retail .retail-approval-check {
  display: flex; gap: 10px; align-items: flex-start;
  cursor: pointer; margin-bottom: 10px;
}
#view-retail .retail-approval-check input[type="checkbox"] {
  margin-top: 3px; width: 18px; height: 18px; cursor: pointer;
  accent-color: var(--accent, #EB4724);
  flex-shrink: 0;
}
#view-retail .retail-approval-title {
  font-weight: 600; font-size: 14px; color: var(--text, #142737);
}
#view-retail .retail-approval-sub {
  font-size: 12px; color: var(--text-muted, #667780); margin-top: 2px;
}
#view-retail .retail-approval-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
#view-retail .retail-approval-notes { margin-top: 12px; }

/* Disabled Send-to-Xero button treatment */
#view-retail #btn-xero-retail:disabled {
  opacity: 0.5; cursor: not-allowed;
}

/* ============================================================================
 * WARRANTY JOBS — reuse retail styles across #view-warranty
 * ==========================================================================*/
#view-warranty .retail-toolbar,
#view-warranty .retail-toolbar-left,
#view-warranty .retail-toolbar-right,
#view-warranty .retail-loader,
#view-warranty .retail-status,
#view-warranty .retail-body,
#view-warranty .retail-card,
#view-warranty .retail-card-head,
#view-warranty .retail-card-actions,
#view-warranty .retail-total-pill,
#view-warranty .retail-grid,
#view-warranty .retail-grid-3,
#view-warranty .field,
#view-warranty .field-label,
#view-warranty .retail-table-wrap,
#view-warranty .retail-table,
#view-warranty .input-cell,
#view-warranty .input-num,
#view-warranty .icon-btn-danger,
#view-warranty .retail-approval,
#view-warranty .retail-approval-grid,
#view-warranty .retail-approval-block,
#view-warranty .retail-approval-check,
#view-warranty .retail-approval-title,
#view-warranty .retail-approval-sub,
#view-warranty .retail-approval-fields,
#view-warranty .retail-approval-notes {}

/* Actually apply retail styling to warranty by aliasing */
#view-warranty .retail-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
#view-warranty .retail-toolbar-left,
#view-warranty .retail-toolbar-right {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
#view-warranty .retail-loader { min-width: 260px; max-width: 380px; }
#view-warranty .retail-status {
  font-size: 12px; color: var(--text-muted, #667780);
  padding: 6px 10px; background: var(--surface-alt, #fafafa);
  border-radius: 6px; border: 1px solid var(--divider, #e6e6e6);
  max-width: 380px;
}
#view-warranty .retail-body { display: flex; flex-direction: column; gap: 16px; }
#view-warranty .retail-card { padding: 18px 20px; }
#view-warranty .retail-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 14px;
}
#view-warranty .retail-card-actions {
  display: flex; gap: 8px; align-items: center;
}
#view-warranty .retail-total-pill {
  font-size: 13px; padding: 6px 12px;
  background: var(--surface-alt, #fafafa);
  border: 1px solid var(--divider, #e6e6e6);
  border-radius: 999px; color: var(--text-muted, #667780);
}
#view-warranty .retail-total-pill span { font-weight: 600; color: var(--text, #142737); }
#view-warranty .retail-grid { display: grid; gap: 12px; }
#view-warranty .retail-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  #view-warranty .retail-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #view-warranty .retail-grid-3 { grid-template-columns: 1fr; }
}
#view-warranty .field { display: flex; flex-direction: column; gap: 4px; }
#view-warranty .field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted, #667780); font-weight: 600;
}
#view-warranty .retail-table-wrap {
  overflow-x: auto; border: 1px solid var(--divider, #e6e6e6);
  border-radius: 10px;
}
#view-warranty .retail-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
#view-warranty .retail-table th {
  text-align: left; padding: 10px 12px;
  background: var(--surface-alt, #fafafa);
  color: var(--text-muted, #667780);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  font-weight: 600;
  border-bottom: 1px solid var(--divider, #e6e6e6);
}
#view-warranty .retail-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--divider-soft, #f0f0f0);
  vertical-align: middle;
}
#view-warranty .retail-table tbody tr:last-child td { border-bottom: none; }
#view-warranty .retail-table .retail-empty td {
  text-align: center; color: var(--text-muted, #667780); padding: 24px;
  font-style: italic;
}
#view-warranty .retail-table td.tc { text-align: center; }

#view-warranty .input-cell {
  width: 100%; padding: 6px 8px;
  border: 1px solid transparent; background: transparent;
  border-radius: 6px; font-size: 13px;
  color: var(--text, #142737);
}
#view-warranty .input-cell:hover { background: var(--surface-alt, #fafafa); }
#view-warranty .input-cell:focus {
  outline: none; background: #fff;
  border-color: var(--accent, #EB4724);
}
#view-warranty .input-num { text-align: right; font-variant-numeric: tabular-nums; }

#view-warranty .icon-btn-danger {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-muted, #667780); cursor: pointer;
  font-size: 14px; line-height: 1;
}
#view-warranty .icon-btn-danger:hover {
  color: #b00020; background: #fbecec; border-color: #f2d0d0;
}

#view-warranty .retail-approval { border-left: 3px solid var(--accent, #EB4724); }
#view-warranty .retail-approval-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 800px) {
  #view-warranty .retail-approval-grid { grid-template-columns: 1fr; }
}
#view-warranty .retail-approval-block {
  padding: 14px; border: 1px solid var(--divider, #e6e6e6);
  border-radius: 10px;
  background: var(--surface-alt, #fafafa);
}
#view-warranty .retail-approval-check {
  display: flex; gap: 10px; align-items: flex-start;
  cursor: pointer; margin-bottom: 10px;
}
#view-warranty .retail-approval-check input[type="checkbox"] {
  margin-top: 3px; width: 18px; height: 18px; cursor: pointer;
  accent-color: var(--accent, #EB4724);
  flex-shrink: 0;
}
#view-warranty .retail-approval-title {
  font-weight: 600; font-size: 14px; color: var(--text, #142737);
}
#view-warranty .retail-approval-sub {
  font-size: 12px; color: var(--text-muted, #667780); margin-top: 2px;
}
#view-warranty .retail-approval-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
#view-warranty .retail-approval-notes { margin-top: 12px; }

/* Cost toggle switch */
#view-warranty .cost-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--surface-alt, #fafafa);
  border: 1px solid var(--divider, #e6e6e6);
  border-radius: 999px; font-size: 13px; cursor: pointer;
  color: var(--text, #142737); user-select: none;
}
#view-warranty .cost-toggle input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent, #EB4724); cursor: pointer;
}
#view-warranty .cost-toggle:hover { background: #fff; border-color: var(--accent, #EB4724); }

/* Also style .check-inline for both views (parts "order more" cell) */
.check-inline {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 12px; color: var(--text-muted, #667780);
}
.check-inline input[type="checkbox"] {
  width: 14px; height: 14px; accent-color: var(--accent, #EB4724); cursor: pointer;
}

/* ---------- Toolbar polish (retail + warranty) ---------- */
.toolbar-group {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--divider, #e6e6e6) 25%, transparent);
}
.toolbar-group .btn { border-color: transparent; background: #fff; }
.toolbar-group .btn:hover { border-color: var(--divider, #e6e6e6); }

/* Ensure retail-toolbar-right can wrap groups nicely */
#view-retail .retail-toolbar-right,
#view-warranty .retail-toolbar-right {
  gap: 10px;
}

/* Primary button (used for HubSpot on warranty and Xero on retail) */
.btn.btn-primary {
  background: #142737;
  color: #fff;
  border-color: #142737;
  font-weight: 600;
}
.btn.btn-primary:hover:not(:disabled) { background: #EB4724; border-color: #EB4724; }
.btn.btn-primary:disabled { background: #99a2a8; border-color: #99a2a8; opacity: 0.9; cursor: not-allowed; }

/* Primary field highlight (used for ERVS stock #) */
.field.field-primary .input {
  border-color: color-mix(in srgb, #EB4724 55%, var(--divider, #e6e6e6));
  background: color-mix(in srgb, #EB4724 4%, #fff);
}
.field.field-primary .input:focus {
  outline: 2px solid color-mix(in srgb, #EB4724 40%, transparent);
  outline-offset: 1px;
  border-color: #EB4724;
}
.field-badge {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: #EB4724;
  background: color-mix(in srgb, #EB4724 12%, #fff);
  border: 1px solid color-mix(in srgb, #EB4724 30%, transparent);
  border-radius: 3px;
  text-transform: uppercase;
  vertical-align: middle;
}


.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 6px;
  color: var(--text-muted);
  border-radius: 10px;
}

.nav-group-toggle:hover,
.nav-group-toggle:focus-visible {
  background: var(--panel-2);
}

.nav-group-toggle .nav-group-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-group-chevron {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .72;
  transition: transform .18s ease;
}

.nav-group-toggle.collapsed .nav-group-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.nav-group-items[hidden] {
  display: none !important;
}


#build-version { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace); }


.hs-banner.status-healthy { border-color: color-mix(in srgb, var(--success) 30%, var(--line)); }
.hs-banner.status-warning { border-color: color-mix(in srgb, var(--warning) 34%, var(--line)); }
.hs-banner.status-failed { border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); }
.hs-banner.status-manual { border-color: color-mix(in srgb, var(--info) 30%, var(--line)); }
.hs-dot.error { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.hs-dot.manual { background: var(--info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 16%, transparent); }


.connector-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
}

.connector-chip {
  width: 34px;
  height: 34px;
  position: relative;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-offset);
  color: var(--text-muted);
}

.connector-chip:hover {
  border-color: var(--border-strong, var(--border));
  color: var(--text);
  background: var(--surface);
}

.connector-chip svg {
  width: 16px;
  height: 16px;
}

.connector-chip-dot {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text-muted);
  box-shadow: 0 0 0 2px var(--surface-offset);
}

.connector-chip.healthy .connector-chip-dot { background: var(--success); }
.connector-chip.warning .connector-chip-dot { background: var(--warning); }
.connector-chip.failed .connector-chip-dot { background: var(--danger); }
.connector-chip.manual .connector-chip-dot { background: var(--info); }


.bva-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bva-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--divider);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
}

.bva-card.teal { border-left-color: var(--teal); }
.bva-card.info { border-left-color: var(--info); }
.bva-card.danger { border-left-color: var(--danger); }
.bva-card.success { border-left-color: var(--success); }

.bva-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.bva-card-title {
  font-size: 14px;
  font-weight: 700;
}

.bva-card-variance,
.bva-label,
.bva-note {
  font-size: 12px;
  color: var(--text-muted);
}

.bva-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bva-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.bva-value.positive,
.bva-card-variance.positive { color: var(--success); }
.bva-value.negative,
.bva-card-variance.negative { color: var(--danger); }

.bva-note {
  margin-top: 12px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .bva-grid { grid-template-columns: 1fr; }
}


.crmproto-shell { display:flex; flex-direction:column; gap:16px; }
.crmproto-topbar, .crmproto-toolbar { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.crmproto-top-actions, .crmproto-head-actions, .crmproto-form-actions, .callqueue-actions { display:flex; gap:10px; flex-wrap:wrap; }
.crmproto-search-wrap { flex:1; }
.crmproto-search { width:100%; min-height:46px; border-radius:14px; border:1px solid var(--border); background:var(--surface-2); padding:0 16px; }
.crmproto-filters { display:flex; gap:8px; flex-wrap:wrap; }
.chip { min-height:38px; padding:0 14px; border:1px solid var(--border); border-radius:999px; background:var(--surface-2); color:var(--text-muted); }
.chip.active { background:rgba(28,161,155,.12); color:var(--text); border-color:rgba(28,161,155,.28); }
.crmproto-layout { display:grid; grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.2fr); gap:16px; align-items:start; }
.crmproto-list, .crmproto-detail, .crmproto-calllist { padding:18px; }
.crmproto-list-head, .crmproto-calllist-head, .crmproto-profile-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:16px; }
.crmproto-list-table { display:flex; flex-direction:column; gap:10px; max-height:900px; overflow:auto; padding-right:4px; }
.crmrow { width:100%; display:grid; grid-template-columns: 28px 1fr; gap:12px; text-align:left; padding:14px; border:1px solid var(--border); border-radius:16px; background:var(--surface-2); }
.crmrow:hover, .crmrow.active { background:rgba(28,161,155,.08); border-color:rgba(28,161,155,.24); }
.crmrow-check { padding-top:3px; }
.crmrow-name { font-weight:700; }
.crmrow-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:4px; }
.crmrow-stage, .crmrow-heat, .mini-pill { display:inline-flex; align-items:center; min-height:26px; padding:0 10px; border-radius:999px; font-size:12px; font-weight:700; }
.crmrow-stage.rtb { background:rgba(67,122,34,.14); color:#2b5f14; }
.crmrow-stage.rts { background:rgba(161,53,68,.14); color:#7a2830; }
.crmrow-stage.res { background:rgba(0,100,148,.14); color:#0a4f73; }
.crmrow-heat { background:var(--surface); color:var(--text-muted); border:1px solid var(--border); }
.crmrow-meta { display:block; color:var(--text-muted); font-size:13px; }
.crmproto-name { font-size:28px; line-height:1.08; margin:6px 0 8px; }
.crmproto-pill-row { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 16px; }
.mini-pill { background:var(--surface-2); color:var(--text-muted); border:1px solid var(--border); }
.mini-pill.link { color:var(--text); }
.crmproto-section-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.crmproto-panel { border:1px solid var(--border); border-radius:16px; background:var(--surface-2); padding:16px; }
.crmproto-panel-title { font-weight:700; margin-bottom:12px; }
.crmproto-facts { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
.crmproto-facts dt { font-size:12px; color:var(--text-muted); margin-bottom:4px; }
.crmproto-facts dd { font-weight:600; }
.crmproto-bullets { list-style:none; display:flex; flex-direction:column; gap:8px; }
.crmproto-bullets li::before { content:'•'; color:var(--teal); margin-right:8px; }
.crmproto-linked-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:10px; }
.linked-card { border:1px solid var(--border); border-radius:14px; padding:12px; background:var(--surface); display:flex; flex-direction:column; gap:4px; }
.linked-card span, .linked-card em { color:var(--text-muted); font-style:normal; }
.crmproto-call-form { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
.crmproto-call-form label { display:flex; flex-direction:column; gap:6px; color:var(--text-muted); font-size:12px; }
.crmproto-call-form label.full { grid-column:1 / -1; }
.crmproto-call-form input, .crmproto-call-form select, .crmproto-call-form textarea { border:1px solid var(--border); border-radius:12px; background:var(--surface); padding:12px 14px; color:var(--text); }
.crmproto-form-actions { grid-column:1 / -1; }
.crmproto-timeline { display:flex; flex-direction:column; gap:12px; }
.timeline-item { display:grid; grid-template-columns: 16px 1fr; gap:12px; align-items:flex-start; }
.timeline-dot { width:12px; height:12px; border-radius:999px; margin-top:6px; background:var(--text-faint); }
.timeline-dot.call { background:var(--teal); }
.timeline-dot.note { background:var(--blue); }
.timeline-dot.task { background:var(--gold); }
.timeline-item h3 { font-size:14px; margin-bottom:3px; }
.timeline-item p { font-size:14px; color:var(--text); margin-bottom:4px; max-width:unset; }
.timeline-item span { font-size:12px; color:var(--text-muted); }
.crmproto-calllist { margin-top:16px; }
.callqueue-row { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:12px 0; border-top:1px solid var(--border); }
.callqueue-row:first-child { border-top:none; }
.callqueue-name { font-weight:700; }
.callqueue-meta { color:var(--text-muted); font-size:13px; }

@media (max-width: 1180px) {
  .crmproto-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .crmproto-topbar, .crmproto-toolbar, .crmproto-list-head, .crmproto-profile-head, .crmproto-calllist-head { flex-direction:column; }
  .crmproto-section-grid, .crmproto-facts, .crmproto-linked-grid, .crmproto-call-form { grid-template-columns: 1fr; }
  .crmrow { grid-template-columns: 24px 1fr; }
}
