/* Wok & Flame Cloud's site (website-and-cloud.md §0): the customers' pages and the staff's
   console, in the app's look: the colours of ui-kit/qml/Theme.qml, dark by default as the website
   is. */

:root {
  --chrome: #0F1B2E;
  --surface: #EEF2F7;
  --raised: #FFFFFF;
  --sunken: #E5EAF1;
  --hover: #F6F8FC;
  --text: #0F172A;
  --muted: #64748B;
  --border: #DDE3EC;
  --border-strong: #C6D0DD;
  --accent: #1663F0;
  --accent-pressed: #0E50CC;
  --accent-soft: #E9F1FE;
  --success: #16A34A;
  --success-soft: #E7F7ED;
  --warning: #C26A00;
  --warning-soft: #FEF4E2;
  --danger: #DC2626;
  --danger-soft: #FDEDED;
  --flame: #EA580C;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 18px rgba(15, 23, 42, 0.06);
  --shadow-sheet: 0 18px 48px rgba(15, 23, 42, 0.24);
  --scrim: rgba(15, 23, 42, 0.45);
  --radius: 12px;
  color-scheme: light;
}
:root:not([data-theme="light"]) {
  --chrome: #0A111D;
  --surface: #0E1522;
  --raised: #172134;
  --sunken: #0A101B;
  --hover: #1C283E;
  --text: #E8EDF5;
  --muted: #95A3B8;
  --border: #26334B;
  --border-strong: #34435F;
  --accent: #4C8DFF;
  --accent-pressed: #3A76E3;
  --accent-soft: #1A2B4B;
  --success: #3DD68C;
  --success-soft: #12351F;
  --warning: #F5B342;
  --warning-soft: #392A10;
  --danger: #F87171;
  --danger-soft: #3E1B1C;
  --flame: #FF8A3D;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  --shadow-sheet: 0 18px 48px rgba(0, 0, 0, 0.55);
  --scrim: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--text); background: var(--surface);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .04em; }

/* ---- the bar at the top ---- */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px;
  height: 60px; padding: 0 20px; background: var(--chrome); color: #fff;
}
.bar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.bar .brand img { height: 26px; }
.bar .brand .amp { color: #FF8A3D; }
.bar nav { display: flex; gap: 2px; margin-left: 12px; }
.bar nav button {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 0; border-radius: 9px;
  background: none; color: #A7B4C8; font-weight: 600; cursor: pointer;
}
.bar nav button:hover, .bar nav button[aria-current="page"] { background: #1C2A43; color: #fff; }
.bar .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bar .who { color: #A7B4C8; font-size: 14px; }
.bar .icon-btn {
  min-width: 38px; height: 38px; padding: 0 9px; border-radius: 9px; border: 1px solid #2B3B58; background: none; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; cursor: pointer;
}
.bar .brand .brand-sub { color: #A7B4C8; font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { margin: 0 0 18px; font-size: 26px; letter-spacing: -0.02em; }
h2 { margin: 28px 0 12px; font-size: 18px; }

/* ---- parts ---- */
.card { padding: 20px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--border); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat strong { display: block; font-size: 30px; line-height: 1.1; }
.stat span { color: var(--muted); font-weight: 600; font-size: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--raised); font-weight: 700; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-pressed); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.busy { cursor: progress; }
td.link-cell a { color: inherit; font-weight: 600; }
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.wide { width: 100%; }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--hover); }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill.valid, .pill.waiting, .pill.used { background: var(--success-soft); color: var(--success); }
.pill.ending, .pill.grace, .pill.later { background: var(--warning-soft); color: var(--warning); }
.pill.ended, .pill.suspended, .pill.revoked, .pill.expired, .pill.off { background: var(--danger-soft); color: var(--danger); }
.pill.confirmed { background: var(--success-soft); color: var(--success); }
.pill.unconfirmed { background: var(--warning-soft); color: var(--warning); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label.field input, label.field select, label.field textarea {
  height: 42px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 400;
}
label.field textarea { height: 84px; padding: 10px 12px; resize: vertical; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.error { margin-top: 10px; padding: 10px 12px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.code-shown { font-size: 26px; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 16px; border-radius: 12px; background: var(--sunken); }
.secret { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.note p { margin: 0; }
.stack > * + * { margin-top: 14px; }
.spaced { margin-top: 14px; }
.search { height: 40px; min-width: 280px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--raised); }

/* ---- sign in ---- */
.sign-in {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 80% -10%, rgba(242, 73, 59, 0.16), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(42, 116, 255, 0.14), transparent 60%), var(--chrome);
}
.sign-in .card { width: min(420px, 100%); }
.sign-in .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 20px; font-weight: 800; }
.sign-in .brand img { height: 32px; }
.sign-in .brand .amp { color: var(--flame); }
.sign-in .brand .brand-sub { color: var(--muted); font-weight: 600; }

/* ---- the customers' pages before signing in ---- */
.sign-in .card.door { width: min(480px, 100%); }
.door h1 { margin: 2px 0 4px; font-size: 22px; }
.door .links { margin: 14px 0 0; color: var(--muted); }
.door-more { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.door-more p { margin: 0 0 12px; }
.files { display: flex; flex-direction: column; gap: 12px; }
.file { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 10px; background: var(--sunken); }
.file-text { min-width: 0; }
.file .sum { margin-top: 4px; font-size: 11px; color: var(--muted); word-break: break-all; letter-spacing: 0; }
.flush { margin: 0; }
.card > p.flush + form { margin-top: 14px; }
/* A wide table scrolls inside its card on a phone. */
.card:has(> table) { overflow-x: auto; }
.card > table { min-width: 620px; }
.bar .brand { white-space: nowrap; }
.till-address { padding: 12px 14px; border-radius: 10px; background: var(--sunken); }
.till-address strong { display: block; margin-top: 2px; font-size: 17px; overflow-wrap: anywhere; }
.store-name { font-size: 18px; }

/* ---- a sheet over the page ---- */
.scrim { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: var(--scrim); }
.sheet { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 24px; border-radius: 16px; background: var(--raised); box-shadow: var(--shadow-sheet); }
.sheet h2 { margin-top: 0; }

@media (max-width: 860px) {
  .stats, .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar nav button span { display: none; }
  .bar .who { display: none; }
}
@media (max-width: 560px) {
  .stats, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .bar nav + .end .who, .bar:has(nav) .brand > span { display: none; }
  .bar:has(nav) { gap: 6px; }
  .bar nav { margin-left: 0; }
  .bar nav button { padding: 0 9px; }
  .bar:has(nav) .icon-btn .label { display: none; }
  .file { flex-direction: column; align-items: stretch; }
  .bar { padding: 0 12px; gap: 10px; }
}
