/* V Tap — app (login, client dashboard, admin) */
:root {
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --bg: #f4f6f8; --card: #fff;
  --brand: #0E1B2C; --brand-2: #1d3150; --brand-soft: #eef1f6; --signal: #E84A0C; --signal-2: #c93d07;
  --ok: #15803d; --ok-bg: #ecfdf3; --warn: #a16207; --warn-bg: #fefce8; --err: #b91c1c; --err-bg: #fef2f2;
  --r: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--signal-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .35rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 1rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
code { background: #eef2f6; padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; } .mono { font-family: ui-monospace, monospace; }
.strong { font-weight: 700; color: var(--ink); }

/* layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem clamp(16px, 4vw, 32px); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav > a:not(.btn) { color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.topbar nav > a.on { color: var(--brand); }
.brand-mark { color: var(--brand); display: inline-flex; align-items: center; gap: .5rem; text-decoration: none !important; line-height: 1; }
.brand-mark .logo { height: 30px; width: auto; display: block; }
.brand-mark small { font-weight: 700; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.auth-card .brand-mark .logo { height: 34px; }
.center .brand-mark { justify-content: center; display: flex; }
.dot { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .72rem; text-align: center; line-height: 18px; }
.container { max-width: 860px; margin: 0 auto; padding: 24px 16px 80px; }
.container.wide { max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-btns form { margin: 0; }
.grow { flex: 1; min-width: 0; }

/* panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel .pad { padding: 18px 20px 0; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); margin: 0; }

/* forms */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
label small, fieldset small { font-weight: 500; color: var(--muted); font-size: .8rem; }
input, textarea, select { font: inherit; font-weight: 500; color: var(--ink); width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; }
input[type=color] { padding: 4px; height: 44px; width: 90px; cursor: pointer; }
input[type=file] { padding: 8px; background: #f8fafc; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; margin: 0; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; font-size: .88rem; padding: 0 6px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prefix-input { display: flex; align-items: stretch; border: 1px solid #cbd5e1; border-radius: 9px; overflow: hidden; background: #fff; }
.prefix-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.prefix-input span { padding: 10px 4px 10px 12px; color: var(--muted); font-weight: 500; white-space: nowrap; background: #f8fafc; flex: none; }
.prefix-input input { border: 0; box-shadow: none !important; padding-left: 4px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; min-width: 0; }
.img-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 14px; }
.img-field { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.thumb { border: 1px solid var(--line); object-fit: cover; background: #f1f5f9; }
.thumb.round { width: 84px; height: 84px; border-radius: 50%; }
.thumb.wide { width: 100%; max-width: 320px; height: 100px; border-radius: 10px; }
.sticky-save { position: sticky; bottom: 0; z-index: 5; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.color-field { max-width: 220px; margin-top: 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--brand); border-color: #cbd5e1; }
.btn.ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn.sm { padding: 6px 12px; font-size: .84rem; border-radius: 8px; }
.btn.lg { padding: 14px 24px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger.ghost { background: #fff; color: var(--err); border-color: #fecaca; }

/* notices & badges */
.notice { padding: 11px 14px; border-radius: 10px; margin: 0 0 14px; font-weight: 500; border: 1px solid; }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.notice.err { background: var(--err-bg); color: var(--err); border-color: #fecaca; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.badge.s-active, .badge.p-paid, .badge.p-verified { background: var(--ok-bg); color: var(--ok); }
.badge.s-pending, .badge.s-payment_review, .badge.p-pending { background: #fff7ed; color: #c2410c; }
.badge.s-disabled, .badge.s-expired, .badge.p-rejected, .badge.p-failed { background: var(--err-bg); color: var(--err); }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1000px 500px at 20% -10%, #fde3d6 0, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: 0 20px 50px -25px rgba(15,23,42,.25); }
.auth-card .brand-mark { margin-bottom: 18px; }

/* wizard */
.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .86rem; color: var(--muted); }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; font-size: .78rem; flex: none; }
.stepper li.now { border-color: var(--brand); color: var(--ink); }
.stepper li.now span { background: var(--brand); color: #fff; }
.stepper li.done span { background: var(--brand-soft); color: var(--brand); }
.confirm-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px; border-radius: 10px; background: #f8fafc; border: 1px dashed #cbd5e1; margin-bottom: 16px; }
.confirm-box p { margin: 2px 0 10px; font-weight: 600; }
.big-link { font-size: 1.15rem; color: var(--brand); word-break: break-all; }

/* themes */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.theme-opt { position: relative; flex-direction: column; gap: 6px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink); background: #fff; }
.theme-opt input { position: absolute; top: 12px; right: 12px; }
.theme-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.theme-swatch { display: block; height: 70px; border-radius: 8px; background: linear-gradient(135deg, var(--a) 0 55%, var(--b) 55% 100%); border: 1px solid rgba(0,0,0,.08); }
.theme-opt small { font-weight: 500; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* share / go live */
.share-box { display: flex; gap: 22px; align-items: flex-start; }
.qr-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
img.qr { display: block; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.share-box .notice { margin-top: 12px; }
.go-live { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.option { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.option p { margin: 0; }
.option form { width: 100%; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 14px 0 0; font-size: .88rem; }
.facts dt { color: var(--muted); font-weight: 600; } .facts dd { margin: 0; }

/* admin */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none !important; }
.stat strong { display: block; font-size: 1.4rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.stat.hot strong { color: #c2410c; }
.search-row { display: flex; gap: 8px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .actions form { margin: 0; }
.danger-zone { border-color: #fecaca; }

/* landing */
.landing { background: #fff; }
.hero { max-width: 1100px; margin: 0 auto; padding: 56px 20px 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.035em; }
.hero h1 span { color: var(--signal); }
.hero .kicker { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .18em; color: var(--signal); margin-bottom: 14px; }
.hero p { font-size: 1.08rem; color: var(--ink-2); max-width: 34em; }
.hero-phone { display: flex; justify-content: center; }
.phone { width: 240px; height: 470px; border-radius: 36px; border: 10px solid var(--ink); background: #fff; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: 0 30px 60px -30px rgba(15,23,42,.5); }
.ph-cover { width: 100%; height: 100px; background: linear-gradient(135deg, var(--brand), #2a4064); flex: none; }
.ph-logo { width: 66px; height: 66px; border-radius: 50%; background: #fff; border: 4px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); margin-top: -44px; flex: none; }
.ph-line { height: 10px; border-radius: 5px; background: #e2e8f0; } .w40 { width: 40%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.ph-icons { display: flex; gap: 12px; margin: 6px 0; } .ph-icons i { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); }
.ph-btn { width: 80%; height: 34px; border-radius: 10px; background: var(--signal); }
.ph-qr { width: 70px; height: 70px; margin-top: 6px; background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 14px 14px; border-radius: 6px; }
.features { max-width: 1100px; margin: 0 auto; padding: 20px 20px 60px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.features div { padding: 20px; border-radius: 14px; background: var(--bg); }
.features p { margin: 0; color: var(--ink-2); font-size: .94rem; }
.site-foot { text-align: center; padding: 24px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero-phone { display: none; }
  .share-box { flex-direction: column; align-items: stretch; }
  .qr-col { align-self: center; }
  .stepper li { flex-direction: column; text-align: center; font-size: .74rem; padding: 8px 4px; }
  .hide-sm { display: none; }
  .page-head { flex-direction: column; }
  .table .actions { flex-direction: column; align-items: flex-end; }
}

/* v1.3: phone box with country picker */
.phone-input { position: relative; display: flex; align-items: stretch; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; }
.phone-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.phone-flag { display: inline-flex; align-items: center; gap: 4px; padding: 0 26px 0 12px; font-weight: 700; color: var(--ink); white-space: nowrap; background: #f8fafc;
  border-right: 1px solid #e2e8f0; border-radius: 9px 0 0 9px; position: relative; pointer-events: none; font-size: .95rem; }
.phone-flag::after { content: ""; position: absolute; right: 10px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.phone-input select { position: absolute; left: 0; top: 0; bottom: 0; width: 96px; opacity: 0; cursor: pointer; font-size: 16px; }
.phone-input input { border: 0; box-shadow: none !important; flex: 1; min-width: 0; border-radius: 0 9px 9px 0; }
.phone-input.is-disabled { opacity: .55; }
.wa-wrap { display: flex; flex-direction: column; gap: 8px; }
.wa-wrap .check { font-size: .86rem; }

/* v1.4: product settings */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.prod-item { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.prod-art { background: #EEF1F6; border-radius: 10px; aspect-ratio: 26 / 21; display: grid; place-items: center; overflow: hidden; }
.prod-art svg, .prod-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
