/* comkaro portals (merchant + admin) — colourful.
 * Each portal has its own palette, set on <html data-portal> by portal.js:
 *   admin    = violet → blue → cyan
 *   merchant = pink → orange → amber
 * Gradient sidebar with icons, KPI cards in rotating colours, gradient charts, buttons and tabs; text stays dark navy on white. */
@font-face { font-family: 'Outfit'; src: url('fonts/Outfit-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('fonts/Outfit-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --ink: #10213A; --ink-2: #475467; --ink-3: #667085;
  --navy: #10213A; --navy-2: #22344F;
  --accent: #EA580C; --accent-strong: #C2410C; --accent-soft: #FFF4ED; --accent-line: #F9DBC7;
  --marigold: var(--accent); --marigold-soft: #FFFAEB;
  --heat: var(--accent-strong);
  --leaf: #067647; --leaf-soft: #ECFDF3;
  --chili: #B42318; --chili-soft: #FEF3F2;
  --indigo-soft: #EEF2F8;
  --paper: #F7F8FA; --card: #FFFFFF; --line: #E6E8EC;
  --display: 'Outfit', system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', system-ui, 'Noto Sans', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: block; padding: 4px 6px 10px; }
.side .brand img { width: 178px; max-width: 100%; display: block; }
.side .who { font-size: 12px; color: #98A2B3; padding: 0 10px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px; }
.side nav button { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: none; border: 0; color: #C3CAD6; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.side nav button:hover { background: rgba(255,255,255,.07); }
.side nav button.on { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.side nav .count { background: var(--chili); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.side nav button.on .count { background: var(--navy); }
.side .navgroup { font-size: 11px; color: var(--ink-3); padding: 14px 10px 4px; }
.main { padding: 24px 28px 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
h1, h2, h3 { font-family: var(--display); font-weight: 700 !important; line-height: 1.15; margin: 0 0 6px; color: var(--navy); }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--ink-2); } .tiny { font-size: 12px; color: var(--ink-3); }
p { margin: 0 0 10px; }

.card { background: var(--card); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: 12px; padding: 14px 16px; }
.kpi .v { font: 800 28px/1.1 var(--display); }
.kpi .l { font-size: 12px; color: var(--ink-2); }
.kpi.good .v { color: var(--leaf); } .kpi.warn .v { color: #B54708; } .kpi.bad .v { color: var(--chili); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn.gold { background: var(--accent-strong); color: #fff; box-shadow: none; }
.btn.leaf { background: var(--leaf); }
.btn.danger { background: var(--chili); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.input { width: 100%; min-height: 38px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
textarea.input { min-height: 80px; }
.input:focus { border-color: var(--ink); outline: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 0 14px 8px 0; font-size: 13px; }
.check input { accent-color: var(--ink); width: 16px; height: 16px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .input { width: auto; min-width: 160px; }
.tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 10px; width: fit-content; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.tabs button.on { background: var(--ink); color: #fff; }

table.t { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 10px 12px; border-bottom: 1.5px solid var(--line); background: #F9FAFB; white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #F9FAFB; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: 12px; margin-bottom: 16px; }

.st { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.st.approved, .st.active, .st.validated, .st.responded, .st.verified, .st.paid, .st.resolved, .st.actioned, .st.sent, .st.live, .st.reviewed { background: var(--leaf-soft); color: var(--leaf); }
.st.pending, .st.pending_review, .st.submitted, .st.issued, .st.open, .st.in_progress, .st.scheduled, .st.changes_requested { background: var(--marigold-soft); color: #B54708; }
.st.rejected, .st.suspended, .st.removed, .st.overdue, .st.high, .st.declined { background: var(--chili-soft); color: var(--chili); }
.st.online { background: var(--indigo-soft); color: #22344F; } .st.instore { background: var(--leaf-soft); color: var(--leaf); }

.notice { border-left: 3px solid var(--accent); background: var(--marigold-soft); padding: 10px 12px; border-radius: 0 8px 8px 0; margin-bottom: 14px; }
.notice.bad { border-color: var(--chili); background: var(--chili-soft); }
.notice.good { border-color: var(--leaf); background: var(--leaf-soft); }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--paper); flex: none; }
.steps .done .dot { background: var(--leaf); color: #fff; }

/* validate screen: the one oversized moment */
.validate { max-width: 560px; }
.code-input { font: 800 34px/1 var(--display); letter-spacing: 6px; text-transform: uppercase; text-align: center; min-height: 72px; }
.preview { border: 2px solid var(--ink); border-radius: 14px; padding: 16px; margin-top: 14px; }
.big-ok { font: 800 34px/1.1 var(--display); color: var(--leaf); margin: 4px 0 10px; }
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent-strong); font: 800 16px/1 var(--display); padding: 6px 12px 5px 18px; clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%); border-radius: 0 6px 6px 0; }
#camBox video { width: 100%; max-height: 260px; border-radius: 12px; background: #000; margin-top: 10px; }

.thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 420px; overflow-y: auto; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; }
.msg.merchant { align-self: flex-end; background: var(--ink); color: #fff; }
.msg.user { align-self: flex-start; background: var(--paper); }
.msg.system { align-self: center; font-size: 12px; color: var(--ink-2); }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; background: #22344F; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 70px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.funnel-row .bar { height: 14px; background: var(--ink); border-radius: 0 4px 4px 0; min-width: 2px; }
.funnel-row .num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.modal-bd { position: fixed; inset: 0; background: rgba(27,31,59,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.modal { background: var(--card); border-radius: 16px; padding: 22px; width: 100%; max-width: 720px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 60; max-width: 420px; }
.toast.err { background: var(--chili); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--card); border-radius: 18px; padding: 32px; width: 100%; max-width: 420px; }
.login-card .brand { display: block; margin-bottom: 10px; }
.login-card .brand img { width: 230px; display: block; }
#map { height: 260px; border-radius: 10px; margin-bottom: 10px; }
.hours-grid { display: grid; grid-template-columns: 60px 1fr 1fr 70px; gap: 6px 8px; align-items: center; font-size: 13px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; font-weight: 600; }
.hide { display: none !important; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 10px; }
  .side .who { border: 0; padding-bottom: 6px; margin: 0; }
  .side nav { display: flex; overflow-x: auto; gap: 4px; }
  .side nav button { width: auto; white-space: nowrap; }
  .side .navgroup { display: none; }
  .main { padding: 16px; }
  .grid2, .grid3, .form-grid { grid-template-columns: 1fr; }
}
@media print {
  .side, .no-print { display: none !important; }
  .shell { display: block; } body { background: #fff; }
}

/* ---------- multi-page sidebar links */
.side a.brand { display: block; text-decoration: none; }
.side nav a { display: flex; justify-content: space-between; align-items: center; width: 100%; color: #C3CAD6; padding: 9px 10px; border-radius: 8px; font-size: 14px; text-decoration: none; }
.side nav a:hover { background: rgba(255,255,255,.07); }
.side nav a.on { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.side nav a.on .count { background: var(--ink); }
a.btn { text-decoration: none; }

/* ---------- category images & banners (admin catalogue, merchant forms) */
.cat-thumb { width: 40px; height: 40px; border-radius: 12px; display: block; }
.cat-thumb.lg { width: 96px; height: 96px; border-radius: 24px; }
.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cat-pick label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 12px; text-align: center; background: #fff; }
.cat-pick label img { width: 52px; height: 52px; border-radius: 14px; }
.cat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pick label:has(input:checked) { border-color: var(--ink); background: var(--paper); font-weight: 700; box-shadow: inset 0 0 0 1px var(--ink); }
.cat-pick label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.cat-pick label:has(input:disabled) { cursor: default; opacity: .85; }
.cat-select { display: flex; gap: 10px; align-items: center; }
.cat-select img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.img-drop { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1.5px dashed var(--line); border-radius: 14px; background: #F9FAFB; }
.img-drop img { background: #fff; }
.banner-thumb { width: 220px; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px; display: block; background: var(--paper); }
.banner-preview { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 14px; display: block; background: var(--paper); border: 1px solid var(--line); }
.banner-preview.hero { aspect-ratio: 27 / 8; }
.banner-thumb.hero { aspect-ratio: 27 / 8; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.color-pick { display: flex; align-items: center; gap: 10px; }
.color-pick input[type=color] { width: 52px; height: 40px; padding: 2px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }


/* =====================================================================
   v2 — colourful portals
   ===================================================================== */
:root, [data-portal="admin"] {
  --p1: #7C3AED; --p2: #2563EB; --p3: #06B6D4;
  --p-deep: #5B21B6; --p-soft: #F3F0FF; --p-tint: #E4DCFF; --p-bg: #F5F4FE;
  --side-bg: linear-gradient(170deg, #4C1D95 0%, #3730A3 48%, #155E75 100%);
  --grad: linear-gradient(135deg, var(--p1) 0%, var(--p2) 60%, var(--p3) 120%);
  --accent: #EA580C; --accent-strong: #C2410C;
}
[data-portal="merchant"] {
  --p1: #DB2777; --p2: #F43F5E; --p3: #F97316;
  --p-deep: #BE185D; --p-soft: #FFF0F6; --p-tint: #FBD3E5; --p-bg: #FFF7F6;
  --side-bg: linear-gradient(170deg, #831843 0%, #BE123C 52%, #C2410C 100%);
  --grad: linear-gradient(135deg, var(--p1) 0%, var(--p2) 55%, var(--p3) 110%);
  --accent: #7C3AED; --accent-strong: #6D28D9;
}
/* six rotating colours for KPIs, funnels, charts */
:root { --k1: linear-gradient(135deg, #8B5CF6, #5B21B6); --k2: linear-gradient(135deg, #3B82F6, #1E40AF); --k3: linear-gradient(135deg, #06B6D4, #155E75);
  --k4: linear-gradient(135deg, #EC4899, #9D174D); --k5: linear-gradient(135deg, #F97316, #9A3412); --k6: linear-gradient(135deg, #6366F1, #3730A3);
  --kg: linear-gradient(135deg, #22C55E, #166534); --kw: linear-gradient(135deg, #F59E0B, #92400E); --kb: linear-gradient(135deg, #F43F5E, #9F1239); }
html, body { background: var(--p-bg); }
a { color: var(--p-deep); }
:focus-visible { outline: 2px solid var(--p1); }

/* sidebar */
.side { background: var(--side-bg); padding: 18px 12px; }
.side .brand img { background: #fff; border-radius: 999px; padding: 7px 16px; width: 186px; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .45); }
.side .who { color: rgba(255, 255, 255, .78); border-bottom-color: rgba(255, 255, 255, .16); padding-top: 8px; }
.side .navgroup { color: rgba(255, 255, 255, .6); }
.side nav a, .side nav button { color: rgba(255, 255, 255, .88); border-radius: 12px; padding: 9px 10px; margin-bottom: 2px; transition: background .15s, transform .15s; }
.side nav a:hover, .side nav button:hover { background: rgba(255, 255, 255, .12); transform: translateX(2px); }
.side .ni { display: inline-flex; align-items: center; gap: 11px; }
.side .ni i { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); font-size: 13px; flex: none; }
.side nav a.on, .side nav button.on { background: #fff; color: var(--p-deep); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .45); }
.side nav a.on .ni i { background: var(--grad); color: #fff; }
.side nav .count { background: #FDE047; color: #713F12; }
.side nav a.on .count { background: var(--grad); color: #fff; }

/* headings, cards */
.main { background: radial-gradient(1200px 400px at 100% -10%, var(--p-tint) 0%, transparent 60%); }
.page-head h1 { position: relative; padding-bottom: 8px; }
.page-head h1::after { content: ''; position: absolute; left: 0; bottom: 0; width: 46px; height: 4px; border-radius: 4px; background: var(--grad); }
.card { box-shadow: 0 1px 2px rgba(16, 33, 58, .04), 0 10px 26px -20px rgba(76, 29, 149, .35); border-radius: 18px; }
.card h3 { color: var(--p-deep); }

/* KPI cards: each a different colour */
.kpi { position: relative; overflow: hidden; color: #fff; border-radius: 16px; padding: 16px 18px; background: var(--k1); box-shadow: 0 12px 24px -16px rgba(16, 33, 58, .6); }
.kpi::after { content: ''; position: absolute; right: -26px; top: -26px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.kpi .v { color: #fff !important; position: relative; z-index: 1; }
.kpi .l { color: rgba(255, 255, 255, .88); position: relative; z-index: 1; }
.kpis .kpi:nth-child(6n+2) { background: var(--k2); } .kpis .kpi:nth-child(6n+3) { background: var(--k3); }
.kpis .kpi:nth-child(6n+4) { background: var(--k4); } .kpis .kpi:nth-child(6n+5) { background: var(--k5); } .kpis .kpi:nth-child(6n+6) { background: var(--k6); }
.kpis .kpi.good { background: var(--kg); } .kpis .kpi.warn { background: var(--kw); } .kpis .kpi.bad { background: var(--kb); }
/* KPIs inside a card: lighter, tinted tiles */
.card .kpi { background: var(--p-soft) !important; color: var(--ink); box-shadow: none; }
.card .kpi::after { background: var(--p-tint); opacity: .6; }
.card .kpi .v { color: var(--p-deep) !important; } .card .kpi .l { color: var(--ink-2); }
.card .kpi.good .v { color: #15803D !important; } .card .kpi.warn .v { color: #B45309 !important; } .card .kpi.bad .v { color: #BE123C !important; }

/* buttons, inputs, tabs */
.btn { background: var(--grad); border-radius: 10px; box-shadow: 0 8px 16px -10px var(--p1); transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: scale(.98); }
.btn.gold { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); box-shadow: 0 8px 16px -10px var(--accent); }
.btn.leaf { background: var(--kg); } .btn.danger { background: var(--kb); }
.btn.ghost { background: #fff; color: var(--p-deep); border: 1.5px solid var(--p-tint); box-shadow: none; }
.btn.ghost:hover { background: var(--p-soft); }
.btn.lg { min-height: 46px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.link { color: var(--p-deep); }
.input { border-radius: 10px; }
.input:focus { border-color: var(--p1); box-shadow: 0 0 0 3px var(--p-tint); }
.check input, input[type=radio], input[type=range] { accent-color: var(--p1); }
.tabs { box-shadow: 0 1px 2px rgba(16, 33, 58, .05); }
.tabs button.on { background: var(--grad); color: #fff; font-weight: 700; }

/* tables */
table.t { border-radius: 16px; }
table.t th { background: var(--p-soft); color: var(--p-deep); border-bottom-color: var(--p-tint); }
table.t tr.click:hover td { background: var(--p-soft); }
.table-wrap { border-radius: 16px; box-shadow: 0 10px 26px -22px rgba(76, 29, 149, .5); }
.st.online { background: #E0F2FE; color: #075985; }

/* charts */
.bars div { background: var(--grad); border-radius: 5px 5px 0 0; }
.bars div:hover { filter: brightness(1.15); }
.funnel-row .bar { background: var(--k1); border-radius: 0 6px 6px 0; height: 16px; }
.funnel-row:nth-child(6n+2) .bar, .funnel-row:nth-of-type(6n+2) .bar { background: var(--k2); }
.funnel-row:nth-of-type(6n+3) .bar { background: var(--k3); } .funnel-row:nth-of-type(6n+4) .bar { background: var(--k4); }
.funnel-row:nth-of-type(6n+5) .bar { background: var(--k5); } .funnel-row:nth-of-type(6n+6) .bar { background: var(--k6); }

/* notices, modal, toast, tag, validate */
.notice { border-left: 0; border-radius: 12px; background: linear-gradient(90deg, #FEF3C7, #FFFBEB); box-shadow: inset 4px 0 0 #F59E0B; }
.notice.bad { background: linear-gradient(90deg, #FFE4E6, #FFF1F2); box-shadow: inset 4px 0 0 #F43F5E; }
.notice.good { background: linear-gradient(90deg, #DCFCE7, #F0FDF4); box-shadow: inset 4px 0 0 #22C55E; }
.modal-bd { background: rgba(30, 27, 75, .55); backdrop-filter: blur(3px); }
.modal { border-radius: 20px; overflow: hidden; position: relative; padding-top: 28px; }
.modal::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--grad); }
.modal-head h2 { color: var(--p-deep); }
.toast { background: var(--grad); box-shadow: 0 14px 30px -12px var(--p1); border-radius: 12px; }
.toast.err { background: var(--kb); }
.tag { background: var(--p-soft); color: var(--p-deep); }
.preview { border-color: var(--p1); border-radius: 18px; }
.code-input { border-color: var(--p-tint); }
.msg.merchant { background: var(--grad); }
.steps .done .dot { background: var(--kg); }
.cat-pick label:has(input:checked) { border-color: var(--p1); background: var(--p-soft); box-shadow: inset 0 0 0 1px var(--p1); }

/* ---------- sign-in and registration: colourful split screen */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth.wide { grid-template-columns: .8fr 1.2fr; }
.auth-art { position: relative; overflow: hidden; background: var(--side-bg); color: #fff; padding: 56px 56px 40px; display: flex; flex-direction: column; justify-content: center; isolation: isolate; }
.auth-art .blob { position: absolute; border-radius: 50%; filter: blur(2px); z-index: -1; animation: drift 14s ease-in-out infinite; }
.auth-art .b1 { width: 420px; height: 420px; right: -140px; top: -120px; background: radial-gradient(circle at 30% 30%, var(--p3), transparent 70%); opacity: .75; }
.auth-art .b2 { width: 340px; height: 340px; left: -120px; bottom: -120px; background: radial-gradient(circle at 60% 40%, var(--p1), transparent 70%); opacity: .8; animation-delay: -5s; }
.auth-art .b3 { width: 220px; height: 220px; right: 18%; bottom: 14%; background: radial-gradient(circle, #FDE047, transparent 70%); opacity: .35; animation-delay: -9s; }
@keyframes drift { 50% { transform: translate(24px, -18px) scale(1.08); } }
.auth-copy { max-width: 480px; }
.auth-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: 5px 14px; font-weight: 700; font-size: 13px; margin-bottom: 18px; }
.auth-art h1 { color: #fff; font-size: 42px; line-height: 1.08; letter-spacing: -.5px; margin-bottom: 12px; }
.auth-art p { color: rgba(255, 255, 255, .88); font-size: 16px; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; padding: 12px 14px; backdrop-filter: blur(4px); }
.auth-points b { display: block; font-size: 15px; } .auth-points span { font-size: 13px; color: rgba(255, 255, 255, .82); }
.auth-points .pi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 16px; color: #fff; }
.pi.c1 { background: var(--k4); } .pi.c2 { background: var(--k3); } .pi.c3 { background: linear-gradient(135deg, #FDE047, #F59E0B); color: #713F12 !important; }
.auth-chips { position: absolute; right: 36px; top: 40px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.chip-f { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); font-weight: 700; font-size: 12.5px; padding: 8px 14px 8px 8px; border-radius: 999px; box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .5); animation: bob 5s ease-in-out infinite; }
.chip-f i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; }
.chip-f.f1 i { background: var(--kg); } .chip-f.f2 { animation-delay: -1.6s; margin-right: 34px; } .chip-f.f2 i { background: var(--k2); } .chip-f.f3 { animation-delay: -3.2s; } .chip-f.f3 i { background: var(--k5); }
@keyframes bob { 50% { transform: translateY(-8px); } }
.auth-form { display: grid; place-items: center; padding: 40px 32px; background: radial-gradient(600px 300px at 100% 0%, var(--p-soft), transparent 70%), #fff; }
.auth .login-card { max-width: 420px; padding: 8px 0; background: none; border-radius: 0; }
.auth.wide .login-card { max-width: 680px; }
.auth .login-card .brand img { width: 200px; margin-bottom: 18px; }
.auth .login-card h2 { font-size: 28px; color: var(--ink); }
.in-ic { position: relative; display: block; }
.in-ic > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--p1); font-size: 14px; pointer-events: none; }
.in-ic .input { padding-left: 38px; min-height: 46px; }
.in-ic .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 36px; height: 36px; border-radius: 8px; color: var(--ink-3); cursor: pointer; }
.in-ic .reveal:hover { background: var(--p-soft); color: var(--p-deep); }
@media (max-width: 960px) {
  .auth, .auth.wide { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 22px 28px; }
  .auth-art h1 { font-size: 30px; }
  .auth-points, .auth-chips { display: none; }
  .auth-form { padding: 28px 20px 40px; }
}
@media (max-width: 860px) {
  .side nav a, .side nav button { white-space: nowrap; }
  .side .brand img { width: 150px; }
}

/* =====================================================================
   v1.5 — products, order requests, storefront media, subcategories (both portals)
   ===================================================================== */
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.empty-card { text-align: center; padding: 40px 20px; }
.empty-card > i { font-size: 34px; color: var(--p1); background: var(--p-soft); width: 72px; height: 72px; border-radius: 22px; display: inline-grid; place-items: center; margin-bottom: 10px; }
.empty-card p { max-width: 460px; margin: 0 auto 14px; }

/* product cards */
.pg-h { margin: 18px 0 10px; color: var(--p-deep); font-size: 16px; }
.pg-h .tiny { background: var(--p-soft); color: var(--p-deep); padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.pa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.pa-card { background: var(--card); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(16, 33, 58, .05), 0 10px 22px -20px rgba(16, 33, 58, .5); }
.pa-card.off { opacity: .62; }
.pa-img { position: relative; aspect-ratio: 16 / 9; background: var(--p-soft); display: grid; place-items: center; color: var(--p1); font-size: 28px; }
.pa-img img { width: 100%; height: 100%; object-fit: cover; }
.pa-off, .pa-hidden { position: absolute; top: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pa-off { left: 8px; background: var(--leaf); color: #fff; }
.pa-hidden { right: 8px; background: var(--ink); color: #fff; }
.pa-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pa-body > b { font-size: 14.5px; line-height: 1.3; }
.pa-price b { font: 700 17px var(--display); } .pa-price s { color: var(--ink-3); font-size: 12.5px; }
.pa-tags { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 8px; }
.pa-body .actions { margin-top: auto; }
.vg { display: inline-block; width: 12px; height: 12px; border: 1.5px solid #B91C1C; border-radius: 3px; margin-right: 6px; vertical-align: -1px; position: relative; }
.vg::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: #B91C1C; }
.vg.on { border-color: #16A34A; } .vg.on::after { background: #16A34A; }
.pf-row { display: flex; gap: 14px; align-items: center; }
.pf-prev { width: 96px; height: 96px; border-radius: 16px; background: var(--p-soft); display: grid; place-items: center; color: var(--p1); font-size: 26px; overflow: hidden; flex: none; }
.pf-prev img { width: 100%; height: 100%; object-fit: cover; }

/* order request cards */
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.ocard { background: var(--card); border-radius: 16px; padding: 14px 16px; border-left: 5px solid var(--line); box-shadow: 0 10px 22px -20px rgba(16, 33, 58, .5); }
.ocard.placed { border-left-color: var(--p1); box-shadow: 0 0 0 1px var(--p-tint), 0 14px 26px -18px var(--p1); }
.ocard.accepted, .ocard.ready, .ocard.out_for_delivery { border-left-color: #F59E0B; }
.ocard.completed { border-left-color: var(--leaf); } .ocard.declined, .ocard.cancelled { border-left-color: var(--ink-3); }
.oc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.oc-head b { font: 700 16px var(--display); }
.oc-ful { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.oc-ful.delivery { background: var(--p-soft); color: var(--p-deep); } .oc-ful.pickup { background: var(--indigo-soft); color: var(--navy-2); }
.oc-cust, .oc-addr { font-size: 13px; margin-top: 8px; color: var(--ink-2); }
.oc-cust a { margin-left: 8px; font-weight: 700; color: var(--p-deep); text-decoration: none; }
.oc-items { width: 100%; border-collapse: collapse; margin: 10px 0 6px; font-size: 13.5px; }
.oc-items td { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.oc-items td:first-child { width: 34px; color: var(--ink-3); }
.oc-items .num { text-align: right; white-space: nowrap; }
.oc-items .tot td { border-bottom: 0; font-weight: 700; padding-top: 8px; }
.oc-note { background: var(--marigold-soft); border-radius: 10px; padding: 7px 10px; font-size: 13px; margin: 6px 0; }
.ocard .actions { margin-top: 10px; }
.st.placed { background: var(--p-soft); color: var(--p-deep); } .st.accepted, .st.completed { background: var(--leaf-soft); color: var(--leaf); }
.st.ready, .st.out_for_delivery { background: var(--marigold-soft); color: #B54708; } .st.cancelled { background: var(--paper); color: var(--ink-3); }
.chips-q { display: flex; gap: 6px; flex-wrap: wrap; }

/* storefront media on the profile page */
.sf-grid { display: grid; grid-template-columns: 180px 1fr; gap: 18px; margin-top: 10px; }
.sf-grid > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sf-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sf-img { background: var(--p-soft); border-radius: 16px; overflow: hidden; display: grid; place-items: center; color: var(--p-deep); font: 700 26px var(--display); }
.sf-img.logo { width: 120px; height: 120px; border-radius: 28px; }
.sf-img.cover { width: 100%; max-width: 520px; aspect-ratio: 16 / 9; height: auto; }
.sf-img img { width: 100%; height: 100%; object-fit: cover; }
.sf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.sf-photos figure { margin: 0; position: relative; border-radius: 12px; overflow: hidden; background: var(--paper); }
.sf-photos img { width: 100%; height: 110px; object-fit: cover; display: block; }
.sf-photos figcaption { font-size: 12px; padding: 6px 8px; color: var(--ink-2); min-height: 16px; }
.sf-photos .btn { position: absolute; top: 6px; right: 6px; background: rgba(255, 255, 255, .92); }
@media (max-width: 700px) { .sf-grid { grid-template-columns: 1fr; } .orders-grid { grid-template-columns: 1fr; } }

/* subcategory thumbnails (admin catalog) */
.sub-thumb { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; vertical-align: middle; }
.logo-thumb { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; vertical-align: middle; margin-right: 8px; box-shadow: 0 0 0 1px var(--line); }
.prod-cell { display: flex; gap: 10px; align-items: center; }
.prod-cell img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.m-store { display: flex; gap: 8px; align-items: center; overflow-x: auto; margin-bottom: 12px; }
.m-store img { border-radius: 12px; object-fit: cover; flex: none; height: 72px; }
.m-store .m-logo { width: 72px; border-radius: 20px; box-shadow: 0 0 0 1px var(--line); }
.m-store .m-cover { width: 128px; } .m-store .m-photo { width: 108px; }
.kpis.sm .kpi { padding: 10px 14px; } .kpis.sm .kpi .v { font-size: 22px; }

/* v1.7: offer scope picker, product COMKARO discount, specs, gallery */
.scope-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.scope-opt { position: relative; cursor: pointer; }
.scope-opt input { position: absolute; opacity: 0; }
.scope-opt span { display: flex; flex-direction: column; gap: 2px; border: 1.5px solid var(--line, #E4E7EC); border-radius: 12px; padding: 10px 12px; height: 100%; }
.scope-opt small { font-size: 12px; color: var(--ink-3, #667085); }
.scope-opt input:checked + span { border-color: var(--navy, #10213A); box-shadow: 0 0 0 3px rgba(16, 33, 58, .1); }
.scope-opt input:focus-visible + span { outline: 2px solid var(--navy, #10213A); outline-offset: 2px; }
.hint { background: #F2F4F7; border-radius: 10px; padding: 8px 10px; grid-column: 1 / -1; }
.scope-cell { display: inline-flex; align-items: center; gap: 8px; }
.scope-cell img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }
.ck-box { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 12px; padding: 10px 12px; }
.ck-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ck-row .input { width: auto; flex: 1 1 140px; }
.ck-row label { display: flex; align-items: center; gap: 6px; }
#ckPrev { font-weight: 700; color: #15803D; margin: 6px 0 0; }
.spec-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 6px; margin-bottom: 6px; }
.gal { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.gal-i { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; }
.gal-i img { width: 100%; height: 100%; object-fit: cover; }
.gal-i button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; line-height: 1; }
.pa-ck { color: #15803D; margin-top: 2px; }
.color-row { display: flex; gap: 8px; align-items: center; } .color-row input[type=color] { width: 44px; height: 38px; padding: 0; border: 1px solid var(--line, #E4E7EC); border-radius: 8px; background: none; }
.banner-preview.hero, .banner-thumb.hero { aspect-ratio: 1080 / 624; }

/* v2.0: customer-entered bill on the Validate screen */
.pay-box { margin-top: 14px; border-radius: 14px; background: #F8F9FC; padding: 6px 14px; }
.pay-box > div { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid #EAECF0; font-size: 15px; }
.pay-box > div:first-child { border-top: 0; }
.pay-box .d b { color: #067647; } .pay-box .t span { font-weight: 700; } .pay-box .t b { font-size: 22px; }

/* v2.0: home delivery switch (merchant Orders page) */
.deliv-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; margin-bottom: 16px; }
.dv-ic { width: 46px; height: 46px; border-radius: 14px; background: #EEF4FF; color: #3538CD; display: grid; place-items: center; font-size: 19px; }
.deliv-card.on .dv-ic { background: #ECFDF3; color: #067647; }
.dv-t h3 { margin: 2px 0 4px; } .dv-t p { margin: 0; }
.dv-note { margin-top: 10px; max-width: 460px; } .deliv-card:not(.on) .dv-note { display: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 52px; height: 30px; border-radius: 999px; background: #D0D5DD; position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .3); transition: transform .2s; }
.switch input:checked + span { background: #12B76A; }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid #84CAFF; outline-offset: 2px; }
.switch b { min-width: 28px; }
@media (max-width: 640px) { .deliv-card { grid-template-columns: auto 1fr; } .deliv-card .switch { grid-column: 1 / -1; } }

/* v2.0.1 Live redemptions (customers redeem on their own) */
.lv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 12px; }
.lv-stats div { background: #fff; border: 1px solid var(--line, #E6E8EC); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.lv-stats b { font-size: 22px; }
.lv-stats span { font-size: 12.5px; color: var(--muted, #667085); }
.lv-stats .d b { color: #067647; }
.lv-find { max-width: 360px; margin-bottom: 12px; }
.lv-list { display: grid; gap: 10px; }
.lv-card { background: #fff; border: 1px solid var(--line, #E6E8EC); border-radius: 16px; padding: 12px 14px; }
.lv-card.new { border-color: #12B76A; box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); animation: lvIn .5s ease-out; }
@keyframes lvIn { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-top { display: flex; align-items: center; gap: 10px; }
.lv-ok { width: 32px; height: 32px; border-radius: 50%; background: #ECFDF3; color: #067647; display: grid; place-items: center; flex: none; }
.lv-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lv-t span { font-size: 12.5px; color: var(--muted, #667085); }
.lv-top time { font-size: 12.5px; color: var(--muted, #667085); white-space: nowrap; }
.lv-card .pay-box { margin-top: 10px; }
@media (max-width: 600px) { .lv-stats b { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .lv-card.new { animation: none; } }
