/* ================================================================
   青账 · 社团财务台
   A warm, editorial interface for student club finances.
   ================================================================ */

:root {
  --bg: #f3f0e8;
  --paper: #fffdf8;
  --paper-2: #faf7ef;
  --paper-3: #f1ede3;
  --ink: #1b2720;
  --ink-soft: #35433a;
  --muted: #6d786f;
  --faint: #97a096;
  --line: #e3ded2;
  --line-strong: #d2cbbb;
  --green: #1f5c4a;
  --green-deep: #143f33;
  --green-deeper: #0e2f26;
  --green-soft: #e6efe8;
  --green-mid: #b9d3c3;
  --gold: #b8752b;
  --gold-deep: #8e571c;
  --gold-soft: #f5e9d5;
  --red: #a8443c;
  --red-soft: #f7e5e2;
  --blue: #49677a;
  --blue-soft: #e8eff3;
  --shadow-xs: 0 1px 2px rgba(24, 39, 30, 0.04);
  --shadow-sm: 0 1px 2px rgba(24, 39, 30, 0.04), 0 8px 24px rgba(24, 39, 30, 0.045);
  --shadow-md: 0 20px 60px rgba(20, 63, 51, 0.14);
  --shadow-lg: 0 30px 90px rgba(14, 47, 38, 0.2);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 254px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 183, 121, 0.14), transparent 34rem),
    radial-gradient(circle at 0% 100%, rgba(31, 92, 74, 0.07), transparent 38rem),
    var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }

::selection { background: var(--gold-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(27, 39, 32, 0.16); border: 3px solid transparent; background-clip: content-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(27, 39, 32, 0.28); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- Boot ---------------- */

.boot-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--green-deep);
  color: #f7f2e7;
}
.boot-mark {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--serif);
  font-size: 24px;
  color: #e4c894;
}
.boot-name { font-family: var(--serif); font-size: 19px; letter-spacing: 0.18em; }
.boot-line { width: 88px; height: 2px; margin-top: 12px; background: rgba(255,255,255,.12); overflow: hidden; border-radius: 99px; }
.boot-line span { display: block; height: 100%; width: 45%; background: #d9b779; border-radius: 99px; animation: bootload 1.2s ease-in-out infinite; }
.boot-screen p { margin-top: 4px; font-size: 12px; letter-spacing: .08em; color: rgba(255,255,255,.55); }
@keyframes bootload { 0% { transform: translateX(-120%); } 100% { transform: translateX(260%); } }

/* ---------------- Progress ---------------- */

.progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), #e5c58e);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  transition: transform .35s ease, opacity .25s ease;
  z-index: 9999;
  pointer-events: none;
}
.progress.active { opacity: 1; transform: scaleX(.72); }
.progress.done { opacity: 0; transform: scaleX(1); }

/* ---------------- Common ---------------- */

.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.amount { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.mobile-only { display: none !important; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink-soft);
  transition: .18s ease;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--paper-2); transform: translateY(-1px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--green); color: #fffdf8; box-shadow: 0 1px 1px rgba(20,63,51,.12), 0 6px 16px rgba(31,92,74,.14); }
.btn-primary:hover { background: var(--green-deep); }
.btn-gold { background: var(--gold); color: #fffdf8; box-shadow: 0 6px 16px rgba(184,117,43,.14); }
.btn-gold:hover { background: var(--gold-deep); }
.btn-secondary { background: var(--paper); border-color: var(--line); color: var(--ink-soft); }
.btn-secondary:hover { border-color: var(--line-strong); background: var(--paper-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--paper-3); color: var(--ink); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #eed3cf; }
.btn-danger:hover { background: #f1d6d2; }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-sm { min-height: 33px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; gap: 6px; }
.btn-lg { min-height: 46px; padding: 0 22px; border-radius: 12px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn .spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-secondary .spinner { border-color: rgba(31,92,74,.2); border-top-color: var(--green); }

@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-pending_admin, .badge-pending_finance { color: var(--gold-deep); background: var(--gold-soft); }
.badge-approved { color: var(--green); background: var(--green-soft); }
.badge-paid { color: #2c6a57; background: #dceee5; }
.badge-rejected { color: var(--red); background: var(--red-soft); }
.badge-neutral { color: var(--muted); background: var(--paper-3); }
.badge-neutral::before { display: none; }
.badge-plain { color: var(--muted); background: transparent; padding-left: 0; }
.badge-plain::before { display: none; }
.badge-lg { min-height: 28px; padding: 3px 11px; font-size: 12px; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--paper-3);
  white-space: nowrap;
}
.role-member { color: #69736b; background: #eeece4; }
.role-admin { color: var(--blue); background: var(--blue-soft); }
.role-finance { color: var(--gold-deep); background: var(--gold-soft); }
.role-owner { color: var(--green); background: var(--green-soft); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--gold); opacity: .8; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.card-head p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.card-link { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--green); white-space: nowrap; }
.card-link:hover { color: var(--gold-deep); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 54px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--faint);
  margin-bottom: 2px;
}
.empty strong { display: block; color: var(--ink-soft); font-size: 14px; }
.empty p { max-width: 320px; font-size: 12.5px; }

.error-state {
  max-width: 560px;
  margin: 10vh auto;
  padding: 36px;
  text-align: center;
}
.error-state h2 { font-family: var(--serif); font-size: 25px; margin-bottom: 8px; }
.error-state p { color: var(--muted); margin-bottom: 20px; }

.skeleton {
  border-radius: 8px;
  background: linear-gradient(100deg, #ece8de 20%, #f7f4ec 38%, #ece8de 56%);
  background-size: 220% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -20% 0; } }
.skeleton-page { padding-top: 10px; }
.skeleton-line { height: 13px; margin-bottom: 12px; }
.skeleton-block { height: 118px; border-radius: var(--radius); margin-bottom: 16px; }

/* ---------------- Auth ---------------- */

.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 5vw, 68px);
  color: #f8f4e9;
  background:
    radial-gradient(circle at 82% 18%, rgba(217, 183, 121, .16), transparent 23rem),
    radial-gradient(circle at 12% 92%, rgba(185, 211, 195, .12), transparent 28rem),
    var(--green-deep);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand::before {
  content: "";
  position: absolute;
  width: 34rem; height: 34rem;
  right: -15rem; bottom: -17rem;
  border: 1px solid rgba(217, 183, 121, .2);
  border-radius: 50%;
  box-shadow: 0 0 0 3.5rem rgba(217, 183, 121, .035), 0 0 0 7rem rgba(217, 183, 121, .025);
  pointer-events: none;
}
.auth-brand::after {
  content: "账";
  position: absolute;
  right: -1.5rem; top: 26%;
  font-family: var(--serif);
  font-size: 19rem;
  line-height: 1;
  color: rgba(255, 255, 255, .025);
  pointer-events: none;
}
.auth-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  font-family: var(--serif);
  font-size: 18px;
  color: #e6c78f;
}
.brand-name { font-family: var(--serif); font-size: 18px; letter-spacing: .12em; }
.brand-sub { font-size: 10px; letter-spacing: .18em; color: rgba(248,244,233,.48); text-transform: uppercase; margin-top: 1px; }
.auth-top-note { font-size: 11px; color: rgba(248,244,233,.45); letter-spacing: .05em; }

.auth-hero { position: relative; z-index: 1; margin: clamp(42px, 9vh, 96px) 0 36px; max-width: 640px; }
.auth-kicker { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: #d9b779; text-transform: uppercase; }
.auth-kicker::before { content: ""; width: 30px; height: 1px; background: #d9b779; opacity: .7; }
.auth-headline {
  margin-top: 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 4.6vw, 64px);
  line-height: 1.16;
  letter-spacing: -.035em;
}
.auth-headline em { font-style: normal; color: #e3c48d; }
.auth-lede { margin-top: 22px; max-width: 470px; font-size: 14px; line-height: 1.9; color: rgba(248,244,233,.62); }

.auth-features { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 650px; }
.auth-feature {
  padding: 14px 15px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
  backdrop-filter: blur(4px);
}
.auth-feature-icon { color: #d9b779; margin-bottom: 9px; }
.auth-feature strong { display: block; font-size: 12.5px; color: rgba(248,244,233,.9); font-weight: 600; }
.auth-feature span { display: block; margin-top: 3px; font-size: 10.5px; color: rgba(248,244,233,.44); line-height: 1.5; }

.auth-visual {
  position: relative;
  z-index: 1;
  margin-top: 32px;
  align-self: flex-start;
  width: min(430px, 100%);
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: 0 20px 50px rgba(0,0,0,.14);
}
.auth-visual-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .1em; color: rgba(248,244,233,.44); text-transform: uppercase; }
.auth-visual-head span:last-child { color: #b9d3c3; }
.auth-visual-balance { margin-top: 11px; font-family: var(--serif); font-size: 31px; letter-spacing: -.02em; color: #fbf7eb; }
.auth-visual-balance small { font-family: var(--sans); font-size: 11px; color: rgba(248,244,233,.4); margin-left: 7px; letter-spacing: .04em; }
.auth-visual-bars { display: flex; align-items: flex-end; gap: 7px; height: 58px; margin-top: 17px; }
.auth-visual-bars i { display: block; flex: 1; border-radius: 4px 4px 1px 1px; background: rgba(217,183,121,.32); }
.auth-visual-bars i:nth-child(3n) { background: #d9b779; }
.auth-visual-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 9px; color: rgba(248,244,233,.3); }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px clamp(26px, 5vw, 72px);
  background: rgba(255, 253, 248, .48);
}
.auth-card { width: min(404px, 100%); }
.auth-card-head { margin-bottom: 27px; }
.auth-card-head h1 { margin-top: 9px; font-family: var(--serif); font-size: clamp(26px, 3vw, 33px); font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.auth-card-head p { margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; padding: 4px; border-radius: 11px; background: var(--paper-3); }
.auth-tab { flex: 1; min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; transition: .18s ease; }
.auth-tab.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-xs); }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .field { gap: 7px; }
.auth-submit { margin-top: 5px; }
.auth-switch { margin-top: 22px; text-align: center; font-size: 12px; color: var(--muted); }
.auth-switch button { border: 0; background: none; padding: 0; color: var(--green); font-weight: 700; }
.auth-switch button:hover { text-decoration: underline; }
.auth-legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-start; color: var(--faint); font-size: 10.5px; line-height: 1.6; }
.auth-legal svg { margin-top: 1px; }
.auth-note {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 2px; padding: 10px 12px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px; line-height: 1.55;
}
.auth-note svg { margin-top: 1px; }

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

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 650; color: var(--ink-soft); letter-spacing: .01em; }
.field-label .optional { font-size: 10px; font-weight: 500; color: var(--faint); }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  appearance: none;
}
.textarea { min-height: 94px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #b1b7ae; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 92, 74, .09);
  background: #fffefa;
}
.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d786f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 38px; }
.input-group .input-icon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.input-affix { position: absolute; right: 12px; font-size: 11px; color: var(--faint); pointer-events: none; }
.input-group .input.has-affix { padding-right: 38px; }
.field-hint { font-size: 10.5px; color: var(--faint); line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 14px; }
.form-error {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.55;
}
.form-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; }
.form-section:last-child { border-bottom: 0; padding-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: var(--ink-soft); line-height: 1.5; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--green); flex: none; }
.segmented { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--paper-3); }
.segmented button { flex: 1; min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; transition: .15s ease; }
.segmented button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-xs); }
.segmented button[data-value="expense"].active { color: var(--gold-deep); }
.segmented button[data-value="income"].active { color: var(--green); }

.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--green); background: var(--green-soft); }
.upload-zone strong { color: var(--ink-soft); font-size: 12.5px; }
.upload-zone span { font-size: 10.5px; color: var(--faint); }
.upload-zone svg { color: var(--green); margin-bottom: 3px; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
}
.upload-preview-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--gold-soft); color: var(--gold-deep); }
.upload-preview-info { flex: 1; min-width: 0; }
.upload-preview-info strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview-info span { font-size: 10px; color: var(--faint); }

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 25px 17px 18px;
  background:
    radial-gradient(circle at 10% 4%, rgba(217, 183, 121, .11), transparent 18rem),
    var(--green-deep);
  color: #f7f3e8;
  overflow-y: auto;
  z-index: 30;
}
.sidebar::after {
  content: "";
  position: absolute;
  left: -8rem; bottom: 14%;
  width: 18rem; height: 18rem;
  border: 1px solid rgba(217, 183, 121, .08);
  border-radius: 50%;
  pointer-events: none;
}
.sidebar-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 2px 7px 26px; }
.sidebar-brand .brand-mark { width: 40px; height: 40px; }
.sidebar-brand .brand-name { font-size: 19px; }
.sidebar-brand .brand-sub { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; }
.nav-label { margin: 19px 12px 7px; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(247,243,232,.28); }
.nav-label:first-child { margin-top: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 41px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(247, 243, 232, .61);
  font-size: 12.8px;
  font-weight: 500;
  transition: .16s ease;
}
.nav-item svg { opacity: .75; transition: .16s ease; }
.nav-item:hover { color: rgba(247,243,232,.95); background: rgba(255,255,255,.055); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { color: #fffdf7; background: rgba(255, 255, 255, .1); font-weight: 600; }
.nav-item.active svg { color: #e3c48d; opacity: 1; }
.nav-item.active::before { content: ""; position: absolute; left: -17px; top: 50%; width: 3px; height: 19px; transform: translateY(-50%); border-radius: 0 3px 3px 0; background: #d9b779; }
.nav-count {
  margin-left: auto;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 99px;
  background: #d9b779;
  color: #3a2b14;
  font-size: 10px;
  font-weight: 750;
}
.sidebar-foot { position: relative; z-index: 1; margin-top: auto; padding-top: 24px; }
.sidebar-tip {
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
}
.sidebar-tip-head { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #d9b779; letter-spacing: .04em; margin-bottom: 5px; }
.sidebar-tip p { font-size: 10.5px; line-height: 1.55; color: rgba(247,243,232,.45); }
.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 11px;
  transition: .16s ease;
}
.user-mini:hover { background: rgba(255,255,255,.055); }
.avatar {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #e8d9ba;
  color: var(--green-deep);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}
.avatar.sm { width: 27px; height: 27px; border-radius: 8px; font-size: 12px; }
.avatar.lg { width: 58px; height: 58px; border-radius: 16px; font-size: 24px; }
.user-mini-info { min-width: 0; flex: 1; }
.user-mini-info strong { display: block; font-size: 11.5px; font-weight: 600; color: rgba(247,243,232,.9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini-info span { display: block; margin-top: 1px; font-size: 9.5px; color: rgba(247,243,232,.38); }
.user-mini .logout-mini { color: rgba(247,243,232,.35); padding: 5px; border-radius: 6px; }
.user-mini .logout-mini:hover { color: #f0c9c3; background: rgba(255,255,255,.06); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(20px, 3vw, 38px);
  border-bottom: 1px solid rgba(210, 203, 187, .58);
  background: rgba(243, 240, 232, .82);
  backdrop-filter: blur(18px) saturate(1.2);
}
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar-brand { display: none; align-items: center; gap: 8px; font-family: var(--serif); font-size: 17px; letter-spacing: .1em; }
.topbar-brand .brand-mark { width: 31px; height: 31px; border-radius: 9px; font-size: 14px; background: var(--green-deep); border: 0; color: #e6c78f; }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11px; color: var(--faint); }
.breadcrumb strong { font-weight: 650; color: var(--ink-soft); font-size: 12px; }
.breadcrumb .slash { color: var(--line-strong); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-date { margin-right: 4px; font-size: 11px; color: var(--faint); letter-spacing: .02em; }
.topbar-user { display: flex; align-items: center; gap: 8px; padding: 4px 5px 4px 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,248,.72); }
.topbar-user .avatar { width: 27px; height: 27px; border-radius: 7px; font-size: 12px; }
.topbar-user span { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.topbar-public { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.topbar-public:hover { color: var(--green); border-color: var(--green-mid); }

.page { width: 100%; max-width: 1460px; margin: 0 auto; padding: 30px clamp(20px, 3vw, 38px) 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-title-block { min-width: 0; }
.page-head h1 { margin-top: 7px; font-family: var(--serif); font-size: clamp(27px, 3vw, 36px); font-weight: 600; letter-spacing: -.035em; line-height: 1.18; }
.page-head .page-sub { margin-top: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.65; max-width: 700px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex: none; flex-wrap: wrap; justify-content: flex-end; }

.mobile-nav { display: none; }

/* ---------------- Dashboard ---------------- */

.hello-line { display: flex; align-items: center; gap: 10px; }
.hello-line .dot { width: 7px; height: 7px; border-radius: 50%; background: #6da184; box-shadow: 0 0 0 4px rgba(109,161,132,.12); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 21px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -30px; bottom: -42px;
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 1px solid rgba(31, 92, 74, .055);
}
.stat-card.dark { background: var(--green-deep); border-color: var(--green-deep); color: #f8f4e9; }
.stat-card.dark::after { border-color: rgba(217,183,121,.18); }
.stat-card.gold { background: #fbf4e7; border-color: #eddfc6; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.stat-card.dark .stat-label { color: rgba(248,244,233,.55); }
.stat-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--paper-2); color: var(--green); }
.stat-card.dark .stat-icon { background: rgba(255,255,255,.08); color: #e3c48d; }
.stat-card.gold .stat-icon { background: rgba(184,117,43,.1); color: var(--gold); }
.stat-value { margin-top: 13px; font-size: clamp(23px, 2.3vw, 30px); font-weight: 650; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value .currency { font-size: .58em; font-weight: 500; opacity: .55; margin-right: 2px; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10.5px; color: var(--faint); }
.stat-card.dark .stat-foot { color: rgba(248,244,233,.38); }
.stat-foot strong { color: var(--green); font-weight: 650; }
.stat-card.dark .stat-foot strong { color: #d9b779; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 19px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 19px; min-width: 0; }

.flow-card { padding: 21px 22px 19px; }
.flow-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.flow-head h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.flow-head p { margin-top: 4px; font-size: 11px; color: var(--muted); }
.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.flow-step { position: relative; padding-right: 15px; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: 32px; right: 8px; height: 1px; background: var(--line); }
.flow-step:last-child { padding-right: 0; }
.flow-num { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: var(--muted); font-family: var(--serif); font-size: 12px; }
.flow-step.active .flow-num { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 0 0 4px var(--green-soft); }
.flow-step strong { display: block; margin-top: 9px; font-size: 11.5px; }
.flow-step span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--faint); line-height: 1.45; }

.request-list { display: flex; flex-direction: column; }
.request-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s ease;
}
.request-row:last-child { border-bottom: 0; }
.request-row:hover { background: rgba(250, 247, 239, .8); }
.request-row::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 2px; border-radius: 0 2px 2px 0; background: transparent; transition: .15s ease; }
.request-row:hover::before { background: var(--gold); }
.req-type {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
}
.req-type.reimbursement { background: var(--gold-soft); color: var(--gold-deep); }
.req-main { min-width: 0; }
.req-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.req-title strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-top: 4px; color: var(--faint); font-size: 10px; }
.req-meta span { display: inline-flex; align-items: center; gap: 4px; }
.req-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.req-amount { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.req-right .badge { font-size: 10px; min-height: 21px; padding: 1px 7px; }

.feed { padding: 4px 0; }
.feed-item { position: relative; display: flex; gap: 11px; padding: 12px 20px; }
.feed-item + .feed-item::before { content: ""; position: absolute; left: 30px; top: -8px; bottom: calc(100% - 14px); border-left: 1px dashed var(--line); }
.feed-node { width: 20px; height: 20px; margin-top: 2px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.feed-node.gold { background: var(--gold-soft); color: var(--gold-deep); }
.feed-node.red { background: var(--red-soft); color: var(--red); }
.feed-node.neutral { background: var(--paper-3); color: var(--muted); }
.feed-body { min-width: 0; flex: 1; }
.feed-body p { font-size: 11.5px; line-height: 1.55; color: var(--ink-soft); }
.feed-body p strong { font-weight: 650; }
.feed-body p a { color: var(--green); font-weight: 600; }
.feed-time { margin-top: 3px; font-size: 9.5px; color: var(--faint); }

.mini-ledger { padding: 20px; }
.mini-ledger-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mini-ledger-head h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.mini-ledger-head p { margin-top: 2px; font-size: 10.5px; color: var(--faint); }
.mini-ledger-balance { margin-top: 17px; font-size: 28px; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.mini-ledger-balance small { font-size: 11px; font-weight: 500; color: var(--faint); margin-left: 5px; letter-spacing: 0; }
.mini-ledger-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.mini-ledger-split div span { display: block; font-size: 9.5px; color: var(--faint); }
.mini-ledger-split div strong { display: block; margin-top: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.mini-ledger-split .income strong { color: var(--green); }
.mini-ledger-split .expense strong { color: var(--gold-deep); }
.mini-bars { display: flex; align-items: flex-end; gap: 5px; height: 48px; margin-top: 16px; }
.mini-bars i { flex: 1; min-height: 3px; border-radius: 3px 3px 1px 1px; background: var(--paper-3); }
.mini-bars i.hot { background: var(--green-mid); }
.mini-bars i.gold { background: #d9b779; }

.queue-callout {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  border: 1px solid #ead9bc;
}
.queue-callout::after { content: ""; position: absolute; right: -18px; bottom: -38px; width: 100px; height: 100px; border-radius: 50%; border: 1px solid rgba(184,117,43,.18); }
.queue-callout h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; color: #5b3c13; }
.queue-callout p { margin-top: 4px; font-size: 11px; color: #8a6a3b; line-height: 1.6; }
.queue-numbers { display: flex; gap: 18px; margin: 14px 0 15px; }
.queue-number strong { display: block; font-size: 24px; font-weight: 650; line-height: 1; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.queue-number span { display: block; margin-top: 4px; font-size: 9.5px; color: #927446; }
.queue-callout .btn { background: #fff9ee; color: var(--gold-deep); border-color: rgba(184,117,43,.18); }
.queue-callout .btn:hover { background: #fff; }

.public-note { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 10.5px; }

/* ---------------- Toolbars and filters ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; min-width: 220px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 12px;
  transition: .18s ease;
}
.search-box input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,92,74,.08); }
.filter-select { height: 38px; min-width: 100px; padding: 0 31px 0 11px; border: 1px solid var(--line); border-radius: 10px; background-color: var(--paper); font-size: 12px; color: var(--muted); }
.filter-select:focus { outline: none; border-color: var(--green); }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--paper-3); overflow: auto; }
.tabs button { flex: 1; min-height: 32px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; transition: .15s ease; }
.tabs button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-xs); }
.tabs button .tab-count { margin-left: 5px; font-size: 10px; color: var(--faint); }

.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 10px; font-size: 10.5px; color: var(--faint); }
.list-meta strong { color: var(--ink-soft); font-weight: 650; }

.request-table .req-title strong { font-size: 12px; }
.request-card-list { display: flex; flex-direction: column; }
.request-card-list .request-row { padding: 16px 18px; background: var(--paper); }
.request-card-list .request-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.request-card-list .request-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* ---------------- Approval ---------------- */

.approval-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.mini-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.mini-stat span { font-size: 10.5px; color: var(--faint); }
.mini-stat strong { display: block; margin-top: 3px; font-size: 20px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.approval-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.approval-card { display: flex; flex-direction: column; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-xs); }
.approval-top { display: flex; align-items: flex-start; gap: 11px; }
.approval-top .req-type { width: 38px; height: 38px; }
.approval-title { flex: 1; min-width: 0; }
.approval-title h3 { font-size: 13.5px; font-weight: 650; line-height: 1.4; }
.approval-title p { margin-top: 3px; font-size: 10px; color: var(--faint); }
.approval-amount { text-align: right; flex: none; }
.approval-amount strong { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.approval-amount span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--faint); }
.approval-purpose { margin-top: 13px; padding: 10px 11px; border-radius: 8px; background: var(--paper-2); color: var(--muted); font-size: 11px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.approval-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 11px; font-size: 10px; color: var(--faint); }
.approval-meta span { display: inline-flex; gap: 4px; align-items: center; }
.approval-actions { display: flex; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.approval-actions .btn { flex: 1; }
.approval-sla { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 9.5px; color: var(--gold-deep); }

.review-modal-summary { padding: 14px; border-radius: 11px; background: var(--paper-2); border: 1px solid var(--line); }
.review-modal-summary h3 { font-size: 14px; }
.review-modal-summary .amount { margin-top: 2px; font-size: 24px; font-weight: 650; }
.review-modal-summary p { margin-top: 7px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 15px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--faint); }
.review-grid strong { color: var(--ink-soft); font-weight: 600; }

/* ---------------- Publicity ---------------- */

.public-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 15px 18px;
  border: 1px solid #dfe8e0;
  border-radius: 13px;
  background: var(--green-soft);
}
.public-banner-left { display: flex; align-items: center; gap: 10px; }
.public-banner-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--paper); color: var(--green); }
.public-banner strong { display: block; font-size: 12px; color: var(--green); }
.public-banner p { margin-top: 2px; font-size: 10.5px; color: #648372; }
.public-banner .mono { font-size: 21px; color: var(--green); font-weight: 650; }

.public-feed { position: relative; padding: 8px 0; }
.public-event { position: relative; display: grid; grid-template-columns: 91px 26px minmax(0, 1fr); gap: 12px; padding: 0 22px 19px; }
.public-event:last-child { padding-bottom: 8px; }
.public-date { padding-top: 12px; text-align: right; font-size: 10px; color: var(--faint); line-height: 1.4; }
.public-date strong { display: block; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.public-line { position: relative; display: flex; justify-content: center; }
.public-line::before { content: ""; position: absolute; top: 0; bottom: -19px; width: 1px; background: var(--line); }
.public-event:last-child .public-line::before { display: none; }
.public-dot { position: relative; z-index: 1; width: 26px; height: 26px; margin-top: 8px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.public-dot.approved { background: var(--green-soft); border-color: #cfe0d5; color: var(--green); }
.public-dot.rejected { background: var(--red-soft); border-color: #efd6d2; color: var(--red); }
.public-dot.pending { background: var(--gold-soft); border-color: #ecdec6; color: var(--gold-deep); }
.public-card { margin-top: 5px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-xs); }
.public-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.public-card h3 { font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.public-card h3 button { border: 0; background: none; padding: 0; text-align: left; color: inherit; font-weight: inherit; }
.public-card h3 button:hover { color: var(--green); }
.public-card .amount { font-size: 14px; font-weight: 650; white-space: nowrap; }
.public-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; margin-top: 5px; font-size: 10px; color: var(--faint); }
.public-action { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 5px; font-size: 9.5px; font-weight: 700; background: var(--paper-3); color: var(--muted); }
.public-action.approved { background: var(--green-soft); color: var(--green); }
.public-action.rejected { background: var(--red-soft); color: var(--red); }
.public-comment { margin-top: 8px; padding: 8px 10px; border-left: 2px solid var(--line-strong); color: var(--muted); font-size: 10.5px; line-height: 1.6; background: var(--paper-2); }

/* ---------------- Ledger ---------------- */

.ledger-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.ledger-summary-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.ledger-summary-card.dark { background: var(--green-deep); border-color: var(--green-deep); color: #f8f4e9; }
.ledger-summary-card span { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--faint); }
.ledger-summary-card.dark span { color: rgba(248,244,233,.5); }
.ledger-summary-card strong { display: block; margin-top: 7px; font-size: 24px; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.ledger-summary-card.dark strong { color: #fffdf7; }
.ledger-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.chart-card { padding: 18px 20px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.chart-head h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.chart-head p { margin-top: 3px; font-size: 10px; color: var(--faint); }
.category-bars { display: flex; flex-direction: column; gap: 10px; }
.category-bar-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 79px; align-items: center; gap: 9px; }
.category-bar-label { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-bar-track { height: 7px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.category-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3e806a, var(--green)); }
.category-bar-fill.gold { background: linear-gradient(90deg, #d3a25f, var(--gold)); }
.category-bar-value { text-align: right; font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.category-bars-empty { padding: 30px 0; text-align: center; color: var(--faint); font-size: 11px; }

.month-chart { display: flex; flex-direction: column; height: 100%; }
.month-bars { display: flex; align-items: flex-end; gap: 8px; height: 122px; padding-top: 12px; flex: 1; }
.month-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.month-bar-stack { width: min(24px, 70%); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.month-bar-expense { width: 100%; min-height: 2px; border-radius: 3px 3px 1px 1px; background: var(--green); }
.month-bar-income { width: 100%; min-height: 2px; border-radius: 1px 1px 3px 3px; background: #d9b779; }
.month-bar span { font-size: 8.5px; color: var(--faint); white-space: nowrap; }
.chart-legend { display: flex; gap: 13px; margin-top: 10px; font-size: 9.5px; color: var(--faint); }
.chart-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; }

.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.date-input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); font-size: 11px; color: var(--ink-soft); }
.date-input:focus { outline: none; border-color: var(--green); }
.range-sep { color: var(--faint); font-size: 10px; }
.quick-ranges { display: flex; gap: 4px; }
.quick-range { min-height: 28px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); font-size: 10px; font-weight: 600; }
.quick-range:hover { background: var(--paper-3); color: var(--ink-soft); }
.quick-range.active { background: var(--green-soft); color: var(--green); }

.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--ink-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fcfaf4; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .money-expense { color: var(--gold-deep); font-weight: 650; }
.data-table .money-income { color: var(--green); font-weight: 650; }
.data-table .sub { display: block; margin-top: 2px; font-size: 9.5px; color: var(--faint); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-action { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--faint); }
.row-action:hover { background: var(--paper-3); color: var(--ink); }
.row-action.danger:hover { background: var(--red-soft); color: var(--red); }

.ledger-cards { display: none; }

/* ---------------- Members / invites ---------------- */

.member-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.member-table { min-width: 540px; }
.member-cell { display: flex; align-items: center; gap: 9px; }
.member-cell strong { display: block; font-size: 11.5px; font-weight: 600; }
.member-cell span { display: block; margin-top: 1px; font-size: 9.5px; color: var(--faint); }
.member-role-select { height: 30px; min-width: 92px; padding: 0 26px 0 8px; border: 1px solid var(--line); border-radius: 7px; background-color: var(--paper); font-size: 10.5px; color: var(--muted); }
.status-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.switch { position: relative; width: 30px; height: 17px; border-radius: 99px; background: var(--line-strong); transition: .18s ease; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: .18s ease; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch.on { background: var(--green); }
.switch.on::after { left: 15px; }

.invite-card { padding: 19px; }
.invite-card h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.invite-card > p { margin-top: 4px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.invite-form { margin-top: 15px; display: flex; flex-direction: column; gap: 12px; }
.invite-list { display: flex; flex-direction: column; gap: 9px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.invite-item { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.invite-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.invite-code { font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: .12em; color: var(--green); }
.invite-item-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 5px; font-size: 9.5px; color: var(--faint); }
.invite-item-meta .expired { color: var(--red); }
.invite-empty { padding: 16px 0; text-align: center; font-size: 10.5px; color: var(--faint); }
.copy-btn { border: 0; background: var(--paper); color: var(--muted); width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line); }
.copy-btn:hover { color: var(--green); border-color: var(--green-mid); }
.invite-revoke { border: 0; background: none; padding: 0; color: var(--faint); font-size: 9.5px; }
.invite-revoke:hover { color: var(--red); }

/* ---------------- Profile ---------------- */

.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr); gap: 18px; align-items: start; }
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 24px; border-radius: var(--radius); background: var(--green-deep); color: #f8f4e9; position: relative; overflow: hidden; }
.profile-hero::after { content: ""; position: absolute; right: -40px; top: -70px; width: 190px; height: 190px; border: 1px solid rgba(217,183,121,.2); border-radius: 50%; }
.profile-hero .avatar { background: #e6d3ae; color: var(--green-deep); }
.profile-hero h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.profile-hero p { margin-top: 3px; font-size: 11px; color: rgba(248,244,233,.48); }
.profile-hero .role-badge { margin-top: 7px; background: rgba(255,255,255,.1); color: #e3c48d; }
.permission-list { display: flex; flex-direction: column; gap: 1px; }
.permission-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.permission-row:last-child { border-bottom: 0; }
.perm-check { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); flex: none; }
.perm-check.off { background: var(--paper-3); color: var(--faint); }
.permission-row span { color: var(--muted); }
.permission-row strong { margin-left: auto; font-size: 10px; color: var(--faint); font-weight: 500; }

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(13, 35, 28, .52);
  backdrop-filter: blur(5px);
  animation: fadeIn .18s ease both;
}
.modal {
  width: min(720px, 100%);
  max-height: min(90dvh, 900px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1) both;
}
.modal.wide { width: min(780px, 100%); }
.modal.narrow { width: min(480px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 21px 24px 17px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.modal-head p { margin-top: 4px; font-size: 11px; color: var(--muted); }
.modal-close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--paper-2); color: var(--muted); flex: none; }
.modal-close:hover { background: var(--paper-3); color: var(--ink); }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 21px 24px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 15px 24px; border-top: 1px solid var(--line); background: var(--paper-2); flex: none; }
.modal-foot .left { margin-right: auto; }
.modal-section + .modal-section { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }
.modal-section h3 { font-size: 10.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 11px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* Request detail */
.detail-top { display: flex; align-items: flex-start; gap: 13px; }
.detail-type { width: 43px; height: 43px; border-radius: 12px; }
.detail-title { flex: 1; min-width: 0; }
.detail-title h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.35; }
.detail-title .meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 5px; font-size: 10px; color: var(--faint); }
.detail-amount { font-size: 24px; font-weight: 650; letter-spacing: -.03em; white-space: nowrap; }
.detail-purpose { margin-top: 16px; padding: 13px 14px; border-radius: 10px; background: var(--paper-2); font-size: 12px; line-height: 1.7; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 18px; margin-top: 16px; }
.detail-grid div span { display: block; font-size: 9.5px; color: var(--faint); }
.detail-grid div strong { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 550; color: var(--ink-soft); overflow-wrap: anywhere; }
.detail-timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; display: flex; gap: 10px; padding-bottom: 14px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-line { position: relative; width: 16px; flex: none; display: flex; justify-content: center; }
.timeline-line::before { content: ""; position: absolute; top: 15px; bottom: -14px; width: 1px; background: var(--line); }
.timeline-item:last-child .timeline-line::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 15px; height: 15px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--paper); background: var(--line-strong); box-shadow: 0 0 0 1px var(--line); }
.timeline-dot.green { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.timeline-dot.gold { background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.timeline-dot.red { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-body p { font-size: 11.5px; line-height: 1.55; }
.timeline-body p strong { font-weight: 650; }
.timeline-body .time { display: block; margin-top: 2px; font-size: 9.5px; color: var(--faint); }
.timeline-comment { margin-top: 6px; padding: 7px 9px; border-radius: 7px; background: var(--paper-2); color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.receipt-box { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); margin-top: 14px; }
.receipt-box-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--gold-soft); color: var(--gold-deep); }
.receipt-box-info { flex: 1; min-width: 0; }
.receipt-box-info strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-box-info span { font-size: 9.5px; color: var(--faint); }
.receipt-missing { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--gold-soft); color: var(--gold-deep); font-size: 10.5px; }

.payout-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid #cfe0d5;
  border-radius: 11px;
  background: var(--green-soft);
  cursor: pointer;
}
.payout-check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green);
  flex: none;
}
.payout-check strong { display: block; color: var(--green); font-size: 12px; }
.payout-check .field-hint { display: block; margin-top: 3px; color: #648372; font-size: 10.5px; line-height: 1.55; }
.payout-check input:disabled { opacity: .55; }

/* ---------------- Toast ---------------- */

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  background: #193b31;
  color: #f8f4e9;
  box-shadow: 0 12px 34px rgba(13,35,28,.24);
  font-size: 11.5px;
  line-height: 1.55;
  pointer-events: auto;
  animation: toastIn .24s cubic-bezier(.2,.8,.2,1) both;
}
.toast.out { animation: toastOut .2s ease both; }
.toast svg { color: #9ec9b2; margin-top: 1px; }
.toast.error { background: #552c28; }
.toast.error svg { color: #f0b6ae; }
.toast.info svg { color: #e3c48d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(5px); } }

/* ---------------- Small shared additions ---------------- */

.text-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  letter-spacing: .01em;
}
.text-link:hover { color: var(--gold-deep); text-decoration: underline; }
.money-income { color: var(--green); }
.money-expense { color: var(--gold-deep); }
.status-toggle {
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
}
.month-bar-pair {
  flex: none;
  width: 100%;
  height: 84px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.month-bar-pair i {
  display: block;
  width: 7px;
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
}
.month-bar-income { background: #d9b779; }
.month-bar-expense { background: var(--green); }
.public-meta .badge { min-height: 19px; padding: 1px 6px; font-size: 9px; }
.card-link { border: 0; background: none; padding: 0; }
.card-link:disabled { opacity: .55; cursor: default; }

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

@media (max-width: 1180px) {
  :root { --sidebar-w: 232px; }
  .dash-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .approval-list { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-only { display: initial !important; }
  .topbar-brand { display: flex; }
  .breadcrumb .topbar-home { display: none; }
  .page { padding-bottom: 100px; }
  .mobile-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 2px;
    min-height: 62px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(210,203,187,.7);
    background: rgba(255,253,248,.94);
    backdrop-filter: blur(18px) saturate(1.2);
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 52px;
    min-height: 45px;
    padding: 3px 5px;
    border-radius: 9px;
    color: var(--faint);
    font-size: 9px;
    font-weight: 600;
  }
  .mobile-nav a.active { color: var(--green); background: var(--green-soft); }
  .mobile-nav a .nav-count { position: absolute; transform: translate(15px, -12px); margin: 0; min-width: 16px; height: 16px; font-size: 9px; }
  .mobile-nav a { position: relative; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 30px 30px; min-height: auto; }
  .auth-hero { margin: 36px 0 0; }
  .auth-headline { font-size: 38px; max-width: 520px; }
  .auth-lede { margin-top: 12px; font-size: 12.5px; }
  .auth-features, .auth-visual { display: none; }
  .auth-panel { padding: 34px 24px 50px; background: transparent; }
  .auth-card { width: min(430px, 100%); }
  .auth-top-note { display: none; }
  .dash-grid, .ledger-grid, .member-grid, .profile-grid { grid-template-columns: 1fr; }
  .public-event { grid-template-columns: 64px 24px minmax(0, 1fr); padding-left: 14px; padding-right: 14px; }
  .public-date strong { font-size: 10px; }
  .public-date { font-size: 9px; }
}

@media (max-width: 760px) {
  .topbar { height: 61px; padding: 0 15px; }
  .topbar-date { display: none; }
  .topbar-public span { display: none; }
  .topbar-public { width: 36px; padding: 0; justify-content: center; }
  .topbar-user span { display: none; }
  .topbar-user .avatar { display: grid; }
  .topbar-user { border: 0; background: transparent; padding: 0; }
  .topbar-user .avatar { width: 31px; height: 31px; }
  .page { padding: 22px 15px 100px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 1; }
  .page-head h1 { font-size: 27px; }
  .page-sub { font-size: 11.5px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 15px; }
  .stat-card { min-height: 113px; padding: 14px; }
  .stat-value { font-size: 24px; }
  .stat-label { font-size: 10px; }
  .stat-icon { width: 24px; height: 24px; }
  .dash-grid { gap: 14px; }
  .dash-main, .dash-side { gap: 14px; }
  .flow-steps { grid-template-columns: 1fr 1fr; gap: 16px 8px; }
  .flow-step:not(:last-child)::after { display: none; }
  .flow-step:nth-child(2)::after { display: block; top: 14px; left: 32px; right: 15px; }
  .flow-step:nth-child(2)::after { display: none; }
  .request-row { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 13px 14px; }
  .req-type { width: 32px; height: 32px; border-radius: 9px; }
  .req-right { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; width: 100%; }
  .req-title strong { font-size: 12px; }
  .req-meta { font-size: 9.5px; gap: 3px 8px; }
  .card-head { padding: 15px 15px; }
  .request-list .request-row { padding: 13px 15px; }
  .feed-item { padding: 11px 15px; }
  .mini-ledger { padding: 17px; }
  .approval-stats { gap: 8px; }
  .mini-stat { padding: 11px 12px; }
  .mini-stat strong { font-size: 18px; }
  .approval-card { padding: 15px; }
  .toolbar { align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-box { flex: 1; min-width: 0; }
  .toolbar-right .search-box { flex-basis: 100%; }
  .filter-select { min-width: 0; flex: 1; }
  .tabs { width: 100%; }
  .tabs button { padding: 0 8px; font-size: 10.5px; }
  .ledger-summary { gap: 8px; }
  .ledger-summary-card { padding: 12px; }
  .ledger-summary-card strong { font-size: 19px; }
  .ledger-summary-card span { font-size: 9.5px; }
  .filter-bar { align-items: stretch; padding: 10px; }
  .filter-group { width: 100%; }
  .date-input { flex: 1; min-width: 0; }
  .quick-ranges { margin-left: auto; }
  .quick-range { padding: 0 7px; }
  .table-card { display: none; }
  .ledger-cards { display: flex; flex-direction: column; gap: 8px; }
  .ledger-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
  .ledger-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .ledger-card h4 { font-size: 12px; font-weight: 600; line-height: 1.45; }
  .ledger-card .amount { font-size: 15px; font-weight: 650; white-space: nowrap; }
  .ledger-card-meta { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 5px; color: var(--faint); font-size: 9.5px; }
  .ledger-card-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
  .public-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .public-banner .mono { font-size: 18px; }
  .public-event { grid-template-columns: 50px 22px minmax(0, 1fr); gap: 8px; padding-left: 8px; padding-right: 8px; }
  .public-card { padding: 11px 12px; }
  .public-card-top { flex-direction: column; gap: 4px; }
  .public-card .amount { font-size: 13px; }
  .member-table { min-width: 520px; }
  .invite-card { padding: 16px; }
  .profile-hero { padding: 19px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.narrow {
    width: 100%;
    max-height: 93dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation: sheetIn .24s cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes sheetIn { from { opacity: .6; transform: translateY(40px); } to { opacity: 1; transform: none; } }
  .modal-head { padding: 17px 17px 14px; }
  .modal-head h2 { font-size: 19px; }
  .modal-body { padding: 17px; }
  .modal-foot { padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); }
  .field-row, .field-row-3, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .detail-top { flex-wrap: wrap; }
  .detail-amount { margin-left: 56px; font-size: 21px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 9px 12px; }
  .toast-root { right: 12px; left: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  .auth-brand { padding: 24px 20px 24px; }
  .auth-headline { font-size: 32px; }
  .auth-lede { max-width: 400px; }
  .auth-panel { padding: 28px 18px 44px; }
  .auth-card-head { margin-bottom: 21px; }
}

@media (max-width: 420px) {
  .stat-value { font-size: 21px; }
  .stat-foot { font-size: 9.5px; }
  .page-actions .btn { font-size: 12.5px; }
  .ledger-summary-card strong { font-size: 17px; }
  .ledger-summary-card span { font-size: 9px; }
  .quick-range { display: none; }
  .quick-range:first-child { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
