/* Roti Didi — shared styles. Palette from the master logo (brand/logo.md). */
:root {
  --cream: #FEF7EA;
  --maroon: #4F0000;
  --red: #FC0230;
  --red-ink: #C8001F;     /* red dark enough for text on cream */
  --gold: #F6B000;
  --ink: #191012;
  --muted: #6B5A57;
  --line: #EADFCB;
  --card: #FFFFFF;
  --ok: #1E7A46;
  --ok-bg: #E4F4EA;
  --warn-bg: #FFF1CC;
  --bad-bg: #FFE3E7;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #17100F; --card: #221816; --ink: #F6EDE4; --muted: #BFAEA8; --line: #3A2B28;
    --maroon: #FFD9D3; --red-ink: #FF6B80; --ok: #6FD39A; --ok-bg: #173324; --warn-bg: #3A2F10; --bad-bg: #3D1A1F;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 0 16px 96px; }
.wide { max-width: 1000px; }
header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 10px;
}
.brand { font-weight: 800; font-size: 20px; color: var(--red-ink); letter-spacing: -0.3px; }
.brand small { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 6px; }
.flat { font-weight: 700; color: var(--maroon); }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 24px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 34px; font-weight: 800; letter-spacing: -0.5px; }
button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 12px 16px;
  background: var(--red); color: #fff; cursor: pointer; min-height: 44px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; color: var(--red-ink); border: 1.5px solid var(--line); }
.btn-quiet { background: transparent; color: var(--muted); font-weight: 600; padding: 8px 10px; min-height: 36px; }
.btn-dark { background: var(--ink); color: var(--cream); }
.block { width: 100%; }
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); min-height: 44px;
}
textarea { min-height: 80px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--ink); }
.badge.bad { background: var(--bad-bg); color: var(--red-ink); }
.banner { border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.banner.warn { background: var(--warn-bg); }
.banner.bad { background: var(--bad-bg); color: var(--red-ink); font-weight: 600; }
.center { text-align: center; }
.hidden { display: none !important; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 48px; height: 48px; padding: 0; font-size: 24px; border-radius: 12px; background: var(--ink); color: var(--cream); }
.stepper .val { min-width: 56px; text-align: center; font-size: 28px; font-weight: 800; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); min-height: 38px; padding: 6px 14px; }

/* bottom sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(25,16,18,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--cream); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 18px 16px 24px; max-height: 90vh; overflow: auto; }
.sheet h3 { margin: 0 0 6px; font-size: 20px; }

/* toast + spinner */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--cream);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 40; max-width: 90vw; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { padding: 60px 0; text-align: center; }

/* PIN pad */
.dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0; }
.dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--maroon); }
.dots span.on { background: var(--maroon); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pad button { height: 60px; font-size: 24px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.pad button.k-empty { visibility: hidden; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
