/* ═══════════════════════════════════════════════════════════════════════
   SanghaCloud design system — "Nappal" (v2, light) port from the Claude
   Design canvas. Single hand-written CSS layer; replaces SmartAdmin/
   Bootstrap entirely. Light grey ground, white surfaces, one ultramarine
   accent, Instrument Sans throughout, tabular numerals for money.
   Token names are kept from v1 so views bind unchanged; values are Nappal.
   ═══════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600&display=swap');

:root {
  --color-bg: #F4F5F7;
  --color-surface: #FFFFFF;
  --color-text: #191B1F;
  --color-muted: #6B6F78;
  --color-accent: #3543C7;
  --color-accent-2: #232FA0;
  --color-divider: #E2E4E9;

  /* Remapped ramps (kept for view compatibility): "dark fill" steps now map
     to light fills, "light text" steps to inks. */
  --color-neutral-100: #191B1F;
  --color-neutral-200: #5F636B;
  --color-neutral-300: #4B4F57;
  --color-neutral-400: #6B6F78;
  --color-neutral-500: #8A8E96;
  --color-neutral-600: #8A8E96;
  --color-neutral-700: #D8DBE1;
  --color-neutral-800: #E7E9ED;
  --color-neutral-900: #3D4048;

  --color-accent-100: #232FA0;
  --color-accent-200: #2A35A8;
  --color-accent-300: #2A35A8;
  --color-accent-400: #3543C7;
  --color-accent-500: #3543C7;
  --color-accent-600: #6B76D6;
  --color-accent-700: #B9C0EE;
  --color-accent-800: #D6DAF6;
  --color-accent-900: #E4E7FA;

  /* Semantic state colors — status only, never decoration */
  --sc-good: #2E7D4F;  --sc-good-ink: #25663F;  --sc-good-bg: #E1F0E7;
  --sc-warn: #9A6B14;  --sc-warn-ink: #7D560F;  --sc-warn-bg: #F6EBD6;
  --sc-crit: #A63D3D;  --sc-crit-ink: #8E3232;  --sc-crit-bg: #F7E3E3;

  --font-heading: "Instrument Sans", system-ui, sans-serif;
  --font-heading-weight: 500;
  --font-body: "Instrument Sans", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 11px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(25,27,31,.06);
  --shadow-md: 0 4px 14px rgba(25,27,31,.10);
  --shadow-lg: 0 10px 30px rgba(25,27,31,.14);

  --field-ring: inset 0 0 0 1px #D8DBE1;
  --field-ring-focus: inset 0 0 0 2px var(--color-accent);
  --field-ring-error: inset 0 0 0 1.5px var(--sc-crit);

  /* Diamond Way brand — logo/wordmark contexts and the DWBN sign-in
     button (.btn-dwbn) only, never a general UI accent */
  --brand-red: #C81C33;

  --tabbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 6px;
}
h1 { font-size: 32px; } h2 { font-size: 26px; } h3 { font-size: 21px; }
h4 { font-size: 18px; } h5 { font-size: 15px; }
h6 { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted); font-weight: 500; }
p { margin: 0 0 8px; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-2); }
img { display: block; max-width: 100%; }
.text-muted, .help-block { color: var(--color-muted); }
.tabular, .amount { font-variant-numeric: tabular-nums; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: var(--color-accent-900); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── App shell ─────────────────────────────────────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* Site header: white bar with the Diamond Way lockup, after
   diamondway-buddhism.org. On desktop the sidebar carries the brand. */
.app-topbar {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface); border-bottom: 1px solid var(--color-divider);
  padding: 8px 16px;
}
.app-topbar a { display: flex; align-items: center; }
.app-topbar img { height: 26px; width: auto; display: block; }
.app-topbar .side { margin-left: auto; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); white-space: nowrap; }
.app-topbar .wordmark { text-decoration: none; }
.app-topbar .wordmark h1 {
  margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1; color: var(--color-text);
}
@media (min-width: 1024px) { .app-topbar { display: none; } }

.brand-lockup { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-lockup img.firewheel { height: 34px; width: auto; display: block; }
.brand-lockup .words { display: flex; flex-direction: column; line-height: 1.15; }
.brand-lockup .words .primary { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--brand-red); text-transform: uppercase; }
.brand-lockup .words .secondary { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-muted); }
.app-header {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 18px 0 8px;
}
.app-header .who { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.app-header .who .ctx { font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-muted); }
.app-header .who .hello { font-size: 23px; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header h1, .app-header h4 { margin: 0; flex: 1; font-size: 23px; letter-spacing: -0.02em; }
.app-main {
  flex: 1; width: 100%; max-width: 640px; margin: 0 auto;
  padding: 0 16px calc(var(--tabbar-h) + 24px);
  display: flex; flex-direction: column; gap: 12px;
}
.app-main.wide { max-width: none; }

/* Deployment footer — version · commit · deploy time, plus the environment.
   Intentionally quiet: muted ink, tabular numerals, never competes with content. */
.app-footer {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  margin-top: 36px; padding: 14px 0 4px; border-top: 1px solid var(--color-divider);
  font-size: 11.5px; color: var(--color-muted); font-variant-numeric: tabular-nums;
}
.login-page .app-footer { justify-content: center; border-top: 0; margin-top: 24px; }
.app-footer .env {
  padding: 1px 7px; border-radius: 999px; background: var(--color-neutral-800);
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
}
.app-footer .env.nonprod { background: var(--sc-warn-bg); color: var(--sc-warn-ink); }

/* Sub-page header with back arrow */
.page-head { display: flex; align-items: center; gap: 12px; padding: 12px 0 4px; }
.page-head .back { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: -8px; color: var(--color-text); text-decoration: none; border-radius: var(--radius-md); }
.page-head .back:hover { background: #EBEDF1; color: var(--color-text); }
.page-head .title { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; flex: 1; }

/* Sticky bottom action bar (above the tab bar) */
.action-bar {
  position: sticky; bottom: calc(var(--tabbar-h)); z-index: 20;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -16px; padding: 10px 16px 12px;
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
}
.action-bar .total { display: flex; flex-direction: column; }
.action-bar .total .lbl { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-muted); }
.action-bar .total .val { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.no-tabbar .action-bar { bottom: 0; }

/* ── Bottom tab bar / desktop sidebar ─────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; padding: 6px 8px calc(12px + env(safe-area-inset-bottom));
  background: var(--color-surface); border-top: 1px solid var(--color-divider);
}
.tabbar a {
  flex: 1; min-height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  text-decoration: none; border-radius: var(--radius-md);
  color: var(--color-muted);
}
.tabbar a i { font-size: 21px; }
.tabbar a span { font-size: 10.5px; letter-spacing: 0.01em; text-align: center; line-height: 1.1; }
.tabbar a.active, .tabbar a:hover { color: var(--color-accent); }

.sidebar { display: none; }

@media (min-width: 1024px) {
  .tabbar { display: none; }
  .app { flex-direction: row; }
  .sidebar {
    display: flex; flex-direction: column; gap: 3px;
    width: 216px; flex: none; padding: 16px 12px;
    background: var(--color-surface); border-right: 1px solid var(--color-divider);
    min-height: 100dvh;
    position: sticky; top: 0; align-self: flex-start;
  }
  .sidebar .brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px 16px; font-size: 15px; font-weight: 500; color: var(--color-text); text-decoration: none; }
  .sidebar .brand img { max-width: 100%; height: auto; display: block; }
  .sidebar a.item {
    display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
    border-radius: var(--radius-md); text-decoration: none; font-size: 13.5px; color: var(--color-text);
  }
  .sidebar a.item i { font-size: 17px; color: var(--color-muted); }
  .sidebar a.item:hover { background: #EBEDF1; }
  .sidebar a.item.active { background: var(--color-accent-900); color: var(--color-accent-200); }
  .sidebar a.item.active i { color: var(--color-accent); }
  .sidebar a.item .count { margin-left: auto; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--sc-crit-bg); color: var(--sc-crit-ink); font-variant-numeric: tabular-nums; }
  .sidebar .spacer { flex: 1; }
  /* Collapsible work groups */
  .sidebar .nav-group { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }
  .sidebar .nav-group-h {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 4px 10px; border: 0; background: none; cursor: pointer; font: inherit;
    font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 500; color: var(--color-muted);
    border-radius: var(--radius-md);
  }
  .sidebar .nav-group-h:hover { color: var(--color-text); background: #F1F2F5; }
  .sidebar .nav-group-h i { font-size: 12px; transition: transform 120ms ease; }
  .sidebar .nav-group.collapsed .nav-group-h i { transform: rotate(-90deg); }
  .sidebar .nav-group-items { display: flex; flex-direction: column; gap: 3px; }
  .sidebar .nav-group.collapsed .nav-group-items { display: none; }
  /* Account block at the bottom */
  .sidebar .sidebar-account { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; border-top: 1px solid var(--color-divider); }
  .sidebar .sidebar-account .who { display: flex; align-items: center; gap: 9px; padding: 4px 10px 8px; min-width: 0; }
  .sidebar .sidebar-account .avatar {
    flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-accent-900); color: var(--color-accent-200); font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  }
  .sidebar .sidebar-account .name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .app-main { max-width: 900px; padding-bottom: 32px; }
  .action-bar { bottom: 0; }
}
.brand-mark {
  width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--color-accent);
  display: flex; align-items: center; justify-content: center; color: #FFFFFF;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: 500;
  font-size: 14.5px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: 8px 14px; min-height: 44px;
  border-radius: var(--radius-md);
}
.btn i { font-size: 1.2em; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:hover { color: var(--color-text); }
.btn-primary, .btn-success { background: var(--color-accent); color: #FFFFFF; }
.btn-primary:hover, .btn-success:hover { background: var(--color-accent-2); color: #FFFFFF; }
.btn-primary:active, .btn-success:active { background: #1E2887; color: #FFFFFF; }
.btn-secondary, .btn-default, .btn-info, .btn-warning { background: #EBEDF1; color: #3D4048; }
.btn-secondary:hover, .btn-default:hover, .btn-info:hover, .btn-warning:hover { background: #E0E3E9; color: #191B1F; }
.btn-ghost { color: var(--color-accent); padding-inline: 6px; }
.btn-ghost:hover { background: var(--color-accent-900); color: var(--color-accent-200); }
.btn-danger { color: var(--sc-crit); border-color: #E0B6B6; background: transparent; }
.btn-danger:hover { background: var(--sc-crit-bg); color: var(--sc-crit); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 15px; border-radius: 12px; }
.btn-sm, .btn-xs { min-height: 36px; font-size: 13px; padding: 4px 10px; }

/* DWBN (DW Connect) sign-in — the one place the brand red is a button.
   The firewheel keeps its own colors on a white disc. */
.btn-dwbn { background: var(--brand-red); color: #FFFFFF; }
.btn-dwbn:hover { background: #AD1729; color: #FFFFFF; }
.btn-dwbn:active { background: #93131F; color: #FFFFFF; }
.btn-dwbn .fw {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center;
}
.btn-dwbn .fw img { width: 18px; height: 18px; display: block; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field > label, .form-group > label, .control-label {
  display: block; font-size: 12px; margin-bottom: 6px;
  color: #5F636B;
  font-weight: 400;
}
.field { margin: 0 0 2px; }
.form-group { margin: 0 0 14px; }
.input, .form-control,
input[type="text"].form-control, select.form-control, textarea.form-control {
  width: 100%; min-height: 48px; padding: 6px 14px; font: inherit;
  font-size: 14.5px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 0; border-radius: var(--radius-md);
  box-shadow: var(--field-ring);
  appearance: none;
}
select.input, select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B6F78' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
.input:hover, .form-control:hover { box-shadow: inset 0 0 0 1px #B4B8C0; }
.input:focus, .form-control:focus, .input:focus-visible, .form-control:focus-visible { box-shadow: var(--field-ring-focus); outline: none; }
textarea.input, textarea.form-control { min-height: 76px; resize: vertical; }
.has-error .input, .has-error .form-control { box-shadow: var(--field-ring-error); }
.help-block:not(:empty) { display: flex; align-items: center; gap: 5px; font-size: 11.5px; margin-top: 5px; }
.has-error .help-block { color: var(--sc-crit); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--color-accent); width: 19px; height: 19px; }
.checkbox label, .radio-plain label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13.5px; cursor: pointer; }

/* Big amount input */
.amount-input {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md); background: var(--color-surface);
  box-shadow: var(--field-ring);
}
.amount-input:focus-within { box-shadow: var(--field-ring-focus); }
.amount-input input {
  flex: 1; width: 100%; min-width: 0; border: 0; background: none; color: var(--color-text);
  font: inherit; font-size: 38px; font-weight: 500; line-height: 1.05; font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em; padding: 0;
}
.amount-input input:focus { outline: none; }
.amount-input .unit { font-size: 17px; color: var(--color-muted); }
.amount-input.warn { box-shadow: inset 0 0 0 1.5px var(--sc-warn); }
.amount-input.err { box-shadow: var(--field-ring-error); }

/* ── Selectable chips (months, methods, presets) ──────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip-opt {
  position: relative; min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 14px; font-size: 13.5px; cursor: pointer;
  border-radius: var(--radius-md);
  background: #EBEDF1; color: #3D4048; border: 0;
  font-variant-numeric: tabular-nums;
}
.chip-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.chip-opt:hover { background: #E0E3E9; }
.chip-opt:has(input:checked) {
  background: var(--color-accent-900); color: var(--color-accent-200); font-weight: 500;
}
.chip-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.chip-opt.disabled, .chip-opt:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.chip-opt.seg { flex: 1; min-height: 46px; font-size: 14px; }

/* Status chips (read-only) */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; padding: 4px 9px; border-radius: 6px;
  background: #EBEDF1; color: #4B4F57;
  white-space: nowrap;
}
.chip.sm { font-size: 10px; padding: 2px 6px; border-radius: 5px; }
.chip-good { background: var(--sc-good-bg); color: var(--sc-good-ink); }
.chip-warn { background: var(--sc-warn-bg); color: var(--sc-warn-ink); }
.chip-crit { background: var(--sc-crit-bg); color: var(--sc-crit-ink); }
.chip-accent { background: var(--color-accent-900); color: var(--color-accent-200); }
.chip-muted { color: #6B6F78; }
.tag-outline {
  display: inline-flex; align-items: center; font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px;
  border-radius: 5px; background: var(--color-accent-900); color: var(--color-accent-200);
  white-space: nowrap;
}

/* Filter chips (applied filters) */
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  padding: 7px 10px; border-radius: var(--radius-md);
  background: var(--color-accent-900); color: var(--color-accent-200);
  text-decoration: none;
}
.filter-chip:hover { color: var(--color-accent-100); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; border-radius: var(--radius-lg); background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.card-kicker { font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-muted); font-weight: 500; }
.card.ring-good { box-shadow: var(--shadow-sm), inset 0 0 0 1px #BFDCCB; }
.card.ring-warn { box-shadow: var(--shadow-sm), inset 0 0 0 1px #E5CB96; }
.card.ring-crit { box-shadow: var(--shadow-sm), inset 0 0 0 1px #E0B6B6; }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

.kv { display: flex; flex-direction: column; padding: 4px 16px; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-sm); font-size: 13px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--color-divider); }
.kv > div:first-child { border-top: 0; }
.kv .k { color: var(--color-muted); }
.kv .v { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }

/* Big number display */
.big-amount { display: flex; align-items: baseline; gap: 8px; }
.big-amount .num { font-size: 44px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.045em; }
.big-amount .unit { font-size: 19px; color: var(--color-muted); }

/* Status line (dot + text) */
.status-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.status-line .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.status-line.good { color: var(--sc-good); } .status-line.good .dot { background: var(--sc-good); }
.status-line.warn { color: var(--sc-warn); } .status-line.warn .dot { background: var(--sc-warn); }
.status-line.crit { color: var(--sc-crit); } .status-line.crit .dot { background: var(--sc-crit); }

/* Inline callout */
.callout { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: var(--radius-md); }
.callout i { font-size: 20px; flex: none; }
.callout .body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.callout .body .t { font-size: 14px; font-weight: 500; }
.callout .body .s { font-size: 11.5px; color: var(--color-muted); }
.callout.warn { background: var(--sc-warn-bg); } .callout.warn i, .callout.warn .t { color: var(--sc-warn-ink); }
.callout.crit { background: var(--sc-crit-bg); } .callout.crit i, .callout.crit .t { color: var(--sc-crit-ink); }
.callout.good { background: var(--sc-good-bg); } .callout.good i, .callout.good .t { color: var(--sc-good-ink); }

/* ── Transaction rows ──────────────────────────────────────────────────── */
/* Grouped list: rows live inside one white card, separated by hairlines. */
.txn-list {
  display: flex; flex-direction: column;
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: 2px 14px; box-shadow: var(--shadow-sm);
}
.txn-list .txn-row { background: none; border-radius: 0; padding: 11px 0; box-shadow: none; }
.txn-list .txn-row + .txn-row { border-top: 1px solid var(--color-divider); }
.txn-list a.txn-row:hover { background: none; }
.txn-list a.txn-row:hover .name { color: var(--color-accent); }

/* Standalone fallback (ungrouped) */
.txn-row {
  display: flex; align-items: center; gap: 11px;
  min-height: 58px; padding: 11px 14px;
  border-radius: var(--radius-lg); background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--color-text);
}
a.txn-row:hover { color: var(--color-text); }
a.txn-row:hover .name { color: var(--color-accent); }
.txn-row .avatar {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; letter-spacing: 0.02em;
  background: #E7E9ED; color: #5F636B;
}
.txn-row .avatar.lg { width: 52px; height: 52px; font-size: 17px; border-radius: 14px; }
.txn-row .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.txn-row .mid .name-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.txn-row .mid .name { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-row .mid .meta { font-size: 11.5px; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-row .end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.txn-row .end .amount { font-size: 14.5px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ── Stat tile ─────────────────────────────────────────────────────────── */
.stat-row { display: flex; gap: 10px; }
.stat-tile {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--color-surface); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--color-text);
}
a.stat-tile:hover .val { color: var(--color-accent); }
.stat-tile .lbl { font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-muted); font-weight: 500; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile .val { font-size: 22px; font-weight: 500; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stat-tile .sub { font-size: 11px; color: var(--color-muted); }
.stat-tile.good .val { color: var(--sc-good); }
.stat-tile.warn .val { color: var(--sc-warn); }
.stat-tile.crit .val { color: var(--sc-crit); }
.stat-tile.accent .val { color: var(--color-accent); }

/* ── List section heading ──────────────────────────────────────────────── */
.list-head { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.list-head h6 { margin: 0; }
.list-head .sp { flex: 1; }
.list-head a { font-size: 12.5px; }
.list-head .count { font-size: 12px; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.list-kicker { font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-muted); font-weight: 500; }

/* Menu rows ("Több" screen) — grouped in cards with hairlines */
.menu-list {
  display: flex; flex-direction: column;
  background: var(--color-surface); border-radius: var(--radius-lg);
  padding: 0 14px; box-shadow: var(--shadow-sm);
}
.menu-list .menu-row { background: none; border-radius: 0; box-shadow: none; padding: 0; }
.menu-list .menu-row + .menu-row { border-top: 1px solid var(--color-divider); }
.menu-row {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px;
  border-radius: var(--radius-lg); background: var(--color-surface);
  text-decoration: none; color: var(--color-text); font-size: 14.5px;
}
.menu-row:hover { color: var(--color-accent); }
.menu-row i.lead { font-size: 19px; color: var(--color-accent); flex: none; }
.menu-row i.lead.warn { color: var(--sc-warn); }
.menu-row .t { flex: 1; min-width: 0; }
.menu-row .count { font-size: 11px; font-weight: 500; background: var(--sc-crit-bg); color: var(--sc-crit-ink); padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.menu-row i.trail { font-size: 15px; color: #8A8E96; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px;
  padding: 26px 18px; border-radius: var(--radius-lg); background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.empty i { font-size: 30px; color: #8A8E96; }
.empty .t { font-size: 14.5px; }
.empty .s { font-size: 12px; color: var(--color-muted); max-width: 260px; text-wrap: pretty; }

/* Success page */
.result-page { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 24px 8px; }
.result-page .badge-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: var(--sc-good-bg); color: var(--sc-good);
}
.result-page .badge-icon.neutral { background: #EBEDF1; color: #4B4F57; }
.result-page .badge-icon.crit { background: var(--sc-crit-bg); color: var(--sc-crit); }

/* ── Tabs (profile) ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--color-divider); padding: 0 2px; }
.tabs a { font-size: 13.5px; padding: 8px 0; text-decoration: none; color: var(--color-muted); }
.tabs a.active { color: var(--color-accent); box-shadow: inset 0 -2px 0 var(--color-accent); }

/* ── Numpad-ish quick grid ─────────────────────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-grid button {
  min-height: 52px; display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: 19px; font-variant-numeric: tabular-nums; cursor: pointer;
  border-radius: var(--radius-md); background: var(--color-surface);
  border: 0; box-shadow: var(--field-ring); color: var(--color-text);
}
.quick-grid button:hover { background: #F7F8FA; }

/* ── Tables (desktop density) ──────────────────────────────────────────── */
.table, table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: transparent; }
.table th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--color-muted);
  padding: 9px 8px; border-bottom: 1px solid var(--color-divider); font-weight: 500;
}
.table td { padding: 9px 8px; border-bottom: 1px solid var(--color-divider); }
.table tbody tr:hover td { background: #FAFBFC; }
.table-wrap { overflow-x: auto; }

/* ── Dialogs / flash messages ──────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px; border-radius: var(--radius-md); font-size: 13.5px;
  background: var(--color-surface); border: 0;
}
.alert-success { background: var(--sc-good-bg); color: var(--sc-good-ink); }
.alert-danger, .alert-error { background: var(--sc-crit-bg); color: var(--sc-crit-ink); }
.alert-warning { background: var(--sc-warn-bg); color: var(--sc-warn-ink); }
.alert-info { background: var(--color-accent-900); color: var(--color-accent-200); }
.alert .close { margin-left: auto; background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; opacity: 0.7; padding: 0 2px; }

/* Dev environment banner */
.dev-banner {
  background: var(--sc-crit-bg); color: var(--sc-crit-ink);
  text-align: center; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 8px;
}

/* ── Login shell ───────────────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh; display: flex; flex-direction: column; justify-content: center;
  gap: 22px; padding: 26px 24px; max-width: 420px; margin: 0 auto; width: 100%;
}
.login-page .brand-mark { width: 38px; height: 38px; border-radius: 11px; }

/* ═══════════════════════════════════════════════════════════════════════
   Legacy bridge — Yii/Bootstrap widget class names emitted by not-yet-
   redesigned views (GridView, ActiveForm, DetailView, panels) restyled
   into the new system so nothing breaks when SmartAdmin is dropped.
   ═══════════════════════════════════════════════════════════════════════ */
.grid-view table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid-view th { text-align: left; font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-muted); padding: 9px 8px; border-bottom: 1px solid var(--color-divider); font-weight: 500; }
.grid-view th a { color: inherit; }
.grid-view td { padding: 9px 8px; border-bottom: 1px solid var(--color-divider); }
.grid-view tbody tr:hover td { background: #FAFBFC; }
.grid-view { overflow-x: auto; padding: 4px 0; }
.grid-view .filters input, .grid-view .filters select { min-height: 36px; font-size: 13px; }
.grid-view .empty { display: block; padding: 16px; background: none; box-shadow: none; }
.summary { font-size: 12px; color: var(--color-muted); margin: 4px 0; }
.pagination { display: flex; gap: 5px; list-style: none; padding: 0; margin: 12px 0; flex-wrap: wrap; }
.pagination li a, .pagination li span {
  display: flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px;
  padding: 0 8px; border-radius: 9px; text-decoration: none; font-size: 13px;
  background: #EBEDF1; color: #3D4048;
}
.pagination li.active a, .pagination li.active span { background: var(--color-accent-900); color: var(--color-accent-200); font-weight: 500; }
.pagination li.disabled a, .pagination li.disabled span { opacity: 0.4; pointer-events: none; }

table.detail-view { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.detail-view th { text-align: left; font-weight: 400; color: var(--color-muted); width: 40%; padding: 9px 8px; border-bottom: 1px solid var(--color-divider); }
table.detail-view td { padding: 9px 8px; border-bottom: 1px solid var(--color-divider); }

/* Old panel/widget chrome → cards */
.jarviswidget, .x_panel, .panel, .well {
  display: block; border-radius: var(--radius-lg); background: var(--color-surface);
  padding: 16px; margin-bottom: 12px; border: 0; box-shadow: var(--shadow-sm);
}
.jarviswidget header, .x_title, .panel-heading {
  background: none; border: 0; padding: 0 0 8px; font-size: 15px;
}
.jarviswidget header h2, .x_title h2, .panel-title { font-size: 16px; margin: 0; display: inline; }
.jarviswidget-ctrls, .x_title .nav, .widget-toolbar { display: none; }
.jarviswidget > div, .x_content, .panel-body { background: none; border: 0; padding: 0; }
.clearfix::after { content: ""; display: table; clear: both; }

/* Bootstrap grid minimal shim: rows stack on mobile, split on desktop */
.row { display: flex; flex-wrap: wrap; gap: 12px 0; margin: 0 -6px; }
.row > [class*="col-"] { padding: 0 6px; width: 100%; }
@media (min-width: 768px) {
  .row > .col-md-6, .row > .col-sm-6 { width: 50%; }
  .row > .col-md-4, .row > .col-sm-4 { width: 33.333%; }
  .row > .col-md-3, .row > .col-sm-3 { width: 25%; }
  .row > .col-md-8, .row > .col-sm-8 { width: 66.666%; }
  .row > .col-md-9 { width: 75%; }
}
.label { display: inline-flex; font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 6px; background: #EBEDF1; color: #4B4F57; }
.label-success { background: var(--sc-good-bg); color: var(--sc-good-ink); }
.label-danger { background: var(--sc-crit-bg); color: var(--sc-crit-ink); }
.label-warning { background: var(--sc-warn-bg); color: var(--sc-warn-ink); }
.label-info, .label-primary { background: var(--color-accent-900); color: var(--color-accent-200); }
.breadcrumb { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 8px; font-size: 12px; color: var(--color-muted); flex-wrap: wrap; }
.breadcrumb li + li::before { content: "·"; margin-right: 6px; }
