/* Inventarie: large, calm, high-contrast UI for iPad and desktop. */
:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #f9f8f5;
  --text: #15171a;
  --muted: #4a4f59;
  --line: #e2dfd7;
  --line-strong: #c9c5bb;
  --accent: #9a2b1f;
  --accent-hover: #7e2218;
  --accent-soft: #f8e8e4;
  --accent-ink: #6b1c13;
  --ok: #17703f;
  --ok-soft: #e3f4ea;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fdeceb;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 4px 16px rgba(20, 22, 26, .05);
  --shadow-lg: 0 2px 4px rgba(20, 22, 26, .05), 0 12px 32px rgba(20, 22, 26, .08);
  --sidebar: 272px;
  --tabbar: 84px;
  font-size: 20px;
  color-scheme: light;
}
html[data-size="2"] { font-size: 23px; }
html[data-size="3"] { font-size: 26px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 2rem; font-weight: 750; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0; }
.icon { flex: none; vertical-align: middle; }
:focus-visible { outline: 4px solid #2f80ed; outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 28px 18px; gap: 6px; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 12px 26px; font-weight: 750; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(145deg, #ab3527, #7a2117); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(154, 43, 31, .3); }
.nav-link {
  display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 16px;
  border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-weight: 600;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav-link .badge { margin-left: auto; }
.sidebar .spacer { flex: 1; }

.main { margin-left: var(--sidebar); min-height: 100vh; }
.page { max-width: 1040px; margin: 0 auto; padding: 40px 40px 80px; }
.page.narrow { max-width: 760px; }

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

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .page { padding: 24px 22px 48px; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(14px + env(safe-area-inset-top)) 22px 14px; background: var(--surface);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
  }
  .topbar .brand { padding: 0; font-size: 1.1rem; }
  .topbar .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line); padding: 6px 6px env(safe-area-inset-bottom); z-index: 10;
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 72px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 650;
    border-radius: 14px; position: relative;
  }
  .tab.active { color: var(--accent-ink); background: var(--accent-soft); }
  .tab .badge { position: absolute; top: 4px; right: calc(50% - 30px); }
}
@media (max-width: 480px) { h1 { font-size: 1.6rem; } }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head .sub { color: var(--muted); margin-top: 6px; font-size: 1.05rem; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; color: var(--muted); font-weight: 600; text-decoration: none; margin: -8px 0 8px -6px; padding: 0 8px; border-radius: 10px; }
.back:hover { color: var(--text); background: rgba(0,0,0,.04); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 26px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background .15s, transform .05s, box-shadow .15s;
  background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(154, 43, 31, .25);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: none; }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.ghost { background: transparent; color: var(--accent-ink); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: #e9b8b4; box-shadow: none; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.big { min-height: 72px; font-size: 1.15rem; padding: 0 34px; border-radius: 18px; }
.btn.small { min-height: 48px; padding: 0 18px; font-size: .9rem; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; }
form.inline { display: inline; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 26px; }
.card + .card, .stack > * + * { margin-top: 18px; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 9px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: .78rem; font-weight: 750;
}
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: .85rem; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

/* ---------- flash ---------- */
.flash {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; border-radius: var(--radius);
  margin-bottom: 26px; font-weight: 600; font-size: 1.05rem; animation: pop .25s ease-out;
  background: var(--ok-soft); color: #0d4a29; border: 2px solid #b5e0c6;
}
.flash .msg { flex: 1; min-width: 200px; display: flex; gap: 12px; align-items: center; }
.flash.error { background: var(--bad-soft); color: #7a1912; border-color: #f0c2be; }
.flash.info { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- home ---------- */
.hello h1 { font-size: 2.3rem; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 28px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-height: 190px; padding: 26px;
  border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .12s, box-shadow .15s;
}
.tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tile:active { transform: scale(.99); }
.tile .ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.tile.primary { background: linear-gradient(150deg, #a83426 0%, #7a2117 100%); color: #fff; border-color: transparent; box-shadow: 0 10px 28px rgba(154, 43, 31, .28); }
.tile.primary .ico { background: rgba(255,255,255,.16); color: #fff; }
.tile.primary .tile-sub { color: rgba(255,255,255,.85); }
.tile-title { font-size: 1.35rem; font-weight: 750; letter-spacing: -0.01em; }
.tile-sub { color: var(--muted); margin-top: 4px; }
.tile .badge { position: absolute; top: 22px; right: 22px; height: 36px; min-width: 36px; font-size: .9rem; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } .tile { min-height: 140px; flex-direction: row; align-items: center; justify-content: flex-start; } }

.notice { display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--radius); background: var(--warn-soft); color: #5c3700; font-weight: 600; text-decoration: none; border: 2px solid #f3d9a6; }
.notice + .notice { margin-top: 12px; }
.notice .grow { flex: 1; }
.notice.bad { background: var(--bad-soft); color: #7a1912; border-color: #f0c2be; }
.notice.ok { background: var(--ok-soft); color: #0d4a29; border-color: #b5e0c6; }
.notice.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: #eccac3; }
a.notice:hover { filter: brightness(.98); }

/* ---------- lists ---------- */
.list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 16px; min-height: 76px; padding: 14px 22px;
  border-top: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; font-size: 1.05rem; }
.row .meta { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.row .chev { color: var(--line-strong); }
button.row { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); font: inherit; text-align: left; cursor: pointer; }
.list-head { padding: 18px 22px 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-head h3 { font-size: 1.15rem; }
.list-head a { text-decoration: none; }

.stock {
  min-width: 92px; padding: 8px 14px; border-radius: 14px; text-align: center; font-weight: 750; font-size: 1.3rem;
  font-variant-numeric: tabular-nums; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.15;
}
.stock small { display: block; font-size: .65rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stock.low { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.stock.out { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.group { margin-top: 18px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.group-head:hover { background: #f2f0eb; }
.group-head .title { font-size: 1.15rem; font-weight: 700; }

/* ---------- search ---------- */
.search { position: relative; }
.search .icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 60px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.toolbar .search { flex: 1; min-width: 260px; }
.segmented { display: inline-flex; background: #e9e7e1; padding: 5px; border-radius: 16px; gap: 4px; }
.segmented a { display: inline-flex; align-items: center; min-height: 52px; padding: 0 20px; border-radius: 12px; color: var(--muted); font-weight: 650; text-decoration: none; }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 20px; }
label.field > span { display: block; font-weight: 650; margin-bottom: 8px; }
label.field > .hint { display: block; color: var(--muted); font-size: .85rem; margin-top: 6px; font-weight: 400; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: 62px; padding: 12px 18px; font: inherit; font-size: 1.05rem; color: var(--text);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius-sm); appearance: none; -webkit-appearance: none;
}
textarea { min-height: 120px; resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%234a4f59' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 52px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(154, 43, 31, .15); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 18px; }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- stepper (change amount) ---------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 18px 0 10px; }
.stepper button {
  width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface);
  color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}
.stepper button:active { transform: scale(.95); background: var(--surface-2); }
.stepper input {
  width: 200px; height: 120px; text-align: center; font-size: 3.4rem; font-weight: 750; border-radius: 24px;
  font-variant-numeric: tabular-nums; padding: 0;
}
.change-text { text-align: center; font-size: 1.15rem; color: var(--muted); min-height: 1.8em; }
.change-text b { color: var(--text); }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 20px; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; background: var(--surface); }
.choice span::before { content: ""; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.choice input:checked + span::before { border: 7px solid var(--accent); }
.choice input:focus-visible + span { outline: 4px solid #2f80ed; outline-offset: 2px; }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } .stepper button { width: 76px; height: 76px; } .stepper input { width: 150px; } }

/* ---------- upload ---------- */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center;
  padding: 44px 24px; border: 3px dashed #dfb2aa; border-radius: 24px; background: linear-gradient(180deg, #fcf5f3, #f7e9e5);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .ico { width: 80px; height: 80px; border-radius: 24px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(154, 43, 31, .3); }
.drop strong { font-size: 1.3rem; }
.drop input { display: none; }
.or { display: flex; align-items: center; gap: 16px; color: var(--muted); margin: 22px 0; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

/* ---------- delivery review ---------- */
.check-banner { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: var(--radius); font-weight: 650; }
.check-banner.ok { background: var(--ok-soft); color: #0d4a29; }
.check-banner.check { background: var(--warn-soft); color: #5c3700; }
.check-banner.unknown { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.line-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px; scroll-margin-top: 100px; }
.line-card + .line-card { margin-top: 14px; }
.line-card.linked { border-color: #ecc6be; }
.line-card.newitem { border-color: #eccac3; }
.line-card.skipped { opacity: .55; background: var(--surface-2); }
.line-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.line-desc { font-size: 1.15rem; font-weight: 700; }
.line-sub { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.line-link { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; text-decoration: none; min-height: 64px; }
.line-link.unlinked { background: var(--warn-soft); color: #5c3700; border: 2px dashed #e6be7a; }
.line-link .grow { flex: 1; }
.line-fields { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-top: 16px; }
.line-fields label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 650; color: var(--muted); }
.line-fields input { width: 120px; min-height: 56px; text-align: center; font-weight: 700; font-size: 1.1rem; }
.line-fields .equals { font-size: 1.15rem; padding-bottom: 14px; }
.line-fields .equals b { font-size: 1.4rem; }
.line-actions { margin-left: auto; display: flex; gap: 10px; }
.summary-bar {
  position: sticky; bottom: 16px; margin-top: 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: 22px; background: rgba(21, 23, 26, .94); color: #fff; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}
.summary-bar .grow { flex: 1; min-width: 200px; }
.summary-bar .muted { color: rgba(255,255,255,.75); }
@media (max-width: 1023px) { .summary-bar { bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); } }
.mailbox { white-space: pre-wrap; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: 18px; max-height: 360px; overflow: auto; border: 1px solid var(--line); }

details.more { margin-top: 18px; }
details.more summary { cursor: pointer; font-weight: 650; min-height: 52px; display: flex; align-items: center; gap: 8px; color: var(--accent-ink); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); font-weight: 700; }
details.more[open] summary::before { content: "−"; }

/* ---------- confirm ---------- */
.confirm-list .row { min-height: 68px; }
.plus { font-weight: 750; font-size: 1.25rem; color: var(--ok); font-variant-numeric: tabular-nums; white-space: nowrap; }
.minus { font-weight: 750; font-size: 1.25rem; color: var(--bad); font-variant-numeric: tabular-nums; white-space: nowrap; }
.big-number { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- history ---------- */
.event { display: flex; gap: 18px; padding: 20px 22px; border-top: 1px solid var(--line); align-items: flex-start; }
.event:first-child { border-top: 0; }
.event .dot { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.event .dot.invoice { background: var(--accent-soft); color: var(--accent-ink); }
.event .dot.sale, .event .dot.sale_review { background: #ece9fb; color: #4a3aa8; }
.event .dot.adjust { background: var(--warn-soft); color: var(--warn); }
.event.undone { opacity: .55; }
.event.undone .title { text-decoration: line-through; }
.event ul { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; }
.event li { padding: 2px 0; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .icon { color: var(--line-strong); margin-bottom: 12px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.textsize { display: flex; gap: 6px; }
.textsize button { min-width: 52px; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 750; cursor: pointer; color: var(--text); font-family: inherit; }
.textsize button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.textsize button:nth-child(1) { font-size: 16px; }
.textsize button:nth-child(2) { font-size: 20px; }
.textsize button:nth-child(3) { font-size: 25px; }

.demo-ribbon { background: #262a33; color: #fff; text-align: center; font-size: .78rem; font-weight: 650; padding: 6px 12px; letter-spacing: .02em; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 460px; padding: 36px; }
.row .dot { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
#book-btn[data-disabled] { opacity: .5; }
.search input[type=search] { padding-left: 60px; }
.line-link.newitem { background: var(--surface-2); color: var(--accent-ink); border: 2px dashed #dfb2aa; }
.brand-logo { width: 52px; height: 52px; border-radius: 50%; flex: none; box-shadow: 0 3px 10px rgba(120, 40, 30, .22); }
.topbar .brand-logo { width: 44px; height: 44px; }
.brand span { line-height: 1.15; }

/* invoice payments */
.pay-row { display: grid; grid-template-columns: 1fr auto; gap: 14px 18px; align-items: center; }
.pay-row .amount { font-size: 1.35rem; font-weight: 750; text-align: right; white-space: nowrap; }
.pay-row .due { font-weight: 700; }
.pay-row.overdue { border-left: 8px solid var(--bad); background: var(--bad-soft); }
.pay-row.soon { border-left: 8px solid var(--warn); }
.pay-row .actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; }
.pay-how { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.copy { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: .95rem; cursor: pointer; }
.copy b { color: var(--text); letter-spacing: .02em; font-size: 1.05rem; }
.copy svg { color: var(--accent); }
.copy:hover { border-color: var(--accent); }
.copy.done { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.pay-edit { grid-column: 1 / -1; }
.pay-edit .fields { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-top: 12px; }
.pay-edit label { display: flex; flex-direction: column; gap: 6px; font-weight: 650; }

/* waiting screen */
#busy { display: none; position: fixed; inset: 0; z-index: 100; background: rgba(244, 243, 239, .92);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 24px; }
#busy.on { display: flex; }
#busy .busy-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 40px 36px; max-width: 520px; width: 100%; text-align: center; }
#busy h2 { font-size: 1.6rem; margin: 22px 0 10px; }
#busy .note { font-size: 1.05rem; margin: 0; }
#busy .time { margin: 14px 0 0; min-height: 1.4em; }
.spinner { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; border: 8px solid var(--accent-soft);
  border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.upload-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .upload-choices { grid-template-columns: 1fr; } }

.events { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.events li { padding-left: 16px; border-left: 4px solid var(--accent-soft); }
.when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* on/off switches */
.switch-row { display: flex; align-items: center; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); margin-top: 14px; }
.switch-row .title { font-weight: 650; font-size: 1.05rem; }
.switch-row .meta { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.switch { position: relative; display: inline-flex; align-items: center; width: 116px; height: 56px; border-radius: 999px;
  border: 2px solid var(--line-strong); background: var(--surface-2); cursor: pointer; padding: 0; flex: none;
  font: inherit; font-weight: 750; font-size: 1.05rem; color: var(--muted); transition: background .15s; }
.switch .knob { position: absolute; left: 5px; top: 5px; width: 42px; height: 42px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: left .15s; }
.switch .label { margin-left: auto; margin-right: 18px; }
.switch.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.switch.on .knob { left: 63px; }
.switch.on .label { margin-left: 18px; margin-right: auto; }
.switch-row .grow { flex: 1; min-width: 0; }

/* PIN login */
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 22px 0 14px; }
.pin-dots span { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line-strong); }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.login .card { position: relative; overflow: hidden; }
.pin-input { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.pin-pad button { min-height: 84px; border-radius: 22px; border: 2px solid var(--line); background: var(--surface);
  font: inherit; font-size: 2rem; font-weight: 700; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.pin-pad button:active { background: var(--accent-soft); border-color: var(--accent); }
.pin-pad button.ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.pin-pad button:disabled { opacity: .4; cursor: default; }
