/* GovWatch Dashboard — Public Ledger theme */

/* ── Reset & Variables ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Shared with the landing page ("Public Ledger"): warm paper, forest ink. */
  color-scheme: light;
  --bg:            #f7f4ee;
  --panel:         #fffdf8;
  --panel-alt:     #f3efe6;
  --text:          #17201b;
  --muted:         #4a524c;
  --subtle:        #7b8079;
  --brand:         #1f4d3a;
  --on-brand:      #ffffff;
  --brand-light:   #e3eee8;
  --action:        #1f4d3a;
  --action-hover:  #163a2b;
  --accent:        #b4532a;
  --accent-light:  #fbeee6;
  --danger:        #a8261d;
  --danger-light:  #fcebe8;
  --danger-line:   #f1b8b0;
  --warning:       #8a4b06;
  --warning-light: #fdf3dc;
  --warning-line:  #ecc97a;
  --success:       #1e6b43;
  --success-light: #e5f3ea;
  --success-line:  #a8d5b9;
  --info:          #1f5fbf;
  --info-light:    #e8f0fc;
  --info-line:     #b3cbf0;
  --violet:        #6250d6;
  --violet-light:  #efedfc;
  --data:          #1e7a4c;   /* single-hue chart marks; passes the dataviz checks */
  --border:        #e3ddd1;
  --border-soft:   #ece7dd;
  --shadow-sm:     0 1px 2px rgba(23,32,27,.05);
  --shadow:        0 1px 2px rgba(23,32,27,.05), 0 6px 18px -10px rgba(23,32,27,.18);
  --shadow-md:     0 1px 2px rgba(23,32,27,.06), 0 14px 32px -14px rgba(23,32,27,.28);
  --radius:        8px;
  --radius-lg:     14px;
  --serif: "Source Serif 4", Georgia, serif;
  --sans:  "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1713; --panel: #16231d; --panel-alt: #1a2a23;
    --text: #eef0ea; --muted: #b9c0b8; --subtle: #858d86;
    --brand: #7cc6a0; --on-brand: #0e1713; --brand-light: #1c3329;
    --action: #7cc6a0; --action-hover: #96d4b4;
    --accent: #ef8a5c; --accent-light: #3a2419;
    --danger: #f2877b; --danger-light: #3a1d1a; --danger-line: #6b2e28;
    --warning: #e8b45a; --warning-light: #352a14; --warning-line: #6a5121;
    --success: #74c99b; --success-light: #183224; --success-line: #2e5a41;
    --info: #8ab4f2; --info-light: #172640; --info-line: #2c4772;
    --violet: #a99ff0; --violet-light: #241f45;
    --data: #3aa772;
    --border: #24342c; --border-soft: #1f2e27;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-md: 0 1px 2px rgba(0,0,0,.35), 0 16px 36px -14px rgba(0,0,0,.7);
  }
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Disclaimer bar ─────────────────────────────────────────────── */
.disclaimer-bar {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--warning-light); border-bottom: 1px solid var(--warning-line);
  padding: 8px 20px; font-size: .8rem; color: var(--warning); line-height: 1.4;
}
.disclaimer-close {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  color: var(--warning); flex-shrink: 0; padding: 2px 4px; line-height: 1;
}
.disclaimer-close:hover { color: var(--warning); }

/* ── Header ─────────────────────────────────────────────────────── */
.header {
  background: var(--brand);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 16px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans); font-stretch: 112%;
  font-size: .78rem;
  font-weight: 700;
  color: var(--on-brand);
  letter-spacing: .5px;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  font-family: var(--sans); font-stretch: 112%;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--on-brand);
  line-height: 1.1;
  letter-spacing: -.2px;
}
.brand-context {
  font-size: .66rem;
  color: rgba(255,255,255,.6);
  font-weight: 400;
  letter-spacing: .2px;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.data-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.75);
}
.data-badge.live {
  background: rgba(34,197,94,.2);
  border-color: rgba(34,197,94,.4);
  color: var(--success-line);
}
.last-updated { font-size: .68rem; color: rgba(255,255,255,.5); white-space: nowrap; }
.header-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.9);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
  letter-spacing: .2px;
}
.header-btn:hover { background: rgba(255,255,255,.22); }

/* ── Page Body ───────────────────────────────────────────────────── */
.page-body {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Role Banner ─────────────────────────────────────────────────── */
.role-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--brand);
  color: var(--on-brand);
  border-radius: var(--radius);
  padding: 10px 16px;
  box-shadow: var(--shadow);
}
.role-banner.hidden { display: none; }
.role-banner-icon { font-size: 1.2rem; flex-shrink: 0; }
.role-banner-text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.role-banner-text strong { font-size: .86rem; }
.role-banner-cats { font-size: .71rem; opacity: .7; }
.role-banner-clear {
  font-size: .68rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  transition: all .12s;
}
.role-banner-clear:hover { background: rgba(255,255,255,.12); color: var(--on-brand); }

/* ── KPI Row ─────────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi-number {
  font-family: var(--sans); font-stretch: 112%;
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.5px;
}
.kpi-label {
  font-size: .64rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.kpi-danger  .kpi-number { color: var(--danger); }
.kpi-warning .kpi-number { color: var(--warning); }
.kpi-success .kpi-number { color: var(--success); }

/* ── Toolbar ─────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.saved-views { display: flex; gap: 5px; flex-wrap: wrap; }
.view-chip {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .76rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  white-space: nowrap;
}
.view-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.view-chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-input {
  width: 220px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .82rem;
  color: var(--text);
  background: var(--panel);
  outline: none;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,77,58,.08); }
.search-input::placeholder { color: var(--subtle); }
.filter-select {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color .12s;
}
.filter-select:focus { border-color: var(--brand); }
.reset-btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.reset-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

.date-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 2px;
  width: 100%;
}
.date-range-row.hidden { display: none; }
.date-range-label { font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.date-input {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--text);
  background: var(--panel);
  outline: none;
  font-family: inherit;
  transition: border-color .12s;
}
.date-input:focus { border-color: var(--brand); }

/* ── Tab Navigation ──────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.tab {
  padding: 9px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .12s, border-color .12s;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }

/* ── Tab Content ─────────────────────────────────────────────────── */
.tab-content { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.tab-content.hidden { display: none; }

/* ── Queue Layout ────────────────────────────────────────────────── */
.queue-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  align-items: start;
}
.queue-pane {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-alt);
}
.queue-count {
  font-size: .69rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.queue-header-controls { display: flex; align-items: center; gap: 10px; }
.sort-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .73rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}
.sort-select:focus { border-color: var(--brand); }
.cluster-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .73rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.cluster-label input { cursor: pointer; accent-color: var(--brand); }

/* ── Queue Row ───────────────────────────────────────────────────── */
.queue-list { display: flex; flex-direction: column; }
.queue-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
  position: relative;
}
.queue-row:last-child { border-bottom: none; }
.queue-row:hover { background: var(--bg); }
.queue-row.selected { background: var(--brand-light); }
.queue-row-stripe { border-radius: 0; }
.queue-row.sev-high   .queue-row-stripe { background: var(--danger); }
.queue-row.sev-medium .queue-row-stripe { background: var(--warning); }
.queue-row.sev-low    .queue-row-stripe { background: var(--success); }
.queue-row-body { padding: 11px 14px; min-width: 0; }
.queue-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.q-priority-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
}
.sev-high   .q-priority-label { background: var(--danger-light);  color: var(--danger); }
.sev-medium .q-priority-label { background: var(--warning-light); color: var(--warning); }
.sev-low    .q-priority-label { background: var(--success-light); color: var(--success); }
.q-cat-badge {
  font-size: .62rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 3px;
  padding: 1px 7px;
  letter-spacing: .2px;
}
.q-area {
  font-size: .66rem;
  color: var(--muted);
}
.q-cluster-badge {
  font-size: .62rem;
  font-weight: 600;
  background: var(--violet-light);
  color: var(--violet);
  border-radius: 3px;
  padding: 1px 7px;
}
.queue-row-text {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}
.q-dept { font-size: .64rem; color: var(--muted); font-weight: 500; }
.q-age  { font-size: .64rem; color: var(--subtle); }
.q-sla  {
  font-size: .6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.sla-ok      { background: var(--success-light); color: var(--success); }
.sla-warning { background: var(--warning-light); color: var(--warning); }
.sla-overdue { background: var(--danger-light); color: var(--danger); font-weight: 700; }

.queue-row-actions { padding: 11px 14px 11px 0; display: flex; align-items: center; gap: 6px; }
.q-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.q-status-open         .q-status-dot { background: var(--border); }
.q-status-acknowledged .q-status-dot { background: var(--info); }
.q-status-in_progress  .q-status-dot { background: var(--warning); }
.q-status-resolved     .q-status-dot { background: var(--success); }
.queue-row[data-status="resolved"] { opacity: .55; }

/* ── Detail Pane ─────────────────────────────────────────────────── */
.detail-pane {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 10px;
  text-align: center;
}
.detail-empty-icon { font-size: 1.5rem; opacity: .25; }
.detail-empty-text { font-size: .84rem; color: var(--subtle); }

.detail-header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-alt);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.detail-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-cat {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--brand);
  background: var(--brand-light);
  padding: 2px 8px;
  border-radius: 4px;
}
.detail-sev {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 8px;
  border-radius: 4px;
}
.detail-sev-high   { background: var(--danger-light);  color: var(--danger); }
.detail-sev-medium { background: var(--warning-light); color: var(--warning); }
.detail-sev-low    { background: var(--success-light); color: var(--success); }
.detail-sla-badge {
  font-size: .63rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.detail-title {
  font-family: var(--sans); font-stretch: 112%;
  font-size: .96rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.detail-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 14px; }

.detail-section-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--subtle);
  margin-bottom: 5px;
}
.detail-full-text {
  font-size: .84rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  border-left: 3px solid var(--border);
  padding: 10px 12px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-meta-item {}
.detail-meta-val {
  font-size: .82rem;
  color: var(--text);
  font-weight: 500;
}
.detail-meta-val a { color: var(--action); text-decoration: underline; font-size: .78rem; }

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.detail-status-row { display: flex; align-items: center; gap: 8px; }
.detail-status-label { font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.status-select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .76rem;
  font-weight: 500;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}
.status-select:focus { border-color: var(--brand); }
.status-select.s-acknowledged { border-color: var(--info-line); background: var(--info-light); color: var(--info); }
.status-select.s-in_progress  { border-color: var(--warning-line); background: var(--warning-light); color: var(--warning); }
.status-select.s-resolved     { border-color: var(--success-line); background: var(--success-light); color: var(--success); }

/* Read-only status badge for viewer role */
.status-badge-ro { display:inline-block; padding:4px 10px; border-radius:4px; font-size:0.8rem; font-weight:600; border:1px solid; text-transform:capitalize; }
.status-badge-ro.s-open        { border-color: var(--border); background: var(--panel); color: var(--subtle); }
.status-badge-ro.s-acknowledged{ border-color: var(--info-line); background: var(--info-light); color: var(--info); }
.status-badge-ro.s-in_progress { border-color: var(--warning-line); background: var(--warning-light); color: var(--warning); }
.status-badge-ro.s-resolved    { border-color: var(--success-line); background: var(--success-light); color: var(--success); }

.btn-assign {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  background: var(--action);
  color: var(--on-brand);
  border: none;
  border-radius: var(--radius);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background .12s;
  letter-spacing: .1px;
}
.btn-assign:hover { background: var(--action-hover); }
.btn-source {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: transparent;
  color: var(--action);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all .12s;
}
.btn-source:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }

.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; background: var(--success-light); color: var(--success);
  border: 1px solid var(--success-line); border-radius: var(--radius);
  font-size: .76rem; font-weight: 600; cursor: pointer;
  text-decoration: none; font-family: inherit; transition: all .12s;
}
.btn-whatsapp:hover { background: var(--success-light); border-color: var(--success); }

.btn-copy-tweet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: transparent;
  color: var(--info-line);
  border: 1px solid var(--info-line);
  border-radius: var(--radius);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.btn-copy-tweet:hover { background: var(--info-light); }
.btn-copy-tweet.copied { background: var(--success-light); color: var(--action); border-color: var(--action); }
.tweet-preview {
  padding: 10px 12px;
  background: var(--info-light);
  border: 1px solid var(--info-line);
  border-radius: var(--radius);
  font-size: .75rem;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.tweet-preview.hidden { display: none; }

/* ── Comments / Notes ────────────────────────────────────────────── */
.detail-comments { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.comments-list {
  margin: 8px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
}
.comment-item {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.comment-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.comment-author { font-size: 0.78rem; font-weight: 600; color: var(--brand); }
.comment-time   { font-size: 0.72rem; color: var(--muted); }
.comment-body   { font-size: 0.85rem; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.comment-empty, .comment-loading { font-size: 0.82rem; color: var(--muted); font-style: italic; padding: 2px 0; }
.comment-form   { display: flex; flex-direction: column; gap: 6px; }
.comment-input  {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 58px;
}
.comment-input:focus { outline: none; border-color: var(--brand); }
.btn-comment-submit {
  align-self: flex-end;
  padding: 6px 14px;
  border-radius: 5px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-comment-submit:hover    { filter: brightness(1.1); }
.btn-comment-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Map View ────────────────────────────────────────────────────── */
.map-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-high   { background: var(--danger); }
.dot-medium { background: var(--warning); }
.dot-low    { background: var(--success); }
.map-hint { margin-left: auto; font-size: .69rem; color: var(--subtle); }
#leaflet-map {
  height: 520px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

/* ── Department View ─────────────────────────────────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.dept-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.dept-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand); }
.dept-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-alt);
}
.dept-icon { font-size: 1.5rem; flex-shrink: 0; }
.dept-name { font-size: .9rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.dept-desc { font-size: .64rem; color: var(--muted); margin-top: 2px; }
.dept-total {
  margin-left: auto;
  font-family: var(--sans); font-stretch: 112%;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: var(--radius);
  padding: 5px 12px;
  white-space: nowrap;
}
.dept-severity-row {
  display: flex;
  gap: 5px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}
.sev-pill {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .64rem;
  font-weight: 600;
}
.sev-pill-high   { background: var(--danger-light);  color: var(--danger); }
.sev-pill-medium { background: var(--warning-light); color: var(--warning); }
.sev-pill-low    { background: var(--success-light); color: var(--success); }
.sev-pill-none   { background: var(--panel-alt); color: var(--subtle); }
.dept-issues-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--subtle);
  padding: 9px 14px 4px;
}
.dept-issue-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
}
.dept-issue-row:hover { background: var(--bg); }
.dept-issue-row:last-child { border-bottom: none; }
.dept-issue-cat {
  font-size: .59rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}
.dept-issue-text {
  font-size: .77rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.dept-issue-sev { font-size: .6rem; font-weight: 600; white-space: nowrap; }
.dept-filter-link {
  display: block;
  text-align: center;
  padding: 11px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--action);
  background: var(--bg);
  text-decoration: none;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: inherit;
  border-top: 1px solid var(--border-soft);
  transition: all .12s;
}
.dept-filter-link:hover { background: var(--brand); color: var(--on-brand); }
.dept-no-issues {
  padding: 20px 14px;
  text-align: center;
  font-size: .82rem;
  color: var(--subtle);
}

/* ── Analytics ───────────────────────────────────────────────────── */
.analytics-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.analytics-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.analytics-card-wide { grid-column: 1 / -1; }
.analytics-title {
  font-size: .67rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}
.chart-wrap { position: relative; height: 220px; }
.chart-wrap-tall { height: 320px; }

.sev-breakdown { display: flex; flex-direction: column; gap: 10px; }
.sev-bar-row { display: flex; align-items: center; gap: 10px; }
.sev-bar-label { font-size: .74rem; font-weight: 600; width: 60px; color: var(--text); }
.sev-bar-track { flex: 1; height: 8px; background: var(--border-soft); border-radius: 4px; overflow: hidden; }
.sev-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.sev-bar-fill-high   { background: var(--danger); }
.sev-bar-fill-medium { background: var(--warning); }
.sev-bar-fill-low    { background: var(--success); }
.sev-bar-count { font-size: .72rem; color: var(--muted); font-weight: 500; width: 28px; text-align: right; }

.sla-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.sla-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: .61rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.sla-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.sla-table tr:last-child td { border-bottom: none; }
.sla-table tr:hover td { background: var(--bg); }
.sla-overdue-count { color: var(--danger); font-weight: 700; }

/* ── Analytics breakdown lists ───────────────────────────────────── */
.breakdown-list { display: flex; flex-direction: column; gap: 7px; max-height: 340px; overflow-y: auto; }
.breakdown-list-wide { flex-direction: row; flex-wrap: wrap; gap: 8px; max-height: none; overflow-y: visible; }
.breakdown-row { display: flex; align-items: center; gap: 8px; }
.breakdown-name { font-size: .79rem; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-bar-track { width: 90px; height: 6px; background: var(--border-soft); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.breakdown-bar-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s ease; }
.breakdown-count { font-size: .72rem; color: var(--muted); font-weight: 600; width: 28px; text-align: right; flex-shrink: 0; }
.breakdown-chip { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 20px; padding: 4px 12px 4px 8px; font-size: .77rem; }
.breakdown-chip-name { color: var(--text); font-weight: 500; }
.breakdown-chip-count { background: var(--accent); color: var(--on-brand); border-radius: 10px; padding: 1px 7px; font-size: .68rem; font-weight: 700; }
.breakdown-no-data { font-size: .78rem; color: var(--muted); font-style: italic; }

/* ── Shared Loading / Empty ──────────────────────────────────────── */
.loading, .no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--subtle);
  font-size: .88rem;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 14px;
  font-size: .67rem;
  color: var(--subtle);
  letter-spacing: .1px;
  margin-top: 20px;
}

/* ── Officials Tab ───────────────────────────────────────────────── */
.officials-section { margin-bottom: 28px; }
.officials-section-title {
  font-family: var(--sans); font-stretch: 112%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.officials-section-sub {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Ward search */
.ward-search-wrap { position: relative; max-width: 480px; margin-bottom: 16px; }
.ward-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 50;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-top: 2px;
}
.ward-suggestions.hidden { display: none; }
.ward-suggestion-item {
  padding: 8px 14px;
  font-size: .84rem;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
}
.ward-suggestion-item:last-child { border-bottom: none; }
.ward-suggestion-item:hover { background: var(--brand-light); color: var(--brand); }
.ward-suggestion-meta { font-size: .71rem; color: var(--muted); margin-top: 1px; }

/* Ward card */
.ward-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ward-card-header {
  background: var(--brand);
  color: var(--on-brand);
  padding: 14px 18px;
}
.ward-card-header-name {
  font-family: var(--sans); font-stretch: 112%;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.ward-card-header-meta {
  font-size: .74rem;
  opacity: .8;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.ward-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}
.ward-dept-cell {
  padding: 12px 14px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  min-height: 100px;
}
.ward-dept-cell:nth-child(3n) { border-right: none; }
.ward-dept-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--brand);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.ward-contact-name {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.ward-contact-detail {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ward-contact-phone {
  display: block;
  font-size: .76rem;
  color: var(--action);
  margin-bottom: 4px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.ward-contact-phone:hover { text-decoration: underline; }
.ward-contact-phone::before { content: "T: "; font-weight: 600; color: var(--muted); }
.ward-dept-cell .ward-email-btn { margin-top: auto; }

/* Detect location button */
.btn-detect-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--success-line);
  border-radius: var(--radius);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 12px;
  transition: background .12s, border-color .12s;
}
.btn-detect-location:hover { background: var(--success-light); border-color: var(--brand); }
.btn-detect-location:disabled { opacity: .6; cursor: wait; }
.ward-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--action);
  color: var(--on-brand);
  border: none;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background .12s;
  margin-top: 4px;
}
.ward-email-btn:hover { background: var(--action-hover); }
.ward-note {
  font-size: .71rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
}
.ward-empty { font-size: .78rem; color: var(--subtle); font-style: italic; }

/* Org chart */
.org-dept-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.org-chart { display: flex; flex-direction: column; gap: 0; }
.org-level {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.org-level:last-child { border-bottom: none; }
.org-level-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.org-level-body { flex: 1; }
.org-level-role {
  font-size: .72rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}
.org-level-use {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.org-level-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.org-contact-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-width: 200px;
}
.org-contact-role {
  font-size: .61rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--brand);
  margin-bottom: 3px;
}
.org-contact-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.org-contact-info {
  font-size: .73rem;
  color: var(--muted);
  text-decoration: none;
  margin-top: 2px;
  display: block;
}
a.org-contact-info { color: var(--action); }
a.org-contact-info:hover { text-decoration: underline; }

/* Routing guide */
.routing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.routing-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.routing-issue-type {
  font-family: var(--sans); font-stretch: 112%;
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.routing-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 7px;
  font-size: .8rem;
  color: var(--text);
}
.routing-badge {
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.badge-first     { background: var(--success-light); color: var(--success); }
.badge-cc        { background: var(--info-light); color: var(--info); }
.badge-esc1      { background: var(--warning-light); color: var(--warning); }
.badge-esc2      { background: var(--danger-light); color: var(--danger); }
.badge-highest   { background: var(--violet-light); color: var(--violet); }
.badge-political { background: var(--violet-light); color: var(--violet); }
.routing-sla {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 8px;
  border-top: 1px solid var(--border-soft);
  padding-top: 8px;
}
.routing-notes {
  font-size: .71rem;
  color: var(--subtle);
  font-style: italic;
  margin-top: 4px;
}

/* Smart contacts in detail panel */
.smart-contacts {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.smart-contact-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel);
}
.smart-contact-row:last-child { border-bottom: none; }
.sc-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sc-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.sc-type-badge {
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sc-name {
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-role {
  font-size: .71rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sc-phone {
  font-size: .71rem;
  color: var(--action);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
a.sc-phone:hover { text-decoration: underline; }
.sc-email-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--action);
  color: var(--on-brand);
  border: none;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background .12s;
  flex-shrink: 0;
}
.sc-email-btn:hover { background: var(--action-hover); }
.sc-no-contacts {
  font-size: .8rem;
  color: var(--subtle);
  font-style: italic;
  padding: 4px 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .queue-layout { grid-template-columns: 1fr; }
  .detail-pane { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .analytics-layout { grid-template-columns: 1fr; }
  .analytics-card-wide { grid-column: auto; }
}
@media (max-width: 640px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-card:last-child { grid-column: 1 / -1; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filter-bar { flex-direction: column; }
  .search-input { width: 100%; }
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .header-actions { flex-wrap: wrap; gap: 8px; }
  #leaflet-map { height: 360px; }
  .tab { font-size: .76rem; padding: 8px 12px; }
  .dept-grid { grid-template-columns: 1fr; }
  .ward-card-grid { grid-template-columns: 1fr; }
  .routing-grid { grid-template-columns: 1fr; }
}

/* ── Official Name Links ─────────────────────────────────────────── */
.official-name-link {
  cursor: pointer;
  color: var(--action);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: color .1s;
}
.official-name-link:hover { color: var(--brand); text-decoration-style: solid; }

/* ── Raise-to Button ────────────────────────────────────────────── */
.sc-raise-btn {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: .66rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.sc-raise-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.sc-raise-btn.active { background: var(--success-light); border-color: var(--success-line); color: var(--success); }

/* ── Queue assigned badge ────────────────────────────────────────── */
.q-assigned-badge {
  font-size: .6rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-light);
  border: 1px solid var(--success-line);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Official Profile Modal ─────────────────────────────────────── */
.official-profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.official-profile-overlay.hidden { display: none; }
.official-profile-modal {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}
.official-profile-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  z-index: 1;
  padding: 0 4px;
  transition: color .1s;
}
.official-profile-close:hover { color: var(--text); }
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 52px 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel-alt);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans); font-stretch: 112%;
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name {
  font-family: var(--sans); font-stretch: 112%;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.profile-role { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.profile-detail { font-size: .73rem; color: var(--subtle); }
.profile-section-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 12px 20px 8px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}
.profile-no-issues {
  padding: 28px 20px;
  text-align: center;
  font-size: .84rem;
  color: var(--subtle);
  font-style: italic;
}
.profile-issue-row {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-issue-row:last-child { border-bottom: none; }
.profile-issue-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile-issue-text { font-size: .82rem; color: var(--text); line-height: 1.4; }
.profile-issue-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-status-select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .74rem;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  outline: none;
  transition: border-color .12s;
}
.profile-status-select.s-acknowledged { border-color: var(--info-line); background: var(--info-light); color: var(--info); }
.profile-status-select.s-in_progress  { border-color: var(--warning-line); background: var(--warning-light); color: var(--warning); }
.profile-status-select.s-resolved     { border-color: var(--success-line); background: var(--success-light); color: var(--success); }

/* ── Resolve Modal ───────────────────────────────────────────────── */
.resolve-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.resolve-modal-overlay.hidden { display: none; }
.resolve-modal-box {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  width: 100%;
  max-width: 480px;
  padding: 24px;
}
.resolve-modal-title {
  font-family: var(--sans); font-stretch: 112%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 6px;
}
.resolve-modal-sub { font-size: .8rem; color: var(--muted); margin-bottom: 14px; line-height: 1.4; }
.resolve-modal-tweet {
  padding: 12px 14px;
  background: var(--info-light);
  border: 1px solid var(--info-line);
  border-radius: var(--radius);
  font-size: .8rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 14px;
}
.resolve-modal-actions { display: flex; gap: 8px; }

/* ── Routing ward context ────────────────────────────────────────── */
.routing-ward-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--brand-light);
  border: 1px solid var(--success-line);
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--brand);
  margin-bottom: 14px;
}
.routing-contact-person {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 8px;
  background: var(--success-light);
  border-radius: 4px;
  font-size: .74rem;
  flex-wrap: wrap;
}
.rcp-label { color: var(--muted); font-weight: 600; }
.rcp-phone { color: var(--muted); font-size: .7rem; }

.org-contact-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .ward-card-grid { grid-template-columns: repeat(2, 1fr); }
  .routing-grid { grid-template-columns: 1fr; }
}

/* ── Raised-to Analytics ────────────────────────────────────────── */
.raised-to-list { display: flex; flex-direction: column; gap: 6px; }
.raised-to-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; gap: 12px;
}
.raised-to-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.raised-to-role { font-size: .75rem; color: var(--muted); }
.raised-to-count {
  font-size: .85rem; font-weight: 600; color: var(--brand);
  white-space: nowrap; background: var(--bg); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 12px;
}

/* ── Ward Hierarchy ─────────────────────────────────────────────── */
.ward-hierarchy {
  margin-top: 16px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.ward-hier-title {
  font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 14px;
}
.ward-hier-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.ward-hier-dept { display: flex; flex-direction: column; gap: 6px; }
.ward-hier-dept-label {
  font-size: .78rem; font-weight: 600; color: var(--brand);
  padding-bottom: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.ward-hier-steps { display: flex; flex-direction: column; gap: 0; }
.ward-hier-step {
  display: flex; align-items: flex-start; gap: 6px; padding: 5px 0;
  border-left: 2px solid var(--border); margin-left: 8px; padding-left: 10px;
  position: relative; font-size: .8rem;
}
.ward-hier-step::before {
  content: ""; position: absolute; left: -6px; top: 11px;
  width: 10px; height: 2px; background: var(--border);
}
.ward-hier-step.ward-level {
  border-left-color: var(--brand); background: rgba(31,77,58,.04);
  padding: 6px 10px; border-radius: 0 4px 4px 0; margin-bottom: 2px;
}
.ward-hier-step.ward-level::before { background: var(--brand); }
.ward-hier-step.last { border-left-color: transparent; }
.ward-hier-badge {
  font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; background: var(--bg); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 3px; white-space: nowrap; color: var(--muted);
  flex-shrink: 0;
}
.ward-hier-step.ward-level .ward-hier-badge {
  background: var(--brand); color: var(--on-brand); border-color: var(--brand);
}
.ward-hier-name { color: var(--text); flex: 1; }
.ward-hier-name.generic { color: var(--muted); font-style: italic; }
.ward-hier-phone { color: var(--accent); font-size: .75rem; }
@media (max-width: 1100px) {
  .ward-hier-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .ward-hier-grid { grid-template-columns: 1fr; }
}

/* ── Ward Heat Map ───────────────────────────────────────────────── */
.heatmap-legend {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; font-size: .73rem; color: var(--muted);
}
.hm-legend-item { display: flex; align-items: center; gap: 4px; }
.hm-swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.hm-legend-hint { margin-left: auto; font-style: italic; font-size: .7rem; }
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.heatmap-tile {
  border-radius: 6px; padding: 10px 10px 8px; cursor: pointer;
  transition: transform .1s, box-shadow .1s; border: 1px solid transparent;
}
.heatmap-tile:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.tile-none     { background: var(--panel); border-color: var(--border-soft); }
.tile-low      { background: var(--success-light); border-color: var(--success-line); }
.tile-medium   { background: var(--warning-light); border-color: var(--warning-line); }
.tile-high     { background: var(--warning-light); border-color: var(--danger-line); }
.tile-critical { background: var(--danger-light); border-color: var(--danger-line); }
.hm-area { font-size: .72rem; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-count { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1.1; margin-top: 3px; }
.hm-sub { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.hm-high { font-size: .65rem; font-weight: 700; color: var(--danger); background: var(--danger-light); padding: 1px 4px; border-radius: 3px; }
.hm-overdue { font-size: .65rem; font-weight: 700; color: var(--warning); background: var(--warning-light); padding: 1px 4px; border-radius: 3px; }
@media (max-width: 700px) {
  .heatmap-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

/* ── Officials Directory tab ─────────────────────────────────────── */
.dir-search-wrap {
  position: relative; max-width: 600px; margin-bottom: 16px;
}
.dir-suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 200; overflow: hidden;
}
.dir-suggestions.hidden { display: none; }
.dir-suggestion-item {
  padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  border-bottom: 1px solid var(--border-soft);
}
.dir-suggestion-item:last-child { border-bottom: none; }
.dir-suggestion-item:hover { background: var(--brand-light); }
.dir-sug-name { font-size: .88rem; font-weight: 600; color: var(--text); }
.dir-sug-meta { font-size: .73rem; color: var(--muted); }

.dir-dept-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.dir-dept-chip {
  padding: 7px 16px; border-radius: 20px;
  border: 1.5px solid var(--border-soft); background: var(--panel);
  color: var(--text); cursor: pointer; font-size: .84rem; font-weight: 500; transition: all .15s;
}
.dir-dept-chip:hover { border-color: var(--brand); color: var(--brand); }
.dir-dept-chip.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.dir-org-wrap { padding-bottom: 40px; }
.dir-org-header { margin-bottom: 16px; }
.dir-org-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.dir-org-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }

.dir-zone-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.dir-zone-card {
  padding: 14px; background: var(--panel); border: 1.5px solid var(--border-soft);
  border-radius: var(--radius); cursor: pointer; transition: all .15s;
}
.dir-zone-card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.dir-zone-card.active { border-color: var(--brand); background: var(--brand-light); }
.dir-zone-icon { font-size: 1.2rem; margin-bottom: 4px; }
.dir-zone-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.dir-zone-head-line { font-size: .72rem; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-zone-count { font-size: .7rem; color: var(--brand); margin-top: 8px; font-weight: 600; }

.dir-sub-panel {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 12px; margin-bottom: 16px;
}
.dir-sub-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dir-sub-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.dir-sub-sect-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 8px; margin-top: 12px;
}

.dir-head-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); margin-bottom: 12px;
}
.dir-head-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: var(--on-brand);
}
.dir-head-info { flex: 1; min-width: 0; }
.dir-head-name { font-size: .84rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-head-role { font-size: .71rem; color: var(--muted); }
.dir-head-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.dir-person-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
}
.dir-person-card {
  padding: 12px; background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); cursor: pointer; transition: all .15s;
}
.dir-person-card:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.dir-person-avatar {
  width: 32px; height: 32px; border-radius: 50%; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--on-brand);
}
.dir-person-name { font-size: .82rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-person-role { font-size: .7rem; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-person-area { font-size: .7rem; color: var(--brand); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-person-phone { font-size: .69rem; color: var(--muted); margin-top: 4px; }
.dir-person-hint { font-size: .67rem; color: var(--brand); margin-top: 6px; opacity: .7; }

/* Profile Drawer */
.dir-profile-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500;
  display: flex; justify-content: flex-end;
}
.dir-profile-overlay.hidden { display: none; }
.dir-profile-drawer {
  width: min(520px, 100vw); height: 100%; background: var(--bg);
  overflow-y: auto; box-shadow: -4px 0 32px rgba(0,0,0,.15);
  display: flex; flex-direction: column;
  animation: slideInRight .2s ease;
}
@keyframes slideInRight { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.dir-drawer-top {
  position: sticky; top: 0; background: var(--bg); z-index: 1;
  border-bottom: 1px solid var(--border-soft); padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.dir-drawer-dept-badge {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 4px; color: var(--on-brand);
}
.dir-drawer-close-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-soft);
  background: none; cursor: pointer; font-size: 1.1rem; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.dir-drawer-close-btn:hover { background: var(--panel); }
.dir-drawer-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dir-drawer-header { display: flex; align-items: flex-start; gap: 14px; }
.dir-drawer-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: var(--on-brand);
}
.dir-drawer-info { flex: 1; min-width: 0; }
.dir-drawer-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.dir-drawer-role { font-size: .81rem; color: var(--muted); margin-top: 2px; }
.dir-drawer-area { font-size: .75rem; color: var(--brand); margin-top: 3px; }
.dir-drawer-contacts { display: flex; gap: 8px; flex-wrap: wrap; }
.dir-drawer-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.dir-drawer-stat {
  background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 12px 8px; text-align: center;
}
.dir-drawer-stat-num { font-size: 1.4rem; font-weight: 700; color: var(--text); display: block; }
.dir-drawer-stat-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dir-drawer-stat.is-active .dir-drawer-stat-num { color: var(--warning); }
.dir-drawer-stat.is-resolved .dir-drawer-stat-num { color: var(--success); }
.dir-drawer-section-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--border-soft);
}
.dir-drawer-issue-row {
  padding: 10px 0; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 5px;
}
.dir-drawer-issue-row:last-child { border-bottom: none; }
.dir-drawer-no-issues { color: var(--muted); font-size: .84rem; text-align: center; padding: 24px 0; line-height: 1.6; }
.dir-assigned-date { font-size: .7rem; color: var(--muted); }
.dir-issue-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dir-issue-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .dir-zone-grid { grid-template-columns: repeat(2, 1fr); }
  .dir-person-grid { grid-template-columns: repeat(2, 1fr); }
  .dir-profile-drawer { width: 100vw; }
}

/* ── Admin Panel ─────────────────────────────────────────────────── */
.admin-panel-wrap { padding: 24px 0; display: flex; flex-direction: column; gap: 24px; max-width: 900px; }

.admin-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.admin-stat-card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 16px 20px; display: flex; flex-direction: column; gap: 4px;
}
.admin-stat-card.admin-stat-pending { border-color: var(--warning); }
.admin-stat-card.admin-stat-admin   { border-color: var(--brand); }
.admin-stat-num   { font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.admin-stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.admin-section {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden;
}
.admin-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}
.admin-section-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.admin-section-title.admin-all-clear { color: var(--success); }
.admin-section-badge {
  font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--border-soft); color: var(--muted);
}
.admin-section-badge.admin-badge-pending { background: var(--warning-light); color: var(--warning); }

.admin-table {
  width: 100%; border-collapse: collapse; font-size: .84rem;
}
.admin-table th {
  text-align: left; padding: 10px 16px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--border-soft); background: var(--bg);
}
.admin-table td { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); color: var(--text); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(0,0,0,.02); }
.admin-td-email { font-weight: 500; }
.admin-td-date  { color: var(--muted); font-size: .78rem; }

.role-pill {
  display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 10px;
  border-radius: 999px; text-transform: capitalize; letter-spacing: .02em;
}
.role-pill-pending { background: var(--warning-light); color: var(--warning); }
.role-pill-viewer  { background: rgba(31,77,58,.1);    color: var(--brand); }
.role-pill-admin   { background: rgba(31,77,58,.2);    color: var(--brand); font-weight: 800; }

.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-admin-approve { padding: 4px 10px; border-radius: 4px; border: none; cursor: pointer; font-size: .78rem; font-weight: 600; background: var(--brand); color: var(--on-brand); font-family: inherit; }
.btn-admin-approve:hover { opacity: .85; }
.btn-admin-suspend { padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; font-size: .78rem; background: transparent; color: var(--muted); font-family: inherit; }
.btn-admin-suspend:hover { background: var(--panel-alt); color: var(--text); }
.btn-admin-promote { padding: 4px 10px; border-radius: 4px; border: 1px solid var(--brand); cursor: pointer; font-size: .78rem; background: transparent; color: var(--brand); font-family: inherit; }
.btn-admin-promote:hover { background: var(--brand-light); }
.btn-admin-demote  { padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; font-size: .78rem; background: transparent; color: var(--muted); font-family: inherit; }
.btn-admin-demote:hover  { background: var(--panel-alt); color: var(--text); }
.btn-admin-approve:disabled,
.btn-admin-suspend:disabled,
.btn-admin-promote:disabled,
.btn-admin-demote:disabled { opacity: .5; cursor: not-allowed; }

.admin-you-tag {
  font-size: .72rem; padding: 2px 8px; border-radius: 4px;
  background: var(--border-soft); color: var(--muted);
}

@media (max-width: 700px) {
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-table th:nth-child(2),
  .admin-table td:nth-child(2),
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) { display: none; }
}

/* ── Utility: anything marked hidden stays hidden ───────────────── */
.hidden { display: none !important; }

/* ── Public demo banner ─────────────────────────────────────────── */
.demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 24px; font-size: .82rem; line-height: 1.4;
  background: var(--brand-light); color: var(--brand);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.demo-pill {
  font-weight: 700; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--brand); color: var(--on-brand);
}
.demo-link { margin-left: auto; font-weight: 600; color: var(--brand); text-decoration: none; }
.demo-link:hover { text-decoration: underline; }
.badge.snapshot, .data-badge.snapshot { background: rgba(255,255,255,.12); color: var(--warning-light); border-color: rgba(244,231,197,.4); }
.demo-close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--brand); font-size: .9rem; padding: 2px 4px; line-height: 1; }

/* ════════════════════════════════════════════════════════════════════
   Ledger v2 — dashboard skin matching the landing page (2026-11-02)
   Later rules here intentionally override the older component styles.
   ════════════════════════════════════════════════════════════════════ */

@view-transition { navigation: auto; }

html { font-size: 15px; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-light); }

/* Top notice (open access + disclaimer, one line) */
.demo-banner { background: var(--panel-alt); color: var(--muted); border-bottom: 1px solid var(--border); padding: 8px 24px; font-size: .8rem; }
.demo-pill { background: var(--brand); color: var(--on-brand); font: 600 .64rem/1 var(--mono); letter-spacing: .06em; padding: 5px 8px; }
.demo-close { color: var(--subtle); }
.demo-close:hover { color: var(--text); }

/* Header: paper bar like the landing nav */
.header {
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.header-inner { height: 64px; max-width: 1400px; gap: 20px; }
.header-brand { gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--brand); border: 0; position: relative; }
.brand-mark svg { display: none; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bg) 40%, transparent); }
.brand-text { flex-direction: row; align-items: baseline; gap: 10px; }
.brand-name { font: 700 1.08rem/1 var(--serif); color: var(--text); letter-spacing: -.01em; }
.brand-name em { font-style: normal; color: var(--brand); }
.brand-context { font: 500 .66rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); padding-left: 10px; border-left: 1px solid var(--border); }
.header-actions { margin-left: auto; gap: 14px; }
.data-badge { background: transparent; border: 1px solid var(--border); color: var(--muted); font: 500 .64rem/1 var(--mono); letter-spacing: .06em; padding: 6px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.data-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.data-badge.live { background: var(--success-light); border-color: var(--success-line); color: var(--success); }
.data-badge.live::before { background: var(--accent); }
.data-badge.snapshot { background: var(--warning-light); border-color: var(--warning-line); color: var(--warning); }
.data-badge.snapshot::before { background: var(--warning); }
.last-updated { color: var(--subtle); font: 400 .72rem/1 var(--mono); }
.header-btn { text-decoration: none; display: inline-flex; align-items: center; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font: 600 .8rem/1 var(--sans); }
.header-btn:hover { background: var(--panel); border-color: var(--subtle); }
.header-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.header-btn.primary:hover { background: var(--action-hover); }
.header-user { margin-left: 0; }

/* Page */
.page-body { padding: 28px 24px 56px; gap: 18px; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-intro h1 { font: 600 clamp(1.6rem, 2.6vw, 2.2rem)/1.1 var(--serif); letter-spacing: -.015em; }
.page-intro p { color: var(--muted); font-size: .95rem; margin-top: 6px; max-width: 60ch; }
.eyebrow { font: 500 .7rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: block; }

/* KPI: ledger figures (number + label, hairline divided) */
.kpi-row { gap: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.kpi-card { background: transparent; border: 0; border-left: 1px solid var(--border-soft); border-radius: 0; box-shadow: none; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.kpi-card:first-child { border-left: 0; }
.kpi-number { font: 600 2.1rem/1 var(--serif); color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 0; }
.kpi-label { font: 500 .66rem/1.2 var(--mono); letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-label::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--border); flex: none; }
.kpi-danger .kpi-label::before { background: var(--danger); }
.kpi-warning .kpi-label::before { background: var(--warning); }
.kpi-success .kpi-label::before { background: var(--success); }
.kpi-danger .kpi-number, .kpi-warning .kpi-number, .kpi-success .kpi-number { color: var(--text); }

/* Toolbar */
.toolbar { gap: 12px 16px; }
.view-chip { border-radius: 999px; padding: 7px 14px; font-size: .82rem; color: var(--muted); border-color: var(--border); background: var(--panel); }
.view-chip:hover { color: var(--text); border-color: var(--subtle); background: var(--panel); }
.view-chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.search-input, .filter-select, .date-input, .sort-select { border-radius: 999px; border-color: var(--border); background-color: var(--panel); color: var(--text); font-size: .84rem; padding: 8px 14px; }
.search-input { width: 240px; padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%237b8079' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px 50%; }
.search-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.filter-select, .sort-select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%237b8079' stroke-width='1.5'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.reset-btn { border-radius: 999px; padding: 8px 14px; font-size: .8rem; }

/* Tabs: underline with mono counts feel */
.tab-nav { border-bottom: 1px solid var(--border); gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tab-nav::-webkit-scrollbar { display: none; }
.tab { padding: 12px 14px; font-size: .9rem; color: var(--muted); border-bottom-width: 2px; }
.tab.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }

/* Cards */
.queue-pane, .detail-pane, .analytics-card, .dept-card, .map-card { border-radius: var(--radius-lg); border-color: var(--border); box-shadow: var(--shadow); background: var(--panel); }
.queue-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; }
.queue-header { background: transparent; padding: 14px 18px; border-bottom-color: var(--border-soft); }
.queue-count { font: 500 .7rem/1 var(--mono); letter-spacing: .06em; color: var(--muted); }

/* Queue rows */
.queue-row { grid-template-columns: 3px 1fr auto; border-bottom-color: var(--border-soft); }
.queue-row:hover { background: var(--panel-alt); }
.queue-row.selected { background: var(--brand-light); }
.queue-row-stripe { margin: 10px 0; border-radius: 0 3px 3px 0; }
.queue-row-body { padding: 14px 18px; }
.queue-row-meta { gap: 8px; margin-bottom: 6px; }
.q-priority-label { font: 600 .6rem/1 var(--mono); letter-spacing: .06em; padding: 4px 7px; border-radius: 999px; }
.q-cat-badge { font-size: .7rem; border-radius: 999px; padding: 3px 9px; }
.q-area { font-size: .76rem; color: var(--muted); }
.queue-row-text { font-size: .92rem; line-height: 1.5; }
.queue-row-footer { margin-top: 8px; gap: 12px; }
.q-dept, .q-age { font-size: .74rem; }
.q-sla { font: 500 .66rem/1 var(--mono); padding: 4px 7px; border-radius: 999px; }
.sla-ok { background: var(--success-light); color: var(--success); }
.q-status-open .q-status-dot { background: var(--border); box-shadow: inset 0 0 0 1px var(--subtle); }
.q-status-acknowledged .q-status-dot { background: var(--info); }
.q-status-in_progress .q-status-dot { background: var(--warning); }
.q-status-resolved .q-status-dot { background: var(--success); }

/* Detail pane */
.detail-pane { top: 84px; }
.detail-pane h2, .detail-title, .detail-headline { font-family: var(--serif); letter-spacing: -.01em; }
.detail-section-label { font: 500 .66rem/1 var(--mono); letter-spacing: .06em; color: var(--muted); }
.btn-assign, .btn-whatsapp, .btn-source, .btn-copy-tweet { border-radius: 999px !important; }
.btn-assign { background: var(--brand); color: var(--on-brand); }

/* Charts & analytics */
.analytics-title { font: 500 .7rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sev-bar-fill-high, .sev-bar-fill-medium, .sev-bar-fill-low { border-radius: 0 4px 4px 0; }
.breakdown-bar-fill { background: var(--data); border-radius: 0 4px 4px 0; }
.breakdown-chip-count { background: var(--brand); color: var(--on-brand); }

/* Leaflet in dark mode: invert the light basemap */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
  :root:not([data-theme="light"]) .leaflet-container { background: #0e1713; }
}
.leaflet-container { border-radius: var(--radius-lg); font-family: var(--sans); }

/* Footer */
.app-footer { border-top: 1px solid var(--border); margin-top: 24px; padding: 24px; color: var(--subtle); font-size: .8rem; text-align: center; }
.app-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .kpi-row, .toolbar, .tab-nav, .tab-content { animation: gw-enter .5s cubic-bezier(.2,.7,.2,1) both; }
  .toolbar { animation-delay: .04s; } .tab-nav { animation-delay: .08s; } .tab-content { animation-delay: .12s; }
  @keyframes gw-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Responsive */
@media (max-width: 1100px) {
  .queue-layout { grid-template-columns: 1fr; }
  .detail-pane { position: static; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .kpi-card:nth-child(4) { border-left: 0; }
  .kpi-card:nth-child(n+4) { border-top: 1px solid var(--border-soft); }
}
@media (max-width: 640px) {
  .header { padding: 0 16px; }
  .brand-context, .last-updated { display: none; }
  .page-body { padding: 20px 16px 40px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { border-left: 0; border-top: 1px solid var(--border-soft); }
  .kpi-card:nth-child(-n+2) { border-top: 0; }
  .kpi-card:nth-child(even) { border-left: 1px solid var(--border-soft); }
  .search-input { width: 100%; }
  .filter-bar { width: 100%; }
  .filter-select { flex: 1 1 calc(50% - 8px); }
  .demo-banner { padding: 8px 16px; }
}
@media (max-width: 640px) {
  .header-inner { height: 56px; flex-wrap: nowrap; }
  .header-btn.primary, #export-csv { display: none; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filter-bar .search-input { grid-column: 1 / -1; }
  .filter-bar .filter-select, .filter-bar .reset-btn { width: 100%; min-width: 0; }
  .demo-banner { flex-wrap: nowrap; align-items: flex-start; }
  .demo-banner .demo-pill { flex: none; }
}

/* ════════════════════════════════════════════════════════════════════
   WARD SIGNBOARD (2026-11-02) — replaces the "Ledger v2" look above.
   Borrowed from Bengaluru street-name boards, BMTC bus displays and road
   markings. Square corners, 2px rules, sentence case. Colour = meaning:
   blue = act, yellow = past deadline, red = high severity.
   See docs/design/WARD_SIGNBOARD.md.
   ════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;
  --bg: #EEF0EC; --panel: #FAFBF9; --panel-alt: #E4E7E2;
  --text: #1B1F22; --muted: #4A5157; --subtle: #6F777C;
  --rule: #1B1F22;                       /* strong 2px borders */
  --border: #D3D7D3; --border-soft: #E2E5E1;
  --brand: #1D4F9C; --on-brand: #FFFFFF; --brand-light: #E1E9F5;
  --action: #1D4F9C; --action-hover: #163E7C;
  --accent: #1D4F9C; --accent-light: #E1E9F5;
  --marking: #F4C400; --marking-light: #FFF4C2;
  --danger: #C8321E; --danger-light: #FBE7E3; --danger-line: #C8321E;
  --warning: #1B1F22; --warning-light: #FFF4C2; --warning-line: #F4C400;
  --success: #2F6B3F; --success-light: #E4F0E6; --success-line: #2F6B3F;
  --info: #1D4F9C; --info-light: #E1E9F5; --info-line: #1D4F9C;
  --violet: #1D4F9C; --violet-light: #E1E9F5;
  --data: #1D4F9C;
  --seq-1: #E1E9F5; --seq-2: #BFD0EC; --seq-3: #8FAEDF; --seq-4: #1D4F9C;
  --shadow-sm: none; --shadow: none; --shadow-md: none;
  --radius: 0; --radius-lg: 0;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Archivo", system-ui, sans-serif;
  --mono: "Archivo", system-ui, sans-serif;
  --kn: "Noto Sans Kannada", "Archivo", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131719; --panel: #1A1F22; --panel-alt: #20262A;
    --text: #E9ECE8; --muted: #B3BAB7; --subtle: #8B9397;
    --rule: #8B9397; --border: #2E3539; --border-soft: #262C30;
    --brand: #8DB3F0; --on-brand: #0E1A2E; --brand-light: #1C2B44;
    --action: #8DB3F0; --action-hover: #A9C6F4; --accent: #8DB3F0; --accent-light: #1C2B44;
    --marking-light: #3A3110;
    --danger: #EE6A55; --danger-light: #3A1E19; --danger-line: #EE6A55;
    --warning: #E9ECE8; --warning-light: #3A3110; --warning-line: #F4C400;
    --success: #7CC08E; --success-light: #19301F; --success-line: #7CC08E;
    --info: #8DB3F0; --info-light: #1C2B44; --info-line: #8DB3F0;
    --violet: #8DB3F0; --violet-light: #1C2B44;
    --data: #5B8DE0;
    --seq-1: #1C2B44; --seq-2: #24406B; --seq-3: #2F5A99; --seq-4: #5B8DE0;
  }
}

/* Global: hard edges, sentence case, one type family */
*, *::before, *::after { border-radius: 0 !important; text-transform: none !important; letter-spacing: normal; }
.q-status-dot, .dot-high, .dot-medium, .dot-low, .legend-dot, [class*="-dot"], .leaflet-marker-icon { border-radius: 50% !important; }
html { font-size: 15px; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); }
h1, h2, h3, .analytics-title, .detail-title, .detail-headline, .dept-name, .section-title { font-family: var(--sans); }
:focus-visible { outline: 3px solid var(--marking); outline-offset: 2px; }
::selection { background: var(--marking); color: #1B1F22; }

/* Top notice: plain, quiet */
.demo-banner { background: var(--panel); color: var(--muted); border-bottom: 2px solid var(--rule); padding: 8px 24px; font-size: .85rem; gap: 16px; }
.demo-pill { display: none; }
.demo-close { color: var(--muted); font-size: 1rem; }

/* Header: the street-name board */
.header { background: #1D4F9C; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; box-shadow: inset 0 -4px 0 #F4C400; padding: 0 24px; position: sticky; }
.header-inner { height: 64px; padding-bottom: 4px; }
.header-brand { color: #fff; gap: 12px; }
.brand-mark { width: 26px; height: 26px; background: #1D4F9C; box-shadow: inset 0 0 0 2px #1D4F9C, inset 0 0 0 4px #fff; }
.brand-mark::after { inset: auto 7px 7px 7px; height: 3px; background: #F4C400; box-shadow: none; }
.brand-text { flex-direction: row; align-items: baseline; gap: 12px; }
.brand-kn { font: 800 1.15rem/1 var(--kn); color: #fff; }
.brand-name { font: 800 1.15rem/1 var(--sans); font-stretch: 118%; color: #fff; }
.header-actions { gap: 10px; }
.led { display: inline-flex; align-items: center; gap: 6px; background: #121416; padding: 7px 12px; font-stretch: 70%; font-weight: 700; font-size: .95rem; color: #FFB000; white-space: nowrap; }
.led .data-badge, .led .last-updated { all: unset; color: #FFB000; font: inherit; }
.led .data-badge::before { display: none; }
.header-btn { background: transparent; color: #fff; border: 2px solid #fff; padding: 8px 12px; font: 700 .85rem/1 var(--sans); }
.header-btn:hover { background: #fff; color: #1D4F9C; border-color: #fff; }
.header-btn.primary { background: transparent; color: #fff; border-color: #fff; }

/* Page heading, written from the data */
.page-body { padding: 32px 24px 64px; gap: 20px; }
.page-intro h1 { font: 800 clamp(1.8rem, 3.6vw, 3rem)/1.05 var(--sans); font-stretch: 125%; max-width: 22ch; letter-spacing: -.01em; }
.page-intro p { font-size: 1.02rem; color: var(--muted); max-width: 60ch; margin-top: 12px; }
.hl-late { background: #F4C400; color: #1B1F22; padding: 0 .15em; font-stretch: 100%; }

/* Figures strip */
.kpi-row { background: var(--panel); border: 2px solid var(--rule); box-shadow: none; }
.kpi-card { border-left: 2px solid var(--rule); padding: 16px 18px; gap: 6px; }
.kpi-card:first-child { border-left: 0; }
.kpi-number { font: 800 2.4rem/1 var(--sans); font-stretch: 75%; color: var(--text); }
.kpi-label { font: 600 .9rem/1.25 var(--sans); color: var(--muted); }
.kpi-label::before { display: none; }
.kpi-danger { box-shadow: inset 0 -6px 0 #F4C400; }
.kpi-warning .kpi-number { color: var(--danger); }

/* Saved views: one segmented control */
.saved-views { gap: 0; border: 2px solid var(--rule); background: var(--panel); flex-wrap: nowrap; }
.view-chip { border: 0; border-left: 2px solid var(--rule); padding: 9px 14px; font: 600 .9rem/1 var(--sans); color: var(--text); background: transparent; }
.view-chip:first-child { border-left: 0; }
.view-chip:hover { background: var(--panel-alt); color: var(--text); }
.view-chip.active { background: var(--text); color: var(--bg); }

/* Fields */
.search-input, .filter-select, .date-input, .sort-select, .reset-btn {
  border: 2px solid var(--rule); background-color: var(--panel); color: var(--text);
  font: 500 .9rem/1.2 var(--sans); padding-top: 9px; padding-bottom: 9px; box-shadow: none;
}
.search-input:focus, .filter-select:focus, .sort-select:focus { border-color: var(--brand); box-shadow: none; }
.reset-btn { font-weight: 700; }
.reset-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Tabs */
.tab-nav { border-bottom: 2px solid var(--rule); gap: 0; }
.tab { padding: 12px 16px; font: 600 .95rem/1 var(--sans); color: var(--muted); border-bottom: 4px solid transparent; margin-bottom: -2px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 800; }

/* Panels */
.queue-pane, .detail-pane, .analytics-card, .dept-card, .map-card, .officials-section, .dir-card, .heatmap-tile, .admin-card, .official-card { box-shadow: none; }
.queue-pane, .detail-pane, .analytics-card, .dept-card, .map-card { border: 2px solid var(--rule); background: var(--panel); }
.queue-header { background: var(--panel-alt); border-bottom: 2px solid var(--rule); }
.queue-count { font: 700 .9rem/1 var(--sans); color: var(--text); }

/* Queue rows */
.queue-row { grid-template-columns: 6px 1fr auto; border-bottom: 1px solid var(--border); }
.queue-row:hover { background: var(--panel-alt); }
.queue-row.selected { background: var(--brand-light); box-shadow: inset 4px 0 0 var(--brand); }
.queue-row-stripe { margin: 0; }
.queue-row.sev-medium .queue-row-stripe, .queue-row.sev-low .queue-row-stripe { background: transparent; }
.queue-row.sev-high .queue-row-stripe { background: var(--danger); }
.queue-row-meta { gap: 12px; }
.q-priority-label { background: none !important; padding: 0; font: 700 .85rem/1 var(--sans); font-stretch: 75%; color: var(--muted) !important; }
.sev-high .q-priority-label { color: var(--danger) !important; }
.q-cat-badge { background: none; padding: 0; color: var(--brand); font: 700 .85rem/1 var(--sans); font-stretch: 75%; }
.q-area, .q-dept, .q-age { font-stretch: 75%; font-size: .85rem; color: var(--muted); }
.queue-row-text { font-size: .95rem; }
.q-sla { font: 700 .8rem/1 var(--sans); font-stretch: 75%; padding: 4px 7px; }
.sla-overdue { background: #F4C400; color: #1B1F22; box-shadow: inset 5px 0 0 #1B1F22; padding-left: 11px; }
.sla-warning { background: transparent; color: var(--text); border: 2px solid var(--rule); padding: 2px 6px; }
.sla-ok { background: transparent; color: var(--muted); padding-left: 0; }
.q-status-acknowledged .q-status-dot { background: var(--brand); }
.q-status-in_progress .q-status-dot { background: var(--text); }
.q-status-resolved .q-status-dot { background: var(--success); }
.q-cluster-badge { background: none; color: var(--brand); padding: 0; font-weight: 700; }

/* Detail pane */
.detail-pane { top: 84px; }
.detail-pane h2, .detail-title, .detail-headline { font-stretch: 112%; font-weight: 800; }
.detail-section-label { font: 700 .85rem/1 var(--sans); color: var(--muted); }
.btn-assign, .btn-whatsapp, .btn-source, .btn-copy-tweet, .sc-raise-btn { border: 2px solid var(--rule) !important; font-weight: 700; }
.btn-assign { background: #1D4F9C !important; border-color: #1D4F9C !important; color: #fff !important; }
.status-select { border: 2px solid var(--rule) !important; }

/* Analytics & heat map */
.analytics-title { font: 700 1rem/1.2 var(--sans); color: var(--text); }
.heatmap-tile { border: 1px solid var(--border); }
.tile-low { background: var(--seq-1); border-color: var(--border); }
.tile-medium { background: var(--seq-2); border-color: var(--border); }
.tile-high { background: var(--seq-3); border-color: var(--border); }
.hm-count { font-stretch: 75%; font-weight: 800; }
.breakdown-bar-fill { background: var(--data); }
.sev-bar-fill-medium, .sev-bar-fill-low { background: var(--subtle); }
.sev-bar-fill-high { background: var(--danger); }

/* Map */
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); box-shadow: none; border: 2px solid var(--rule); }
.leaflet-bar a { border-radius: 0 !important; }

/* Footer */
.app-footer { border-top: 2px solid var(--rule); background: var(--bg); color: var(--muted); }
.app-footer a { color: var(--brand); }

/* No decorative entrance animation */
.kpi-row, .toolbar, .tab-nav, .tab-content { animation: none !important; }

@media (max-width: 640px) {
  .brand-name { font-size: 1rem; }
  .brand-kn { font-size: 1rem; }
  .header-btn { display: none; }
  .led { font-size: .85rem; padding: 6px 8px; }
  .saved-views { overflow-x: auto; width: 100%; }
  .kpi-card { border-left: 0; border-top: 2px solid var(--rule); }
  .kpi-card:nth-child(-n+2) { border-top: 0; }
  .kpi-card:nth-child(even) { border-left: 2px solid var(--rule); }
}
.kpi-label, .queue-count, .detail-section-label, .tab, .view-chip { letter-spacing: 0 !important; }
.detail-badges { gap: 12px; }
.detail-cat, .detail-sev { background: none !important; border: 0 !important; padding: 0 !important; font: 700 .85rem/1 var(--sans); font-stretch: 75%; }
.detail-cat { color: var(--brand) !important; }
.detail-sev { color: var(--muted) !important; }
.detail-sev-high { color: var(--danger) !important; }
.detail-sla-badge { font: 700 .8rem/1 var(--sans); font-stretch: 75%; padding: 4px 7px; }
.detail-header { background: var(--panel-alt); border-bottom: 2px solid var(--rule); }
.detail-title { font-size: 1.15rem; line-height: 1.25; }
@media (max-width: 640px) {
  .header { padding: 0 14px; }
  .header-inner { gap: 10px; }
  .brand-kn, .header-user, .led .data-badge { display: none; }
  .brand-mark { width: 22px; height: 22px; }
}
.dept-icon { display: none; }
.dept-total, .dept-count { font-stretch: 75% !important; font-weight: 800; background: none !important; }

/* ── Information architecture (2026-11-02): two modes, global nav, Insights ── */
/* Mode switching: complaint controls only where they work */
.people-only { display: none !important; }
body.view-people .people-only { display: revert !important; }
body.view-people .complaints-only,
body.view-people .page-intro:not(.people-only),
body.view-people .kpi-row,
body.view-people .toolbar { display: none !important; }
body.view-people .tab.people-only { display: inline-block !important; }

/* Global nav inside the signboard header */
.header-inner { gap: 28px; }
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: rgba(255,255,255,.85); text-decoration: none; font: 600 .95rem/1 var(--sans); padding: 6px 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.site-nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,.5); }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: #F4C400; }
.header-actions { margin-left: auto; }

/* Detail pane: the hand-off to Report a problem */
.btn-report { display: block; background: #1D4F9C; color: #fff !important; border: 2px solid #1D4F9C; padding: 10px 14px; font-weight: 700; text-decoration: none; text-align: center; }
.btn-report:hover { background: #163E7C; }
.btn-assign { background: transparent !important; color: var(--text) !important; border-color: var(--rule) !important; }

/* Insights */
.insight-block { display: grid; gap: 16px; padding-bottom: 36px; margin-bottom: 8px; border-bottom: 2px solid var(--rule); }
.insight-block:last-child { border-bottom: 0; }
.insight-head h2 { font: 800 1.5rem/1.1 var(--sans); font-stretch: 118%; }
.insight-head p { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.where-levels { width: max-content; max-width: 100%; overflow-x: auto; }
.where-list { border: 2px solid var(--rule); background: var(--panel); }
.where-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) 2fr 90px 110px; gap: 16px; align-items: center; padding: 10px 16px; border: 0; border-top: 1px solid var(--border); background: none; width: 100%; text-align: left; font: inherit; color: var(--text); }
.where-row:first-child { border-top: 0; }
button.where-row { cursor: pointer; }
button.where-row:hover { background: var(--panel-alt); }
.where-head { font-weight: 700; font-size: .85rem; color: var(--muted); background: var(--panel-alt); border-bottom: 2px solid var(--rule); }
.where-name { font-weight: 600; display: grid; }
.where-name small { font-weight: 400; color: var(--muted); font-stretch: 75%; font-size: .85rem; }
.where-bar { height: 14px; background: var(--panel-alt); }
.where-bar i { display: block; height: 100%; background: var(--data); }
.where-n, .where-late { font-stretch: 75%; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.where-late b { background: #F4C400; color: #1B1F22; padding: 1px 6px; }
.where-note { padding: 10px 16px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }
.where-note:empty { display: none; }

@media (max-width: 1100px) {
  .site-nav { order: 3; width: 100%; overflow-x: auto; gap: 18px; padding-bottom: 10px; scrollbar-width: none; }
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 12px; row-gap: 6px; }
}
@media (max-width: 640px) {
  .where-row { grid-template-columns: 1fr 64px 80px; }
  .where-bar { display: none; }
}
.page-intro a { color: var(--brand); font-weight: 600; text-underline-offset: 3px; }
