/* ONE MALL brand theme: navy + gold, taken from the logo */
:root {
  --navy: #13243b;
  --navy-2: #1c3352;
  --navy-3: #2a4a73;
  --gold: #c9a452;
  --gold-2: #a8853a;       /* darker gold, readable on light backgrounds */
  --gold-soft: #f5edd9;
  --gold-glow: rgba(201, 164, 82, .35);
  --bg: #f6f3ed;
  --card: #ffffff;
  --ink: #18253a;
  --muted: #687385;
  --line: #e7e1d6;
  --good: #11804a;
  --bad: #c0362c;
  --warn: #b7791f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(19, 36, 59, .06), 0 6px 18px rgba(19, 36, 59, .06);
  --shadow-up: 0 4px 10px rgba(19, 36, 59, .08), 0 14px 30px rgba(19, 36, 59, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font-head: "Jost", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-3); }
h1, h2, h3, .top h1 { font-family: var(--font-head); color: var(--navy); }
h1 { font-size: 26px; margin: 0; font-weight: 600; letter-spacing: .2px; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
::selection { background: var(--gold-soft); }
.ic { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }
h2 .ic { width: 20px; height: 20px; vertical-align: -3px; }

/* brand logo, cropped from the square artwork */
.brandlogo { position: relative; overflow: hidden; aspect-ratio: 1370 / 1085; width: 100%; }
.brandlogo img { position: absolute; width: 146%; left: -23.36%; top: -40.55%; max-width: none; display: block; }
.mark { width: 30px; height: 30px; color: #fff; flex: 0 0 auto; }

.boot { padding: 60px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--gold-soft); border-top-color: var(--gold); animation: spin .8s linear infinite; }

/* ---------------- layout */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--navy) 0%, #0f1d31 100%); color: #fff; padding: 16px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto; z-index: 60;
}
.side::after { /* thin gold edge */
  content: ""; position: absolute; top: 0; right: 0; width: 3px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent); opacity: .55;
}
.side-logo {
  display: block; background: #fff; border-radius: 14px; padding: 10px 14px; margin: 2px 4px 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: transform .3s var(--ease), box-shadow .3s;
}
.side-logo .brandlogo { width: 82%; margin: 0 auto; }
.side-logo:hover { transform: translateY(-2px) scale(1.015); box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 0 2px var(--gold); }
.side nav { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; flex: 1; }
.side nav a {
  position: relative; overflow: hidden; color: rgba(255, 255, 255, .78); text-decoration: none; padding: 10px 14px; border-radius: 10px;
  display: flex; gap: 12px; align-items: center; font-size: 14.5px; transition: background .25s, color .25s, transform .25s var(--ease);
  animation: slide-in .45s var(--ease) both; animation-delay: calc(var(--i) * 35ms);
}
.side nav a::before { /* gold indicator bar */
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 0; background: var(--gold); border-radius: 0 3px 3px 0;
  transform: translateY(-50%); transition: height .3s var(--ease);
}
.side nav a .ic { color: var(--gold); transition: transform .3s var(--ease); }
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(3px); }
.side nav a:hover::before { height: 55%; }
.side nav a:hover .ic { transform: scale(1.15) rotate(-6deg); }
.side nav a.on { background: linear-gradient(90deg, rgba(201, 164, 82, .22), rgba(201, 164, 82, .06)); color: #fff; font-weight: 600; }
.side nav a.on::before { height: 70%; }
.who {
  display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--gold); color: var(--navy); flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
}
.who-t { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; line-height: 1.3; }
.who-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-t span { color: var(--gold); text-transform: capitalize; font-size: 12px; }
.who button {
  background: rgba(255, 255, 255, .06); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; transition: background .2s, color .2s, transform .2s;
}
.who button:hover { background: var(--gold); color: var(--navy); transform: translateY(-1px); }
.main { padding: 26px 30px 70px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.top h1 { position: relative; padding-bottom: 6px; }
.top h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 42px; height: 3px; border-radius: 3px; background: var(--gold); animation: grow-x .6s var(--ease) both .1s; transform-origin: left; }
.top .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mobilebar, .scrim { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-105%); transition: transform .35s var(--ease); }
  .menu-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 18, 30, .5); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .menu-open .scrim { opacity: 1; pointer-events: auto; }
  .mobilebar {
    display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 10px 16px;
    position: sticky; top: 0; z-index: 40; font-family: var(--font-head); letter-spacing: 2px; font-size: 17px; border-bottom: 2px solid var(--gold);
  }
  .mobilebar b { color: var(--gold); font-weight: 600; }
  .mobilebar button { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; display: grid; place-items: center; }
  .mobilebar .ic { width: 24px; height: 24px; }
  .main { padding: 18px 16px 70px; }
  h1 { font-size: 22px; }
}

/* ---------------- page entrance */
.main.enter > * { animation: fade-up .5s var(--ease) both; }
.main.enter > *:nth-child(2) { animation-delay: .05s; }
.main.enter > *:nth-child(3) { animation-delay: .1s; }
.main.enter > *:nth-child(4) { animation-delay: .15s; }
.main.enter > *:nth-child(5) { animation-delay: .2s; }
.main.enter > *:nth-child(n+6) { animation-delay: .25s; }
.main.enter .stats > * { animation: fade-up .5s var(--ease) both; }
.main.enter .stats > *:nth-child(2) { animation-delay: .06s; }
.main.enter .stats > *:nth-child(3) { animation-delay: .12s; }
.main.enter .stats > *:nth-child(4) { animation-delay: .18s; }
.main.enter .stats > *:nth-child(5) { animation-delay: .24s; }

/* ---------------- cards & stats */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
  border: 1px solid rgba(19, 36, 59, .04); transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.card:hover { box-shadow: var(--shadow-up); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  position: relative; overflow: hidden; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
  border: 1px solid rgba(19, 36, 59, .04); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); transform: scaleY(0); transform-origin: bottom; transition: transform .35s var(--ease); }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-up); }
.stat:hover::before { transform: scaleY(1); }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: .6px; }
.stat .v { font-family: var(--font-head); font-size: 25px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--navy); }
.stat .v.good { color: var(--good); } .stat .v.bad { color: var(--bad); } .stat .v.warn { color: var(--warn); }
.stat.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy-3) 100%); color: #fff; border: 0; }
.stat.hero::before { display: none; }
.stat.hero::after { /* moving gold shimmer */
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(201, 164, 82, .25), transparent); animation: shimmer 4.5s ease-in-out infinite 1s;
}
.stat.hero .k { color: var(--gold); }
.stat.hero .v { color: #fff; }
.stat.hero.big .v { font-size: 32px; }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } }

.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); } .muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------- hidden balance */
.bal-v { display: none; }
.bal-h { letter-spacing: 1px; }
.show-bal .bal-v { display: inline; animation: reveal .4s var(--ease); }
.show-bal .bal-h { display: none; }
.eye {
  position: relative; overflow: hidden; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 0;
  background: var(--gold-soft); color: var(--gold-2); cursor: pointer; padding: 0; vertical-align: middle;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.eye:hover { background: var(--gold); color: var(--navy); transform: scale(1.1); }
.eye .ic { width: 16px; height: 16px; }
.eye .i-hide { display: none; }
.show-bal .eye .i-show { display: none; }
.show-bal .eye .i-hide { display: block; }
.hero .eye { background: rgba(201, 164, 82, .2); color: var(--gold); }
.hero .eye:hover { background: var(--gold); color: var(--navy); }
.h-eye { display: flex; align-items: center; gap: 8px; }
th .eye { width: 22px; height: 22px; margin-left: 4px; }
th .eye .ic { width: 13px; height: 13px; }

/* ---------------- tables */
.tablewrap { overflow-x: auto; margin: 0 -4px; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 8px; border-bottom: 2px solid var(--gold-soft); white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; }
.t td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; transition: background .2s; }
.t tbody tr { transition: transform .2s var(--ease); }
.t tbody tr:hover td { background: #fbf9f4; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.t tfoot td { font-weight: 700; border-top: 2px solid var(--navy); border-bottom: 0; color: var(--navy); }
.t .void td { color: var(--muted); text-decoration: line-through; }
.empty { color: var(--muted); padding: 22px 8px; text-align: center; }

/* ---------------- forms */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #d9d3c8; border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
  transition: border-color .2s, box-shadow .2s;
}
input:hover, select:hover, textarea:hover { border-color: #c4b8a2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); }
textarea { resize: vertical; min-height: 60px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.search input { padding-left: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a452' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16' y2='16'/%3E%3C/svg%3E") no-repeat 12px center / 18px; }

/* ---------------- buttons */
.btn {
  position: relative; overflow: hidden; font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; cursor: pointer;
  background: var(--navy); color: #fff; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
  box-shadow: 0 2px 6px rgba(19, 36, 59, .18);
}
.btn .ic { color: var(--gold); transition: transform .25s var(--ease); }
.btn:hover { background: var(--navy-2); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(19, 36, 59, .25), 0 0 0 2px var(--gold-glow); }
.btn:hover .ic { transform: scale(1.12); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: 0 1px 3px rgba(19, 36, 59, .2); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.gold { background: linear-gradient(135deg, #d6b469, var(--gold) 50%, var(--gold-2)); color: var(--navy); }
.btn.gold .ic { color: var(--navy); }
.btn.gold:hover { box-shadow: 0 8px 20px rgba(168, 133, 58, .4); }
.btn.ghost { background: #fff; color: var(--navy); border-color: #dccfb3; box-shadow: none; }
.btn.ghost .ic { color: var(--gold-2); }
.btn.ghost:hover { background: var(--gold-soft); border-color: var(--gold); box-shadow: 0 6px 14px rgba(19, 36, 59, .1); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f0c9c5; box-shadow: none; }
.btn.danger:hover { background: #fdf1f0; border-color: var(--bad); }
.btn.big { padding: 14px 24px; font-size: 16px; }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--navy-3); cursor: pointer; font: inherit; padding: 2px 4px; text-decoration: none; border-bottom: 1px dashed currentColor; transition: color .2s; }
.linkbtn:hover { color: var(--gold-2); }
.ripple { position: absolute; border-radius: 50%; background: rgba(201, 164, 82, .45); transform: scale(0); animation: ripple .65s ease-out; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  position: relative; overflow: hidden; border: 1px solid #dccfb3; background: #fff; color: var(--navy); border-radius: 999px; padding: 7px 14px; cursor: pointer;
  font: inherit; font-size: 13.5px; transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.chip:hover { border-color: var(--gold); background: var(--gold-soft); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(19, 36, 59, .08); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 0 0 3px var(--gold-glow); }
.chip:active { transform: scale(.95); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--gold-soft); color: var(--gold-2); text-transform: capitalize; }
.badge.ok { background: #e3f4ea; color: var(--good); }
.badge.no { background: #fdecea; color: var(--bad); }
.badge.warn { background: #fdf1df; color: var(--warn); }

.notice { display: flex; gap: 10px; align-items: flex-start; background: #fdf6e6; border: 1px solid #f0dcaa; border-left: 4px solid var(--gold); border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; font-size: 14px; }
.notice .ic { color: var(--gold-2); margin-top: 2px; }
.notice.ok { background: #ecf7f0; border-color: #bfe2cb; border-left-color: var(--good); }
.notice.ok .ic { color: var(--good); }

/* ---------------- charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; cursor: default; }
.bars .bar {
  width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--navy-3), var(--navy)); border-radius: 7px 7px 2px 2px; min-height: 2px;
  transform-origin: bottom; animation: grow-y .7s var(--ease) both; animation-delay: calc(var(--i) * 30ms + .15s); transition: filter .2s, transform .2s;
}
.bars .b:hover .bar { background: linear-gradient(180deg, #dcbc74, var(--gold)); }
.bars .b.today .bar { background: linear-gradient(180deg, #dcbc74, var(--gold)); box-shadow: 0 0 0 3px var(--gold-glow); }
.bars .lbl { font-size: 11.5px; color: var(--muted); }
.bars .val { font-size: 11px; color: var(--muted); white-space: nowrap; opacity: 0; animation: fade-in .4s both; animation-delay: calc(var(--i) * 30ms + .6s); }
.bars .b:hover .val { color: var(--navy); font-weight: 700; }
@media (max-width: 860px) { .bars .val { display: none; } }
.hbar { height: 8px; background: var(--gold-soft); border-radius: 4px; overflow: hidden; margin-top: 5px; }
.hbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--navy-3)); border-radius: 4px; transform-origin: left; animation: grow-x .9s var(--ease) both .2s; }
.hbar:hover > span { background: linear-gradient(90deg, var(--gold-2), var(--gold)); }

/* ---------------- POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
.pos > .card:last-child { position: sticky; top: 16px; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; } .pos > .card:last-child { position: static; } }
.search { position: relative; }
.results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-up); max-height: 330px; overflow-y: auto; margin-top: 6px; animation: drop .2s var(--ease);
}
.results button {
  display: flex; width: 100%; justify-content: space-between; gap: 12px; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 11px 14px; cursor: pointer; font: inherit; text-align: left; transition: background .15s, padding .2s;
}
.results button:hover, .results button.hl { background: var(--gold-soft); padding-left: 18px; }
.lines input { padding: 7px 9px; }
.lines .qty { width: 84px; } .lines .price { width: 112px; }
.lines tbody tr { animation: fade-up .35s var(--ease) both; }
.totalbox { font-size: 15px; }
.totalbox .line { display: flex; justify-content: space-between; padding: 6px 0; }
.totalbox .grand { font-family: var(--font-head); font-size: 26px; font-weight: 600; border-top: 2px solid var(--gold); margin-top: 6px; padding-top: 10px; color: var(--navy); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pay .chip { text-align: center; border-radius: 10px; }
.totalbox .owed { font-weight: 700; color: var(--warn); border-top: 1px dashed var(--line); }

/* ---------------- debts */
.debt-toggle { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border: 1.5px dashed var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.debt-toggle:hover { border-color: var(--gold); background: var(--gold-soft); }
.debt-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.debt-toggle > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.debt-toggle .sw { flex: none; width: 40px; height: 23px; border-radius: 999px; background: #d5d9e0; position: relative; transition: background .25s; }
.debt-toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.debt-toggle input:checked + .sw { background: var(--gold); }
.debt-toggle input:checked + .sw::after { transform: translateX(17px); }
.debt-toggle:has(input:checked) { border-style: solid; border-color: var(--gold); background: var(--gold-soft); }
.debt-toggle input:focus-visible + .sw { box-shadow: 0 0 0 3px var(--gold-glow); }
[hidden] { display: none !important; }
.debtbox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; animation: fade-up .3s var(--ease) both; }

.tabs { display: flex; gap: 6px; margin: 4px 0 14px; border-bottom: 2px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; margin-bottom: -2px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; border-radius: 10px 10px 0 0; transition: color .2s, background .2s, border-color .25s; }
.tabs a:hover { color: var(--navy); background: var(--gold-soft); }
.tabs a.on { color: var(--navy); border-bottom-color: var(--gold); background: var(--card); }
.tabs .count { background: var(--navy); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }

a.stat.link { text-decoration: none; color: inherit; cursor: pointer; }
a.stat.link .k .ic { color: var(--gold-2); }
tr.overdue-row td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.btn.small-btn { padding: 6px 11px; font-size: 13px; }

.debtcard { border-left: 5px solid var(--warn); }
.debtcard.overdue { border-left-color: var(--bad); }
.debtcard.cleared { border-left-color: var(--good); }
.debtcard h2 { display: flex; align-items: center; gap: 8px; }
.debt-nums { display: flex; gap: 22px; margin-left: auto; }
.debt-nums > div { display: flex; flex-direction: column; text-align: right; }
.debt-nums b { font-family: var(--font-head); font-size: 20px; }
.progress { height: 9px; background: var(--gold-soft); border-radius: 6px; overflow: hidden; margin: 12px 0 8px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); border-radius: 6px; transform-origin: left; animation: grow-x .9s var(--ease) both .2s; }
.debtcard.cleared .progress > span { background: linear-gradient(90deg, #0d6b3d, var(--good)); }
@media (max-width: 640px) {
  .debt-nums { margin-left: 0; gap: 16px; }
  .tabs a { padding: 9px 11px; font-size: 14px; }
}

/* ---------------- modal */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 18, 30, .5); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px; overflow-y: auto; animation: fade-in .2s both; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 580px; padding: 22px; box-shadow: 0 24px 70px rgba(10, 18, 30, .35); border-top: 4px solid var(--gold); animation: pop .3s var(--ease) both; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal .grid { gap: 12px; }

/* ---------------- login */
.login {
  position: relative; overflow: hidden; min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--navy-3), transparent 60%), linear-gradient(140deg, var(--navy) 0%, #0c1828 100%);
}
.login-deco i { position: absolute; border-radius: 50%; border: 2px solid rgba(201, 164, 82, .25); animation: float 12s ease-in-out infinite; }
.login-deco i:nth-child(1) { width: 520px; height: 520px; left: -160px; bottom: -200px; }
.login-deco i:nth-child(2) { width: 300px; height: 300px; right: -80px; top: -90px; border-color: rgba(201, 164, 82, .35); animation-delay: -4s; }
.login-deco i:nth-child(3) { width: 140px; height: 140px; right: 18%; bottom: 12%; background: rgba(201, 164, 82, .08); border: 0; animation-delay: -8s; }
.login .card { position: relative; width: 100%; max-width: 390px; padding: 26px 30px 30px; border-top: 4px solid var(--gold); animation: pop .6s var(--ease) both; }
.login .card:hover { box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.login .brandlogo.lg { width: 82%; margin: 0 auto; animation: fade-up .7s var(--ease) both .15s; }
.login-sub { text-align: center; color: var(--muted); font-family: var(--font-head); letter-spacing: 4px; text-transform: uppercase; font-size: 12px; margin: 4px 0 20px; }
.login .card.shake { animation: shake .45s; }
.login .card.leaving { animation: leave .25s ease-in both; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin-top: 8px; }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(130px); background: var(--navy); color: #fff;
  padding: 12px 20px; border-radius: 12px; z-index: 200; transition: transform .4s var(--ease); max-width: calc(100vw - 32px); font-size: 14px;
  box-shadow: 0 12px 30px rgba(10, 18, 30, .3); border-left: 4px solid var(--gold);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--bad); border-left-color: #ffd7d3; }

/* ---------------- receipt */
.receipt { max-width: 390px; margin: 0 auto; background: #fff; padding: 24px; border-radius: 12px; box-shadow: var(--shadow-up); font-size: 14px; border-top: 4px solid var(--gold); }
.receipt .head { text-align: center; border-bottom: 1px dashed #b9b0a0; padding-bottom: 10px; margin-bottom: 10px; }
.receipt .rcpt-logo { width: 62%; margin: 0 auto 6px; }
.mailstat { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 auto 10px; max-width: 390px; flex-wrap: wrap; }
.mailstat .ic { width: 15px; height: 15px; }
.receipt .rcpt-phones { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; margin-top: 2px; font-weight: 600; color: var(--navy); }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td, .receipt th { padding: 4px 0; font-size: 13px; vertical-align: top; }
.receipt th { text-align: left; border-bottom: 1px dashed #b9b0a0; color: var(--navy); }
.receipt .tot td { border-top: 1px dashed #b9b0a0; font-weight: 700; color: var(--navy); }
.receipt .thanks { text-align: center; margin-top: 14px; font-size: 13px; color: var(--navy); font-family: var(--font-head); letter-spacing: 1px; }
.voidstamp { color: var(--bad); border: 3px solid var(--bad); font-weight: 800; text-align: center; padding: 4px; margin: 8px 0; letter-spacing: 3px; transform: rotate(-3deg); }

/* ---------------- keyframes */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { left: -60%; } 40%, 100% { left: 130%; } }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -22px); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes leave { to { opacity: 0; transform: scale(.96) translateY(-10px); } }

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

@media print {
  body { background: #fff; }
  .side, .mobilebar, .scrim, .top .actions, .noprint, #toast, .eye { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .main.enter > *, .stat, .bars .bar, .hbar > span { animation: none !important; }
  .card, .stat, .receipt { box-shadow: none; border: 1px solid #ddd; }
  .stat.hero::after { display: none; }
  .receipt { border: 0; max-width: 80mm; padding: 0; }
}
