/* WhatsApp Digital Loyalty & Coupon Framework — UI */
:root {
  --ink: #14201b;
  --ink-2: #4a5852;
  --ink-3: #7b8781;
  --canvas: #f4f6f5;
  --paper: #ffffff;
  --line: #e2e7e4;
  --line-2: #eef1ef;
  --wa: #059669;
  --wa-dark: #047857;
  --wa-soft: #e7f6ef;
  --pt: #ea580c;
  --pt-soft: #fff1e8;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #b45309;
  --amber-soft: #fef5e4;
  --blue: #2563eb;
  --blue-soft: #eaf1fe;
  --violet: #7c3aed;
  --violet-soft: #f2edfe;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 32, 27, .05), 0 4px 16px rgba(20, 32, 27, .04);
  --sidebar: 256px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand: #059669;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.num, .money, table td.r { font-variant-numeric: tabular-nums; }
a { color: var(--wa-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--wa); outline-offset: 2px; border-radius: 6px; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.9; vertical-align: -3px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.hide { display: none !important; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; letter-spacing: .02em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--paper); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 14px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--wa); color: #fff; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand b { display: block; font-size: 14px; line-height: 1.2; }
.brand span { font-size: 11.5px; color: var(--ink-3); }
.biz-switch { margin: 4px 14px 10px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; display: flex; gap: 10px; align-items: center; cursor: pointer; background: var(--paper); width: calc(100% - 28px); text-align: left; font: inherit; color: inherit; }
.biz-switch:hover { border-color: #c9d2cd; }
.biz-emoji { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; flex: none; }
.biz-switch .t { flex: 1; min-width: 0; }
.biz-switch .t b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-switch .t span { font-size: 11.5px; color: var(--ink-3); }
.nav { padding: 4px 10px 16px; flex: 1; }
.nav-group { font-size: 11.5px; color: var(--ink-3); padding: 14px 10px 5px; font-weight: 600; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: var(--canvas); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--ink); color: #fff; }
.nav a.active [data-lucide] { color: #fff; }
.nav a [data-lucide] { color: var(--ink-3); width: 17px; height: 17px; }
.nav a .pill { margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: var(--wa-soft); color: var(--wa-dark); font-weight: 600; }
.nav a.active .pill { background: rgba(255,255,255,.18); color: #fff; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--canvas); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--ink-2); flex: none; }
.side-foot .who { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.3; }
.side-foot .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .sub { color: var(--ink-3); font-size: 12.5px; }
.topbar .spacer { flex: 1; }
.btn.menu-btn { display: none; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.app-footer { margin-top: auto; padding: 16px 28px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }
.app-footer a { color: var(--wa-dark); font-weight: 600; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.contact-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; padding: 9px 16px; background: var(--wa); color: #fff; font-size: 13px; text-align: center; }
.contact-bar a { color: #fff; font-weight: 700; text-decoration: underline; }
.contact-bar [data-lucide] { width: 16px; height: 16px; }
.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.how li { display: flex; gap: 11px; align-items: flex-start; }
.how-n { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--wa-soft); color: var(--wa-dark); }
.how-n [data-lucide] { width: 17px; height: 17px; }
.how b { font-size: 13.5px; }
.how p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.how-card { margin-bottom: 16px; }
.how-card summary { list-style: none; cursor: pointer; padding-bottom: 15px; }
.how-card summary::-webkit-details-marker { display: none; }
.how-card summary h3 { display: inline-flex; gap: 7px; align-items: center; }
.how-card summary .right [data-lucide] { transition: transform .15s; }
.how-card[open] summary { padding-bottom: 0; }
.how-card[open] summary .right [data-lucide] { transform: rotate(180deg); }
.login-art .how-title { font-size: 15px; font-weight: 700; margin: 28px 0 12px; color: #fff; }
.login-art .how { grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.login-art .how-n { background: rgba(110,231,183,.12); color: #6ee7b7; }
.login-art .how b { color: #fff; }
.login-art .how p { color: #a8b8b0; margin: 3px 0 0; font-size: 12.5px; max-width: none; }
.demo-strip { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); background: var(--amber-soft); border: 1px solid #f6e2bc; border-radius: 99px; padding: 4px 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--ink-3); }
.status-dot.on { background: var(--wa); box-shadow: 0 0 0 3px var(--wa-soft); }
.status-dot.off { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* ---------- primitives ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px 0; flex-wrap: wrap; }
.card-h h3 { font-size: 14.5px; font-weight: 700; }
.card-h .hint { color: var(--ink-3); font-size: 12.5px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 16px 18px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1fr) 380px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 7px 13px; border-radius: 9px; font: 600 13px var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--canvas); border-color: #cbd3ce; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn [data-lucide] { width: 16px; height: 16px; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #26352e; border-color: #26352e; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); border-color: var(--wa-dark); }
.btn-pt { background: var(--pt); border-color: var(--pt); color: #fff; }
.btn-pt:hover { background: #c2410c; border-color: #c2410c; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #f3c3c3; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: 11px; }
.btn-ghost { border-color: transparent; background: transparent; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font: 13.5px var(--font); color: var(--ink); background: var(--paper); }
.input:focus { outline: none; border-color: var(--wa); box-shadow: 0 0 0 3px var(--wa-soft); }
textarea.input { resize: vertical; min-height: 70px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 11.5px; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--wa); width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font-size: 12.5px; background: var(--paper); cursor: pointer; font-family: var(--font); color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: inline-flex; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font: 600 12.5px var(--font); color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--canvas); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-green { background: var(--wa-soft); color: var(--wa-dark); }
.b-red { background: var(--red-soft); color: #b91c1c; }
.b-amber { background: var(--amber-soft); color: var(--amber); }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.b-orange { background: var(--pt-soft); color: #c2410c; }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.b-gray { background: var(--canvas); color: var(--ink-3); }
.pts { color: var(--pt); font-weight: 700; }
.pts-neg { color: var(--ink-3); font-weight: 700; }
.alert { border-radius: 11px; padding: 11px 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.alert [data-lucide] { flex: none; margin-top: 1px; }
.alert-warn { background: var(--amber-soft); border-color: #f4ddb0; color: #7c4a06; }
.alert-info { background: var(--blue-soft); border-color: #cfdcfb; color: #1e3a8a; }
.alert-ok { background: var(--wa-soft); border-color: #bfe6d4; color: #065f46; }
.alert-err { background: var(--red-soft); border-color: #f5c6c6; color: #991b1b; }
.empty { text-align: center; padding: 34px 16px; color: var(--ink-3); }
.empty [data-lucide] { width: 28px; height: 28px; margin-bottom: 6px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 7px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-weight: 500; }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfa; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: #f8faf9; }
table.t .r { text-align: right; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--ink-3); font-size: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .input { width: auto; min-width: 140px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.toolbar .search input { padding-left: 33px; }
.toolbar .search [data-lucide] { position: absolute; left: 10px; top: 9px; color: var(--ink-3); width: 16px; height: 16px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px 15px; cursor: default; position: relative; }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: #c8d1cc; }
.kpi .lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.kpi .lbl [data-lucide] { width: 15px; height: 15px; }
.kpi .val { font-size: 25px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.wa .lbl [data-lucide] { color: var(--wa); }
.kpi.pt .lbl [data-lucide] { color: var(--pt); }
.kpi.pt .val { color: var(--pt); }
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 200px; }

/* ---------- WhatsApp simulator ---------- */
.wa-shell { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 60px - 48px - 46px); min-height: 560px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
.wa-list { border-right: 1px solid #e9edef; display: flex; flex-direction: column; min-height: 0; }
.wa-list-h { background: #f0f2f5; padding: 10px 14px; display: flex; align-items: center; gap: 10px; height: 59px; }
.wa-list-h .botav { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: #fff; }
.wa-list-h b { font-size: 14px; display: block; line-height: 1.2; }
.wa-list-h span { font-size: 11.5px; color: #667781; }
.wa-search { padding: 7px 12px; border-bottom: 1px solid #e9edef; }
.wa-search input { width: 100%; border: 0; background: #f0f2f5; border-radius: 8px; padding: 8px 12px 8px 34px; font: 13px var(--font); }
.wa-search { position: relative; }
.wa-search [data-lucide] { position: absolute; left: 22px; top: 15px; width: 15px; height: 15px; color: #8696a0; }
.wa-convs { overflow-y: auto; flex: 1; }
.wa-conv { display: flex; gap: 12px; padding: 0 0 0 13px; cursor: pointer; align-items: center; }
.wa-conv:hover { background: #f5f6f6; }
.wa-conv.on { background: #f0f2f5; }
.wa-conv .av { width: 46px; height: 46px; border-radius: 50%; background: #dfe5e7; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.wa-conv .body { flex: 1; min-width: 0; border-bottom: 1px solid #e9edef; padding: 11px 14px 11px 0; }
.wa-conv .top { display: flex; justify-content: space-between; gap: 8px; }
.wa-conv .name { font-size: 15px; color: #111b21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv .time { font-size: 11.5px; color: #667781; flex: none; }
.wa-conv .prev { font-size: 13px; color: #667781; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-conv .phone { font-size: 11.5px; color: #8696a0; }
.wa-section { font-size: 12px; color: var(--wa-dark); padding: 12px 16px 4px; font-weight: 600; }
.wa-chat { display: flex; flex-direction: column; min-height: 0; background: #efeae2; position: relative; }
.wa-chat::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; pointer-events: none; }
.wa-chat-h { background: #f0f2f5; height: 59px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-left: 1px solid #e9edef; position: relative; z-index: 1; }
.wa-chat-h .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; }
.wa-chat-h b { font-size: 15px; font-weight: 600; display: block; line-height: 1.25; color: #111b21; }
.wa-chat-h span { font-size: 12.5px; color: #667781; }
.wa-chat-h .tools { margin-left: auto; display: flex; gap: 6px; }
.wa-msgs { flex: 1; overflow-y: auto; padding: 18px 7% 12px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; }
.wa-day { align-self: center; background: #fff; color: #54656f; font-size: 12px; padding: 5px 12px; border-radius: 8px; margin: 10px 0; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.bubble { max-width: min(78%, 520px); padding: 6px 9px 8px; border-radius: 8px; font-size: 14.2px; line-height: 1.42; color: #111b21; box-shadow: 0 1px .5px rgba(11,20,26,.13); position: relative; word-wrap: break-word; white-space: normal; }
.bubble .meta { float: right; font-size: 11px; color: #667781; margin: 6px 0 -4px 12px; display: inline-flex; gap: 3px; align-items: center; }
.bubble .meta [data-lucide] { width: 15px; height: 15px; color: #53bdeb; }
.bubble.in { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 0; }   /* customer (right) */
.bubble.out { align-self: flex-start; background: #fff; border-top-left-radius: 0; }  /* bot (left) */
.bubble.gap { margin-top: 8px; }
.bubble.typing { color: #667781; font-style: italic; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8696a0; margin-right: 3px; animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.verify-chip { align-self: center; background: #fff8e1; border: 1px solid #f3dfa4; color: #7c5a05; font-size: 12px; border-radius: 8px; padding: 6px 12px; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.verify-chip .spin { width: 12px; height: 12px; border: 2px solid #e7c76a; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wa-compose { background: #f0f2f5; padding: 8px 12px; display: flex; gap: 8px; align-items: center; position: relative; z-index: 1; }
.wa-compose input { flex: 1; border: 0; border-radius: 8px; padding: 10px 14px; font: 14.5px var(--font); background: #fff; }
.wa-compose input:focus { outline: 2px solid var(--wa-soft); }
.wa-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: #54656f; cursor: pointer; }
.wa-icon:hover { background: rgba(0,0,0,.05); }
.wa-send { background: var(--wa); color: #fff; }
.wa-send:hover { background: var(--wa-dark); }
.wa-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; background: #f0f2f5; position: relative; z-index: 1; }
.wa-quick button { border: 1px solid #d1d7db; background: #fff; border-radius: 99px; font: 600 12px var(--font); padding: 4px 11px; cursor: pointer; color: #3b4a54; }
.wa-quick button:hover { border-color: var(--wa); color: var(--wa-dark); }
.wa-empty { flex: 1; display: grid; place-items: center; text-align: center; color: #667781; position: relative; z-index: 1; padding: 30px; }
.wa-empty .ic { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin: 0 auto 12px; color: var(--wa); }
.wa-back { display: none; }
.attach-menu { position: absolute; bottom: 62px; left: 12px; background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(11,20,26,.18); padding: 8px; width: 330px; z-index: 5; max-height: 380px; overflow-y: auto; }
.attach-menu h5 { font-size: 12px; color: #667781; margin: 4px 8px 6px; font-weight: 600; }
.attach-item { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; cursor: pointer; }
.attach-item:hover { background: #f5f6f6; }
.attach-item .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pt-soft); color: var(--pt); flex: none; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.prod { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--paper); cursor: pointer; text-align: left; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 4px; transition: border-color .12s, transform .08s; }
.prod:hover { border-color: var(--ink-3); }
.prod:active { transform: scale(.98); }
.prod .em { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.prod b { font-size: 13.5px; line-height: 1.3; }
.prod .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.prod .cat { font-size: 11.5px; color: var(--ink-3); }
.cart { position: sticky; top: 76px; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; }
.qty button { border: 0; background: transparent; width: 28px; height: 28px; cursor: pointer; font-size: 15px; color: var(--ink-2); }
.qty span { min-width: 22px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals { font-size: 13.5px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 20px; font-weight: 800; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pay-methods button { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 4px; font: 600 12px var(--font); cursor: pointer; color: var(--ink-2); }
.pay-methods button.on { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ---------- Receipt (the memorable piece) ---------- */
.receipt-wrap { display: flex; justify-content: center; padding: 6px 0 4px; }
.receipt { width: 320px; background: #fffefb; color: #1d1d1b; font-family: "Courier Prime", ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.45; padding: 22px 20px 26px; position: relative; box-shadow: 0 10px 30px rgba(20,32,27,.12), 0 1px 3px rgba(20,32,27,.08); }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px; background: linear-gradient(-45deg, transparent 6px, #fffefb 0) 0 0 / 12px 10px, linear-gradient(45deg, transparent 6px, #fffefb 0) 0 0 / 12px 10px; background-repeat: repeat-x; filter: drop-shadow(0 3px 2px rgba(20,32,27,.06)); }
.receipt .c { text-align: center; }
.receipt .logo { font-size: 30px; line-height: 1; }
.receipt .merchant { font-family: var(--font); font-weight: 800; font-size: 16px; letter-spacing: -.01em; margin-top: 4px; }
.receipt .rule { border-top: 1px dashed #b9b6ac; margin: 9px 0; }
.receipt .ln { display: flex; justify-content: space-between; gap: 10px; }
.receipt .ln span:last-child { text-align: right; white-space: nowrap; }
.receipt .tot { font-weight: 700; font-size: 14px; }
.receipt .qr { width: 168px; height: 168px; margin: 8px auto 4px; background: #fff; padding: 6px; }
.receipt .qr svg { width: 100%; height: 100%; display: block; }
.receipt .token { font-weight: 700; font-size: 14.5px; letter-spacing: .06em; }
.receipt .stamp { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 3px solid var(--red); color: var(--red); font: 800 22px var(--font); padding: 4px 14px; border-radius: 8px; opacity: .78; background: rgba(255,255,255,.5); }
.receipt .stamp.ok { border-color: var(--wa); color: var(--wa); }

/* ---------- Coupon ---------- */
.coupon { display: grid; grid-template-columns: 1fr 112px; border-radius: 16px; overflow: hidden; color: #fff; position: relative; min-height: 150px; box-shadow: 0 8px 24px rgba(20,32,27,.12); }
.coupon .main { padding: 16px 18px; background: var(--c, var(--pt)); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.coupon .main .biz { font-size: 12px; opacity: .9; font-weight: 600; }
.coupon .main .name { font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.coupon .main .ben { font-size: 13.5px; opacity: .95; }
.coupon .main .terms { margin-top: auto; font-size: 11.5px; opacity: .85; }
.coupon .stub { background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-left: 2px dashed rgba(20,32,27,.18); position: relative; }
.coupon .stub::before, .coupon .stub::after { content: ""; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--canvas); }
.coupon .stub::before { top: -8px; } .coupon .stub::after { bottom: -8px; }
.coupon .stub svg { width: 84px; height: 84px; }
.coupon .stub .code { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; font-weight: 700; text-align: center; word-break: break-all; }
.coupon.dim { filter: grayscale(.85); opacity: .7; }

/* ---------- misc ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,32,27,.42); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--paper); border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s; }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1100px; }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-h h3 { font-size: 16px; flex: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 11px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; display: flex; gap: 9px; align-items: flex-start; animation: pop .2s; }
.toast.err { background: #7f1d1d; }
.toast.ok [data-lucide] { color: #6ee7b7; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 11px 12px; font: 600 13px var(--font); color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--ink); }
.progress { height: 8px; background: var(--canvas); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--pt); border-radius: 99px; transition: width .4s; }
.stampcard { display: flex; gap: 6px; flex-wrap: wrap; }
.stampcard i { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed #e7c9b3; display: grid; place-items: center; font-style: normal; font-size: 13px; }
.stampcard i.on { border: 2px solid var(--pt); background: var(--pt-soft); }
.loading { padding: 50px; text-align: center; color: var(--ink-3); }
.loading .spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--wa); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
.code-block { background: #0f1a15; color: #d1fae5; border-radius: 10px; padding: 12px 14px; font: 12px/1.55 ui-monospace, Menlo, monospace; overflow-x: auto; white-space: pre; max-height: 320px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--ink); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art h1 { font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; max-width: 14ch; margin-top: auto; }
.login-art p { color: #a8b8b0; max-width: 46ch; font-size: 15px; margin: 14px 0 0; }
.login-flow { display: flex; gap: 10px; margin-top: 34px; flex-wrap: wrap; }
.login-flow span { border: 1px solid rgba(255,255,255,.16); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; color: #d6e2dc; display: inline-flex; gap: 7px; align-items: center; }
.login-flow [data-lucide] { width: 15px; height: 15px; color: #6ee7b7; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form .box { width: 100%; max-width: 420px; }
.acct { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; cursor: pointer; background: #fff; width: 100%; font: inherit; text-align: left; color: inherit; }
.acct:hover { border-color: var(--wa); }
.acct .r { margin-left: auto; }

/* ---------- Journey ---------- */
.journey { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 8px; }
.steps li { display: flex; gap: 11px; padding: 8px 10px; border-radius: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-3); }
.steps li .n { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; background: #fff; }
.steps li.done { color: var(--ink-2); }
.steps li.done .n { background: var(--wa); border-color: var(--wa); color: #fff; }
.steps li.cur { background: var(--canvas); color: var(--ink); font-weight: 600; }
.steps li.cur .n { border-color: var(--ink); color: var(--ink); }
.steps li.fail .n { background: var(--red); border-color: var(--red); color: #fff; }
.jlog { font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.jlog div { display: flex; gap: 8px; }
.jlog .ok { color: var(--wa-dark); }
.jlog .bad { color: var(--red); }
.phone-mini { background: #efeae2; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.phone-mini .bubble { font-size: 13px; max-width: 92%; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side, .pos { grid-template-columns: 1fr; }
  .cart { position: static; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 50; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 40px; }
  .app-footer { padding: 14px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .wa-shell { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 60px - 32px); }
  .topbar .sub { display: none; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  .topbar .badge { font-size: 10.5px; }
  .wa-shell.chat-open .wa-list { display: none; }
  .wa-shell:not(.chat-open) .wa-chat { display: none; }
  .wa-back { display: grid; }
  .wa-msgs { padding: 14px 10px; }
  .bubble { max-width: 88%; }
  .journey { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; }
  .login-art h1 { font-size: 30px; margin-top: 30px; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar .demo-strip { display: none; }
  .contact-btn span { display: none; }
  .login-art .how { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .val { font-size: 21px; }
  .kv { grid-template-columns: 110px 1fr; }
  .coupon { grid-template-columns: 1fr 96px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; }
  .receipt { box-shadow: none; }
}
