/* admin.css — Terma admin: money tracker + coffee shop (30 Oct 2026). Phone first; a side rail on desktop. */
:root {
  --bg: #14100c; --bg-2: #1b1510; --surface: #211a14; --surface-2: #2a2119; --surface-3: #33281e;
  --border: #3a2e23; --text: #f5efe7; --muted: #b0a596; --faint: #7d7266;
  --accent: #c99a53; --accent-2: #e0b56b;
  --in: #3ddc84; --out: #ff8a6b; --move: #6bb5ff; --warn: #ffc857; --bad: #ff6b6b;
  --radius: 16px; --tabs-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); line-height: 1.45;
  background: radial-gradient(120% 60% at 50% -10%, #3b2718 0%, #1d130c 55%, var(--bg) 100%) fixed var(--bg);
  min-height: 100vh; overscroll-behavior-y: contain;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a, button, input, select, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.c-in { color: var(--in); } .c-out { color: var(--out); } .c-move { color: var(--move); } .c-muted { color: var(--muted); }

/* ---------- lock screen ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card {
  width: 100%; max-width: 400px; background: rgba(30, 24, 19, .94); border: 1px solid var(--border);
  border-radius: 22px; padding: 30px 24px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); text-align: center;
}
.glow {
  display: inline-block; font-size: clamp(2.4rem, 12vw, 3.6rem); font-weight: 800; letter-spacing: 6px; text-transform: uppercase;
  background: linear-gradient(180deg, #fbe7be, #c99a53); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: glowpulse 2.6s ease-in-out infinite;
}
@keyframes glowpulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(201,154,83,.55)) drop-shadow(0 0 18px rgba(201,154,83,.35)); }
  50% { filter: drop-shadow(0 0 12px rgba(224,181,107,.9)) drop-shadow(0 0 34px rgba(224,181,107,.55)); }
}
.gate-card h2 { font-size: 1.15rem; margin: 6px 0 4px; }
.gate-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.gate-card .field { text-align: left; }
.gate-card .btn { width: 100%; margin-top: 6px; }
.gate-card .small-link { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--muted); padding: 8px; }
.shield { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: rgba(61,220,132,.07); border: 1px solid rgba(61,220,132,.25); border-radius: 12px; padding: 12px; font-size: 13px; color: #cfe9d9; margin: 14px 0; }
.warnbox { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: rgba(255,200,87,.08); border: 1px solid rgba(255,200,87,.35); border-radius: 12px; padding: 12px; font-size: 13px; color: #f3e3bd; margin: 14px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 13.5px; margin: 10px 0 4px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.err { color: var(--bad); font-size: 13.5px; min-height: 20px; margin-top: 8px; }
.meter { height: 6px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin: -4px 0 12px; }
.meter i { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }

/* ---------- inputs & buttons ---------- */
.field { display: block; margin-bottom: 14px; }
.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; letter-spacing: .2px; }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); outline: none; font-size: 16px; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 70px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px;
  border-radius: 13px; font-weight: 700; font-size: 15.5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a120b;
}
.btn:disabled { opacity: .55; cursor: wait; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: rgba(255,107,107,.12); color: var(--bad); border: 1px solid rgba(255,107,107,.35); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.chip.on { background: rgba(201,154,83,.16); border-color: var(--accent); color: var(--accent-2); }
.chip .sw { width: 10px; height: 10px; border-radius: 50%; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 42px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.seg.kind button.on[data-k="in"] { color: var(--in); } .seg.kind button.on[data-k="out"] { color: var(--out); } .seg.kind button.on[data-k="move"] { color: var(--move); }

/* ---------- app frame ---------- */
.app { min-height: 100vh; }
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: rgba(20,16,12,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(58,46,35,.7);
}
.bar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-logo { width: 38px; height: 38px; border-radius: 10px; display: block; flex: none; }
/* Orbit logo on the lock screen (30 Oct) */
.gate-logo { width: 84px; height: 84px; border-radius: 20px; display: block; margin: 0 auto 10px; box-shadow: 0 10px 30px rgba(224,173,92,.25); }
.bar-title b { display: block; font-size: 1.08rem; }
.bar-title small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-actions { display: flex; gap: 4px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.sync .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--in); box-shadow: 0 0 0 4px rgba(61,220,132,.16); }
.sync.wait .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(255,200,87,.16); }
.sync.bad .dot { background: var(--bad); box-shadow: 0 0 0 4px rgba(255,107,107,.18); }
.sync.busy .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.view { padding: 16px 16px calc(var(--tabs-h) + 30px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: stretch; justify-content: space-around;
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(20,16,12,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
}
.tabs a, .tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 600; }
.tabs a.on { color: var(--accent-2); }
.tabs .tab-add i { width: 50px; height: 50px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a120b; box-shadow: 0 8px 24px rgba(201,154,83,.45); }
.tabs .tab-add i svg { width: 26px; height: 26px; stroke-width: 2.6; }
.tabs .tab-add { color: var(--accent-2); }

/* ---------- cards ---------- */
.card { background: rgba(33,26,20,.92); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3 { font-size: 15px; letter-spacing: .2px; }
.card-h a, .card-h button.link { font-size: 13px; color: var(--accent); font-weight: 600; padding: 6px 0; }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--faint); font-weight: 700; margin: 22px 2px 10px; }

.hero {
  background: linear-gradient(145deg, #3a2716, #241810 60%, #1d140d); border: 1px solid #4a3622; border-radius: 22px;
  padding: 20px 18px; margin-bottom: 14px; position: relative; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(224,181,107,.22), transparent 70%); }
.hero .k { font-size: 13px; color: #d9c6a8; }
.hero .v { font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 800; letter-spacing: -.5px; margin: 2px 0 12px; }
.hero .accs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.hero .accs::-webkit-scrollbar { display: none; }
.acc-pill { flex: none; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 8px 12px; font-size: 12px; color: #d9c6a8; }
.acc-pill b { display: block; font-size: 14px; color: var(--text); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: rgba(33,26,20,.92); border: 1px solid var(--border); border-radius: 14px; padding: 12px; min-width: 0; }
.tile .t { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.tile .r { display: flex; justify-content: space-between; gap: 4px; font-size: 12.5px; font-weight: 700; }
.tile .r + .r { margin-top: 3px; }
.tile .net { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 13px; font-weight: 800; }

.limit .bar-out { height: 10px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin: 10px 0 8px; }
.limit .bar-out i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--in), #9be37a); }
.limit.mid .bar-out i { background: linear-gradient(90deg, var(--warn), #ffb347); }
.limit.over .bar-out i { background: linear-gradient(90deg, var(--bad), #ff8a6b); }
.limit .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.limit .big { font-size: 1.25rem; font-weight: 800; color: var(--text); }

.biz { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(58,46,35,.7); cursor: pointer; }
.biz:first-of-type { border-top: 0; padding-top: 2px; }
.biz .av { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #160f09; flex: none; }
.biz .mid { flex: 1; min-width: 0; }
.biz .mid b { display: block; font-size: 14.5px; }
.biz .mid small { color: var(--muted); font-size: 12px; }
.biz .amt { text-align: right; font-weight: 800; font-size: 14.5px; }
.biz .amt small { display: block; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.share { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: rgba(201,154,83,.16); color: var(--accent-2); margin-left: 6px; vertical-align: 1px; }

.split { display: flex; height: 12px; border-radius: 9px; overflow: hidden; background: var(--surface-3); margin: 8px 0 10px; }
.split i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* transactions */
.tx { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(58,46,35,.6); cursor: pointer; }
.tx:first-child { border-top: 0; }
.tx .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); flex: none; }
.tx .mid { flex: 1; min-width: 0; }
.tx .mid b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .mid small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .amt { font-weight: 800; font-size: 15px; text-align: right; white-space: nowrap; }
.tx .amt small { display: block; color: var(--faint); font-weight: 600; font-size: 11px; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 6px; margin-left: 4px; vertical-align: 1px; }
.tag.want { background: rgba(255,107,107,.14); color: #ff9c9c; }
.tag.auto { background: rgba(107,181,255,.14); color: #9ccbff; }
.day-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); font-weight: 700; margin: 18px 4px 6px; }
.day-h:first-child { margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; font-size: 14px; }
.empty .e { font-size: 34px; margin-bottom: 6px; }

/* period navigator */
.period { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.period .lbl-p { flex: 1; text-align: center; font-weight: 800; font-size: 15px; }
.period .icon-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.period .icon-btn:disabled { opacity: .35; }
.sumrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.sumrow div { background: rgba(33,26,20,.92); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; }
.sumrow small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.sumrow b { font-size: 14.5px; }
.search { position: relative; margin-bottom: 10px; }
.search svg { position: absolute; left: 13px; top: 13px; width: 20px; height: 20px; color: var(--faint); }
.search .input { padding-left: 42px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.select { appearance: none; -webkit-appearance: none; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b0a596' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 34px; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--faint); font-size: 10px; font-family: inherit; }
.chart .g { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.chart .bi { fill: var(--in); } .chart .bo { fill: var(--out); }
.hbar { margin: 10px 0; }
.hbar .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; margin-bottom: 5px; }
.hbar .top span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .top b { white-space: nowrap; }
.hbar .tr { height: 8px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 9px; }
.delta { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.delta.up { background: rgba(61,220,132,.13); color: var(--in); }
.delta.down { background: rgba(255,107,107,.13); color: var(--bad); }
table.months { width: 100%; border-collapse: collapse; font-size: 13px; }
table.months th { text-align: right; color: var(--faint); font-weight: 700; font-size: 11.5px; padding: 6px 4px; }
table.months th:first-child, table.months td:first-child { text-align: left; }
table.months td { text-align: right; padding: 9px 4px; border-top: 1px solid rgba(58,46,35,.6); font-weight: 700; }

/* coffee: orders + stock */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: rgba(33,26,20,.92); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 14px; padding: 14px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 1.35rem; font-weight: 800; margin-top: 2px; }
.stat.green { border-left-color: var(--in); } .stat.green .value { color: var(--in); }
.order { background: rgba(33,26,20,.92); border: 1px solid var(--border); border-radius: 14px; padding: 15px; margin-bottom: 12px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.order-head h4 { font-size: 15px; }
.order .meta { color: var(--muted); font-size: 13px; margin-top: 3px; word-break: break-word; }
.order .meta a { color: inherit; text-decoration: underline; text-decoration-color: rgba(201,154,83,.5); }
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.b-pending { background: rgba(201,154,83,.18); color: var(--accent); } .b-confirmed { background: rgba(74,168,255,.18); color: #6bb5ff; }
.b-packed { background: rgba(167,139,250,.2); color: #c4b5fd; } .b-on_the_way { background: rgba(224,181,107,.22); color: var(--accent-2); }
.b-delivered { background: rgba(61,220,132,.16); color: var(--in); } .b-cancelled { background: rgba(255,107,107,.16); color: #ff9c9c; }
.items { font-size: 13px; color: #ddd; margin-bottom: 10px; } .items div { padding: 2px 0; }
.order-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 11px; }
.total { font-weight: 800; color: var(--accent); }
.order-act { display: flex; gap: 8px; }
.order-act .btn { flex: none; }
.order-act select { flex: 1; min-height: 40px; }
.stock-p { margin-bottom: 14px; }
.stock-p h4 { font-size: 14.5px; margin-bottom: 8px; }
.srow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(58,46,35,.6); }
.srow:first-of-type { border-top: 0; }
.srow .mid { flex: 1; min-width: 0; }
.srow .mid b { display: block; font-size: 14px; }
.srow .mid small { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: rgba(61,220,132,.14); color: var(--in); }
.pill.low { background: rgba(255,200,87,.16); color: var(--warn); }
.pill.none { background: rgba(255,107,107,.16); color: #ff9c9c; }
.pill.free { background: var(--surface-3); color: var(--muted); }
.note-line { font-size: 12.5px; color: var(--muted); margin: -4px 2px 12px; }

/* settings lists */
.row-link { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(58,46,35,.6); width: 100%; text-align: left; }
.row-link:first-of-type { border-top: 0; }
.row-link .mid { flex: 1; min-width: 0; }
.row-link .mid b { display: block; font-size: 14.5px; }
.row-link .mid small { color: var(--muted); font-size: 12.5px; }
.row-link .go { color: var(--faint); }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }
.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.colors button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; }
.colors button.on { border-color: #fff; }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); animation: up .22s cubic-bezier(.2,.9,.3,1); overscroll-behavior: contain;
}
.sheet::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 4px auto 10px; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-h h3 { font-size: 1.1rem; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.amt-in { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 6px 16px; margin: 14px 0; }
.amt-in span { font-size: 1.2rem; font-weight: 800; color: var(--muted); }
.amt-in input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 2.1rem; font-weight: 800; padding: 6px 0; }
.amt-in:focus-within { border-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.hint b { color: var(--in); }

.toasts { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + var(--safe-b)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: #2e241b; border: 1px solid var(--border); color: var(--text); padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: up .2s; max-width: 420px; text-align: center; }
.toast.err { border-color: rgba(255,107,107,.5); color: #ffb3b3; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .app { padding-left: 92px; }
  .tabs {
    top: 0; right: auto; width: 92px; height: auto; flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 86px 0 20px; border-top: 0; border-right: 1px solid var(--border);
  }
  .tabs a, .tabs button { flex: none; height: 66px; font-size: 11.5px; }
  .tabs a:hover { color: var(--text); }
  .tabs .tab-add { order: -1; margin-bottom: 10px; }
  .tabs .tab-add i { margin-top: 0; }
  .bar { padding-left: 24px; padding-right: 24px; }
  .view { padding: 24px 28px 40px; max-width: none; }
  .grid2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
  .tiles { gap: 14px; }
  .tile { padding: 16px; }
  .tile .r { font-size: 14px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .order-foot { flex-direction: row; justify-content: space-between; align-items: center; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--border); max-height: 88vh; }
  .toasts { bottom: 28px; }
}
@media (max-width: 380px) {
  .tiles { gap: 6px; } .tile { padding: 10px 8px; } .tile .r { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Windows contrast themes repaint colours: show the chosen chip / tab with an outline instead */
@media (forced-colors: active) {
  .chip.on, .seg button.on, .colors button.on { outline: 3px solid Highlight; outline-offset: 1px; }
  .tabs a.on { outline: 2px solid Highlight; outline-offset: -6px; }
}

/* Records (30 Oct): All / Income / Expenses tabs + the big total of the open list */
.rec-tabs { margin-bottom: 10px; }
.rec-tabs button { min-height: 48px; font-size: 15px; }
.rec-tabs button.on[data-t="in"] { color: var(--in); }
.rec-tabs button.on[data-t="out"] { color: var(--out); }
.rec-total { border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--border); display: grid; gap: 2px; }
.rec-total small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rec-total b { font-size: 1.7rem; letter-spacing: -.3px; }
.rec-total span { font-size: 12.5px; color: var(--muted); }
.rec-total.in { background: rgba(61,220,132,.08); border-color: rgba(61,220,132,.3); } .rec-total.in b { color: var(--in); }
.rec-total.out { background: rgba(255,138,107,.08); border-color: rgba(255,138,107,.3); } .rec-total.out b { color: var(--out); }

/* To collect (30 Oct): money people still have to give */
.c-warn { color: var(--warn); }
.rec-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 56px; font-size: 12.5px; line-height: 1.15; padding: 4px 2px; }
.rec-tabs button span { font-size: 17px; }
.rec-tabs button.on[data-t="due"] { color: var(--warn); }
.rec-total.owe { background: rgba(255,200,87,.08); border-color: rgba(255,200,87,.32); } .rec-total.owe b { color: var(--warn); }
.due { padding: 12px 0; border-top: 1px solid rgba(58,46,35,.6); cursor: pointer; }
.card > .due:first-child, .due-sum + .due { border-top: 0; }
.due-top { display: flex; align-items: center; gap: 12px; }
.due-top .mid { flex: 1; min-width: 0; }
.due-top .mid b { display: block; font-size: 15px; }
.due-top .mid small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-top .amt { text-align: right; font-weight: 800; font-size: 15.5px; white-space: nowrap; }
.due-top .amt small { display: block; color: var(--faint); font-weight: 600; font-size: 11px; }
.due .tr { height: 6px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin: 8px 0 0; }
.due .tr i { display: block; height: 100%; background: var(--in); border-radius: 9px; }
.due-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.due.done { opacity: .72; }
.due-sum { display: flex; align-items: baseline; gap: 8px; margin: -2px 0 6px; }
.due-sum b { font-size: 1.5rem; }
.due-sum span { color: var(--muted); font-size: 13px; }

/* Coffee (30 Oct): − / + stock steppers, order form */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; flex: none; }
.stepper button { width: 42px; height: 40px; border-radius: 9px; font-size: 22px; font-weight: 800; color: var(--text); background: var(--surface-3); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper b { min-width: 40px; text-align: center; font-size: 1.15rem; }
.srow-acts { display: flex; gap: 18px; padding: 0 0 10px; margin-top: -4px; }
.srow-acts .link { font-size: 12.5px; color: var(--accent); font-weight: 600; padding: 4px 0; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.order-act .btn.danger { padding: 0 12px; }

/* Stock per roast (30 Oct) */
.roast-h { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 2px; padding: 8px 12px; border-radius: 10px; font-weight: 800; font-size: 13.5px; }
.roast-h span { font-weight: 700; font-size: 12px; color: var(--muted); }
.roast-h.medium { background: rgba(201,154,83,.12); color: var(--accent-2); }
.roast-h.dark { background: rgba(255,255,255,.05); color: #e8dccb; }
.stock-p h4 + .roast-h { margin-top: 4px; }

/* Stock in two parts (30 Oct, owner): MEDIUM ROAST / DARK ROAST, long boxes with the packet photo */
.roast-part { border-radius: 20px; padding: 14px; margin-bottom: 16px; border: 1px solid var(--border); }
.roast-part.medium { background: linear-gradient(160deg, rgba(201,154,83,.16), rgba(33,26,20,.94) 55%); border-color: rgba(201,154,83,.45); }
.roast-part.dark { background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(20,16,12,.96) 55%); border-color: #4a4038; }
.roast-top { display: flex; align-items: baseline; gap: 10px; padding: 2px 4px 10px; }
.roast-top .dot { width: 16px; height: 16px; border-radius: 50%; align-self: center; flex: none; }
.roast-part.medium .dot { background: #a0673a; box-shadow: 0 0 0 4px rgba(160,103,58,.25); }
.roast-part.dark .dot { background: #2a1a12; border: 2px solid #6b5444; }
.roast-top h3 { flex: 1; font-size: 1.25rem; letter-spacing: .3px; text-transform: uppercase; }
.roast-part.medium .roast-top h3 { color: var(--accent-2); }
.roast-top b { font-size: 1.5rem; }
.roast-top small { color: var(--muted); font-size: 12.5px; }
/* Beans (whole) / Powder (ground): big and clear (owner, 30 Oct) */
.roast-kind { font-size: 1.2rem; text-transform: uppercase; letter-spacing: .8px; color: var(--text); font-weight: 800; margin: 16px 4px 10px; }
.pack-box { display: flex; align-items: center; gap: 12px; background: rgba(20,16,12,.55); border: 1px solid var(--border); border-radius: 16px; padding: 10px; margin-bottom: 10px; }
.pack-box.is-out { border-color: rgba(255,107,107,.45); }
.pack-img { width: 74px; height: 100px; object-fit: cover; border-radius: 12px; flex: none; background: var(--surface-3); }
.pack-box.is-out .pack-img { filter: grayscale(.8) brightness(.7); }
.pack-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pack-mid b { font-size: 1.3rem; line-height: 1.1; }
.pack-mid small { color: var(--muted); font-size: 12px; }
.pack-acts { display: flex; gap: 14px; margin-top: 2px; }
.pack-acts .link { font-size: 12.5px; color: var(--accent); font-weight: 700; padding: 4px 0; }
.pack-count { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.pack-count button { width: 50px; height: 42px; border-radius: 12px; font-size: 24px; font-weight: 800; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.pack-count button[data-step="1"] { background: rgba(61,220,132,.14); color: var(--in); border-color: rgba(61,220,132,.35); }
.pack-count button[data-step="-1"] { background: rgba(255,138,107,.12); color: var(--out); border-color: rgba(255,138,107,.35); }
.pack-count button:disabled { opacity: .35; cursor: not-allowed; }
.pack-count b { font-size: 1.5rem; min-width: 50px; text-align: center; }
@media (min-width: 900px) {
  .roast-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}
