/* Dizzee-Go demo · shared styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --red: #d7262e;
  --red-dark: #b01c23;
  --red-soft: #fdecec;
  --yellow: #ffc20e;
  --yellow-soft: #fff6d9;
  --teal: #0f6e66;
  --teal-soft: #e3f2ef;
  --ink: #17181c;
  --ink-2: #4b4d55;
  --ink-3: #80838c;
  --line: #e7e5e0;
  --line-2: #f0eeea;
  --bg: #f7f6f3;
  --card: #ffffff;
  --ok: #138a4b;
  --ok-soft: #e4f5ec;
  --warn: #a86400;
  --warn-soft: #fff3dc;
  --bad: #c62828;
  --bad-soft: #fdeaea;
  --info: #2a62c9;
  --info-soft: #e8effc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .05), 0 4px 16px rgba(20, 20, 30, .05);
  --shadow-lg: 0 10px 40px rgba(20, 20, 30, .16);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Poppins', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--bg);
}
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
p { margin: 0; }
a { color: var(--red); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, opacity .15s;
}
.btn:hover { border-color: #d3d0c8; background: #fbfaf8; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #2b2d33; border-color: #2b2d33; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0f7640; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 52px; font-size: 16px; padding: 0 24px; }
.btn-block { width: 100%; }

/* ---------- Cards, badges, chips ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--red-soft); color: var(--red); }
.badge.gold { background: var(--yellow-soft); color: #8a6200; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-weight: 500; font-size: 14px; color: var(--ink-2);
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .count { font-size: 12px; opacity: .7; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 11px; border: 1px solid #dcd9d2; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 88px; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,24,28,.08); }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(198,40,40,.1); }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix { display: flex; align-items: center; padding: 0 12px; border: 1px solid #dcd9d2; border-right: 0; border-radius: 11px 0 0 11px; background: var(--bg); color: var(--ink-2); font-weight: 500; }
.input-group .input { border-radius: 0 11px 11px 0; }
.hint { font-size: 12px; color: var(--ink-3); }
.error-text { font-size: 12px; color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* segmented control */
.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* quantity stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.qty button { width: 38px; height: 38px; border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--ink); }
.qty button:hover { background: var(--line-2); }
.qty button:disabled { color: #c9c6be; cursor: default; background: transparent; }
.qty span { min-width: 30px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Brand top bar ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 64px; }
.topbar .logo { height: 44px; width: auto; }
.topbar .brand-sub { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.topbar .brand-name { font-family: var(--font-head); font-weight: 600; font-size: 15px; line-height: 1.2; }

/* demo pill that returns to the hub */
.demo-pill {
  position: fixed; left: 14px; bottom: 14px; z-index: 60; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 999px; background: rgba(23,24,28,.88); color: #fff; font-size: 12px; font-weight: 600;
  backdrop-filter: blur(6px); box-shadow: var(--shadow-lg);
}
.demo-pill:hover { background: var(--ink); }
body.has-bottom-bar .demo-pill { bottom: 96px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: toastIn .25s ease-out; pointer-events: auto;
}
.toast.ok { background: #0f5132; } .toast.bad { background: #8e1c1c; } .toast.wa { background: #075e54; }
.toast .ti { font-size: 16px; line-height: 1.3; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal & drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,15,20,.45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.drawer-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(15,15,20,.35); animation: fade .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; overflow: auto; box-shadow: var(--shadow-lg); animation: slideIn .25s ease-out; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { position: sticky; top: 0; background: #fff; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--line-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fcfbf9; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table tbody tr:hover { background: #faf9f6; }
.table .r { text-align: right; }

/* ---------- Key-value list ---------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; text-align: right; }

/* ---------- QR ---------- */
.qr { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }

/* ---------- Phone mock ---------- */
.phone { width: 320px; max-width: 100%; border-radius: 38px; background: #111; padding: 12px; box-shadow: var(--shadow-lg); }
.phone-screen { border-radius: 28px; overflow: hidden; background: #efe7de; height: 600px; display: flex; flex-direction: column; }
.wa-head { background: #075e54; color: #fff; display: flex; align-items: center; gap: 10px; padding: 34px 14px 12px; }
.wa-avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.wa-avatar img { width: 34px; }
.wa-body { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; overflow: auto;
  background-color: #efe7de; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.wa-msg { align-self: flex-start; max-width: 86%; background: #fff; border-radius: 0 10px 10px 10px; padding: 8px 10px 6px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-msg .time { display: block; text-align: right; font-size: 10.5px; color: #8a8f94; margin-top: 3px; }
.wa-msg .wa-btn { display: block; margin: 8px -10px -6px; border-top: 1px solid #eee; padding: 9px; text-align: center; color: #0a7cff; font-weight: 600; cursor: pointer; }
.wa-day { align-self: center; background: #e1f2fb; color: #54656f; font-size: 11px; padding: 4px 10px; border-radius: 8px; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(19,138,75,.5); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(19,138,75,.45); } 70% { box-shadow: 0 0 0 8px rgba(19,138,75,0); } 100% { box-shadow: 0 0 0 0 rgba(19,138,75,0); } }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--red); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-ring { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto; animation: pop .3s ease-out; }

/* chart tooltip (shared) */
.viz-tip { position: fixed; z-index: 300; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12.5px; min-width: 150px; display: none; }
.viz-tip .t { font-weight: 600; margin-bottom: 6px; }
.viz-tip .l { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.viz-tip .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }

@media print {
  .no-print, .demo-pill, .topbar { display: none !important; }
  body { background: #fff; }
}

@media (max-width: 560px) {
  .topbar .badge { display: none; }
  .topbar .logo { height: 38px; }
  .topbar .brand-sub { font-size: 11px; }
}
