/* Ștampila: casier la stânga, cardul din wallet la dreapta; paginile publice sunt o singură coloană de telefon */
:root {
  --bg: #F2F4F1; --surface: #FFFFFF; --ink: #17201C; --muted: #5C6963; --line: #DAE1DC;
  --accent: #2747C9; --accent-ink: #FFFFFF; --accent-soft: #E4E9FB;
  --good: #1F7A4D; --good-soft: #DDF1E6; --warn: #9A5A0C; --warn-soft: #F8EBD7; --bad: #B3261E; --chip: #E7ECE8;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0F1412; --surface: #171F1B; --ink: #E7EEEA; --muted: #93A29A; --line: #29342F;
  --accent: #8197FF; --accent-ink: #0C1230; --accent-soft: #1E2645;
  --good: #5CC48E; --good-soft: #17301F; --warn: #E3A653; --warn-soft: #34260F; --bad: #F2867E; --chip: #212B26; color-scheme: dark } }

* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100% }
img { max-width: 100% }
[hidden] { display: none !important }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.15 }
button, input, select, textarea { font: inherit; color: inherit }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }

.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 48px }
.narrow { max-width: 440px }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0 }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 2.5px solid var(--accent); display: grid; place-items: center; color: var(--accent); transform: rotate(-12deg) }
.brand h1 { font-size: 22px; font-weight: 700 }
.brand small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted) }

nav.tabs { display: flex; gap: 4px; background: var(--chip); padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px }
nav.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap }
nav.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08) }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px }
.stat b { display: block; font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.1 }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.panel h2 { font-size: 18px }
.hint { margin: 0; color: var(--muted); font-size: 13.5px }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0 }

.search { display: flex; gap: 8px; flex-wrap: wrap }
.search input { flex: 1 1 220px; min-width: 0; font-family: var(--font-mono); font-size: 24px; letter-spacing: .12em; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg) }
.search input::placeholder { letter-spacing: .04em; font-family: var(--font-body); font-size: 17px }
#reader { border-radius: 12px; overflow: hidden; background: #000 }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0 }
.field label, .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em }
.field input, .field select, .field textarea { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); width: 100% }
.field textarea { min-height: 90px; resize: vertical }
.row { display: flex; gap: 10px; flex-wrap: wrap }
.row > .field { flex: 1 1 160px }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--muted) }
.check input { margin-top: 3px }

.btn { border: 1.5px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px }
.btn:hover { border-color: var(--muted) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.btn.good { background: var(--good); border-color: var(--good); color: var(--surface) }
.btn.danger { color: var(--bad) }
.btn.big { padding: 14px 20px; font-size: 17px }
.btn.block { width: 100% }
.btn:disabled { opacity: .45; cursor: not-allowed }
/* Butoanele Wallet rămân negre în ambele teme, cum le cer Apple și Google */
.btn.wallet-btn { background: #000000; border-color: #000000; color: #FFFFFF; padding: 13px 18px; font-size: 16px; width: 100% }

.results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.results button { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 14px; cursor: pointer }
.results button:last-child { border-bottom: 0 }
.results button:hover { background: var(--accent-soft) }
.meta { color: var(--muted); font-size: 13px }
.mono { font-family: var(--font-mono); letter-spacing: .06em }

.chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--chip); color: var(--muted); white-space: nowrap }
.chip.good { background: var(--good-soft); color: var(--good) }
.chip.warn { background: var(--warn-soft); color: var(--warn) }

.customer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap }
.customer-head h3 { font-size: 22px }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px }
.facts div { background: var(--bg); border-radius: 10px; padding: 8px 10px; min-width: 0 }
.facts b { display: block; font-variant-numeric: tabular-nums }
.facts span { font-size: 12px; color: var(--muted) }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: end }
.actions .field { flex: 0 1 140px }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg) }
.stepper button { border: 0; background: transparent; width: 38px; height: 40px; cursor: pointer; font-size: 18px; font-weight: 700 }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums }
.notice { border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px }
.notice.warn { background: var(--warn-soft); color: var(--warn) }
.notice.good { background: var(--good-soft); color: var(--good) }
.notice.bad { background: var(--warn-soft); color: var(--bad) }
.history { margin: 0; padding: 0; list-style: none; font-size: 13.5px; max-height: 220px; overflow: auto }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line) }
.history li span:last-child { color: var(--muted); white-space: nowrap; text-align: right }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 14px }

/* Cardul din wallet */
.pass-holder { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); display: flex; flex-direction: column; gap: 10px; align-items: center }
.pass { width: 100%; max-width: 360px; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px -18px rgb(0 0 0 / .45), 0 2px 6px rgb(0 0 0 / .12) }
.pass-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; gap: 10px }
.pass-logo { display: flex; align-items: center; gap: 10px; min-width: 0 }
.pass-logo i { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-family: var(--font-display); font-weight: 700; font-size: 18px }
.pass-logo b { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pass-label { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .72 }
.pass-val { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums }
.pass-strip { padding: 14px 16px; display: grid; gap: 8px; justify-content: center }
.stamp { width: 100%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center }
.stamp svg { width: 58%; height: 58% }
.stamp.on { animation: thump .35s ease-out both }
@keyframes thump { from { transform: scale(1.35) rotate(-14deg); opacity: .2 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .stamp.on { animation: none } }
.pass-fields { display: flex; justify-content: space-between; padding: 6px 16px 12px; gap: 12px }
.pass-fields > div { min-width: 0 }
.pass-fields > div:last-child { text-align: right; flex: none }
.pass-fields .pass-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.pass-reward { padding: 0 16px 14px; font-size: 13px; opacity: .9 }
.pass-qr { background: #FFFFFF; color: #111111; margin: 0 auto 16px; width: 170px; border-radius: 10px; padding: 8px 8px 6px; text-align: center }
.pass-qr img { display: block; width: 100%; height: auto; aspect-ratio: 1 }
.pass-qr div { font-family: var(--font-mono); font-size: 13px; letter-spacing: .16em; padding-top: 2px }
.pass-note { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 340px; margin: 0 }

table { width: 100%; border-collapse: collapse; font-size: 14px }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap }
td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums }
tbody tr.click { cursor: pointer }
tbody tr.click:hover { background: var(--accent-soft) }
.tablewrap { overflow-x: auto }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between }
.toolbar input[type="search"] { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; flex: 1 1 200px }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer }
.swatches button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px }
.swatches input[type="color"] { width: 40px; height: 34px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); padding: 2px }
.icons { display: flex; gap: 8px; flex-wrap: wrap }
.icons button { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; display: grid; place-items: center }
.icons button svg { width: 22px; height: 22px }
.icons button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft) }
input[type="range"] { accent-color: var(--accent); width: 100% }

.copyline { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 12px }
.copyline code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 13px }
.qr-big { width: 220px; max-width: 100%; background: #fff; border-radius: 12px; padding: 10px }

.auth { min-height: 100%; display: grid; place-items: center }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); text-align: center }

@media (max-width: 900px) {
  .grid2 { grid-template-columns: minmax(0, 1fr) }
  .pass-holder { position: static }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 460px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
