:root {
  --bg: #1c1c1e;
  --bg-2: #161618;
  --surface: #2c2c2e;
  --surface-2: #3a3a3c;
  --input: #1c1c1e;
  --sidebar-top: #161618;
  --sidebar-bot: #0f0f11;
  --accent: #0a84ff;
  --accent-dim: #0a6fd8;
  --on-accent: #ffffff;
  --tan: #333335;
  --ink: #ffffff;
  --ink-soft: #d8d8dc;
  --muted: #98989e;
  --line: #38383a;
  --line-soft: #2c2c2e;
  --red: #ff453a;
  --red-soft: #3a2020;
  --green: #30d158;
  --green-soft: #1c2c20;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
/* Never let the page itself pan sideways — wide content (tables) has its own
   .table-scroll box. `clip` (not `hidden`) so the sticky sidebar keeps working. */
html, body { max-width: 100%; overflow-x: clip; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.icon { width: 20px; height: 20px; flex: 0 0 20px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bot) 100%);
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line-soft);
}

.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; }

.brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(10,132,255,.4);
}

.brand-text { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; line-height: 1; display: flex; flex-direction: column; color: var(--ink); }
.brand-text small { font-family: 'Inter', sans-serif; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .5; margin-top: 4px; font-weight: 500; }

.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; overflow-y: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.side-nav a.active .icon { color: #fff; }

.side-foot { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { display: flex; align-items: center; gap: 11px; padding: 6px 10px 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.side-user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.side-user-meta strong { font-size: 14px; color: var(--ink); }
.side-user-meta span { font-size: 11.5px; opacity: .5; text-transform: uppercase; letter-spacing: .06em; }
.side-logout { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 14px; }
.side-logout:hover { background: rgba(255,69,58,.14); color: var(--red); }

/* ---------- Main area ---------- */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mobile-bar { display: none; }
.content { padding: 30px 34px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 30px; color: var(--ink); margin: 0; }

.hint { color: var(--muted); max-width: 74ch; margin: -8px 0 22px; font-size: 14px; }
.hint strong { color: var(--ink-soft); }

/* ---------- Flash ---------- */
.flash-error { background: var(--red-soft); color: #ff8a82; border: 1px solid #5a2f2c; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; }
.flash-success { background: var(--green-soft); color: #6ee08a; border: 1px solid #2c4a37; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; }

/* ---------- Cards / forms ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 22px 24px; margin-bottom: 26px; }
.form-card h3 { margin: 0 0 18px; font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.form-card h3 .icon { color: var(--accent); }

/* shared field styling for every form */
.inline-form, .expense-fields { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; }
.inline-form label, .expense-fields label, .field-label {
  display: flex; flex-direction: column; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}

.inline-form input, .inline-form select, .expense-fields input {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px;
  font-family: inherit; min-width: 160px; background: var(--input); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.inline-form input::placeholder, .expense-fields input::placeholder { color: #6a6a70; }
.inline-form input:focus, .inline-form select:focus, .expense-fields input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,132,255,.25);
}
.inline-form input[type=date], .expense-fields input[type=date],
.inline-form input[type=number], .expense-fields input[type=number] { color-scheme: dark; }

.btn, .inline-form button, .expense-fields button {
  background: var(--accent); color: #fff; border: none; padding: 12px 22px; border-radius: 11px;
  cursor: pointer; font-size: 14.5px; font-weight: 600; font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px; transition: background .15s, transform .05s; text-decoration: none;
}
.btn:hover, .inline-form button:hover, .expense-fields button:hover { background: var(--accent-dim); }
.btn:active, .inline-form button:active, .expense-fields button:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #45454a; }

/* smaller placeholder text for optional note fields */
.note-input::placeholder { font-size: 12px; opacity: .8; }

/* prominent download button */
.btn-download {
  display: inline-flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #0a84ff, #0a6fd8);
  color: #fff; border: none; cursor: pointer; font-family: inherit;
  padding: 14px 22px; border-radius: 14px;
  box-shadow: 0 8px 22px rgba(10,132,255,.35);
  transition: transform .1s, box-shadow .15s, filter .15s;
}
.btn-download:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(10,132,255,.45); }
.btn-download:active { transform: translateY(1px); }
.btn-download .dl-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: rgba(255,255,255,.18); }
.btn-download .dl-ico .icon { width: 24px; height: 24px; }
.btn-download .dl-text { display: flex; flex-direction: column; align-items: flex-start; font-size: 16px; font-weight: 700; line-height: 1.15; }
.btn-download .dl-text small { font-size: 12px; font-weight: 500; opacity: .85; margin-top: 3px; }

/* ---------- Expense entry ---------- */
.cat-block { margin-bottom: 22px; }
.step-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.step-label b {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; margin-right: 8px; vertical-align: middle;
}

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 12px; border: 1.5px solid var(--line); border-radius: 16px;
  background: var(--surface-2); color: var(--ink-soft); cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; text-align: center; transition: all .14s;
}
.cat-tile:hover { transform: translateY(-2px); border-color: var(--c); color: var(--ink); }
.cat-ico {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  font-size: 27px; line-height: 1;
  background: #48484c;
  background: color-mix(in srgb, var(--c) 26%, #2c2c2e);
  transition: background .14s, transform .14s;
}
.cat-name { line-height: 1.25; overflow-wrap: anywhere; }
.cat-tile.selected { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.cat-tile.selected .cat-ico { background: var(--c); transform: scale(1.05); }

.expense-fields { margin-top: 4px; }
.amount-big { flex: 1 1 220px; }
.amount-big input { font-size: 22px !important; font-weight: 700; }

.supplier-select {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; font-size: 15px;
  font-family: inherit; background: var(--input); color: var(--ink); min-width: 280px; color-scheme: dark;
}
.supplier-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,132,255,.25); }
.pick-hint { display: block; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.pick-hint a { color: var(--accent); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; white-space: nowrap; font-size: 14px; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--tan); color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.num, .data-table th.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.negative { color: var(--red); }
.positive { color: var(--green); }
.data-table tfoot td, .total-row td { background: var(--tan); font-weight: 700; color: var(--ink); border-bottom: none; }

.cat-cell { display: inline-flex; align-items: center; gap: 9px; }
.cat-dot { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 15px; background: color-mix(in srgb, var(--c) 26%, #2c2c2e); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-admin { background: rgba(10,132,255,.2); color: #4aa5ff; }
.pill-staff { background: #3a3a3c; color: #c7c7cc; }

.link-btn { background: none; border: none; color: var(--red); cursor: pointer; padding: 0; font-size: 13.5px; font-weight: 500; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

.reset-form { display: flex; gap: 8px; align-items: center; }
.reset-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; width: 130px; background: var(--input); color: var(--ink); }
.reset-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,132,255,.25); }

.owed-prefix { color: var(--muted); font-weight: 700; font-size: 16px; }

/* supplier cards */
.supplier-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.supplier-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.supplier-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.supplier-name { font-weight: 700; font-size: 16.5px; color: var(--ink); }
.mini-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.supplier-remaining { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 600; margin-top: 3px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.supplier-remaining.negative { color: var(--red); }
.supplier-remaining.positive { color: var(--green); }
.paid-badge { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; color: var(--green); background: var(--green-soft); padding: 3px 11px; border-radius: 999px; }
.progress { height: 8px; background: var(--input); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #0a84ff, #30d158); border-radius: 999px; transition: width .35s ease; }
.progress-caption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.owed-edit { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.owed-edit-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.owed-edit-row input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--input); color: var(--ink); font-size: 15px; text-align: right; font-variant-numeric: tabular-nums;
}
.owed-edit-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,132,255,.25); }
.owed-save { padding: 10px 18px !important; font-size: 14px !important; }
.supplier-note { margin-top: 14px; font-size: 13px; color: var(--muted); font-style: italic; }

/* flatpickr calendar — match the app's blue accent on the dark theme */
.flatpickr-calendar { box-shadow: var(--shadow); border-radius: 14px; }
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--accent); border-color: var(--accent);
}
.flatpickr-day.today { border-color: var(--accent); }
.flatpickr-day:hover { background: var(--surface-2); }
.flatpickr-months .flatpickr-month, .flatpickr-weekdays, span.flatpickr-weekday { color: var(--ink-soft); }
.flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 600; }

/* ---------- Snapshot cards ---------- */
.snapshot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 26px; }
.snap-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.snap-top { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.snap-top .icon-badge { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.icon-badge.b-cash { background: #30d158; }
.icon-badge.b-rev { background: #0a84ff; }
.icon-badge.b-profit { background: #ff9f0a; }
.snap-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.snap-value { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 600; color: var(--ink); }
.snap-value.negative { color: var(--red); }
.snap-card a { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; }
.snap-card a:hover { text-decoration: underline; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 12px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 46px; margin-bottom: 10px; }
.empty-state h2 { color: var(--ink); font-family: 'Fraunces', serif; margin: 0 0 8px; }
.empty-state p { max-width: 40ch; margin: 0 auto 20px; }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(1000px 500px at 50% -10%, #2c2c2e, #141416); padding: 20px; }
.login-box { background: var(--surface); padding: 38px 34px; border-radius: 22px; width: 360px; max-width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--line); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo .brand-mark { width: 56px; height: 56px; font-size: 30px; border-radius: 17px; }
.login-logo h1 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 24px; margin: 0; color: var(--ink); }
.login-logo p { margin: 0; color: var(--muted); font-size: 13px; }
.login-box label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.login-box input { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; font-size: 15px; font-family: inherit; background: var(--input); color: var(--ink); }
.login-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,132,255,.25); }
.login-box button { justify-content: center; margin-top: 6px; padding: 13px; font-size: 15px; }

/* ---------- Custom modal & toasts ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 20px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center; animation: lamFade .15s ease;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 24px; width: 340px; max-width: 100%; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); animation: lamPop .18s ease;
}
.modal-icon { font-size: 38px; margin-bottom: 10px; }
.modal-msg { font-size: 16px; color: var(--ink); margin-bottom: 22px; line-height: 1.45; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { flex: 1; justify-content: center; }
.modal-danger { background: var(--red); color: #fff; }
.modal-danger:hover { background: #e0392e; }
@keyframes lamFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lamPop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

.toast-wrap {
  position: fixed; top: 18px; left: 0; right: 0; z-index: 110;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 14px; font-weight: 500; max-width: 90%;
  opacity: 0; transform: translateY(-12px); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { border-left-color: var(--red); }
.toast-success { border-left-color: var(--green); }

/* ---------- Whish e-wallet ---------- */
.whish-hero { margin-bottom: 26px; }
.whish-card {
  position: relative; overflow: hidden;
  max-width: 460px; border-radius: 22px; padding: 24px 26px 20px;
  background: linear-gradient(135deg, #ff3b6b 0%, #e01e5a 46%, #8f1450 100%);
  color: #fff; box-shadow: 0 18px 44px rgba(224,30,90,.42);
}
/* soft sheen sweeping across the card */
.whish-card::after {
  content: ""; position: absolute; top: -70%; right: -15%; width: 65%; height: 220%;
  background: radial-gradient(closest-side, rgba(255,255,255,.28), transparent 70%);
  transform: rotate(22deg); pointer-events: none;
}
.whish-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; position: relative; z-index: 1; }
.whish-tag { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .96; }
.whish-tag .icon { width: 22px; height: 22px; }
.whish-chip { width: 42px; height: 31px; border-radius: 7px; background: linear-gradient(135deg, #ffe9a8, #d8a63a); box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), inset 0 -4px 8px rgba(0,0,0,.18); }
.whish-chip::before { content: ""; display: block; margin: 9px auto 0; width: 60%; height: 1px; background: rgba(0,0,0,.25); box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.whish-balance-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; opacity: .82; position: relative; z-index: 1; }
.whish-balance { font-family: 'Fraunces', serif; font-weight: 600; font-size: 46px; line-height: 1.04; margin-top: 3px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.whish-balance.negative { color: #ffe0e8; }
.whish-card-foot { display: flex; gap: 26px; margin-top: 22px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.24); position: relative; z-index: 1; }
.whish-foot-item { display: flex; flex-direction: column; gap: 3px; }
.whish-foot-item .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; opacity: .82; }
.whish-foot-item .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* segmented in / out toggle */
.seg { display: inline-flex; position: relative; background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
/* attribute selector keeps specificity above the app's `.inline-form input { width:100% }` mobile rule */
.seg input[type=radio] { position: absolute; width: 1px; height: 1px; min-width: 0; opacity: 0; pointer-events: none; }
.seg label { cursor: pointer; padding: 10px 18px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; user-select: none; }
.seg label:hover { color: var(--ink); }
.seg input:focus-visible + label { box-shadow: 0 0 0 3px rgba(10,132,255,.35); }
.seg input:checked + label.seg-in { background: var(--green); color: #04210f; }
.seg input:checked + label.seg-out { background: var(--red); color: #fff; }

.amt-in { color: var(--green); font-weight: 600; }
.amt-out { color: var(--red); font-weight: 600; }
.pill-in { background: var(--green-soft); color: var(--green); }
.pill-out { background: var(--red-soft); color: #ff8a82; }

/* ---------- Mobile ---------- */
.scrim { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 4px 0 30px rgba(0,0,0,.5); }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
  .mobile-bar { display: flex; align-items: center; gap: 14px; background: var(--sidebar-top); color: var(--ink); padding: 12px 16px; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line-soft); }
  .mobile-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 18px; }
  .hamburger { background: none; border: none; cursor: pointer; padding: 4px; display: flex; flex-direction: column; gap: 4px; }
  .hamburger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
  .content { padding: 20px 16px 50px; }
  .page-head h1 { font-size: 24px; }
  .inline-form, .expense-fields { flex-direction: column; align-items: stretch; }
  .inline-form input, .inline-form select, .expense-fields input { min-width: 0; width: 100%; }
  .inline-form button, .expense-fields button { width: 100%; justify-content: center; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .data-table th, .data-table td { padding: 11px 12px; font-size: 13.5px; }
  .form-card { padding: 18px 16px; }
  .whish-balance { font-size: 38px; }
  .whish-card-foot { gap: 18px; }
  .seg { width: 100%; }
  .seg label { flex: 1; text-align: center; }
}

/* ---------- Installments ---------- */
.inst-date { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12.5px; color: var(--muted); margin-left: 10px; }
.supplier-remaining.inst-remaining.due { color: #ff9f0a; }
.status-badge { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; }
.status-badge.partial { color: #ffb340; background: rgba(255, 159, 10, .16); }
.status-badge.awaiting { color: var(--muted); background: var(--input); }

.pay-history { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.pay-history li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pay-history .ph-left { display: flex; align-items: baseline; gap: 9px; min-width: 0; flex-wrap: wrap; }
.pay-history .ph-date { font-size: 13.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pay-history .ph-note { font-size: 12px; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.pay-history .ph-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pay-history .ph-amt { font-size: 14px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.pay-history .ph-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 19px; line-height: 1; padding: 0 4px; border-radius: 6px; }
.pay-history .ph-del:hover { color: var(--red); }

.pay-add { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.pay-add-row { display: flex; gap: 9px; margin-top: 8px; flex-wrap: wrap; }
.pay-add-row input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--ink); font-size: 15px; }
.pay-add-row input[type="number"] { flex: 2 1 120px; text-align: right; font-variant-numeric: tabular-nums; }
.pay-add-row input[type="date"] { flex: 1 1 140px; }
.pay-add-note { width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--ink); font-size: 14px; }
.pay-add input:focus, .pay-add-note:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 132, 255, .25); }
.pay-add button { margin-top: 10px; }
