/* =====================================================================
   KÜ Trummi 21 — Helsinki design system
   Typography: Inter (body) + JetBrains Mono (data/IDs)
   Palette: light grey shell + crisp white surfaces + electric indigo
===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:           #F5F5F7;
  --surface:      #FFFFFF;
  --surface-2:    #FAFAFA;
  --line:         #ECECEC;
  --line-2:       #E2E2E5;

  --ink:          #0A0A0A;
  --ink-2:        #404044;
  --ink-3:        #71717A;
  --ink-4:        #A1A1AA;

  --indigo:       #5750E5;
  --indigo-50:    #EEEEFC;
  --indigo-100:   #DDDDF9;
  --indigo-700:   #4039C0;

  --green:        #18B26B;
  --green-50:     #E6F8EF;
  --amber:        #DA8A00;
  --amber-50:     #FFF6E0;
  --rose:         #DC3545;
  --rose-50:      #FBEBEC;

  --hero-grad:    linear-gradient(135deg, #5750E5 0%, #8B5CF6 50%, #EC4899 100%);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  18px;

  --shadow-sm:  0 1px 2px rgba(20, 20, 30, 0.04), 0 0 0 1px var(--line);
  --shadow-md:  0 1px 3px rgba(20, 20, 30, 0.04), 0 4px 12px rgba(20, 20, 30, 0.04), 0 0 0 1px var(--line);
  --shadow-lg:  0 4px 16px rgba(87, 80, 229, 0.08), 0 1px 3px rgba(20, 20, 30, 0.04), 0 0 0 1px var(--line);

  --transition: 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

* { box-sizing: border-box; }
*::selection { background: var(--indigo); color: white; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'cv11', 'cv05';
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--indigo); }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

img { max-width: 100%; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 1.75rem; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; letter-spacing: -0.02em; }
h3 { font-size: 1rem; }

p { margin: 0; }

code, .mono { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--ink-3); }
.secondary { color: var(--ink-3); font-size: 12.5px; }

/* ---------- Sidebar layout ---------- */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  text-decoration: none;
  color: inherit;
}
.brand-row:hover { color: inherit; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-name small {
  display: block;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0;
  margin-top: 1px;
}

.nav-section {
  padding: 0.6rem 0.75rem 0.4rem;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}

.nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-link svg {
  width: 16px; height: 16px;
  color: var(--ink-3);
  transition: color var(--transition);
  flex-shrink: 0;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link:hover svg { color: var(--ink-2); }
.nav-link.active {
  background: var(--indigo-50);
  color: var(--indigo-700);
}
.nav-link.active svg { color: var(--indigo); }

.nav-link .badge {
  margin-left: auto;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
}
.nav-link.active .badge {
  background: white;
  color: var(--indigo-700);
  border-color: var(--indigo-100);
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.75rem 0.5rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 13px;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--hero-grad);
  color: white;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600;
  flex-shrink: 0;
}
.user-name { font-weight: 500; line-height: 1.2; }
.user-name small { display: block; color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.sidebar-footer a {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 12.5px;
}
.sidebar-footer a:hover { color: var(--ink); }

/* ---------- Page content ---------- */

.page {
  padding: 2.5rem 3rem;
  max-width: 1400px;
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.page-head .titles h1 { margin: 0; }
.page-head .titles .crumbs {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--ink-3);
  font-size: 13px;
  margin-bottom: 0.4rem;
}
.page-head .titles .crumbs svg { width: 12px; height: 12px; flex-shrink: 0; }
.page-head .titles p {
  margin: 0.4rem 0 0;
  color: var(--ink-3);
  font-size: 14px;
  max-width: 70ch;
}
.page-head .meta {
  display: flex; gap: 0.5rem; align-items: center;
  font-size: 13px; color: var(--ink-3);
}

/* ---------- Hero (dashboard top) ---------- */

.hero {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: var(--hero-grad);
  opacity: 0.06;
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 12px; font-weight: 500;
  color: var(--indigo-700);
  background: var(--indigo-50);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--indigo-100);
}
.hero-eyebrow svg { width: 13px; height: 13px; flex-shrink: 0; }
.hero h1 {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.028em;
  margin: 0.7rem 0 0.4rem;
  line-height: 1.15;
}
.hero p {
  margin: 0; color: var(--ink-2);
  font-size: 14.5px;
  max-width: 52ch;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 1.25rem;
  background: var(--ink); color: white;
  padding: 0.65rem 1.05rem;
  border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500;
  border: 0;
  transition: background var(--transition), transform var(--transition);
}
.hero-cta:hover { background: var(--indigo); color: white; transform: translateY(-1px); }
.hero-cta svg { width: 14px; height: 14px; flex-shrink: 0; }

.hero-side {
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
}
.hero-side .row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.4rem 0; }
.hero-side .row + .row { border-top: 1px dashed var(--line-2); }
.hero-side .lbl { color: var(--ink-3); font-size: 12.5px; }
.hero-side .val { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.hero-side .val.green { color: var(--green); }
.hero-side .val.indigo { color: var(--indigo); }

/* ---------- Stat tiles ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.35rem;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); color: inherit; }

.stat-card .head { display: flex; align-items: center; justify-content: space-between; }
.stat-card .head h3 {
  margin: 0; font-size: 12.5px; font-weight: 500;
  color: var(--ink-3); letter-spacing: 0.01em;
  text-transform: none;
}
.stat-card .head .icon-pill {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--indigo-50); color: var(--indigo);
}
.stat-card .head .icon-pill.green { background: var(--green-50); color: var(--green); }
.stat-card .head .icon-pill.amber { background: var(--amber-50); color: var(--amber); }
.stat-card .head .icon-pill.gray  { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.stat-card .head .icon-pill svg { width: 14px; height: 14px; flex-shrink: 0; }
.stat-card .value {
  font-size: 1.85rem; font-weight: 600;
  letter-spacing: -0.03em;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.stat-card .value .unit { font-size: 1rem; color: var(--ink-3); margin-left: 4px; }
.stat-card .meta { font-size: 12.5px; color: var(--ink-3); }
.stat-card .meta .ok    { color: var(--green); font-weight: 500; }
.stat-card .meta .pend  { color: var(--amber); font-weight: 500; }
.stat-card .meta .danger{ color: var(--rose);  font-weight: 500; }

.stat-card.credit .value { color: var(--green); }
.stat-card.debt   .value { color: var(--rose); }

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

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  gap: 1rem;
}
.card-head h2 {
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  display: flex; align-items: center; gap: 0.5rem;
}
.card-head h2 svg { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.card-head .right { font-size: 13px; color: var(--ink-3); }
.card-body { padding: 0.5rem 0; }
.card-body.padded { padding: 1.25rem; }

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

table.crisp {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
table.crisp thead th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--ink-3);
  padding: 0.55rem 1.25rem;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
table.crisp tbody td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.crisp tbody tr:last-child td { border-bottom: 0; }
table.crisp tbody tr { transition: background var(--transition); }
table.crisp tbody tr:hover { background: var(--surface-2); }
table.crisp .num { text-align: right; }
table.crisp .num.balance { font-weight: 600; }
table.crisp .num.credit { color: var(--green); }
table.crisp .num.debt { color: var(--rose); }
table.crisp .id { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
table.crisp .apt-id {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-weight: 600; font-size: 12px;
  color: var(--ink-2);
}
table.crisp .secondary { color: var(--ink-3); font-size: 12.5px; }
table.crisp .mono { font-family: var(--mono); font-size: 12.5px; }

table.crisp .pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 11.5px; font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
}
table.crisp .pill.credit { background: var(--green-50); color: var(--green); }
table.crisp .pill.debt   { background: var(--rose-50); color: var(--rose); }
table.crisp .pill.pend   { background: var(--amber-50); color: var(--amber); }
table.crisp .pill.idle   { background: var(--surface-2); color: var(--ink-3); }
table.crisp .pill.indigo { background: var(--indigo-50); color: var(--indigo-700); }
table.crisp .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

table.crisp .row-action {
  font-size: 12.5px; color: var(--ink-3); font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.3rem;
  transition: color var(--transition), gap var(--transition);
}
table.crisp .row-action:hover { color: var(--indigo); gap: 0.5rem; }
table.crisp .row-action svg { width: 12px; height: 12px; flex-shrink: 0; }

table.crisp .empty-row td {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  padding: 2.5rem 1.25rem;
}

/* Compact variant for dense tables (audit log, balance events) */
table.crisp.dense thead th { padding: 0.45rem 1rem; font-size: 11.5px; }
table.crisp.dense tbody td { padding: 0.55rem 1rem; font-size: 13px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--r-md);
  border: 0;
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: var(--ink); color: white;
}
.btn-primary:hover { background: var(--indigo); color: white; transform: translateY(-1px); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); }
.btn-secondary {
  background: var(--indigo-50);
  color: var(--indigo-700);
  border: 1px solid var(--indigo-100);
}
.btn-secondary:hover { background: var(--indigo-100); }
.btn-danger {
  background: var(--surface);
  color: var(--rose);
  border: 1px solid var(--line-2);
}
.btn-danger:hover { background: var(--rose-50); border-color: var(--rose); }
.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 12.5px;
}

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-sm svg { width: 12px; height: 12px; }

/* Google sign-in button */
.btn-google {
  display: inline-flex; align-items: center; gap: 0.6rem; justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  font-size: 14px; font-weight: 500;
  width: 100%;
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
}
.btn-google:hover { background: var(--surface-2); color: var(--ink); transform: translateY(-1px); }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Forms ---------- */

.form-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.form-card h3 {
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.form-card h3 + .form-row { margin-top: 0; }
.form-card .form-row + h3,
.form-card details + h3 { margin-top: 1.5rem; }

.form-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.form-row.single { grid-template-columns: 1fr; }
.form-row.thirds { grid-template-columns: 1fr 1fr 1fr; }
.field {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 0.55rem 0.75rem;
  font-size: 14px;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: 0;
  font-family: inherit;
}
.field input.mono, .field input[type="number"] { font-family: var(--mono); font-size: 13px; }
.field input[type="email"], .field input[type="text"]:not(.mono):not([type="number"]) { font-family: inherit; font-size: 14px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-50);
}
.field textarea { min-height: 4.5em; resize: vertical; line-height: 1.5; }
.field input[readonly] { background: var(--surface-2); color: var(--ink-3); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.field .hint strong { color: var(--ink-2); }
.field .check {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: 0.45rem 0.75rem;
  border-radius: var(--r-md);
  cursor: pointer;
  width: max-content;
  font-size: 13.5px;
}
.field .check input { width: 14px; height: 14px; accent-color: var(--indigo); margin: 0; }

.form-actions {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.form-actions .saved {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 12.5px; color: var(--ink-3);
}
.form-actions .saved svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ---------- Tabs ---------- */

.tab-bar {
  display: flex; gap: 0.25rem;
  background: var(--surface-2);
  padding: 0.25rem;
  border-radius: var(--r-md);
  margin-bottom: 1.25rem;
  width: max-content;
  border: 1px solid var(--line);
}
.tab-bar a {
  padding: 0.45rem 0.85rem;
  font-size: 13px; font-weight: 500;
  color: var(--ink-3);
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.tab-bar a:hover { color: var(--ink-2); }
.tab-bar a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Step cards ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.step-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: box-shadow var(--transition);
}
.step-card:hover { box-shadow: var(--shadow-md); }
.step-card .step-no {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 11.5px; color: var(--ink-3); font-weight: 500;
}
.step-card .step-no .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--indigo-50);
  color: var(--indigo);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
}
.step-card .step-no .dot.done { background: var(--green-50); color: var(--green); }
.step-card .step-title {
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.step-card .step-meta {
  font-size: 12.5px; color: var(--ink-3);
}
.step-card form { margin: 0.5rem 0 0; }
.step-card .step-cta, .step-card form button {
  margin-top: 0.5rem;
  font-size: 12.5px; font-weight: 500;
  color: var(--indigo); display: inline-flex; align-items: center; gap: 0.25rem;
  background: transparent; border: 0; padding: 0; cursor: pointer;
  font-family: inherit;
}
.step-card form button:hover, .step-card .step-cta:hover { gap: 0.5rem; }
.step-card .step-cta svg, .step-card form button svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ---------- Banners ---------- */

.callout {
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  color: var(--indigo-700);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  font-size: 13px;
  display: flex; gap: 0.6rem; align-items: flex-start;
  margin-bottom: 1.25rem;
}
.callout svg { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; }

.banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 1.25rem;
}
.banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.banner.success { background: var(--green-50); color: #0F7340; border: 1px solid #C5EFD8; }
.banner.warn    { background: var(--amber-50); color: #8A5800; border: 1px solid #FCE6A8; }
.banner.error   { background: var(--rose-50);  color: #97162A; border: 1px solid #F4C7CB; }

/* legacy class names from earlier templates — keep working */
.warn { background: var(--amber-50); color: #8A5800; border: 1px solid #FCE6A8;
  border-radius: var(--r-md); padding: 0.7rem 1rem; font-size: 13.5px; margin-bottom: 1rem; }
.error { background: var(--rose-50); color: #97162A; border: 1px solid #F4C7CB;
  border-radius: var(--r-md); padding: 0.7rem 1rem; font-size: 13.5px; margin-bottom: 1rem; }

.kbd {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink-2);
}

/* ---------- Login (centered card) ---------- */

.center-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 2rem;
}
.center-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.center-card .brand-stack { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; margin-bottom: 1.5rem; }
.center-card .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.center-card h1 { font-size: 1.5rem; }
.center-card p { color: var(--ink-3); font-size: 14px; margin-top: 0.4rem; }

.divider {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 0.75rem;
  color: var(--ink-3); font-size: 12px;
  margin: 1.25rem 0;
}
.divider::before, .divider::after { content: ''; height: 1px; background: var(--line); }

/* ---------- Misc utility ---------- */

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; } .gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.text-right { text-align: right; }
.text-mono { font-family: var(--mono); font-size: 12.5px; }
.no-wrap { white-space: nowrap; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .stat-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.thirds { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; overflow-y: visible; }
  .stat-grid, .steps { grid-template-columns: 1fr; }
  .page { padding: 1.5rem; }
}

/* ---- Contextual help tooltips (macros/help.html) ---------------------- */
.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  color: var(--ink-4);
  cursor: help;
  vertical-align: middle;
}
.help-tip svg { width: 14px; height: 14px; }
.help-tip:hover, .help-tip:focus-within, .help-tip:focus { color: var(--ink-2); outline: 0; }
.help-tip .tip-body {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: max-content;
  max-width: 280px;
  padding: 0.55rem 0.7rem;
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  border-radius: var(--r-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  white-space: normal;
  text-transform: none;
  letter-spacing: normal;
}
.help-tip:hover .tip-body, .help-tip:focus .tip-body, .help-tip:focus-within .tip-body { display: block; }
.hint-inline { color: var(--ink-4); font-weight: 400; font-size: 12px; text-transform: none; letter-spacing: normal; }

/* ---- Review queue / digitize layout ----------------------------------- */
.review-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.review-split .pdf-pane {
  position: sticky;
  top: 1.5rem;
}
.review-split .pdf-pane iframe {
  width: 100%;
  height: 78vh;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: #fff;
}
@media (max-width: 1100px) {
  .review-split { grid-template-columns: 1fr; }
  .review-split .pdf-pane { position: relative; }
  .review-split .pdf-pane iframe { height: 50vh; }
}
