/* Billbuk Bills: brand design system. iOS-inspired, mobile first, light & dark. */
:root {
  --brand: #FF5822; --brand-2: #FF8A55; --brand-deep: #D93A06; --brand-soft: #FFF1EB; --brand-ring: rgba(255, 88, 34, .22);
  --ink: #0F172A; --ink-2: #334155; --muted: #64748B; --faint: #94A3B8;
  --bg: #F4F5F9; --bg-2: #ECEEF4; --card: #FFFFFF; --line: #E6E8EF; --glass: rgba(255, 255, 255, .78);
  --ok: #16A34A; --ok-soft: #E8F7EE; --warn: #D97706; --warn-soft: #FFF6E5; --bad: #DC2626; --bad-soft: #FDECEC; --info: #2563EB; --info-soft: #EAF1FE;
  --r: 20px; --r-sm: 14px; --r-xs: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, .14);
  --grad: linear-gradient(135deg, #FF8A55 0%, #FF5822 48%, #D93A06 100%);
  --grad-ink: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F1F5F9; --ink-2: #CBD5E1; --muted: #94A3B8; --faint: #64748B;
    --bg: #0B0F17; --bg-2: #111827; --card: #151B26; --line: #253041; --glass: rgba(21, 27, 38, .78);
    --brand-soft: rgba(255, 88, 34, .14); --ok-soft: rgba(22, 163, 74, .16); --warn-soft: rgba(217, 119, 6, .16); --bad-soft: rgba(220, 38, 38, .16); --info-soft: rgba(37, 99, 235, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F1F5F9; --ink-2: #CBD5E1; --muted: #94A3B8; --faint: #64748B;
  --bg: #0B0F17; --bg-2: #111827; --card: #151B26; --line: #253041; --glass: rgba(21, 27, 38, .78);
  --brand-soft: rgba(255, 88, 34, .14); --ok-soft: rgba(22, 163, 74, .16); --warn-soft: rgba(217, 119, 6, .16); --bad-soft: rgba(220, 38, 38, .16); --info-soft: rgba(37, 99, 235, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; color: var(--ink); }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 16.5px; font-weight: 700; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 18px; height: 18px; } .i.lg { width: 28px; height: 28px; } .i.xl { width: 44px; height: 44px; }
.hide { display: none !important; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 256px; flex: none; position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; background: var(--card); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 20px; color: var(--ink); }
.brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 6px 16px var(--brand-ring); }
.brand b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; display: block; line-height: 1.1; }
.brand span { font-size: 12px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; font-size: 15px; transition: background .15s, color .15s; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side .scan-cta { margin-top: 14px; }
.side .who { margin-top: auto; padding: 12px; border-radius: 14px; background: var(--bg); display: flex; gap: 10px; align-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1240px; }

.topbar { display: none; }
.tabbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- acting-as banner ---------- */
.acting { background: var(--grad-ink); color: #fff; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; position: sticky; top: 0; z-index: 60; }
.acting form { margin: 0; }
.acting button { background: #fff; color: var(--ink); border: 0; border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }

/* ---------- cards & grids ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; border: 1px solid var(--line); animation: rise .35s ease both; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head a { font-size: 14px; font-weight: 650; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { background: var(--grad); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero::before { content: ""; position: absolute; right: 40px; bottom: -90px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero h2, .hero .muted, .hero small { color: #fff; }
.hero .muted { opacity: .85; }
.hero .big { font-size: 38px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0; }
.hero .pill { background: rgba(255, 255, 255, .2); color: #fff; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--muted); font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.stat .hint { font-size: 13px; color: var(--muted); }
.ico-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ico-tile.brand { background: var(--brand-soft); color: var(--brand); } .ico-tile.ok { background: var(--ok-soft); color: var(--ok); }
.ico-tile.bad { background: var(--bad-soft); color: var(--bad); } .ico-tile.warn { background: var(--warn-soft); color: var(--warn); } .ico-tile.info { background: var(--info-soft); color: var(--info); }

/* ---------- lists (iOS grouped) ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 13px; padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--bg); border-radius: 12px; margin: 0 -8px; padding-left: 12px; padding-right: 12px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { font-weight: 750; text-align: right; white-space: nowrap; }
.row .chev { color: var(--faint); }
.cat-dot { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; font-weight: 800; font-size: 15px; }

/* ---------- badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-paid { background: var(--ok-soft); color: var(--ok); } .b-pending { background: var(--info-soft); color: var(--info); }
.b-overdue { background: var(--bad-soft); color: var(--bad); } .b-partial { background: var(--warn-soft); color: var(--warn); }
.b-brand { background: var(--brand-soft); color: var(--brand); } .b-muted { background: var(--bg-2); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--bg-2); font-size: 13px; font-weight: 650; color: var(--ink-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-weight: 650; font-size: 14px; }
.chip.on, .chip:hover { background: var(--ink); color: var(--card); border-color: var(--ink); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 15px var(--font); color: #fff; background: var(--grad); box-shadow: 0 8px 20px var(--brand-ring); transition: transform .12s, box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn:hover { color: #fff; box-shadow: 0 10px 26px rgba(255, 88, 34, .35); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--bg); color: var(--ink); }
.btn.dark { background: var(--grad-ink); box-shadow: 0 8px 20px rgba(15, 23, 42, .2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.lg { height: 54px; font-size: 16.5px; padding: 0 28px; }
.link-btn { background: none; border: 0; color: var(--brand); font: 650 14px var(--font); cursor: pointer; padding: 0; }
.link-btn.danger { color: var(--bad); }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.field label, .lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 6px 2px; }
.input, select.input, textarea.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font: 500 15.5px var(--font); outline: none; transition: border .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input.uncertain { border-color: var(--warn); background: var(--warn-soft); }
.input.sm { height: 40px; font-size: 14.5px; border-radius: 11px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin: 5px 2px 0; }
.field-validation-error, .err { color: var(--bad); font-size: 13px; font-weight: 600; margin: 5px 2px 0; display: block; }
.validation-summary-errors ul { margin: 0; padding: 0; list-style: none; }
.alert { padding: 13px 16px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 550; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); } .alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.info { background: var(--info-soft); color: var(--info); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 1px; flex: none; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.meter { height: 5px; border-radius: 9px; background: var(--bg-2); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 9px; transition: width .25s, background .25s; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-2); padding: 4px; border-radius: 13px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { padding: 7px 14px; border-radius: 10px; font-weight: 650; font-size: 14px; color: var(--ink-2); border: 0; background: none; cursor: pointer; }
.seg .on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; } .tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line); }

/* item editor */
.items { display: flex; flex-direction: column; gap: 10px; }
.item-row { display: grid; grid-template-columns: minmax(0, 3fr) 80px 70px 100px 100px 36px; gap: 8px; align-items: center; padding: 10px; border-radius: 14px; background: var(--bg); }
.item-row.uncertain { background: var(--warn-soft); }
.item-head { display: grid; grid-template-columns: minmax(0, 3fr) 80px 70px 100px 100px 36px; gap: 8px; padding: 0 10px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--bad-soft); color: var(--bad); }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sum-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.sum-line:last-child { border-bottom: 0; }
.sum-line.total { font-size: 18px; font-weight: 850; border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 12px; margin-top: 4px; }

/* ---------- scan ---------- */
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 34px 20px; text-align: center; background: var(--card); transition: border .2s, background .2s; cursor: pointer; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .big-ico { width: 74px; height: 74px; border-radius: 24px; background: var(--grad); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; box-shadow: 0 14px 30px var(--brand-ring); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 16px; }
.thumb { position: relative; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .n { position: absolute; left: 6px; top: 6px; background: rgba(15, 23, 42, .7); color: #fff; font-size: 11px; font-weight: 800; border-radius: 8px; padding: 2px 7px; }
.thumb .x { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(15, 23, 42, .7); color: #fff; cursor: pointer; display: grid; place-items: center; }
.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.photo-strip img { height: 180px; border-radius: 14px; box-shadow: var(--shadow); cursor: zoom-in; }
.reading { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 200; }
.reading.on { display: grid; }
.reading .box { background: var(--card); border-radius: 26px; padding: 30px 34px; text-align: center; max-width: 340px; box-shadow: var(--shadow-lg); }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .9s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.legend-unsure { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--warn); font-weight: 650; }
.legend-unsure i { width: 14px; height: 14px; border-radius: 4px; background: var(--warn-soft); border: 1.5px solid var(--warn); display: inline-block; }

/* ---------- charts (pure CSS) ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { width: 100%; max-width: 42px; border-radius: 10px 10px 4px 4px; background: var(--bg-2); min-height: 4px; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.bars .bar.cur i { background: var(--grad); box-shadow: 0 6px 16px var(--brand-ring); }
.bars .bar span { font-size: 12px; color: var(--muted); font-weight: 650; }
.bars .bar b { font-size: 11.5px; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.hbar { margin: 10px 0; }
.hbar .top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 650; margin-bottom: 6px; gap: 10px; }
.hbar .track { height: 9px; border-radius: 9px; background: var(--bg-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 9px; background: var(--brand); }
.donut { width: 160px; height: 160px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--card); }
.donut .c { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; font-weight: 800; font-size: 18px; }
.legend { display: grid; gap: 8px; font-size: 14px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.progress { height: 10px; border-radius: 10px; background: rgba(255, 255, 255, .25); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: #fff; border-radius: 10px; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty .ico { width: 70px; height: 70px; border-radius: 22px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { margin-bottom: 4px; }

/* ---------- flash toast ---------- */
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 300; background: var(--ink); color: var(--card); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 650; font-size: 14.5px; display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 32px); animation: toast 4.5s ease forwards; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -14px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -14px); visibility: hidden; } }

/* ---------- modal sheet ---------- */
dialog.sheet { border: 0; border-radius: 26px; padding: 0; width: min(480px, calc(100vw - 24px)); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgba(15, 23, 42, .5); backdrop-filter: blur(4px); }
dialog.sheet .in { padding: 22px; }
dialog.sheet .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: var(--grad); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: rgba(255, 255, 255, .09); right: -180px; top: -140px; }
.auth-art::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(255, 255, 255, .07); left: -120px; bottom: -160px; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h1 { color: #fff; font-size: 40px; line-height: 1.12; max-width: 460px; }
.auth-art .feat { display: grid; gap: 14px; margin-top: 28px; max-width: 440px; }
.auth-art .feat div { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); padding: 12px 14px; border-radius: 16px; backdrop-filter: blur(4px); font-weight: 600; }
.auth-art .feat .i { width: 22px; height: 22px; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--card); }
.auth-form .box { width: 100%; max-width: 410px; }
.auth-form .logo { width: 58px; height: 58px; border-radius: 16px; box-shadow: 0 12px 26px var(--brand-ring); margin-bottom: 18px; }
.auth-form h1 { font-size: 28px; margin-bottom: 6px; }
.auth-form .lead { color: var(--muted); margin-bottom: 24px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- landing ---------- */
.land-nav { position: sticky; top: 0; z-index: 50; background: var(--glass); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
.land-nav .in { max-width: 1160px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.land { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.land-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 70px 0 50px; }
.land-hero h1 { font-size: 54px; line-height: 1.04; letter-spacing: -.04em; }
.land-hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-hero p { font-size: 18.5px; color: var(--muted); margin: 18px 0 28px; max-width: 540px; }
.phone { width: 330px; margin: 0 auto; border-radius: 44px; padding: 12px; background: var(--grad-ink); box-shadow: var(--shadow-lg); transform: rotate(2deg); }
.phone .scr { border-radius: 34px; overflow: hidden; background: var(--bg); padding: 14px; display: grid; gap: 12px; }
.phone .row { gap: 10px; } .phone .cat-dot { width: 36px; height: 36px; border-radius: 11px; } .phone .row .title { font-size: 14px; } .phone .row .amt { font-size: 14px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 30px 0 60px; }
.feat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.feat-card .ico-tile { margin-bottom: 14px; width: 48px; height: 48px; border-radius: 15px; }
.feat-card p { color: var(--muted); margin: 6px 0 0; font-size: 14.5px; }
.footer { border-top: 1px solid var(--line); padding: 26px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- mobile ---------- */
@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  body { font-size: 15px; }
  .side { display: none; }
  .main { padding: 8px 16px calc(var(--tabbar-h) + 34px); }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--glass);
    backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; } .topbar .brand img { width: 32px; height: 32px; border-radius: 9px; } .topbar .brand b { font-size: 16.5px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--glass); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--faint); }
  .tabbar a.on { color: var(--brand); }
  .tabbar .fab { width: 58px; height: 58px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; margin: -22px auto 0; box-shadow: 0 12px 26px var(--brand-ring); border: 4px solid var(--bg); }
  h1 { font-size: 27px; }
  .page-head { margin: 10px 0 16px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .g4.keep2, .g2.keep2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: auto; }
  .card { padding: 16px; border-radius: 18px; }
  .hero .big { font-size: 32px; }
  .item-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 1fr; }
  .item-row .nm { grid-column: 1 / -1; }
  .item-row .del { grid-column: 3; justify-self: end; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .land-hero { grid-template-columns: 1fr; padding: 40px 0 20px; text-align: center; }
  .land-hero h1 { font-size: 38px; } .land-hero p { margin-left: auto; margin-right: auto; }
  .land-hero .actions { justify-content: center; }
  .feat-grid { grid-template-columns: 1fr; }
  .phone { width: 270px; }
  .stat .value { font-size: 22px; }
  .tbl.mobile-cards thead { display: none; }
  .tbl.mobile-cards tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl.mobile-cards td { display: flex; justify-content: space-between; border: 0; padding: 4px 4px; }
  .tbl.mobile-cards td::before { content: attr(data-l); color: var(--muted); font-size: 13px; font-weight: 600; }
}
@media print {
  .side, .topbar, .tabbar, .no-print, .acting { display: none !important; }
  body { background: #fff; } .main { padding: 0; max-width: none; } .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
