@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Instrument+Sans:wght@400;500;600&display=swap");

:root {
  --paper: #f2f4f1;
  --surface: #ffffff;
  --ink: #10221f;
  --ink-2: #4b5b57;
  --ink-3: #82918d;
  --line: #dfe4e0;
  --petrol: #0e3b43;
  --petrol-2: #175260;
  --petrol-ink: #c9dcdc;
  --marigold: #f5b700;
  --marigold-soft: #fff4cf;
  --volt: #1f4fff;
  --lime: #c8f031;
  --good: #13804f;
  --good-soft: #e2f3ea;
  --bad: #b4372c;
  --bad-soft: #fbe9e7;
  --warn-soft: #fff4cf;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--petrol-2); text-underline-offset: 3px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 40px); background: var(--petrol); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 21px; color: inherit; text-decoration: none; letter-spacing: -0.02em; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--lime); display: grid; place-items: center; flex: none; }
.logo svg { width: 17px; height: 17px; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--petrol-ink); }
.topbar .who { color: #fff; font-weight: 600; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; }

main { max-width: 1160px; margin: 0 auto; padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 40px) 64px; }

/* ---------- buttons ---------- */
button, .btn { font: inherit; font-weight: 600; font-size: 14px; line-height: 1; border-radius: 999px; border: 1px solid transparent; padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn-gold { background: var(--marigold); color: var(--ink); }
.btn-gold:hover { background: #ffc61f; }
.btn-dark { background: var(--petrol); color: #fff; }
.btn-dark:hover { background: var(--petrol-2); }
.btn-line { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--ink-3); }
.btn-line.on-dark { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.btn-line.on-dark:hover { border-color: #fff; }
.btn-text { background: none; padding: 6px 2px; color: var(--petrol-2); border-radius: 6px; }
.btn-text:hover { text-decoration: underline; }
.btn-danger { background: var(--surface); border-color: #efc9c4; color: var(--bad); }
.btn-sm { padding: 8px 13px; font-size: 13px; }
.btn-lg { padding: 15px 28px; font-size: 16px; }
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], select {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus { outline: 2px solid var(--volt); outline-offset: -1px; border-color: transparent; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }
.error { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 1.2em; }

/* switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,34,31,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--volt); outline-offset: 2px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stack > * + * { margin-top: 18px; }

/* ---------- earnings hero (the signature piece) ---------- */
.hero { background: var(--petrol); color: #fff; border-radius: 22px; padding: clamp(22px, 4vw, 36px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 48px); align-items: end; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }
.hero .label { color: var(--petrol-ink); font-size: 15px; }
.amount { font-family: var(--display); font-weight: 800; letter-spacing: -0.035em; line-height: .95; font-size: clamp(54px, 9vw, 88px); margin: 8px 0 18px; font-variant-numeric: tabular-nums; }
.amount .cents { font-size: .45em; letter-spacing: -0.01em; vertical-align: .95em; margin-left: 2px; color: var(--marigold); }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero .note { color: var(--petrol-ink); font-size: 13px; margin-top: 14px; max-width: 46ch; }

.cells { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; align-items: end; height: 132px; }
.cell { background: rgba(245,183,0,.82); border-radius: 4px 4px 2px 2px; min-height: 3px; position: relative; }
.cell.zero { background: rgba(255,255,255,.14); }
.cell.today { background: var(--marigold); box-shadow: 0 0 0 2px rgba(245,183,0,.35); }
.cells-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--petrol-ink); }
.cells-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 14px; color: var(--petrol-ink); }
.cells-title strong { color: #fff; font-family: var(--display); font-size: 20px; font-weight: 700; }

/* ---------- key figures strip ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin: 18px 0; }
.figures > div { padding: 16px 20px; }
.figures > div + div { border-left: 1px solid var(--line); }
.figures .k { font-size: 13px; color: var(--ink-2); }
.figures .v { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.figures .v.voltly { color: var(--volt); }
.figures .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
@media (max-width: 760px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div:nth-child(3) { border-left: none; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- layout grid ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

/* ---------- machine cards ---------- */
.machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.machine { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 34px 1fr; gap: 4px 14px; background: var(--surface); }
.kiosk { grid-row: span 3; width: 34px; height: 56px; border-radius: 7px; background: #fff; border: 1.5px solid var(--ink-3); display: grid; grid-template-rows: repeat(4, 1fr); gap: 3px; padding: 4px; }
.kiosk i { background: var(--ink); border-radius: 2px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.kiosk i::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: var(--lime); }
.machine h3 { font-size: 16px; }
.machine .where { font-size: 13px; color: var(--ink-3); }
.machine dl { margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; grid-column: 1 / -1; }
.machine dt { font-size: 12px; color: var(--ink-3); }
.machine dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.machine .foot { grid-column: 1 / -1; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-3); gap: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-3); padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.strong { font-weight: 600; }
td.voltly { color: var(--volt); }
.empty { color: var(--ink-3); text-align: center; padding: 28px 0 !important; white-space: normal; }

.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.paid { background: var(--good-soft); color: var(--good); }
.tag.ready { background: var(--marigold-soft); color: #7a5b00; }
.tag.back { background: var(--bad-soft); color: var(--bad); }
.tag.off { background: #eef1ef; color: var(--ink-3); }

/* ---------- payout panel ---------- */
.payout-state { display: flex; gap: 12px; align-items: flex-start; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.ok { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.dot.wait { background: var(--marigold); box-shadow: 0 0 0 4px var(--marigold-soft); }
.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.history li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.history li:last-child { border-bottom: none; }
.history { list-style: none; margin: 0; padding: 0; }

/* ---------- notices ---------- */
.notice { border-radius: 14px; padding: 14px 18px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.notice.warn { background: var(--warn-soft); border: 1px solid #f1dc95; }
.notice.ok { background: var(--good-soft); border: 1px solid #b9e0c9; }
.notice.err { background: var(--bad-soft); border: 1px solid #efc9c4; color: var(--bad); }

/* ---------- dialogs ---------- */
dialog { border: none; border-radius: 20px; padding: 0; width: min(720px, 94vw); max-height: 90vh; box-shadow: 0 40px 100px rgba(14,59,67,.35); color: var(--ink); }
dialog::backdrop { background: rgba(14,59,67,.5); }
.dialog-body { padding: 26px; overflow: auto; max-height: calc(90vh - 70px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 26px; border-bottom: 1px solid var(--line); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.close { background: none; border: none; font-size: 24px; line-height: 1; padding: 4px 8px; color: var(--ink-3); border-radius: 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 14px; font-size: 14px; z-index: 50; max-width: min(520px, 92vw); box-shadow: 0 10px 30px rgba(0,0,0,.2); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); background: var(--petrol); }
.login-art { color: #fff; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-art h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 800; letter-spacing: -0.035em; max-width: 13ch; line-height: 1; }
.login-art p { color: var(--petrol-ink); max-width: 42ch; margin-top: 16px; font-size: 16px; }
.stack-art { display: flex; gap: 10px; align-items: flex-end; }
.stack-art span { width: 44px; border-radius: 9px; background: #0a2b31; border: 1px solid rgba(255,255,255,.08); display: flex; justify-content: center; gap: 4px; padding-top: 10px; }
.stack-art span i { width: 5px; height: 5px; border-radius: 50%; background: var(--marigold); }
.login-card { background: var(--surface); padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card form { margin-top: 24px; }
.login-card button[type=submit] { width: 100%; padding: 14px; font-size: 15px; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding-bottom: 8px; }
  .login-art .stack-art { display: none; }
  .login-card { border-radius: 22px 22px 0 0; }
}

/* ---------- admin ---------- */
.reader-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.reader-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; cursor: pointer; margin: 0; color: var(--ink); font-weight: 500; }
.reader-opt:has(input:checked) { border-color: var(--petrol-2); background: #f1f7f7; }
.reader-opt input { margin-top: 3px; accent-color: var(--petrol); }
.reader-opt.taken { opacity: .5; cursor: not-allowed; }
.reader-opt small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 400; }
.linkbox { display: flex; gap: 8px; margin-top: 12px; }
.linkbox input { font-size: 13px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.op-name { font-weight: 600; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.connect-box { margin-top: 8px; min-height: 120px; }

@media (max-width: 640px) { th.opt, td.opt { display: none; } td.machine-col { white-space: normal; min-width: 110px; } td, th { padding-left: 8px; padding-right: 8px; } }
