/* ─── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #edf1f5;
  --panel: #ffffff;
  --ink: #142033;
  --muted: #5d6b7d;
  --line: #d7dfe8;
  --line-strong: #c5d0dc;
  --blue: #1f4f82;
  --blue-light: #edf4fb;
  --teal: #2f6f66;
  --green: #2d7a52;
  --green-light: #edf7f0;
  --yellow: #b07a18;
  --yellow-light: #fcf6e8;
  --red: #b54a4d;
  --red-light: #fdf0f1;
  --navy: #162235;
  --slate: #31455f;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 24px rgba(15, 23, 42, .04);
  --shadow: 0 8px 28px rgba(15, 23, 42, .08);
  --radius: 8px;
  --sidebar-w: 272px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  min-width: 0;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(31,79,130,.07), transparent 24%),
    linear-gradient(180deg, #f6f8fb 0%, var(--bg) 100%);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; min-width: 0; }
button { touch-action: manipulation; }
.hidden { display: none !important; }

/* ─── Login ──────────────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(31,79,130,.10), transparent 28%),
    linear-gradient(180deg, #f4f7fa 0%, #e9eef4 100%);
}

.login-panel {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid rgba(20,32,51,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

.login-brand { color: var(--ink); margin-bottom: 22px; }
.login-brand span { color: var(--muted); }

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #eef2f6;
  padding: 5px;
  border-radius: 9px;
  margin-bottom: 20px;
}

.login-tab {
  height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  min-width: 0;
  padding: 0 6px;
}

.login-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
}

.login-field { display: grid; gap: 6px; margin-bottom: 14px; }

.login-field span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.login-field input,
.login-field select,
.login-button { width: 100%; }

.login-error {
  min-height: 20px;
  color: var(--red);
  font-weight: 700;
  font-size: .875rem;
  margin: 0 0 10px;
}

.login-lockout {
  background: var(--yellow-light);
  border: 1px solid #f5c842;
  color: #7a5500;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 8px 0 0;
}

/* ─── App shell ──────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, #162235 0%, #111b2b 100%);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #162235;
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 90;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #244b78 0%, #173251 100%);
  border: 1px solid rgba(255,255,255,.14);
  font-weight: 800;
  font-size: .9rem;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.brand strong, .brand span { display: block; }
.brand strong { font-size: .96rem; letter-spacing: .01em; }
.brand span, .sidebar-card small { color: #9ab0c9; font-size: .78rem; margin-top: 2px; }

.nav { display: grid; gap: 4px; }

.nav-item {
  border: 0;
  color: #bccbdd;
  background: transparent;
  text-align: left;
  padding: 11px 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.nav-item::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: transparent;
  flex-shrink: 0;
  transition: background .15s;
}

.nav-item.active, .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.08); }
.nav-item.active::before { background: var(--teal); }

.centre-only { display: none; }
body.centre-mode .admin-only { display: none; }
body.centre-mode .centre-only { display: flex; }

.sidebar-card {
  margin-top: auto;
  background: rgba(255,255,255,.04);
  padding: 16px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,.08);
}

.sidebar-card strong,
.sidebar-card span,
.sidebar-card small { display: block; }

.sidebar-card strong { font-size: .88rem; margin-bottom: 2px; }

.role-switch { margin-top: 12px; }

.role-chip {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
  color: #d6e1ec;
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: .83rem;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}

.role-chip:hover { background: rgba(255,255,255,.10); color: #fff; border-color: rgba(255,255,255,.16); }

/* ─── Main ───────────────────────────────────────────────────────────────── */
.main { min-width: 0; padding: 28px 32px; }

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.eyebrow {
  color: var(--slate);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.01em;
  margin-top: 3px;
  line-height: 1.2;
}

h2 { font-size: 1rem; font-weight: 700; }
h3 { font-size: .9rem; font-weight: 700; margin-bottom: 12px; }
p { color: var(--muted); margin-top: 5px; line-height: 1.55; font-size: .875rem; }

.topbar-actions,
.form-actions,
.report-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.company-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6fa;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
}

.company-tabs {
  display: flex;
  gap: 10px;
  margin: -6px 0 20px;
  padding: 6px;
  border: 1px solid rgba(20,32,51,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.65);
  width: fit-content;
  box-shadow: var(--shadow-sm);
}

.company-tab {
  min-width: 120px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}

.company-tab.active {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(15,23,42,.06);
}

.company-tab:hover {
  color: var(--ink);
  background: rgba(255,255,255,.72);
}

/* ─── Inputs & buttons ───────────────────────────────────────────────────── */
select,
input[type="text"],
input[type="password"],
input[type="date"],
input[type="month"],
input[type="number"] {
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

select:focus, input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.button {
  border: 0;
  height: 38px;
  padding: 0 15px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.button:active { transform: scale(.97); }

.button.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31,79,130,.18);
}

.button.primary:hover { background: #193f68; }
.button.secondary { background: #f3f6f9; color: #25364b; border-color: #d9e1ea; }
.button.secondary:hover { background: #e8eef5; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  padding: 0;
  margin-bottom: 14px;
  cursor: pointer;
  font-size: .875rem;
  transition: opacity .15s;
}

.text-button:hover { opacity: .75; }

/* ─── Export dropdown ────────────────────────────────────────────────────── */
.export-menu { position: relative; }

.export-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 175px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 5px;
  z-index: 20;
}

.export-dropdown button {
  width: 100%;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 7px;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: .875rem;
  transition: background .12s;
}

.export-dropdown button:hover { background: #eef3f8; }

/* ─── Access banner ──────────────────────────────────────────────────────── */
.access-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: #f5f8fb;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: .875rem;
}

.access-banner span { color: var(--muted); }

.locked-centre {
  min-height: 38px;
  min-width: 140px;
  border: 1px solid var(--line);
  background: #f2f6fb;
  border-radius: 8px;
  padding: 5px 11px;
}

.locked-centre span {
  display: block;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.locked-centre strong { display: block; margin-top: 1px; }

/* ─── Views ──────────────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ─── Metric cards ───────────────────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid rgba(20,32,51,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  border-top: 3px solid var(--blue);
  transition: box-shadow .2s, border-color .2s;
}

.metric-card:nth-child(2) { border-top-color: var(--teal); }
.metric-card:nth-child(3) { border-top-color: #6b7c93; }
.metric-card:nth-child(4) { border-top-color: var(--green); }

.metric-card:hover { box-shadow: var(--shadow); }

.metric-card span,
.metric-card small { color: var(--muted); font-size: .78rem; }

.metric-card span { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.metric-card strong {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  margin: 6px 0 4px;
  letter-spacing: -.02em;
}

/* ─── Panels ─────────────────────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid rgba(20,32,51,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  align-items: center;
}

.legend i {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.good  { background: var(--green); }
.watch { background: var(--yellow); }
.risk  { background: var(--red); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  background: #fff;
  max-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: #fff;
  font-size: .845rem;
}

.data-table.compact { min-width: 1380px; }

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
}

.data-table th {
  background: #f3f6fa;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #46586f;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table thead .group-row th {
  background: #e9eff5;
  text-align: center;
  font-size: .76rem;
}

/* Sticky first column */
.data-table td:first-child,
.data-table th:first-child {
  text-align: left;
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.data-table th:first-child { background: #e9eff5; z-index: 4; }

.data-table tbody tr { transition: background .12s; cursor: pointer; }
.data-table tbody tr:hover td { background: #f7fafd; }
.data-table tbody tr:hover td:first-child { background: #eef3f8; }

/* Zebra striping */
.data-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.data-table tbody tr:nth-child(even) td:first-child { background: #f8fafc; }
.data-table tbody tr:nth-child(even):hover td { background: #f7fafd; }
.data-table tbody tr:nth-child(even):hover td:first-child { background: #eef3f8; }

.data-table tfoot td {
  background: #eef4ef;
  font-weight: 800;
  font-size: .845rem;
  border-top: 2px solid #c2d5c6;
  position: sticky;
  bottom: 0;
}

.data-table tfoot td:first-child { background: #e6efe7; }

.status-good  { background: #edf6ef !important; color: #1f5d3e; font-weight: 800; }
.status-watch { background: #fbf5e8 !important; color: #8a6113; font-weight: 800; }
.status-risk  { background: #fbefef !important; color: #8f3940; font-weight: 800; }

/* ─── Dashboard grid ─────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

/* ─── Bar chart ──────────────────────────────────────────────────────────── */
.bar-list { display: grid; gap: 10px; }

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 52px;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  font-size: .875rem;
}

.bar-track { height: 11px; background: #e2e9f2; border-radius: 999px; overflow: hidden; }

.bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }

/* ─── Donut / payer split ────────────────────────────────────────────────── */
.donut-row { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; }

.donut {
  width: 155px;
  height: 155px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 50%, var(--teal) 50% 85%, #7a8797 85% 100%);
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(20,32,51,.06);
}

.donut::after {
  content: '';
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: #fff;
}

.split-list { display: grid; gap: 8px; }

.split-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: .875rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

/* ─── Filter / report panel ──────────────────────────────────────────────── */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.filter-grid label { display: grid; gap: 5px; min-width: 0; }

.filter-grid select,
.filter-grid input[type="date"],
.filter-grid input[type="month"],
.filter-grid input[type="text"],
.filter-grid input[type="number"] {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

.filter-grid span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── Swizton entry form ─────────────────────────────────────────────────── */
.swizton-form {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

/* 4-column common fields row */
.swizton-common-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.swizton-common-fields label {
  display: grid;
  gap: 5px;
}

.swizton-common-fields span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.swizton-common-fields input {
  width: 100%;
  height: 38px;
}

/* 2-column section grid */
.swizton-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.swizton-section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.swizton-section-head {
  padding: 10px 16px;
  font-weight: 800;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.swizton-section-head.ufe {
  background: #e8f0fb;
  color: #1e3a6e;
  border-bottom: 2px solid #bfd1ff;
}

.swizton-section-head.vericose {
  background: #e8f7f0;
  color: #1a5c3a;
  border-bottom: 2px solid #9fd4bb;
}

.swizton-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.swizton-fields label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.swizton-fields label:nth-child(even) { border-right: none; }
.swizton-fields label:nth-last-child(-n+2) { border-bottom: none; }

.swizton-fields span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  flex: 1;
}

.swizton-fields input {
  width: 80px;
  height: 30px;
  text-align: right;
  font-size: .85rem;
  flex-shrink: 0;
}

.sw-calc-preview {
  width: 80px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f9;
  border-radius: 6px;
  font-weight: 800;
  font-size: .85rem;
  color: var(--blue);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.sw-common-preview {
  color: var(--muted);
  font-weight: 700;
}

.entry-subpanel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 14px;
}

.entry-subpanel h3 {
  color: var(--ink);
  font-size: .92rem;
  margin-bottom: 12px;
}

#swiztonMappingGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
  gap: 12px;
}

.mini-chart, .forecast-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 16px;
}

.forecast-card { display: grid; align-content: center; gap: 8px; }

.forecast-card span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.forecast-card strong { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.forecast-card small { color: var(--muted); line-height: 1.55; font-size: .82rem; }

/* ─── Snapshot / centre hero ─────────────────────────────────────────────── */
.snapshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.snapshot-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px 15px;
  background: #fff;
  transition: box-shadow .15s;
}

.snapshot-item:hover { box-shadow: var(--shadow-sm); }

.snapshot-item span {
  color: var(--muted);
  display: block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.snapshot-item strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 5px;
  letter-spacing: -.01em;
}

.centre-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border: 1px solid rgba(20,32,51,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 26px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.centre-hero h2 { font-size: 1.8rem; font-weight: 800; margin-top: 4px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
  min-width: 340px;
}

.hero-stats div {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
}

.hero-stats span {
  color: var(--muted);
  display: block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.hero-stats strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 5px;
}

/* ─── Trend chart ────────────────────────────────────────────────────────── */
.trend-chart {
  height: 240px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 16px 0 28px;
  overflow-x: auto;
}

.trend-chart.small { height: 160px; }

.trend-bar {
  flex: 1;
  min-width: 18px;
  max-width: 40px;
  background: linear-gradient(180deg, #5b7ca2, #1f4f82);
  border-radius: 5px 5px 0 0;
  position: relative;
  transition: opacity .15s;
  cursor: default;
}

.trend-bar:hover { opacity: .75; }

.trend-bar span {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Entry form ─────────────────────────────────────────────────────────── */
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.entry-list { display: grid; gap: 0; }

.entry-row {
  display: grid;
  grid-template-columns: 1fr 82px 82px 82px;
  gap: 7px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  margin-bottom: 4px;
  background: #fafcff;
  border: 1px solid var(--line);
  transition: background .1s;
}

.entry-row:hover:not(.header) { background: #f0f6ff; }

.entry-row.header {
  background: #f3f6fa;
  color: #495c71;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-color: #d8e3ef;
}

.entry-row span { font-weight: 600; font-size: .875rem; }

.entry-row input,
.entry-table input,
.target-card input { width: 100%; height: 32px; text-align: center; font-size: .85rem; }

.entry-row output,
.entry-table output {
  height: 32px;
  display: grid;
  place-items: center;
  background: #eff4f9;
  border-radius: 6px;
  color: #27405d;
  font-weight: 800;
  font-size: .85rem;
}

/* ─── Targets ────────────────────────────────────────────────────────────── */
.centre-detail-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 16px;
  flex-wrap: wrap;
}

.centre-detail-tab {
  border: 1px solid var(--line);
  background: #f3f6fa;
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}

.centre-detail-tab.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.centre-detail-pane { display: none; }
.centre-detail-pane.active { display: block; }

.petty-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.petty-summary-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px 14px;
}

.petty-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.petty-summary-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.petty-balance-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.petty-balance-row label,
.petty-entry-grid label {
  display: grid;
  gap: 5px;
}

.petty-balance-row span,
.petty-entry-grid span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.petty-entry-panel .panel-head {
  margin-bottom: 12px;
}

.petty-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.petty-entry-grid input { width: 100%; min-width: 0; }

.petty-particulars-field,
.petty-remarks-field {
  grid-column: span 2;
}

.petty-entry-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.petty-table { min-width: 980px; }

.petty-table td:nth-child(3),
.petty-table th:nth-child(3),
.petty-table td:nth-child(8),
.petty-table th:nth-child(8) {
  text-align: left;
}

.petty-table .petty-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.petty-table .petty-opening-row td { background: #f8f2eb; }

.petty-table tfoot td {
  border-top: 2px solid #1f2937;
  font-weight: 800;
}

.petty-actions-cell { white-space: nowrap; }

.text-button.danger { color: var(--red); }

.target-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }

.target-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: #fff;
  transition: box-shadow .15s;
}

.target-card:hover { box-shadow: var(--shadow-sm); }
.target-card strong, .target-card span { display: block; }
.target-card span { color: var(--muted); margin-top: 3px; font-size: .78rem; }

/* ─── Users ──────────────────────────────────────────────────────────────── */
.user-list { display: grid; gap: 10px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: #fff;
  flex-wrap: wrap;
}

.user-card > div { flex: 1; min-width: 120px; }
.user-card strong, .user-card span { display: block; }
.user-card span { color: var(--muted); margin-top: 2px; font-size: .78rem; }
.user-card input { max-width: 145px; }
.user-card button { white-space: nowrap; }

/* ─── Procedures settings ────────────────────────────────────────────────── */
#procedureSettingsTable input[type="checkbox"] { width: 18px; height: 18px; }
#procedureSettingsTable input[type="text"] { min-width: 200px; height: 34px; }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(20,32,51,.96);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  font-size: .875rem;
  font-weight: 600;
  z-index: 999;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ─── Responsive — tablet (≤1080px) ─────────────────────────────────────── */
@media (max-width: 1080px) {
  :root { --sidebar-w: 240px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .report-preview-grid { grid-template-columns: 1fr; }
  .swizton-section-grid { grid-template-columns: 1fr; }
  .petty-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .swizton-common-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
  .petty-entry-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
}

/* ─── Responsive — mobile (≤768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(86vw, 292px);
    transform: translateX(-100%);
    padding: 64px 14px 18px;
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: flex; }

  .sidebar-toggle {
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
  }

  .main { padding: 14px; padding-top: 66px; }

  h1 { font-size: 1.35rem; }
  h2 { font-size: .98rem; }
  p { font-size: .82rem; }

  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 1.55rem; }
  .metric-card span,
  .metric-card small { font-size: .72rem; }

  .entry-grid,
  .dashboard-grid,
  .filter-grid,
  .report-preview-grid,
  .petty-entry-grid,
  .swizton-section-grid,
  .donut-row,
  .hero-stats { grid-template-columns: 1fr; }

  .hero-stats { min-width: 0; }

  .centre-hero,
  .topbar,
  .panel-head { flex-direction: column; }

  .topbar {
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
  }

  .topbar-actions,
  .form-actions,
  .report-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 8px;
    align-items: end;
  }

  .topbar-actions > *,
  .form-actions > *,
  .report-actions > *,
  .export-menu,
  .export-menu-button,
  .button,
  select,
  input[type="text"],
  input[type="password"],
  input[type="date"],
  input[type="month"],
  input[type="number"] {
    width: 100%;
  }

  select,
  input[type="text"],
  input[type="password"],
  input[type="date"],
  input[type="month"],
  input[type="number"],
  .button {
    min-height: 44px;
  }

  .export-dropdown {
    left: 0;
    right: 0;
    min-width: 0;
  }

  .access-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
  }

  .panel {
    padding: 14px;
    margin-bottom: 14px;
  }

  .panel-head {
    gap: 10px;
    margin-bottom: 12px;
    align-items: stretch;
  }

  .panel-head > div { min-width: 0; }

  .company-tabs { width: 100%; }
  .company-tab { flex: 1; min-width: 0; }
  .company-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .company-pill { justify-content: center; }
  .petty-particulars-field,
  .petty-remarks-field { grid-column: auto; }

  .locked-centre {
    min-width: 0;
    width: 100%;
  }

  .table-wrap {
    margin-inline: -4px;
    border-radius: 7px;
  }

  .data-table {
    min-width: 760px;
    font-size: .78rem;
  }

  .data-table.compact { min-width: 1040px; }
  .entry-table { min-width: 980px; }
  .petty-table { min-width: 860px; }

  .data-table th,
  .data-table td {
    padding: 8px;
  }

  .data-table th {
    font-size: .65rem;
    line-height: 1.2;
  }

  .swizton-fields { grid-template-columns: 1fr; }
  .swizton-fields label {
    border-right: 0;
    min-height: 48px;
  }
  .swizton-fields label:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .swizton-fields label:last-child { border-bottom: 0; }
  .swizton-fields input,
  .sw-calc-preview {
    width: 96px;
    min-height: 38px;
  }

  .entry-row {
    grid-template-columns: minmax(0, 1fr) repeat(3, minmax(62px, 74px));
    gap: 6px;
    padding: 8px;
  }

  .entry-row span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .entry-row.header {
    font-size: .65rem;
    line-height: 1.15;
  }

  .entry-row input,
  .entry-table input {
    height: 40px;
    font-size: .82rem;
  }

  .entry-row output,
  .entry-table output,
  .locked-value {
    min-height: 38px;
    height: auto;
    padding: 0 4px;
  }

  .petty-balance-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .petty-entry-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .target-card,
  .user-card {
    align-items: stretch;
  }

  .target-card {
    flex-direction: column;
  }

  .user-card {
    flex-direction: column;
  }

  .user-card input,
  .user-card button {
    max-width: none;
    width: 100%;
  }

  .unlock-card-head,
  .unlock-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .unlock-actions,
  .modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .modal-overlay { padding: 12px; }
  .modal {
    padding: 18px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .panel-head .legend { margin-top: 4px; }
  .snapshot-grid { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 90px 1fr 44px; font-size: .8rem; }
}

/* ─── Responsive — small mobile (≤480px) ────────────────────────────────── */
@media (max-width: 480px) {
  .login-screen { padding: 14px; }
  .login-panel { padding: 24px 18px; }
  .login-tab {
    font-size: .78rem;
    padding: 0 4px;
  }

  .metric-card strong { font-size: 1.5rem; }

  .entry-row {
    grid-template-columns: minmax(84px, 1fr) repeat(3, minmax(52px, 62px));
    gap: 4px;
    padding: 7px 8px;
  }

  .entry-row span { font-size: .8rem; }
  .entry-row.header { font-size: .58rem; }
  .entry-row input,
  .entry-row output,
  .locked-value {
    font-size: .76rem;
  }

  .snapshot-grid { grid-template-columns: 1fr; }
  .user-card { flex-direction: column; align-items: flex-start; }
  .user-card input { max-width: 100%; width: 100%; }
  .topbar-actions { width: 100%; }
  .filter-grid { grid-template-columns: 1fr; }
  .petty-summary-grid { grid-template-columns: 1fr; }
  .petty-entry-actions { justify-content: stretch; }
  .petty-entry-actions .button { flex: 1; }
  .swizton-common-fields { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 78px 1fr 38px; gap: 7px; }
  .donut { width: 132px; height: 132px; margin-inline: auto; }
  .donut::after { inset: 28px; }
}

@media (max-width: 380px) {
  .main {
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 64px;
  }

  .panel { padding: 12px; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 12px; }

  .entry-row {
    grid-template-columns: minmax(72px, 1fr) repeat(3, minmax(48px, 1fr));
  }

  .entry-row input,
  .entry-row output,
  .locked-value {
    padding-inline: 2px;
  }
}

/* ─── Lock banners ───────────────────────────────────────────────────────── */
.lock-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.lock-banner.locked {
  background: var(--yellow-light);
  border: 1px solid #e6d2a4;
  color: #795718;
}

.lock-banner.unlocked {
  background: var(--green-light);
  border: 1px solid #c7dacd;
  color: #23543b;
}

.lock-banner.future {
  background: var(--red-light);
  border: 1px solid #e2c4c6;
  color: #86383d;
}

.lock-banner span { color: inherit; opacity: .8; }

/* ─── Entry meta (last updated) ─────────────────────────────────────────── */
.entry-meta {
  color: var(--muted);
  font-size: .78rem;
  margin: -8px 0 12px;
  font-style: italic;
}

/* ─── Locked value cell ──────────────────────────────────────────────────── */
.locked-value {
  height: 32px;
  display: grid;
  place-items: center;
  background: #f0f2f5;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: .85rem;
  border: 1px dashed var(--line);
}

/* ─── Nav badge ──────────────────────────────────────────────────────────── */
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── Unlock request cards ───────────────────────────────────────────────── */
.unlock-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
}

.unlock-card.approved { border-left: 4px solid var(--green); }
.unlock-card.rejected { border-left: 4px solid var(--red); }
.unlock-card.pending  { border-left: 4px solid var(--yellow); }

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

.unlock-card-head strong { display: block; font-size: .95rem; }
.unlock-card-head span   { color: var(--muted); font-size: .8rem; }

.unlock-badge {
  font-size: .7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.unlock-badge.pending  { background: #fff3cd; color: #7a5500; }
.unlock-badge.approved { background: var(--green-light); color: #1b5e2e; }
.unlock-badge.rejected { background: var(--red-light); color: #721c24; }

.unlock-reason {
  color: var(--ink);
  font-size: .875rem;
  margin: 6px 0 10px;
  font-style: italic;
}

.unlock-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.unlock-actions { display: flex; gap: 8px; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal {
  background: #fff;
  border: 1px solid rgba(20,32,51,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  width: min(480px, 100%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}

.modal-close:hover { background: #eef3f8; color: var(--ink); }

.modal p { color: var(--muted); margin-bottom: 16px; font-size: .9rem; }
.modal p strong { color: var(--ink); }

.modal-field { display: grid; gap: 6px; margin-bottom: 18px; }

.modal-field span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.modal-field textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: .9rem;
  resize: vertical;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.modal-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ─── Unlock view panel min-height ──────────────────────────────────────── */

/* ─── Audit log ──────────────────────────────────────────────────────────── */
.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.audit-filter-grid label { display: grid; gap: 5px; }

.audit-filter-grid span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.audit-filter-grid select,
.audit-filter-grid input[type="date"] { width: 100%; }

.audit-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fafcff;
  transition: box-shadow .15s;
}

.audit-card:hover { box-shadow: var(--shadow-sm); }

.audit-card[data-type="unlocked-edit"] { border-left: 4px solid var(--yellow); }
.audit-card[data-type="revert"]        { border-left: 4px solid #6b7c93; }

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

.audit-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.audit-card-title strong { font-size: .95rem; }

.audit-date-tag {
  background: #e8edf5;
  color: #3d5068;
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.audit-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--muted);
}

.audit-card-meta strong { color: var(--ink); }

/* Audit type badges */
.audit-badge {
  font-size: .7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.audit-badge-normal  { background: #e8f0fb; color: #1e3a6e; }
.audit-badge-unlock  { background: #fff3cd; color: #7a5500; }
.audit-badge-revert  { background: #f0ebff; color: #4c1d95; }

/* Diff section */
.audit-diff summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue);
  padding: 4px 0;
  user-select: none;
}

.audit-diff summary:hover { opacity: .8; }

.audit-diff-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 480px;
}

.audit-diff-table th,
.audit-diff-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.audit-diff-table th {
  background: #edf2f9;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #3d5068;
}

.audit-diff-table tr:last-child td { border-bottom: 0; }

.audit-diff-before { color: var(--red);   font-weight: 700; }
.audit-diff-after  { color: var(--green); font-weight: 700; }
.audit-up   { color: var(--green); font-weight: 800; }
.audit-down { color: var(--red);   font-weight: 800; }

.audit-revert-btn { font-size: .8rem; height: 32px; padding: 0 12px; }

@media (max-width: 768px) {
  .audit-filter-grid { grid-template-columns: 1fr 1fr; }
  .audit-card-head   { flex-direction: column; }
}

@media (max-width: 480px) {
  .audit-filter-grid { grid-template-columns: 1fr; }
}

/* ─── Super Admin role visibility ───────────────────────────────────────────── */
.superadmin-only { display: none; }
body.superadmin-mode .superadmin-only { display: flex; }
body.superadmin-mode .admin-only { display: flex; } /* super admin sees all admin nav */

/* Role badges in audit log */
.role-badge-superadmin {
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.role-badge-admin {
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8f0fb;
  color: #1e3a6e;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── Centre assignment chips ────────────────────────────────────────────────  */
.centre-assign-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.centre-assign-chip {
  appearance: none;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  background: #f2f6fb;
  color: var(--muted);
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
}

.centre-assign-chip.selected {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.centre-assign-chip:hover {
  border-color: var(--blue);
}

/* Centre chip (display only in admin list) */
.centre-chip {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin: 2px 2px 0 0;
}

/* ─── Backup comparison ───────────────────────────────────────────────────── */
.backup-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.backup-compare-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.backup-compare-card span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.backup-compare-card strong {
  display: block;
  font-size: 1.5rem;
  margin-top: 8px;
}

.backup-compare-delta {
  margin-top: 8px;
  font-size: .85rem;
  font-weight: 700;
}

.backup-compare-up {
  color: var(--green);
}

.backup-compare-down {
  color: var(--red);
}

.backup-compare-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 12px;
}

.backup-compare-section summary {
  cursor: pointer;
  padding: 12px 14px;
  background: #eef3f8;
  font-weight: 800;
  color: var(--ink);
}

.backup-compare-table {
  width: 100%;
  border-collapse: collapse;
}

.backup-compare-table th,
.backup-compare-table td {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: .86rem;
}

.backup-compare-table th {
  background: #f9fbfd;
  color: var(--muted);
  text-transform: uppercase;
  font-size: .72rem;
}

.backup-feedback {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  font-size: .88rem;
}

.backup-feedback strong,
.backup-state strong {
  display: block;
  margin-bottom: 4px;
  font-size: .9rem;
}

.backup-feedback.loading,
.backup-state.loading {
  background: var(--blue-light);
  border-color: #bfd1ff;
  color: #1e3a6e;
}

.backup-feedback.success,
.backup-state.success {
  background: var(--green-light);
  border-color: #b9dfc5;
  color: #17603a;
}

.backup-feedback.error,
.backup-state.error {
  background: var(--red-light);
  border-color: #f0b7bf;
  color: #9f2130;
}

.backup-feedback.empty,
.backup-state.empty {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--muted);
}

.alert-banner {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .875rem;
  font-weight: 700;
  background: #f6f8fb;
  color: var(--ink);
}

.alert-banner.success {
  background: var(--green-light);
  border-color: #c7dacd;
  color: #23543b;
}

.alert-banner.error {
  background: var(--red-light);
  border-color: #e2c4c6;
  color: #86383d;
}

.alert-banner small {
  display: block;
  margin-top: 4px;
  color: inherit;
  font-weight: 500;
}

.entry-status {
  display: inline-block;
  margin-top: 4px;
  font-size: .73rem;
  font-weight: 700;
  color: var(--muted);
}

.entry-status.missing {
  color: var(--red);
}

.entry-status.updated {
  color: var(--green);
}

.backup-state {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #fbfdff;
}

/* ─── Super admin sidebar highlight ─────────────────────────────────────────── */
.nav-item[data-view="superadmin"] {
  background: linear-gradient(135deg, rgba(124,58,237,.15), rgba(37,99,235,.1));
  color: #c4b5fd;
  border: 1px solid rgba(124,58,237,.25);
}

.nav-item[data-view="superadmin"].active,
.nav-item[data-view="superadmin"]:hover {
  background: linear-gradient(135deg, rgba(124,58,237,.35), rgba(37,99,235,.2));
  color: #fff;
}

/* ─── Login tabs (3-tab layout) ──────────────────────────────────────────────── */
.login-tabs {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
  .unlock-card-head,
  .unlock-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .unlock-actions,
  .modal-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .modal-overlay { padding: 12px; }

  .modal {
    padding: 18px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }
}
