/* ============================================================================
   Loan & Collection Management System - interface stylesheet
   Modern gradient admin theme. Two audiences, one system: back-office staff
   on a desktop reading dense tables, and collectors on a cheap Android phone
   in the street. Money is set in tabular figures so columns of digits line
   up. Tenant colours arrive as CSS custom properties from the database -
   every gradient below is *derived* from those variables with color-mix(),
   so a blue tenant gets a blue-violet system and a green tenant gets a
   green-teal one; nothing here names a client or hardcodes a single brand.
   ========================================================================= */

:root {
  /* Tenant-supplied; these are only fallbacks (login screen, platform shell). */
  --brand-primary: #12408F;
  --brand-secondary: #0A2A5E;
  --brand-accent: #F5A800;
  --brand-sidebar: #FFFFFF;
  --brand-header: #FFFFFF;
  --brand-bg: #FAFAFB;

  --ink: #0B1B3A;
  --body: #43506A;
  --muted: #66758F;
  --faint: #97A4BB;
  --line: #E2E9F4;
  --line-strong: #CCD8EA;
  --surface: #FFFFFF;
  --rail: #F2F6FC;

  --ok: #0F9D6B;
  --ok-bg: #E4F9F0;
  --warn: #C2760B;
  --warn-bg: #FEF3DE;
  --bad: #E1336B;
  --bad-bg: #FDE7EF;
  --info: #12408F;
  --info-bg: #E8F0FC;

  --r-sm: 9px;
  --r: 14px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(10, 42, 94, .05), 0 6px 20px rgba(10, 42, 94, .07);
  --shadow-lg: 0 16px 38px rgba(10, 42, 94, .16);
  --sidebar-w: 232px;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  /* Conventional SaaS token names, aliased onto the tokens above so both
     vocabularies work from the same source of truth - nothing below this
     block should ever need a color literal of its own. */
  --primary: var(--brand-primary);
  --primary-hover: color-mix(in srgb, var(--brand-primary) 88%, black);
  --secondary: var(--brand-secondary);
  --accent: var(--brand-accent);
  --background: var(--brand-bg);
  --text: var(--ink);
  --border: var(--line);
  --success: var(--ok);
  --warning: var(--warn);
  --danger: var(--bad);

  /* Derived gradients - every one built from the live brand variables. */
  --grad-primary: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 62%, #3B82F6));
  --grad-accent: linear-gradient(135deg, var(--brand-accent), color-mix(in srgb, var(--brand-accent) 55%, var(--brand-primary)));
  --grad-dark: linear-gradient(160deg, color-mix(in srgb, var(--brand-secondary) 92%, black), var(--brand-secondary));
  --grad-ok: linear-gradient(135deg, #34D399, #059669);
  --grad-bad: linear-gradient(135deg, #FB7185, #E11D48);
  --grad-mesh: var(--brand-bg);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--body);
  background: var(--grad-mesh);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 23px; font-weight: 700; }
h2 { font-size: 16.5px; font-weight: 650; }
h3 { font-size: 14.5px; font-weight: 650; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 10px; }

.num, .money, td.num, th.num, .kpi-value, .amount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.cur { color: var(--faint); font-weight: 500; margin-right: 1px; }

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

.shell { display: flex; min-height: 100vh; gap: 16px; padding: 16px; align-items: flex-start; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  /* Always the light surface - a tenant's dark sidebar_color would fight the
     rest of this light/gradient theme, so every company gets the same shell
     and only the gradients (derived from brand-primary/accent) carry branding. */
  background: var(--surface);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 8%, white);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 15px 16px; margin-bottom: 2px;
  min-height: 48px;
}
.sidebar-brand { flex: 0 0 auto; flex-direction: column; align-items: flex-start; gap: 2px; padding-bottom: 8px; }
.sidebar-brand .logo-link { display: block; line-height: 0; }
.sidebar-brand img { height: 46px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.sidebar-brand .mark {
  width: 32px; height: 32px; border-radius: 10px; flex: 0 0 32px;
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 45%, transparent);
  display: grid; place-items: center; font-weight: 750; font-size: 12.5px;
}
.sidebar-brand .name { color: var(--ink); font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.sidebar-brand .role { color: var(--muted); font-size: 11px; font-weight: 450; }

.nav { padding: 4px 11px 18px; flex: 1 0 auto; }
.nav-group { margin-bottom: 10px; }
.nav-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); padding: 8px 9px 5px; font-weight: 700;
}
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--r-sm); margin-bottom: 1px;
  color: var(--body); font-size: 13.5px; font-weight: 550; line-height: 1.3;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.nav a:hover { background: var(--rail); color: var(--ink); text-decoration: none; }
.nav a.on {
  font-weight: 650;
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand-primary) 38%, transparent);
}
.nav a .ic {
  width: 20px; height: 20px; text-align: center; font-size: 13px; flex: 0 0 20px;
  display: grid; place-items: center; border-radius: 6px;
  background: var(--rail); opacity: .9;
}
.nav a.on .ic { background: rgba(255,255,255,.22); }
.nav a .tag {
  margin-left: auto; background: color-mix(in srgb, var(--brand-primary) 14%, white); color: var(--brand-primary);
  border-radius: 999px; padding: 1px 7px; font-size: 11px; font-variant-numeric: tabular-nums;
}
.nav a.on .tag { background: rgba(255,255,255,.24); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.topbar {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 7%, white);
  padding: 0 20px; min-height: 60px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 16px; z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar .crumb { color: var(--muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.burger {
  display: none; background: var(--rail); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 9px; cursor: pointer; color: var(--ink);
}
.who { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.who:hover { background: var(--rail); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--grad-accent);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--brand-accent) 40%, transparent);
}
.who .n { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.who .r { font-size: 11px; color: var(--muted); font-weight: 450; }

.content { padding: 0 0 16px; max-width: 1600px; width: 100%; }

/* --------------------------------------------------------------- pieces -- */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h2 { flex: 1; min-width: 140px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 420; }
.card-body { padding: 22px; }
.card-body.tight { padding: 0; }

.adv-settings > summary {
  padding: 14px 18px; cursor: pointer; list-style: none; user-select: none;
  font-size: 13.5px; font-weight: 650; color: var(--body);
  display: flex; align-items: center; gap: 8px;
}
.adv-settings > summary::-webkit-details-marker { display: none; }
.adv-settings > summary::before {
  content: "›"; display: inline-block; font-size: 16px; color: var(--faint);
  transition: transform .15s ease; transform: rotate(0deg);
}
.adv-settings[open] > summary::before { transform: rotate(90deg); }
.adv-settings[open] > summary { border-bottom: 1px solid var(--line); }
.adv-settings:hover > summary { color: var(--ink); }
.card-foot {
  padding: 11px 18px; border-top: 1px solid var(--line);
  background: var(--rail);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

.grid { display: grid; gap: 16px; }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.kpi {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 0; bottom: 0;
  width: 3px; background: color-mix(in srgb, var(--brand-primary) 55%, transparent);
}
/* Decorative overlapping circles, in the "premium SaaS" style - two soft
   discs peeking from a corner, never touching the label/value text which
   sits in normal flow above them (z-index: -1, contained by overflow:hidden
   on .kpi so they never spill onto neighbouring cards). Both circles are one
   layered background on a single pseudo-element, so no extra markup is
   needed on any card that already uses .kpi. */
.kpi::after {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 28px at calc(100% - 34px) 46px, color-mix(in srgb, var(--brand-primary) 8%, transparent), transparent 100%),
    radial-gradient(circle 54px at calc(100% - 20px) -14px, color-mix(in srgb, var(--brand-primary) 10%, transparent), transparent 100%);
}
.kpi .label {
  font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .045em; font-weight: 700; margin-bottom: 7px;
  max-width: calc(100% - 42px);
}
.kpi-value { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.kpi .meta { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
/* The small colour-badged icon in the corner of a stat card - the one
   element per card that sits above the decorative circles (z-index: 0
   beats their -1) instead of behind them. */
.kpi-icon {
  position: absolute; top: 14px; right: 14px; z-index: 0;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand-primary) 11%, white);
  color: var(--brand-primary);
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi.accent .kpi-icon, .kpi.bad-edge .kpi-icon { background: rgba(255,255,255,.2); color: #fff; }
.kpi.accent {
  background: var(--grad-primary); border-color: transparent; color: #fff;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--brand-primary) 40%, transparent);
}
.kpi.accent::before, .kpi.bad-edge::before, .kpi.ok-edge::before { display: none; }
.kpi.accent .label { color: rgba(255,255,255,.78); }
.kpi.accent .kpi-value { color: #fff; }
.kpi.accent .meta { color: rgba(255,255,255,.75); }
.kpi.accent::after, .kpi.bad-edge::after {
  background:
    radial-gradient(circle 28px at calc(100% - 34px) 46px, rgba(255,255,255,.16), transparent 100%),
    radial-gradient(circle 54px at calc(100% - 20px) -14px, rgba(255,255,255,.14), transparent 100%);
}
.kpi.bad-edge {
  background: var(--grad-bad); border-color: transparent; color: #fff;
  box-shadow: 0 14px 30px rgba(225,29,72,.32);
}
.kpi.bad-edge .label, .kpi.bad-edge .meta { color: rgba(255,255,255,.8); }
.kpi.bad-edge .kpi-value { color: #fff; }
.kpi.ok-edge { border-left: 4px solid var(--ok); }

/* --------------------------------------------------------------- tables -- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 650; padding: 11px 14px;
  background: var(--rail); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.4; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--brand-primary) 4%, white); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.right, table.data th.right { text-align: right; }
table.data tfoot td {
  background: var(--rail); font-weight: 700; color: var(--ink);
  border-top: 2px solid var(--line-strong); padding: 11px 14px;
}
.t-main { color: var(--ink); font-weight: 600; }
.t-sub { color: var(--muted); font-size: 12px; }
table.data tr.unread { background: color-mix(in srgb, var(--brand-primary) 5%, white); }
table.data tr.unread td { font-weight: 650; color: var(--ink); }
.unread-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap; border: 1px solid transparent;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: var(--rail); color: var(--muted); border-color: var(--line); }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--rail); color: var(--body); font-size: 11.5px; border: 1px solid var(--line); font-weight: 600;
}
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 17px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; line-height: 1.3; letter-spacing: -.003em;
  transition: transform .1s ease, box-shadow .1s ease, filter .1s ease, background .12s ease;
}
.btn:hover { background: var(--rail); text-decoration: none; }
.btn.primary {
  background: var(--grad-primary); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand-primary) 40%, transparent);
}
.btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.danger { background: var(--grad-bad); border-color: transparent; color: #fff; }
.btn.danger:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-primary); }
.btn.ghost:hover { background: var(--rail); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { min-height: 46px; padding: 0 22px; font-size: 15px; width: 100%; border-radius: var(--r-sm); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- forms -- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.k1 { grid-template-columns: 1fr; }
.form-grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f label { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.f .help { font-size: 12px; color: var(--muted); line-height: 1.4; }
.f .err { font-size: 12px; color: var(--bad); font-weight: 500; }
.req { color: var(--bad); opacity: .85; }

.field {
  width: 100%; min-height: 42px; padding: 9px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); line-height: 1.4;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field::placeholder { color: var(--faint); font-size: 13px; }
.field:focus {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 16%, transparent);
  border-color: var(--brand-primary);
}
.field[type="color"] { padding: 2px; height: 40px; cursor: pointer; }
textarea.field { resize: vertical; min-height: 58px; }
select.field { appearance: auto; }
.f.has-error .field { border-color: var(--bad); background: #FFF7FA; }

.amount-field { display: flex; flex-direction: column; gap: 6px; }
.amount-field label {
  font-size: 12.5px; font-weight: 650; color: var(--ink);
}
.amount-input-wrap {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r);
  background: var(--rail); padding: 10px 16px;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.amount-input-wrap:focus-within {
  border-color: var(--brand-primary); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 14%, transparent);
}
.amount-field.has-error .amount-input-wrap { border-color: var(--bad); background: #FFF7FA; }
.cur-lg { font-size: 22px; font-weight: 700; color: var(--muted); }
.field-amount {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 28px; font-weight: 750; color: var(--ink); padding: 4px 0;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 0;
}
.field-amount::placeholder { color: var(--faint); font-weight: 600; }
.field-amount::-webkit-outer-spin-button, .field-amount::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-amount[type="number"] { -moz-appearance: textfield; }

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--rail);
}
.filters .f { min-width: 140px; flex: 0 1 auto; }
.filters .f.grow { flex: 1 1 220px; }
.filters .f label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.filters .field { padding: 7px 10px; font-size: 13px; }
.filters-more { flex: 1 1 100%; order: 99; }
.filters-more > summary {
  cursor: pointer; list-style: none; user-select: none;
  font-size: 12px; font-weight: 650; color: var(--brand-primary); padding: 4px 0;
}
.filters-more > summary::-webkit-details-marker { display: none; }
.filters-more > summary::before { content: "+ "; }
.filters-more[open] > summary::before { content: "− "; }
.filters-more-body {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding-top: 10px; margin-top: 6px; border-top: 1px dashed var(--line-strong);
}
.filters-more-body .f { min-width: 140px; flex: 0 1 auto; }

/* ------------------------------------------------------ states & alerts -- */

.msg {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--r); margin-bottom: 12px;
  font-size: 13.5px; border: 1px solid transparent;
  opacity: 1; transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease;
}
.msg.is-hiding { opacity: 0; transform: translateY(-4px); }
.msg strong { display: block; }
.msg > div { flex: 1 1 auto; }
.msg.success { background: var(--ok-bg); color: #0B6B47; border-color: #BEEBD8; }
.msg.error { background: var(--bad-bg); color: #9C1949; border-color: #F6C9DC; }
.msg.warning { background: var(--warn-bg); color: #8A5108; border-color: #F5DCA6; }
.msg.info, .msg.debug { background: var(--info-bg); color: #0A2A5E; border-color: #BFD3F2; }
.msg-ic {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: inherit; background: color-mix(in srgb, currentColor 16%, transparent);
  position: relative; top: 1px;
}
.msg-close {
  flex: 0 0 auto; appearance: none; -webkit-appearance: none;
  background: transparent; border: none; box-shadow: none; border-radius: 4px;
  cursor: pointer; color: inherit; opacity: .6; font-size: 13px; line-height: 1;
  padding: 2px; margin: 0; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
}
.msg-close:hover, .msg-close:focus-visible { opacity: 1; background: rgba(0, 0, 0, .06); }

.empty { padding: 34px 22px; text-align: center; color: var(--muted); }
.empty .icon { font-size: 26px; opacity: .35; margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 5px; }
.empty p { max-width: 420px; margin: 0 auto 14px; font-size: 13.5px; }

.loading { display: none; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.is-busy .loading { display: inline-flex; }
.is-busy .idle-label { display: none; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn:not(.primary):not(.danger) .spinner { border: 2px solid var(--line-strong); border-top-color: var(--brand-primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--rail) 25%, #EFE9FB 37%, var(--rail) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
  border-radius: var(--r-sm); height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

dialog.confirm {
  border: none; border-radius: var(--r-lg); padding: 0;
  box-shadow: var(--shadow-lg); max-width: 420px; width: calc(100% - 32px);
}
dialog.confirm::backdrop { background: rgba(21, 15, 39, .48); backdrop-filter: blur(2px); }
dialog.confirm .body { padding: 20px 22px; }
dialog.confirm h3 { margin-bottom: 6px; font-size: 15px; }
dialog.confirm p { color: var(--muted); font-size: 13.5px; }
dialog.confirm .foot {
  padding: 13px 22px; background: var(--rail); border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* ------------------------------------------------ signature: collection -- */

.target {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 20px; border-radius: var(--r-lg); color: #fff;
  background: var(--grad-dark);
  box-shadow: var(--shadow-lg);
}
.target .ring {
  --pct: 0;
  width: 92px; height: 92px; border-radius: 50%; flex: 0 0 92px;
  background: conic-gradient(#fff calc(var(--pct) * 1%), rgba(255,255,255,.22) 0);
  display: grid; place-items: center; position: relative;
}
.target .ring::after {
  content: ""; position: absolute; inset: 9px; border-radius: 50%;
  background: color-mix(in srgb, var(--brand-secondary) 88%, black);
}
.target .ring span {
  position: relative; z-index: 1; font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.target .figures { display: flex; gap: 26px; flex-wrap: wrap; }
.target .fig .l {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .72; font-weight: 600;
}
.target .fig .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.sheet { border-top: 1px solid var(--line); }
.sheet-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.sheet-row:hover { background: color-mix(in srgb, var(--brand-primary) 4%, white); }
.sheet-row .amt {
  flex: 0 0 auto; min-width: 116px; text-align: right;
  font-size: 22px; font-weight: 750; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.sheet-row.late .amt { color: var(--bad); }
.sheet-row .who-col { flex: 1; min-width: 0; }
.sheet-row .who-col .nm {
  font-size: 14px; font-weight: 650; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-row .who-col .dt { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sheet-row .act { flex: 0 0 auto; }

/* ------------------------------------------------------------- receipts -- */

.receipt-page { background: var(--grad-mesh); padding: 26px 14px; min-height: 100vh; }
.receipt {
  max-width: 600px; margin: 0 auto; background: #fff; padding: 26px 30px;
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); color: var(--ink);
}
.receipt .rhead {
  display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink);
}
.receipt .rhead img { max-height: 46px; max-width: 160px; object-fit: contain; }
.receipt .rhead .co { flex: 1; }
.receipt .rhead .co h2 { font-size: 17px; }
.receipt .rhead .co .addr { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.receipt .stamp {
  text-align: right; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 700; color: var(--brand-primary);
}
.receipt .rrow { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.receipt .rrow .k { color: var(--muted); }
.receipt .rrow .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.receipt .total {
  margin: 16px 0; padding: 14px 18px; background: var(--rail);
  border-radius: var(--r); display: flex; justify-content: space-between; align-items: baseline;
}
.receipt .total .k { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.receipt .total .v { font-size: 25px; font-weight: 750; font-variant-numeric: tabular-nums; }
.receipt table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 10px 0; }
.receipt table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; }
.receipt table td { padding: 6px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.receipt .rfoot { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 11.5px; color: var(--muted); }
.report-sheet {
  max-width: 1040px; margin: 0 auto; background: #fff; padding: 26px 30px;
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); color: var(--ink);
}
.report-sheet .rhead {
  display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink);
}
.report-sheet .rhead img { max-height: 46px; max-width: 170px; object-fit: contain; }
.report-sheet .rhead .co { flex: 1; }
.report-sheet .rhead .co h2 { font-size: 18px; }
.report-sheet .rhead .co .addr { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.report-sheet .stamp {
  text-align: right; font-size: 12px; text-transform: uppercase;
  letter-spacing: .09em; font-weight: 700; color: var(--brand-primary); max-width: 220px;
}
.report-meta {
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between;
  font-size: 11.5px; color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--line);
}
.report-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 10px; }
.report-table th {
  text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-strong);
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.report-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.report-table tbody tr:nth-child(even) { background: var(--rail); }
.report-sheet .rfoot {
  margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line-strong);
  font-size: 11px; color: var(--muted);
}

.print-bar { max-width: 1040px; margin: 0 auto 14px; display: flex; gap: 8px; justify-content: flex-end; }
.receipt-flash { max-width: 600px; margin: 0 auto 12px; }

@media print {
  .print-bar, .receipt-flash, .sidebar, .topbar, .bottombar { display: none !important; }
  .receipt-page { background: #fff; padding: 0; }
  .receipt, .report-sheet { box-shadow: none; max-width: none; padding: 0; }
  .report-table { font-size: 9.5px; }
  .report-table thead { display: table-header-group; }
  body { background: #fff; }
}

/* --------------------------------------------------------------- charts -- */

.bars { display: flex; align-items: flex-end; gap: 5px; height: 132px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 5px; }
.bars .b i {
  display: block; background: var(--grad-primary); border-radius: 6px 6px 2px 2px;
  min-height: 2px; opacity: .92;
}
.bars .b:hover i { opacity: 1; }
.bars .b span { font-size: 9.5px; color: var(--faint); text-align: center; white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 3px; }
.hbar .track { height: 8px; background: var(--rail); border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--grad-primary); border-radius: 999px; }
.hbar.alt .fill { background: var(--grad-accent); }

/* ------------------------------------------------------------ utilities -- */

.stack { display: flex; flex-direction: column; gap: 3px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.right { text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.bold { font-weight: 700; color: var(--ink); }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
.warn-text { color: var(--warn); }
.mt { margin-top: 16px; }
.mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; line-height: 1.5; }
.dl dt { color: var(--muted); font-weight: 450; }
.dl dd { margin: 0; color: var(--ink); font-weight: 600; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a {
  padding: 10px 15px; font-size: 13.5px; font-weight: 650; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }

.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px; }
.pager a, .pager span {
  padding: 6px 11px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); color: var(--body);
}
.pager .on { background: var(--grad-primary); color: #fff; border-color: transparent; }
.pager .off { opacity: .45; }

/* ----------------------------------------------------------- login page -- */

body.auth-page { height: 100%; overflow: hidden; }
html:has(body.auth-page) { height: 100%; overflow: hidden; }

.auth {
  height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1fr 1.05fr;
  background: var(--surface); overflow: hidden;
}
.auth-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  justify-content: space-between; padding: 40px 44px; color: #fff;
  background: var(--brand-secondary);
}
.auth-visual .av-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0; filter: saturate(.75) brightness(.75) contrast(1.02);
}
.auth-visual::before {
  /* Faint ledger grid - a quiet nod to rows of figures rather than decoration for its own sake. */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; z-index: 1;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 100% 44px, 64px 100%;
  mask-image: linear-gradient(180deg, transparent, rgba(0,0,0,.9) 30%, rgba(0,0,0,.9) 75%, transparent);
}
.auth-visual::after {
  /* Brand-tinted scrim over the video so it reads as a premium backdrop, not
     a literal clip, and every weight of text on top stays legible. */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(720px 480px at 100% 0%, color-mix(in srgb, var(--brand-primary) 9%, transparent), transparent 62%),
    radial-gradient(600px 460px at 0% 100%, color-mix(in srgb, var(--brand-primary) 20%, transparent), transparent 60%),
    linear-gradient(165deg, color-mix(in srgb, var(--brand-secondary) 80%, black) 0%, color-mix(in srgb, var(--brand-secondary) 62%, transparent) 55%, color-mix(in srgb, var(--brand-secondary) 84%, black) 100%);
}
.auth-visual .av-top, .auth-visual .av-bottom { position: relative; z-index: 2; }
.auth-visual .av-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.auth-visual .av-brand .mark {
  width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.28); display: grid; place-items: center; font-weight: 750;
  backdrop-filter: blur(6px);
}
.auth-visual .av-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px;
  border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: rgba(255,255,255,.85);
  margin-bottom: 16px; backdrop-filter: blur(6px);
}
.auth-visual .av-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: color-mix(in srgb, var(--brand-accent) 70%, #fff);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}
.auth-visual h2 { color: #fff; font-size: clamp(24px, 3.2vh, 33px); line-height: 1.22; max-width: 380px; margin-bottom: 20px; font-weight: 680; letter-spacing: -.015em; }
.auth-visual .av-points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.auth-visual .av-points li {
  display: flex; align-items: center; gap: 10px; font-size: 13.5px;
  color: rgba(255,255,255,.85); font-weight: 500; line-height: 1.3;
  opacity: 0; animation: av-point-in .5s ease-out both;
}
.auth-visual .av-points li:nth-child(1) { animation-delay: .12s; }
.auth-visual .av-points li:nth-child(2) { animation-delay: .22s; }
.auth-visual .av-points li:nth-child(3) { animation-delay: .32s; }
@keyframes av-point-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-visual .av-points li { opacity: 1; animation: none; }
}
.auth-visual .av-points .ic {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.4);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff;
}
.auth-visual .av-foot { font-size: 12px; color: rgba(255,255,255,.5); }

.auth-form-side {
  position: relative; height: 100%; overflow: hidden; /* clips the orbs - never scrolls */
  background: var(--brand-bg);
}
.auth-form-side::before,
.auth-form-side::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(60px); z-index: 0; opacity: .4;
}
.auth-form-side::before {
  width: 360px; height: 360px; top: -120px; right: -100px;
  background: color-mix(in srgb, var(--brand-primary) 14%, transparent);
}
.auth-form-side::after {
  width: 320px; height: 320px; bottom: -110px; left: -90px;
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}
.auth-form-scroll {
  position: relative; z-index: 1; height: 100%; width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto; /* safety net: scrolls only if the card itself can't fit */
}
.auth-card {
  width: 100%; max-width: 392px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 26px;
  padding: 30px 30px 26px;
  box-shadow: 0 1px 2px rgba(10,42,94,.06),
    0 24px 56px -12px color-mix(in srgb, var(--brand-primary) 30%, transparent),
    0 0 0 1px color-mix(in srgb, var(--brand-primary) 6%, transparent);
  animation: auth-card-in .5s cubic-bezier(.16,1,.3,1) both;
  position: relative; overflow: hidden; z-index: 1;
}
.auth-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-primary);
}
@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card .logo { text-align: center; margin-bottom: 14px; }
.auth-card .logo img { max-height: 48px; max-width: 200px; object-fit: contain; }
.auth-card .logo .mark {
  width: 48px; height: 48px; border-radius: 14px; margin: 0 auto; position: relative;
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-primary) 46%, transparent);
  display: grid; place-items: center; font-weight: 750; font-size: 17px;
}
.auth-card h1 {
  text-align: center; font-size: 22px; margin-bottom: 5px; letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--ink), color-mix(in srgb, var(--brand-primary) 60%, var(--ink)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; line-height: 1.5; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 12px; color: var(--faint); }
.auth-foot::before {
  content: ""; display: block; width: 40px; height: 1px; margin: 0 auto 14px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.auth-card .f label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700;
}
.auth-card .f label .req { text-transform: none; }

.auth-options {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 0 4px; font-size: 12.5px;
}
.auth-options .remember { display: flex; align-items: center; gap: 7px; color: var(--body); font-weight: 550; cursor: pointer; }
.auth-options .remember input { width: 15px; height: 15px; accent-color: var(--brand-primary); cursor: pointer; }
.auth-options a { font-weight: 600; }

.auth-card .btn.primary.lg { position: relative; overflow: hidden; letter-spacing: .01em; }
.auth-card .btn.primary.lg .idle-label { display: inline-flex; align-items: center; gap: 6px; }
.auth-card .btn.primary.lg .idle-label::after {
  content: "→"; display: inline-block; transition: transform .18s ease;
}
.auth-card .btn.primary.lg:hover .idle-label::after { transform: translateX(4px); }
.auth-card .btn.primary.lg:active { transform: translateY(0) scale(.98); }

.auth-card .field-ic { position: relative; }
.auth-card .field-ic .ic-lead {
  position: absolute; top: 0; left: 0; bottom: 0; width: 40px;
  display: grid; place-items: center; color: var(--faint); pointer-events: none;
  transition: color .12s ease;
}
.auth-card .field-ic .ic-lead svg { width: 17px; height: 17px; }
.auth-card .field-ic .field { padding-left: 40px; }
.auth-card .f:focus-within .ic-lead { color: var(--brand-primary); }

.field-pw { position: relative; }
.field-pw .field { padding-right: 42px; }
.pw-toggle {
  position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
  display: grid; place-items: center; background: none; border: none; padding: 0;
  color: var(--faint); cursor: pointer; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  transition: color .12s ease;
}
.pw-toggle:hover { color: var(--brand-primary); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; color: var(--brand-primary); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .eye-on { display: none; }
.pw-toggle[aria-pressed="true"] .eye-off { display: block; }

/* ------------------------------------------------------------- mobile --- */

.bottombar { display: none; }

@media (max-width: 1080px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

@media (max-width: 960px) {
  .grid.k4, .grid.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split { grid-template-columns: 1fr; }
  .form-grid, .form-grid.k3 { grid-template-columns: 1fr; }
  .shell { padding: 0; gap: 0; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; border-radius: 0;
    transform: translateX(-100%); transition: transform .18s ease; top: 0; height: 100vh;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .burger { display: inline-flex; }
  .content { padding: 14px 14px 84px; }
  .main { gap: 0; }
  .topbar { padding: 0 14px; border-radius: 0; top: 0; margin-bottom: 14px; }
  .who .n, .who .r { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}

@media (max-width: 620px) {
  .grid.k2, .grid.k3, .grid.k4, .grid.k5 { grid-template-columns: 1fr; }
  .sheet-row { flex-wrap: wrap; }
  .sheet-row .amt { order: -1; min-width: 0; text-align: left; }
  .sheet-row .who-col { flex: 1 1 100%; order: 1; }
  .sheet-row .act { flex: 1 1 100%; order: 2; }
  .sheet-row .act .btn { width: 100%; }
  .target .figures { gap: 16px; }
  .auth-form-scroll { padding: 18px; }
  .auth-card { padding: 26px 20px; }

  .bottombar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(10,42,94,.08);
  }
  .bottombar a {
    flex: 1; text-align: center; padding: 6px 2px; color: var(--muted);
    font-size: 10.5px; font-weight: 650; border-radius: var(--r-sm);
  }
  .bottombar a .ic { display: flex; justify-content: center; margin-bottom: 2px; }
  .bottombar a.on { color: var(--brand-primary); }
  .bottombar a:hover { text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: 3px; }

/* --------------------------------------------------------- setup wizard -- */

.wizard-rail { display: flex; overflow-x: auto; border-top: 1px solid var(--line); }
.wizard-step {
  flex: 1 0 auto; min-width: 132px; display: flex; align-items: center; gap: 9px;
  padding: 13px 15px; border-right: 1px solid var(--line); color: var(--muted);
  font-size: 12.5px; font-weight: 650;
}
.wizard-step:last-child { border-right: 0; }
.wizard-step:hover { background: var(--rail); text-decoration: none; }
.wizard-step .n {
  width: 23px; height: 23px; border-radius: 50%; flex: 0 0 23px;
  display: grid; place-items: center; font-size: 11px;
  background: var(--rail); color: var(--muted); border: 1px solid var(--line-strong);
}
.wizard-step.done .n { background: var(--ok); color: #fff; border-color: var(--ok); }
.wizard-step.on { color: var(--ink); background: #fff; box-shadow: inset 0 -2px 0 var(--brand-primary); }
.wizard-step.on .n { background: var(--grad-primary); color: #fff; border-color: transparent; }

/* ---------------------------------------------------------- app footer -- */
.app-footer {
  margin-top: auto; padding: 14px 8px 4px; text-align: center;
  font-size: 12px; color: var(--muted); border-top: 1px solid var(--line);
}
@media print { .app-footer { display: none; } }

/* Dashboard tiles that link to the page behind the number. */
a.kpi { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.kpi:hover { text-decoration: none; }
a.kpi:focus-visible { outline: 2px solid var(--brand-primary, #2563eb); outline-offset: 2px; }
.kpi .go { position: absolute; right: 14px; bottom: 12px; font-size: 12px; font-weight: 600;
  color: var(--brand-primary, #2563eb); opacity: 0; transition: opacity .15s ease; }
a.kpi:hover .go, a.kpi:focus-visible .go { opacity: 1; }
