/* AHAM Family Finance — styled to match AHAM Family Schedule (Fredoka/Nunito, cream & navy) */
:root {
  --bg: #FBF6EE; --paper: #FFFFFF; --field: #FFFDF9; --ink: #14213D; --ink2: #4A5672; --ink3: #8A93A8;
  --line: #ECE4D6; --soft: #EFE7DA; --hl: #F4EFE6; --sel: #EAE6E1;
  --primary: #14213D; --on-primary: #FFFFFF; --accent: #F2994A; --now: #E5484D;
  --ok-bg: #EAF6EF; --ok-ink: #1F7A4D; --info-bg: #E9EEFF; --info-ink: #3046B5;
  --warn-bg: #FFF4E5; --warn-ink: #8A4B0F; --err-bg: #FDECEC; --err-ink: #A12A2E;
  --r: 18px; --shadow: 0 1px 2px rgba(20,33,61,.06), 0 6px 20px rgba(20,33,61,.07);
  --shadow-lg: 0 24px 60px rgba(20,33,61,.22);
  --hero: linear-gradient(160deg, #2B3A63 0%, #14213D 100%);
  --font-display: Fredoka, Nunito, system-ui, sans-serif;
  --font-body: Nunito, system-ui, sans-serif;
  --side: 248px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E1320; --paper: #171F31; --field: #121929; --ink: #EEF1F7; --ink2: #A9B3C7; --ink3: #737D93;
  --line: #263049; --soft: #222B40; --hl: #1F2738; --sel: #222B40;
  --primary: #F2B27A; --on-primary: #1B1206; --now: #FF6369;
  --ok-bg: #12301F; --ok-ink: #7FD6A4; --info-bg: #1E2747; --info-ink: #A9B8FF;
  --warn-bg: #3A2A12; --warn-ink: #F6C88B; --err-bg: #3B1A1C; --err-ink: #F5A3A6;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.28);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.6);
  --hero: linear-gradient(160deg, #26324F 0%, #111829 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body { font-family: var(--font-body); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); }

/* ================= sidebar ================= */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 50; background: var(--paper);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; overflow-y: auto;
  transition: transform .28s cubic-bezier(.2,.9,.3,1);
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.logo { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
:root[data-theme="dark"] .logo { background: var(--primary); color: var(--on-primary); }
.logo svg { width: 22px; height: 22px; }
.side-brand b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.1; }
.side-brand small { display: block; font-size: 12px; color: var(--ink3); font-weight: 700; margin-top: 2px; }
.side h4 { margin: 16px 10px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); font-weight: 800; font-family: var(--font-body); }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 12px; font-weight: 700; font-size: 14.5px; margin: 2px 0; color: var(--ink); }
.nav:hover { background: var(--hl); }
.nav.on { background: var(--sel); }
.nav .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; flex: none; }
.nav .ic.plain { width: 22px; font-size: 15px; }
.nav .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .cnt { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--hl); color: var(--ink3); }
.nav.on .cnt { background: var(--paper); }
.nav .chipv { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--hl); color: var(--ink3); white-space: nowrap; }
.nav .code { font-size: 11px; font-weight: 800; color: var(--ink2); width: 22px; text-align: center; }
.nav .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--now); flex: none; }
.scrim { position: fixed; inset: 0; background: rgba(20,33,61,.35); z-index: 45; }

.main { margin-left: var(--side); min-height: 100vh; transition: margin-left .28s; }
html.side-closed .side { transform: translateX(-100%); }
html.side-closed .main { margin-left: 0; }

/* ================= top bar ================= */
.top { display: flex; align-items: center; gap: 12px; padding: 12px 32px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.title { flex: 1; min-width: 0; }
.title h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title .sub { font-size: 13px; color: var(--ink2); display: flex; align-items: center; gap: 6px; margin-top: 2px; font-weight: 700; flex-wrap: wrap; }
.live { font-size: 11px; font-weight: 800; color: var(--ok-ink); background: var(--ok-bg); padding: 1px 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rbtn { width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 18px; flex: none; transition: transform .12s; }
.rbtn:active { transform: scale(.94); }
.rbtn svg { width: 20px; height: 20px; }
.rbtn.on { background: var(--primary); color: var(--on-primary); }
.seg { display: flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--soft); flex: none; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 800; font-size: 14px; color: var(--ink2); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.mpill { display: flex; align-items: center; gap: 2px; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 3px; flex: none; }
.mpill button { border: 0; background: none; width: 30px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink2); }
.mpill button:hover { background: var(--hl); }
.mpill button svg { width: 16px; height: 16px; }
.mpill span { font-weight: 800; font-size: 14px; padding: 0 6px; white-space: nowrap; }

.content { padding: 20px 32px 120px; max-width: 1640px; }

/* ================= month strip ================= */
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 16px; }
.mtile { position: relative; border: 0; background: var(--paper); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 6px 9px; text-align: center; transition: transform .12s; }
.mtile:hover { transform: translateY(-1px); }
.mtile b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 15.5px; line-height: 1.15; }
.mtile small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin-top: 2px; }
.mtile.on { background: var(--primary); color: var(--on-primary); }
.mtile.on small { color: color-mix(in srgb, var(--on-primary) 70%, transparent); }
.mtile.cur::after { content: ""; position: absolute; top: 8px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--now); }
.mtile.on.cur::after { background: #fff; }

.edit-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px 9px 16px; margin-bottom: 16px; border-radius: 14px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 800; font-size: 14px; }
.edit-bar .grow { flex: 1; min-width: 200px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--paper); box-shadow: var(--shadow); font-weight: 800; font-size: 14px; white-space: nowrap; color: var(--ink); transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.danger { color: var(--err-ink); }
.btn.flat { box-shadow: none; background: var(--hl); }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ================= board ================= */
.board { display: grid; grid-template-columns: minmax(380px, 470px) 1fr; gap: 24px; align-items: start; }
.left { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }

.hero { border-radius: 24px; padding: 18px 18px 16px; color: #fff; position: relative; overflow: hidden; background: var(--hero); box-shadow: 0 10px 30px rgba(20,33,61,.18); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.16), transparent 60%); pointer-events: none; }
.hero .lbl { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; display: flex; align-items: center; gap: 7px; }
.hero .lbl i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 100% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } }
.hero .row { display: flex; align-items: center; gap: 14px; margin: 12px 0 14px; position: relative; }
.hero .bigic { width: 62px; height: 62px; border-radius: 18px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 32px; flex: none; }
.hero .big { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.05; }
.hero .cap { font-size: 14px; opacity: .85; margin-top: 3px; }
.hero .bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin-bottom: 12px; position: relative; }
.hero .bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7FD6A4, #F2C66D); transition: width .5s; }
.hero .next { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.18); border-radius: 14px; padding: 11px 14px; font-size: 14px; position: relative; }
.hero .next b { font-weight: 800; }
.hero .next .e { font-size: 18px; }

.panel { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 2px 10px; }
.panel-h b { font-family: var(--font-display); font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 7px; }
.panel-h small { color: var(--ink3); font-size: 12.5px; font-weight: 700; }
.glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gt { background: var(--hl); border-radius: 14px; padding: 10px 6px 9px; text-align: center; min-width: 0; }
.gt small { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); font-weight: 800; }
.gt b { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 4px 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt span { display: block; font-size: 10.5px; color: var(--ink3); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.gt.dark { background: var(--primary); color: var(--on-primary); }
.gt.dark small, .gt.dark span { color: color-mix(in srgb, var(--on-primary) 70%, transparent); }
.foot { font-size: 12px; color: var(--ink3); margin: 10px 2px 0; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--paper); box-shadow: var(--shadow); border-radius: 99px; padding: 6px 11px; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip.on { background: var(--primary); color: var(--on-primary); }
.chip.dim { opacity: .45; }

.cat-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 6px 2px; }
.cat-row .e { font-size: 17px; text-align: center; }
.cat-row .nm { font-weight: 800; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.cat-row .nm small { color: var(--ink3); font-weight: 700; }
.cat-bar { height: 7px; border-radius: 99px; background: var(--hl); position: relative; overflow: hidden; margin-top: 4px; }
.cat-bar .plan { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--c); opacity: .28; }
.cat-bar .done { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--c); }
.cat-row .amt { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; }

/* ================= right column ================= */
.right-h { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.right-h h2 { margin: 0; font-size: 20px; font-weight: 600; }
.right-h small { color: var(--ink3); font-size: 13.5px; font-weight: 700; }
.right-h .grow { flex: 1; }
.search { width: 260px; max-width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); padding: 0 12px 0 36px; outline: none; font-weight: 700;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A93A8' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; }
.search:focus { border-color: var(--ink3); }
.sec-title { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; margin: 8px 4px 0; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); font-weight: 800; }
.sec-title:first-child { margin-top: 0; }

/* cards (like schedule activity cards) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.tile { --bgc: color-mix(in srgb, var(--c) 13%, var(--paper)); --cd: color-mix(in srgb, var(--c) 78%, var(--ink));
  position: relative; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--c); cursor: default; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.tile.click { cursor: pointer; }
.tile.click:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20,33,61,.06), 0 12px 28px rgba(20,33,61,.11); }
.tile-band { background: var(--bgc); display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 16px 12px 18px; min-height: 78px; }
.tile-band .em { font-size: 38px; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.12)); }
.tile-band .tag { font-size: 12.5px; font-weight: 800; color: var(--cd); margin-top: 3px; text-align: right; }
.tile-body { padding: 14px 18px 16px; flex: 1; display: flex; flex-direction: column; }
.tile-body h3 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.15; }
.tile-body .amt { font-size: 18px; font-weight: 800; color: var(--cd); margin-top: 6px; }
.tile-body .meta { font-size: 13.5px; color: var(--ink3); margin-top: 6px; font-weight: 700; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tile-body .meta .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile.tbd { background: repeating-linear-gradient(135deg, var(--paper) 0 14px, color-mix(in srgb, var(--c) 6%, var(--paper)) 14px 28px); }
.tile.tbd .tile-band { background: transparent; }
.tile.paid .tile-body h3, .tile.paid .tile-body .amt { opacity: .7; }
.tile .pbar { height: 6px; border-radius: 99px; background: var(--hl); overflow: hidden; margin-top: 10px; }
.tile .pbar > div { height: 100%; background: var(--c); border-radius: 99px; }
.tile-actions { position: absolute; left: 18px; bottom: 14px; display: none; }
.tile .acts { display: flex; gap: 6px; margin-top: auto; padding-top: 12px; }
.tile .acts .btn { height: 32px; padding: 0 11px; font-size: 13px; box-shadow: none; background: var(--hl); }
.tile .acts .btn.paidbtn { background: var(--ok-bg); color: var(--ok-ink); }

.pill { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 99px; text-transform: uppercase; letter-spacing: .05em; }
.pill.paid { background: var(--ok-bg); color: var(--ok-ink); }
.pill.pending { background: var(--warn-bg); color: var(--warn-ink); }
.pill.partial { background: var(--info-bg); color: var(--info-ink); }
.pill.tbd { background: var(--hl); color: var(--ink3); }

/* list view (compact rows, like schedule List) */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { position: relative; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.item { --bgc: color-mix(in srgb, var(--c) 13%, var(--paper)); --cd: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 16px; }
.row .em { width: 44px; height: 44px; border-radius: 14px; background: var(--bgc); display: grid; place-items: center; font-size: 22px; flex: none; }
.row .tx { flex: 1; min-width: 0; }
.row .ti { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.15; }
.row .su { font-size: 12.5px; color: var(--ink2); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row .rt { text-align: right; flex: none; }
.row .amt { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--cd); }
.check { width: 30px; height: 30px; border-radius: 50%; flex: none; border: 2px solid var(--line); background: var(--paper); display: grid; place-items: center; padding: 0; color: #fff; }
.check svg { width: 15px; height: 15px; opacity: 0; }
.check[data-status="paid"] { background: var(--ok-ink); border-color: var(--ok-ink); }
.check[data-status="paid"] svg { opacity: 1; }
.check[data-status="partial"] { border-color: var(--info-ink); background: conic-gradient(var(--info-ink) var(--pct, 50%), transparent 0); }
.check:disabled { cursor: default; }
.trip-items { display: none; border-top: 1px dashed var(--line); padding: 4px 16px 12px 22px; }
.item.open .trip-items { display: block; }
.chev { width: 18px; height: 18px; color: var(--ink3); transition: transform .25s; flex: none; }
.item.open .chev { transform: rotate(180deg); }

.items-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.items-table td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.items-table tr:last-child td { border-bottom: 0; }
.items-table td.calc { color: var(--ink3); text-align: center; white-space: nowrap; padding: 7px 10px; }
.items-table td.t { text-align: right; font-weight: 800; white-space: nowrap; }
.items-table tr.transport td:first-child { color: var(--ink3); }
.items-table tfoot td { border-top: 2px solid var(--line); border-bottom: 0; padding-top: 10px; font-family: var(--font-display); font-size: 17px; font-weight: 600; }

.empty { background: var(--paper); border-radius: var(--r); padding: 34px 20px; text-align: center; color: var(--ink2); box-shadow: var(--shadow); grid-column: 1 / -1; }
.empty .e { font-size: 40px; }

.fab { position: fixed; right: 26px; bottom: 26px; z-index: 30; height: 56px; padding: 0 22px 0 18px; border-radius: 18px; border: 0; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; box-shadow: 0 12px 30px rgba(20,33,61,.3); }
.fab svg { width: 22px; height: 22px; }

/* ================= modal & misc ================= */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(14,19,32,.45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .18s ease-out; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { max-width: 780px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal-head h3 { margin: 0; font-size: 20px; font-weight: 600; flex: 1; }
.modal-body { padding: 10px 20px 4px; }
.modal-foot { display: flex; gap: 8px; padding: 16px 20px 20px; align-items: center; }
.modal-foot .grow { flex: 1; }
.x-btn { width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--hl); font-size: 15px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 800; color: var(--ink2); }
.input { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); padding: 0 12px; outline: none; width: 100%; font-weight: 700; }
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--ink3); background: var(--paper); }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.mseg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--soft); }
.mseg button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 10px; font-weight: 800; font-size: 13.5px; color: var(--ink2); }
.mseg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.mseg button.on[data-v="paid"] { color: var(--ok-ink); }
.mseg button.on[data-v="partial"] { color: var(--info-ink); }
.mseg button.on[data-v="pending"] { color: var(--warn-ink); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; cursor: pointer; margin-bottom: 14px; }
.switch input { width: 18px; height: 18px; accent-color: var(--ink); }
.items-editor { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.ie-head, .ie-row { display: grid; grid-template-columns: 1fr 64px 64px 80px 88px 34px; gap: 6px; align-items: center; padding: 6px 8px; }
.ie-head { background: var(--hl); font-size: 11px; font-weight: 800; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em; }
.ie-row { border-top: 1px solid var(--line); }
.ie-row .input { height: 36px; border-radius: 9px; padding: 0 8px; font-size: 13.5px; }
.ie-row .input.t { font-weight: 800; text-align: right; }
.ie-row .x { width: 32px; height: 32px; border-radius: 9px; border: 0; background: none; color: var(--ink3); font-size: 18px; }
.ie-row .x:hover { color: var(--err-ink); background: var(--err-bg); }
.ie-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--hl); flex-wrap: wrap; }
.ie-foot .total { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.paste-box { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--ink3); margin-top: 4px; font-weight: 700; }
.pin-wrap { text-align: center; padding: 6px 0 4px; }
.pin-wrap .lock { width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--hl); font-size: 28px; }
.pin-input { font-size: 28px; letter-spacing: 14px; text-align: center; height: 60px !important; font-weight: 800; }
.pin-error { color: var(--err-ink); font-size: 13.5px; min-height: 20px; margin-top: 8px; font-weight: 800; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.menu { position: fixed; min-width: 230px; padding: 6px; z-index: 55; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-lg); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--hl); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s; max-width: calc(100vw - 32px); }
.toast.err { background: var(--err-ink); color: #fff; }
.loading { padding: 60px; text-align: center; color: var(--ink3); grid-column: 1 / -1; }

/* ================= responsive ================= */
@media (max-width: 1280px) {
  .top .seg.view .lbl-txt { display: none; }
}
@media (max-width: 1100px) {
  .main { margin-left: 0; }
  .side { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  html.side-open .side { transform: none; }
  .board { grid-template-columns: 1fr; }
  .left { position: static; }
  .top { padding: 12px 18px; }
  .content { padding: 16px 18px 120px; }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .top .title { order: 1; flex-basis: calc(100% - 60px); }
  .top #menuToggle { order: 0; }
  .top .tools { order: 2; width: 100%; display: flex; gap: 8px; }
  .top .tools .mpill { margin-left: auto; }
  .top .seg.view { display: none; }
  .title h1 { font-size: 22px; }
  .strip { grid-template-columns: repeat(7, 74px); overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .glance { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .tile { flex-direction: row; border-top: 0; border-left: 4px solid var(--c); }
  .tile-band { min-height: 0; flex-direction: column; justify-content: center; align-items: center; padding: 12px; gap: 4px; width: 78px; flex: none; }
  .tile-band .em { font-size: 30px; }
  .tile-band .tag { display: none; }
  .tile-body { padding: 12px 14px; }
  .tile-body h3 { font-size: 18px; }
  .tile-body .amt { font-size: 16px; margin-top: 3px; }
  .tile-body .meta { margin-top: 4px; font-size: 12.5px; }
  .search { width: 100%; }
  .fields-3 { grid-template-columns: 1fr 1fr; }
  .ie-head { display: none; }
  .ie-row { grid-template-columns: 1fr 1fr 1fr 34px; }
  .ie-row .name { grid-column: 1 / -2; }
  .ie-row .unit { display: none; }
  .ie-row .x { grid-column: 4; grid-row: 1; }
  .fab .lbl { display: none; }
  .fab { padding: 0; width: 58px; justify-content: center; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .overlay { align-items: flex-end; padding: 0; }
}
@media (min-width: 721px) { .top .tools { display: contents; } }

@media print {
  .side, .top, .fab, .edit-bar, .strip, .search { display: none !important; }
  .main { margin: 0; }
  .board { grid-template-columns: 1fr; }
  body { background: #fff; }
}
