/* ===================================================================
 * SOMESHWARI · main.css  (v2 — Professional / Tableau-style)
 * IBM Plex Sans + IBM Plex Mono. White canvas, deep-blue accent.
 * Desktop: sidebar + top bar. Mobile: stacked + bottom nav.
 * =================================================================== */

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

/* ── Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg:        #ffffff;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;

  --text:    #0f172a;
  --text-2:  #475569;
  --text-3:  #94a3b8;
  --text-muted: #64748b;

  --border:    #e2e8f0;
  --border-2:  #cbd5e1;

  --accent:       #1e3a8a;
  --accent-hover: #1d4ed8;
  --accent-soft:  #eff6ff;

  --success:      #15803d;
  --success-soft: #dcfce7;
  --warning:      #b45309;
  --warning-soft: #fef3c7;
  --danger:       #b91c1c;
  --danger-soft:  #fee2e2;
  --info:         #0369a1;
  --info-soft:    #e0f2fe;

  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, Monaco, monospace;

  --sidebar-w:  220px;
  --topbar-h:   48px;
  --bottomnav-h: 58px;
  --radius:     6px;
  --radius-lg:  8px;
  --shadow:     0 1px 2px rgba(15,23,42,0.04);
  --shadow-lg:  0 4px 12px rgba(15,23,42,0.08);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.font-mono    { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted        { color: var(--text-muted); }
.small        { font-size: 12px; }
.tiny         { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.numeric      { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ── App shell ──────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-areas: "topbar topbar" "sidebar main";
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* ── Top bar ────────────────────────────────────────────────────── */
.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.topbar-brand:hover { text-decoration: none; }
.topbar-brand .logo {
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.topbar-brand .name { font-size: 14px; }
.topbar-brand .sub  { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2);
}
.topbar-user .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}
.topbar-user a { color: var(--text-2); }
.topbar-user a:hover { color: var(--text); text-decoration: none; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  grid-area: sidebar;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 12px 0 20px;
  overflow-y: auto;
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
}
.sidebar-section {
  padding: 10px 16px 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 500;
}
.sidebar-section:not(:first-child) {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--text-2);
  font-size: 13px;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background 120ms;
  text-decoration: none;
}
.sidebar-item:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}
.sidebar-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.sidebar-item svg {
  width: 15px; height: 15px; flex-shrink: 0;
}
.sidebar-item .badge {
  margin-left: auto;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
}

/* ── Main content ──────────────────────────────────────────────── */
.main {
  grid-area: main;
  background: var(--bg);
  min-width: 0;
}

.container {
  max-width: 1200px;
  padding: 20px 24px 40px;
}

/* ── Page head ─────────────────────────────────────────────────── */
.page-head { margin-bottom: 18px; }
.page-head .eyebrow {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--text);
}
.page-head .lede {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}
.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head-row .page-head { flex: 1; min-width: 0; margin-bottom: 0; }

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-2); }
.breadcrumb .sep { margin: 0 6px; color: var(--text-3); }
.breadcrumb .current { color: var(--text-2); }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-pad { padding: 14px 16px; }
.card-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-header .title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.card-header .link {
  font-size: 12px;
  color: var(--accent);
}
.card-body { padding: 14px 16px; }
.card-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── KPI cards ─────────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.kpi .label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.kpi .value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.kpi .sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.kpi.success .label, .kpi.success .value { color: var(--success); }
.kpi.warning .label, .kpi.warning .value { color: var(--warning); }
.kpi.danger  .label, .kpi.danger  .value { color: var(--danger);  }
.kpi.info    .label, .kpi.info    .value { color: var(--info);    }

/* ── Progress bar ──────────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
.progress-lg { height: 12px; border-radius: 6px; }
.progress-seg { height: 100%; }
.progress-seg.raised  { background: var(--success); }
.progress-seg.pledged { background: #fbbf24; }
.progress-seg.spent   { background: var(--danger); }
.progress-legend {
  display: flex; gap: 12px; font-size: 11px; margin-top: 6px; color: var(--text-muted);
  flex-wrap: wrap;
}
.progress-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.progress-legend .dot.raised  { background: var(--success); }
.progress-legend .dot.pledged { background: #fbbf24; }
.progress-legend .dot.spent   { background: var(--danger); }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms;
  line-height: 1.2;
}
.btn:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn.danger {
  background: #fff;
  border-color: var(--danger);
  color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn.success:hover { background: #166534; border-color: #166534; color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.lg { padding: 10px 18px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; }
.form-row > .form-group, .form-row-3 > .form-group { margin-bottom: 0; }

.label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}
.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  transition: border-color 120ms, box-shadow 120ms;
  font-family: var(--font-sans);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,58,138,0.1);
}
input.large { font-size: 16px; font-family: var(--font-mono); }
input.mono, input[type="date"] { font-family: var(--font-mono); }
textarea { min-height: 72px; resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ── Tables ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead {
  background: var(--surface-2);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Tags ──────────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-2);
  letter-spacing: 0.02em;
  line-height: 1.6;
}
.tag.outline { background: transparent; border: 1px solid var(--border-2); }
.tag.success { background: var(--success-soft); color: var(--success); }
.tag.warning, .tag.amber { background: var(--warning-soft); color: var(--warning); }
.tag.danger  { background: var(--danger-soft);  color: var(--danger);  }
.tag.info    { background: var(--info-soft);    color: var(--info);    }
.tag.accent, .tag.vermillion  { background: var(--accent-soft);  color: var(--accent);  }
.tag.sage    { background: var(--success-soft); color: var(--success); }
.tag.muted   { background: var(--surface-3); color: var(--text-muted); }
.tag.mono    { font-family: var(--font-mono); }

/* Filter chips */
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chip {
  padding: 5px 11px;
  border: 1px solid var(--border-2);
  border-radius: 16px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
}
.chip:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Detail grid ───────────────────────────────────────────────── */
.detail-grid {}
.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .key { color: var(--text-muted); font-size: 12px; padding-top: 1px; }
.detail-row .val { color: var(--text); }
.detail-row .val.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── Row list ──────────────────────────────────────────────────── */
.row-list { }
.row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  gap: 12px;
  cursor: pointer;
  transition: background 120ms;
}
.row:hover { background: var(--surface-2); text-decoration: none; }
.row:last-child { border-bottom: none; }
.row .avatar {
  width: 38px; height: 38px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500;
  flex-shrink: 0;
}
.row .body { flex: 1; min-width: 0; }
.row .body .title { font-size: 14px; font-weight: 500; color: var(--text); }
.row .body .sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.row .body .meta  { font-size: 11px; color: var(--text-3); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row .right { text-align: right; flex-shrink: 0; font-size: 12px; color: var(--text-muted); }
.row .right .amount { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text); }

/* ── Member list (family detail page) ──────────────────────────── */
.member {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.member:last-child { border-bottom: none; }
.member.head { background: var(--accent-soft); }
.member.deceased { opacity: 0.6; }
.member .badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}
.member.head .badge { background: var(--accent); color: #fff; }
.member > div:nth-child(2) { flex: 1; min-width: 0; }
.member .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.member .relation {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.member .right {
  text-align: right;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}
.member .right .mono { color: var(--text-2); font-size: 12px; }
.member .right a { font-size: 11px; color: var(--accent); text-decoration: none; }
.member .right a:hover { text-decoration: underline; }

/* ── Stat strip (summary cards: Received / Pending / etc.) ─────── */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.stat-strip > * {
  flex: 1 1 200px;
  min-width: 0;
}
@media (max-width: 480px) {
  .stat-strip > * { flex-basis: 100%; }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 120ms;
}
a.stat-card:hover { border-color: var(--border-2); }
.stat-card .label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.stat-card .value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.15;
  margin-top: 2px;
}
.stat-card .sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Community badge (family header / row pill) ────────────────── */
.community-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1.6;
  white-space: nowrap;
}
.community-badge.outsider {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ── Phone input (country code + national number) ──────────────── */
.phone-input {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.phone-input .phone-country {
  flex: 0 0 auto;
  max-width: 140px;
  font-size: 13px;
}
.phone-input .phone-national {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ── Section head (page subsection like "5 members · Family") ─── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 22px 0 8px;
  gap: 10px;
}
.section-head h2 {
  font-size: 17px;
  font-weight: 500;
  margin: 2px 0 0;
  color: var(--text);
}

/* ── Search ────────────────────────────────────────────────────── */
.search { margin-bottom: 12px; }
.search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 12px center;
}

/* ── Flash ─────────────────────────────────────────────────────── */
.flash {
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid;
}
.flash-success { background: var(--success-soft); color: var(--success); border-color: #86efac; }
.flash-error   { background: var(--danger-soft);  color: var(--danger);  border-color: #fca5a5; }
.flash-warn    { background: var(--warning-soft); color: var(--warning); border-color: #fcd34d; }
.flash-info    { background: var(--info-soft);    color: var(--info);    border-color: #7dd3fc; }

/* ── Action bar ────────────────────────────────────────────────── */
.action-bar {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  margin: 20px -24px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
}
.action-bar-inner { display: contents; }
.action-bar .summary {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}
.action-bar .summary .label { display: block; font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }
.action-bar .summary .val   { font-size: 13px; color: var(--text); font-family: var(--font-mono); font-weight: 500; }

/* ── Empty state ───────────────────────────────────────────────── */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty .icon { font-size: 32px; color: var(--text-3); margin-bottom: 8px; }
.empty .title { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.empty .sub { font-size: 12px; color: var(--text-muted); }

/* ── Section head ──────────────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 20px 0 10px;
  gap: 10px;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 { font-size: 15px; font-weight: 500; margin: 0; color: var(--text); }
.section-head .eyebrow { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }

/* ── Event card (list) ─────────────────────────────────────────── */
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: all 120ms;
}
.event-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.event-card .head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.event-card .code { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: 0.02em; }
.event-card h3 { font-size: 15px; font-weight: 500; margin: 2px 0 4px; }
.event-card .dates { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.event-card .money { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.event-card .money .lbl { color: var(--text-muted); }
.event-card .money .val { font-family: var(--font-mono); font-weight: 500; }

/* ── Bottom nav (hidden on desktop) ────────────────────────────── */
.bottom-nav { display: none; }

/* ── FAB ───────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  z-index: 30;
  transition: background 120ms;
}
.fab:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }

/* ══════════════════════════════════════════════════════════════════
 * MOBILE
 * ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .app {
    grid-template-areas: "topbar" "main" "bottomnav";
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr auto;
  }
  .sidebar { display: none; }

  .topbar { padding: 0 14px; }
  .topbar-brand .sub { display: none; }

  .container {
    padding: 14px 14px calc(var(--bottomnav-h) + 16px);
  }

  .page-head h1 { font-size: 18px; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .action-bar {
    position: fixed;
    bottom: var(--bottomnav-h);
    left: 0; right: 0;
    margin: 0;
    padding: 10px 14px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .fab { bottom: calc(var(--bottomnav-h) + 16px); }

  .bottom-nav {
    grid-area: bottomnav;
    display: block;
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: var(--bottomnav-h);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 10px;
    text-decoration: none;
  }
  .bottom-nav a svg { width: 18px; height: 18px; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav a.active svg { stroke: var(--accent); }

  .table th, .table td { padding: 6px 8px; font-size: 12px; }
}

/* ── Utilities ─────────────────────────────────────────────────── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gap-sm { gap: 6px; }
.gap-md { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Print ─────────────────────────────────────────────────────── */
@media print {
  .topbar, .sidebar, .bottom-nav, .action-bar, .fab { display: none !important; }
  .main { grid-area: auto; }
  .container { max-width: none; padding: 0; }
}

/* ── Auth (login / password) page ──────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--background);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 20px rgba(0, 0, 0, 0.04);
}
.auth-card h1 {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.auth-card .lede {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 20px;
}
.auth-card .tiny {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.auth-card .form-group { margin-bottom: 14px; }
.auth-card .label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.08);
}

/* Button size modifiers used by login + big action CTAs */
.btn.full   { width: 100%; display: flex; align-items: center; justify-content: center; }
.btn.large  { padding: 12px 20px; font-size: 14px; font-weight: 500; }
