/* ============================================================
   TAPKA APP: style.css
   Black and white Tapka look, built for phones first.
   Change the colours here and the whole app follows.
   ============================================================ */
 
:root {
  --black: #000000;
  --white: #ffffff;
  --bg: #f4f4f2;
  --card: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --line: #e2e2df;
  --green: #1a7f37;
  --green-bg: #e6f4ea;
  --red: #b42318;
  --red-bg: #fdecea;
  --amber: #8a5a00;
  --amber-bg: #fff4dc;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
 
* { box-sizing: border-box; }
 
html, body { margin: 0; }
 
body {
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  /* subtle hexagon net, like the website */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath fill='none' stroke='%23000' stroke-opacity='0.04' d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/svg%3E");
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
 
[hidden] { display: none !important; }
 
a { color: inherit; }
 
h1 { font-size: 1.5rem; margin: 0.4em 0; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; margin: 0 0 0.6em; }
 
.muted { color: var(--muted); }
.error { color: var(--red); margin: 0.5em 0 0; }
.warning { color: var(--amber); background: var(--amber-bg); padding: 8px 10px; border-radius: 8px; margin: 0; font-size: 0.9rem; }
 
/* ---------- logo ---------- */
.logo {
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--black);
}
.logo.small { font-size: 1.4rem; }
.logo-tag {
  font-size: 0.45em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--black);
  color: var(--white);
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: middle;
}
 
/* ---------- screens ---------- */
.screen { min-height: 100vh; }
.center-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
  gap: 8px;
}
.center-screen > * { max-width: 420px; width: 100%; }
.center-screen .logo { width: auto; }
 
/* ---------- cards & forms ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 12px 0;
}
 
.form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
 
input, select, textarea {
  font: inherit;
  font-size: 16px; /* 16px stops iPhone from zooming in */
  color: var(--text);
  background: var(--white);
  border: 1px solid #cfcfcb;
  border-radius: 10px;
  padding: 11px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--black); outline-offset: 1px; }
textarea { min-height: 70px; resize: vertical; }
 
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > label { flex: 1 1 160px; }
.row.buttons > * { flex: 1 1 auto; }
 
/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--white);
  background: var(--black);
  border: 1px solid var(--black);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  min-height: 44px;
}
.btn:disabled { opacity: 0.5; cursor: wait; }
.btn.ghost { background: var(--white); color: var(--black); }
.btn.danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 0.85rem; }
.btn.big { min-height: 54px; font-size: 1.05rem; }
 
button.link, .link {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
 
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cfcfcb;
  background: var(--white);
  cursor: pointer;
}
.chip.active { background: var(--black); color: var(--white); border-color: var(--black); }
 
/* ---------- fallback page ---------- */
.cta { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.cta h2 { margin: 0; }
.cta p { margin: 0; color: var(--muted); }
.staff-note { background: var(--amber-bg); color: var(--amber); padding: 10px 12px; border-radius: 10px; font-size: 0.9rem; }
.tiny-link { font-size: 0.9rem; color: #444; margin-top: 24px; }
 
/* ---------- loading spinner ---------- */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
 
/* ---------- admin layout ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; gap: 14px; align-items: center; font-weight: 600; font-size: 0.95rem; }
.topbar nav a { text-decoration: none; color: var(--muted); }
.topbar nav a.active { color: var(--black); text-decoration: underline; text-underline-offset: 4px; }
 
.admin-main { max-width: 900px; margin: 0 auto; padding: 12px 16px 60px; }
 
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.toolbar input[type="search"] { flex: 1 1 180px; width: auto; }
.toolbar select { width: auto; flex: 0 1 200px; }
 
.inline-form h2 { margin: 0; }
 
/* ---------- tiles (numbers) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.tile .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.tile .label { font-size: 0.8rem; color: var(--muted); }
 
/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}
a.item:hover, button.item:hover { border-color: #b9b9b5; }
button.item { font: inherit; text-align: left; width: 100%; cursor: pointer; }
.item .main { min-width: 0; flex: 1; }
.item .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .side { text-align: right; flex-shrink: 0; font-size: 0.85rem; }
.item .side strong { font-size: 1.1rem; display: block; }
.item .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.list.compact .item { padding: 9px 12px; }
.list.compact .item.selected { border-color: var(--black); outline: 2px solid var(--black); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
 
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
}
 
.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
}
.pill.active { background: var(--green-bg); color: var(--green); }
.pill.off { background: var(--red-bg); color: var(--red); }
.pill.pro { background: var(--black); color: var(--white); }
 
/* ---------- customer detail ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.product .numbers { font-size: 0.85rem; color: var(--muted); }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.share .url {
  flex: 1 1 100%;
  font-size: 0.85rem;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
}
 
/* ---------- activation done ---------- */
.done { text-align: center; display: flex; flex-direction: column; gap: 10px; }
.done .check {
  width: 64px; height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
}
 
/* ---------- customer stats page ---------- */
.customer-page { max-width: 520px; margin: 0 auto; padding: 28px 16px 40px; }
.customer-page .logo { font-size: 1.6rem; }
.big-number { text-align: center; }
.big-number .value { font-size: 3.4rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.big-number .label { color: var(--muted); font-size: 0.9rem; }
.teaser { background: var(--black); color: var(--white); border-color: var(--black); }
.teaser p { margin: 0; opacity: 0.85; }
.footer { font-size: 0.8rem; text-align: center; margin-top: 28px; }
 
.bar-row {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  border-bottom: 1px solid var(--line);
}
.bar-row .bar {
  flex: 1;
  background: var(--black);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
.bar-row .bar.zero { background: var(--line); }
.chart-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75rem; margin-top: 4px; }
.day-list { margin-top: 10px; font-size: 0.9rem; }
.day-list summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.day-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--line); }
 
/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 50;
  max-width: calc(100% - 32px);
  text-align: center;
}
 
/* ---------- sticker sheet ---------- */
#screen-stickers { background: var(--white); }
.sticker-toolbar {
  position: sticky;
  top: 0;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.sticker-toolbar label { display: flex; flex-direction: column; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.sticker-toolbar input { width: 110px; }
 
.sticker-sheet {
  --size: 30mm;
  display: flex;
  flex-wrap: wrap;
  gap: 3mm;
  padding: 10mm;
  background: var(--white);
}
.sticker {
  width: var(--size);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5mm;
  border: 0.2mm dashed #bbb;
  break-inside: avoid;
  page-break-inside: avoid;
}
.sticker .qr { width: 100%; aspect-ratio: 1; }
.sticker .qr svg { width: 100%; height: 100%; display: block; }
.sticker .sticker-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: calc(var(--size) * 0.11); line-height: 1.1; margin-top: 0.8mm; }
.sticker .sticker-link { font-size: calc(var(--size) * 0.065); color: #333; line-height: 1.1; white-space: nowrap; }
 
@media print {
  /* 10 mm margin on every page, so no printer cuts off a sticker */
  @page { size: A4; margin: 10mm; }
  body { background: var(--white); }
  .no-print, .toast { display: none !important; }
  .sticker-sheet { padding: 0; }
}
 