:root {
  --bg: #f5f6f8; --panel: #fff; --ink: #1d2330; --ink2: #5b6475; --line: #e3e6ec;
  --accent: #2f6fed; --accent-soft: #e8efff; --green: #2b8a3e; --red: #c92a2a; --amber: #b7791f;
  --radius: 10px; --side: 232px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0f2f5; padding: 1px 6px; border-radius: 4px; font-size: 13px; word-break: break-all; }
h1 { font-size: 22px; margin: 0 0 20px; }
h2 { font-size: 16px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 18px 0 10px; color: var(--ink2); }

/* ---------- Layout ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #141a26; color: #c8cfdc; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.brand { display: block; padding: 4px 8px 16px; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 100%; max-width: 168px; height: auto; margin-bottom: 10px; }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .04em; }
.brand small { display: block; color: #8a93a6; font-size: 12px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { display: block; height: 44px; width: auto; margin: 0 auto 12px; }
.auth-brand b { display: block; font-size: 20px; letter-spacing: .06em; }
.auth-brand small { color: var(--ink2); }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.wallet { display: block; margin: 0 4px 14px; padding: 12px 14px; border-radius: 10px; background: #1f2737; color: #fff; }
.wallet:hover { text-decoration: none; background: #26304a; }
.wallet small { display: block; color: #8a93a6; font-size: 12px; }
.wallet b { font-size: 22px; font-variant-numeric: tabular-nums; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { color: #c8cfdc; padding: 8px 12px; border-radius: 8px; }
.side nav a:hover { background: #1f2737; text-decoration: none; }
.side nav a.on { background: var(--accent); color: #fff; }
.side .me { font-size: 12.5px; color: #8a93a6; padding: 12px 8px 0; border-top: 1px solid #263046; }
.side .me a { color: #c8cfdc; }
main.with-side { margin-left: var(--side); padding: 28px 32px 60px; max-width: 1400px; }
main.plain { padding: 40px 16px; }

/* ---------- Components ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + section, .grid2 + p { margin-top: 20px; }
.grid2.wide-left { grid-template-columns: 1.5fr 1fr; }
.grid2.single { grid-template-columns: 1fr; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat small { display: block; color: var(--ink2); font-size: 12.5px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat b.sm { font-size: 18px; }
.stat a { font-size: 12.5px; }
.stat.alert { border-color: #ffc9c9; background: #fff5f5; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--ink2); font-weight: 600; background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.sel td { background: var(--accent-soft); }
.neg { color: var(--red); } .pos { color: var(--green); }
.card { overflow-x: auto; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.gray { background: #eceef2; color: #555e6e; } .badge.blue { background: var(--accent-soft); color: #1c4fbf; }
.badge.green { background: #e6f4ea; color: var(--green); } .badge.red { background: #fde8e8; color: var(--red); }
.badge.amber { background: #fdf3dc; color: var(--amber); }

.btn { display: inline-block; border: 0; background: var(--accent); color: #fff; padding: 9px 18px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.link.danger, a.danger { color: var(--red); }

.form label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--ink2); font-weight: 600; }
.form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink); }
input, select, textarea { font: inherit; color: var(--ink); }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .search input, .search select, .reply textarea, .code {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #ccd2dc; border-radius: 8px; background: #fff; font-weight: 400; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
table input:not([type=checkbox]) { padding: 5px 8px; border: 1px solid #ccd2dc; border-radius: 6px; width: 100%; min-width: 70px; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > label { flex: 1; }
.row.between { justify-content: space-between; align-items: center; margin-bottom: 12px; }
.row.wrap { flex-wrap: wrap; } .row.wrap > label { flex: 1 1 260px; } .row.wrap > label.full { flex-basis: 100%; }
.form.inline, form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.form.inline input, .form.inline select { width: auto; flex: 1 1 140px; margin: 0; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.search { margin-bottom: 14px; max-width: 420px; }
.search.row select { width: auto; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: #e6f4ea; border-color: #b7e0c2; color: #1e6b31; }
.flash.err { background: #fde8e8; border-color: #f5c2c2; color: #a51d1d; }
.flash.warn { background: #fdf3dc; border-color: #f1d9a0; color: #8a5a0a; }
.flash.info { background: var(--accent-soft); border-color: #c8d8ff; color: #1c4fbf; }
.muted { color: var(--ink2); } .center { text-align: center; }
.pad { padding: 14px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 99px; color: var(--ink2); background: #fff; border: 1px solid var(--line); font-size: 13.5px; }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs a:hover { text-decoration: none; }
.tabs small { opacity: .7; }

.auth-card { max-width: 400px; margin: 6vh auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; }
.auth-card.wide { max-width: 640px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a { display: block; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.quick a:hover { border-color: var(--accent); text-decoration: none; }
.quick small { display: block; color: var(--ink2); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li small { display: block; color: var(--ink2); font-size: 12px; }
.plain-list { margin: 0; padding-left: 20px; } .plain-list li { margin-bottom: 6px; }

.result { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 16px; line-height: 1.8; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tier { margin: 0 !important; cursor: pointer; }
.tier input { position: absolute; opacity: 0; }
.tier span { display: block; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink); font-weight: 400; }
.tier input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.tier b { display: block; font-size: 15px; } .tier small { display: block; color: var(--ink2); font-size: 11.5px; } .tier em { font-style: normal; font-weight: 700; color: var(--accent); }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.video video, .video .placeholder { width: 100%; aspect-ratio: 16/9; border-radius: 8px; background: #0f1420; }
.video .placeholder { display: grid; place-items: center; align-content: center; gap: 6px; color: #c8cfdc; padding: 12px; text-align: center; }
.video p { margin: 8px 0 2px; }

.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.package { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.package .price { font-size: 22px; font-weight: 700; }
.package .bonus { color: var(--green); font-weight: 600; }
.package .btn { margin-top: 8px; }
.pager { display: flex; gap: 16px; margin-top: 12px; }

.kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0 0 14px; }
.kv dt { color: var(--ink2); font-size: 13px; } .kv dd { margin: 0; }
.kv dd.ai { background: #f3f0ff; border-radius: 8px; padding: 8px 10px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline small { display: block; color: var(--ink2); } .timeline p { margin: 2px 0 0; }

.chat-admin { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.sessions { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); max-height: 72vh; overflow-y: auto; }
.sessions li a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.sessions li a:hover { background: #fafbfc; text-decoration: none; }
.sessions li.on a { background: var(--accent-soft); }
.sessions small { display: block; font-size: 12px; }
.convo .thread { max-height: 52vh; overflow-y: auto; padding: 4px; margin-bottom: 12px; }
.msg { margin-bottom: 10px; max-width: 80%; }
.msg small { display: block; font-size: 11.5px; color: var(--ink2); margin-bottom: 2px; }
.msg > div { display: inline-block; padding: 8px 12px; border-radius: 12px; background: #f0f2f5; white-space: pre-wrap; }
.msg.user { margin-left: auto; text-align: right; } .msg.user > div { background: var(--accent); color: #fff; text-align: left; }
.msg.staff > div { background: #e6f4ea; }
.reply { display: flex; gap: 10px; align-items: flex-end; } .reply textarea { margin: 0; }
.test-chat { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 10px; }
.code-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.code { font-family: Consolas, monospace; font-size: 12.5px; resize: none; margin: 0 !important; }

@media (max-width: 900px) {
  .side { position: static; width: auto; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  main.with-side { margin-left: 0; padding: 20px 16px; }
  .grid2, .grid2.wide-left, .chat-admin, .tiers { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .row.between { flex-direction: row; flex-wrap: wrap; }
}

/* v2: business management, branding */
.card.narrow { max-width: 760px; }
.grid2.wide-right { grid-template-columns: 1fr 1.7fr; }
.btn.danger-btn { background: var(--red); }
.danger-zone { border-color: #f5c2c2; }
h2.title { font-size: 20px; margin: 0; }
form.inline-tight { margin: 0; }
form.inline-tight select { padding: 4px 6px; border: 1px solid #ccd2dc; border-radius: 6px; }
.logo-preview { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.logo-preview div { padding: 14px 18px; border-radius: 10px; border: 1px solid var(--line); }
.logo-preview .on-dark { background: #141a26; }
.logo-preview img { height: 40px; width: auto; display: block; }
@media (max-width: 900px) { .grid2.wide-right { grid-template-columns: 1fr; } }

.result.md { white-space: normal; }
.result.md p { margin: 0 0 10px; } .result.md ul, .result.md ol { margin: 0 0 10px; padding-left: 22px; }
.result.md h3, .result.md h4, .result.md h5, .result.md h6 { margin: 14px 0 8px; color: var(--ink); font-size: 15px; }
.result.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.reply .btn, .row .btn, .code-row .btn { white-space: nowrap; flex: none; }

.md p { margin: 0 0 8px; } .md ul, .md ol { margin: 0 0 8px; padding-left: 20px; } .md h3, .md h4, .md h5, .md h6 { margin: 10px 0 6px; font-size: 14px; }
.kv dd.ai.md { white-space: normal; }

/* v6: Customer Site management */
.portal-head { display: flex; gap: 24px; justify-content: space-between; align-items: center; }
.portal-head > div:first-child { flex: 1; min-width: 0; }
.portal-head .code-row { align-items: center; }
.portal-head .code { flex: 1; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.qr-box #qr img, .qr-box #qr canvas { display: block; border: 6px solid #fff; box-shadow: 0 0 0 1px var(--line); border-radius: 6px; }
.layouts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.layout-opt { margin: 0 !important; cursor: pointer; }
.layout-opt input { position: absolute; opacity: 0; }
.layout-opt > span { display: block; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; height: 100%; font-weight: 400; color: var(--ink); }
.layout-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.layout-opt strong { display: block; margin-top: 8px; font-size: 14px; }
.layout-opt small { display: block; color: var(--ink2); font-size: 12px; line-height: 1.5; }
.mock { display: grid; gap: 3px; height: 92px; padding: 6px; border-radius: 6px; background: #eef1f6; }
.mock b { display: block; border-radius: 3px; background: #c9d2e3; }
.mock-classic { grid-template: 10px 30px 1fr / 1fr 1fr; } .mock-classic b:nth-child(1), .mock-classic b:nth-child(2) { grid-column: 1 / -1; } .mock-classic b:nth-child(2) { background: var(--accent); opacity: .55; } .mock-classic b:nth-child(n+5) { display: none; }
.mock-magazine { grid-template: 40px 1fr / 1fr 1fr 1fr; } .mock-magazine b:nth-child(1) { grid-column: 1 / -1; background: var(--accent); opacity: .55; } .mock-magazine b:nth-child(n+5) { display: none; }
.mock-minimal { grid-template: 8px 22px 8px 8px 8px / 1fr; padding: 6px 22px; } .mock-minimal b:nth-child(2) { background: var(--accent); opacity: .55; } .mock-minimal b:nth-child(6) { display: none; }
.mock-sidebar { grid-template: 24px 1fr 1fr / 26px 1fr 1fr; } .mock-sidebar b:nth-child(1) { grid-row: 1 / -1; background: #48546a; } .mock-sidebar b:nth-child(2) { grid-column: 2 / -1; background: var(--accent); opacity: .55; } .mock-sidebar b:nth-child(n+7) { display: none; }
.mock-tiles { grid-template: 22px 1fr 1fr / 1fr 1fr; } .mock-tiles b:nth-child(1) { grid-column: 1 / -1; background: var(--accent); opacity: .55; } .mock-tiles b:nth-child(6) { display: none; }
.logo-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.logo-prev { width: 140px; height: 80px; flex: none; display: grid; place-items: center; border: 1px dashed #ccd2dc; border-radius: 10px; background: repeating-conic-gradient(#f3f4f7 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-prev img { max-width: 124px; max-height: 64px; }
.thumb-wide { width: 160px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.ficon { display: inline-block; min-width: 44px; text-align: center; padding: 3px 6px; border-radius: 6px; background: var(--accent-soft); color: #1c4fbf; font-size: 11px; font-weight: 700; }
.form input.color { height: 40px; padding: 4px; }
td input + small { display: block; margin-top: 4px; }
@media (max-width: 1100px) { .layouts { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .portal-head { flex-direction: column; } .layouts { grid-template-columns: 1fr 1fr; } }
.layout-opt .pv { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 600; }

/* v8: AI Images, permissions */
.img-result img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; margin-bottom: 10px; }
.img-wait { display: grid; place-items: center; gap: 10px; min-height: 260px; border: 1px dashed #ccd2dc; border-radius: 10px; color: var(--ink2); }
.img-wait span { width: 34px; height: 34px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f0f2f5; }
.gallery .ph { aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 6px; padding: 12px; text-align: center; background: #fafbfc; }
.gallery figcaption { padding: 10px 12px; font-size: 13px; }
.gallery figcaption small { display: block; }
.acts { display: inline-flex; gap: 12px; margin-top: 4px; }
.ref-from { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); border-radius: 10px; padding: 10px; margin-bottom: 14px; }
.ref-from img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.ref-from small { display: block; }
.locked { max-width: 560px; }
.perm-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.perm-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.svc-toggles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.svc-toggle { margin: 0 !important; cursor: pointer; }
.svc-toggle input { position: absolute; opacity: 0; }
.svc-toggle span { display: block; border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 16px 14px 44px; position: relative; color: var(--ink); font-weight: 400; }
.svc-toggle span::before { content: ""; position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #ccd2dc; background: #fff; }
.svc-toggle input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.svc-toggle input:checked + span::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px #fff; }
.svc-toggle b { display: block; } .svc-toggle small { color: var(--ink2); font-size: 12.5px; }
.thumb-sq { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb-sm { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; border: 1px solid var(--line); }
.thumb-sm.ph { background: #f0f2f5; }
table.lines { margin-bottom: 14px; }
@media (max-width: 900px) { .svc-toggles { grid-template-columns: 1fr 1fr; } }
td.actions { display: table-cell; white-space: nowrap; }
td.actions > * { display: inline-block; vertical-align: middle; margin-right: 10px; }
td.actions > *:last-child { margin-right: 0; }
/* Top-up orders: separate buttons for confirming payment and cancelling */
td.order-acts { white-space: nowrap; }
.act-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.act-row form { display: flex; align-items: center; gap: 8px; margin: 0; }
.act-row input { width: 170px; margin: 0; }
.btn.ghost.danger-line { color: #c92a2a; border-color: #f0b4b4; background: #fff; }
.btn.ghost.danger-line:hover { background: #fff5f5; border-color: #c92a2a; }
/* Sign-up application thank-you page */
.auth-card.thanks h2 { margin: 6px 0 8px; font-size: 24px; }
.thanks-icon { width: 64px; height: 64px; margin: 6px auto 8px; border-radius: 50%; background: #e7f6ec; color: #2b8a3e; display: grid; place-items: center; }
.thanks-icon svg { width: 34px; height: 34px; }
.thanks-steps { list-style: none; counter-reset: t; margin: 20px 0 14px; padding: 0; display: grid; gap: 10px; }
.thanks-steps li { counter-increment: t; position: relative; padding: 10px 12px 10px 46px; border: 1px solid var(--line); border-radius: 10px; display: grid; }
.thanks-steps li::before { content: counter(t); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--accent, #2f6fed); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.thanks-steps span { font-size: 13px; color: var(--ink2); }
.small { font-size: 13px; }
.review-box { border: 1px solid #f2d39b; background: #fff8eb; }
.review-box .row { gap: 10px; flex-wrap: wrap; }
/* Sidebar: store open today toggle */
.open-switch { margin: 0 4px 14px; }
.open-switch button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #fff; cursor: pointer; text-align: left; font: inherit; }
.open-switch button:hover { background: rgba(255,255,255,.08); }
.open-switch .sw { position: relative; flex: none; width: 38px; height: 22px; border-radius: 99px; background: #5b6475; transition: background .2s; }
.open-switch .sw i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.open-switch.on .sw { background: #2f9e44; }
.open-switch.on .sw i { left: 19px; }
.open-switch .tx { display: grid; min-width: 0; }
.open-switch .tx b { font-size: 14px; }
.open-switch .tx small { font-size: 11.5px; color: #aab3c5; }

/* ===== v14: Store Profile, pause online orders, pending counts, order handling ===== */
.side nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #e03131; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; flex: none; }
.nav-badge.pop { animation: badge-pop .6s ease 2; }
@keyframes badge-pop { 50% { transform: scale(1.35); } }
.sound-toggle { margin: 10px 4px 0; padding: 7px 10px; border-radius: 8px; border: 1px dashed rgba(255,255,255,.25); background: transparent; color: #aab3c5; font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.sound-toggle.on { border-style: solid; color: #c8cfdc; }
.sound-toggle.alert { border-color: #ffa94d; color: #ffd8a8; background: rgba(255,169,77,.12); }
.pause-switch { margin: -6px 4px 14px; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); }
.pause-switch .pz-tx { display: grid; } .pause-switch .pz-tx b { font-size: 13px; color: #fff; } .pause-switch .pz-tx small { font-size: 11.5px; color: #aab3c5; }
.pause-switch .pz-btns { display: flex; gap: 4px; margin-top: 6px; }
.pause-switch .pz-btns button { flex: 1; padding: 5px 0; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); background: transparent; color: #c8cfdc; font: inherit; font-size: 12px; cursor: pointer; }
.pause-switch .pz-btns button:hover { background: rgba(255,255,255,.1); }
.pause-switch.paused { border-color: #f08c00; background: rgba(240,140,0,.16); }
.pause-switch.paused .pz-tx b { color: #ffc078; }
.pause-switch .pz-resume { margin-top: 6px; width: 100%; padding: 6px 0; border-radius: 6px; border: 0; background: #f08c00; color: #fff; font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.readonly-box { background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 8px; font-weight: 400; color: var(--ink); }
.small, p.small { font-size: 12.5px; }
.small-pre { font-size: 12px; max-height: 360px; overflow: auto; }
.hours-table td, .hours-table th { vertical-align: middle; }
.hours-table .period input { width: 110px; display: inline-block; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; }
.hours-table tr.is-closed td.period { opacity: .35; }
.special-form input[type=time] { width: 110px; }
.nowrap { white-space: nowrap; }
table.orders tr.due td { background: #fff8e6; }
table.orders tr.due td:first-child { box-shadow: inset 4px 0 0 #f59f00; }
table.orders tr.late td { background: #fff0f0; }
table.orders tr.late td:first-child { box-shadow: inset 4px 0 0 #e03131; }
.due-tx { color: #e67700; font-weight: 600; } .late-tx { color: #e03131; font-weight: 600; }
.legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.legend .lg.due { background: #ffe8a3; } .legend .lg.late { background: #ffc9c9; }
.o-actions { display: flex; align-items: center; gap: 4px; }
.o-actions form { margin: 0; }
.btn.step { white-space: nowrap; padding: 7px 14px; }
.btn.step-new { background: #e03131; } .btn.step-preparing { background: #2b8a3e; } .btn.step-ready, .btn.step-shipped { background: #1d2330; }
.more-menu { position: relative; }
.more-menu summary { list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--ink2); border: 1px solid var(--line); background: #fff; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu .mm-box { position: absolute; right: 0; top: 34px; z-index: 30; width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 10px; display: grid; gap: 10px; }
.more-menu .mm-box input { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 4px; }
.note-pop { display: inline-block; position: relative; }
.note-pop summary { list-style: none; cursor: pointer; display: inline; }
.note-pop summary::-webkit-details-marker { display: none; }
.note-pop > div { position: absolute; left: 0; top: 22px; z-index: 30; width: 240px; background: #fffbe6; border: 1px solid #ffe066; border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.cust-note { background: #fffbe6; border-radius: 6px; padding: 4px 8px; font-weight: 600; }
.o-progress { list-style: none; display: flex; gap: 4px; padding: 0; margin: 4px 0 14px; }
.o-progress li { flex: 1; text-align: center; font-size: 12px; padding: 5px 0; border-radius: 6px; background: #eef0f3; color: var(--ink2); }
.o-progress li.done { background: var(--accent-soft); color: #1c4fbf; }
.o-progress li.current { background: var(--accent); color: #fff; font-weight: 700; }
.o-progress.cancelled li { background: #fde8e8; color: var(--red); }
table.lines tr.disc td { color: var(--green); }
.small-table td, .small-table th { font-size: 12.5px; padding: 6px 8px; }
.soldout-btn { border: 1px solid var(--line); background: #fff; color: var(--ink2); border-radius: 99px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.soldout-btn.on { background: #fde8e8; border-color: #ffc9c9; color: var(--red); font-weight: 700; }
.open-badge.inline { background: #eceef2; color: var(--ink2); padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.open-badge.inline.on { background: #e6f4ea; color: var(--green); }
.open-badge.inline i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
@media (max-width: 900px) { .o-actions { flex-wrap: wrap; } }
.form .hours-table .period { white-space: nowrap; }
.form .hours-table .period input { display: inline-block; width: 136px; margin: 0; }
.form.special-form input[type=time] { display: inline-block; width: 110px; }
.orders-grid:not(.single) { grid-template-columns: minmax(0, 1fr); }
.orders-grid:not(.single) > section:last-child { order: -1; }

table.orders th, table.orders td { padding: 9px 8px; }
table.orders td:first-child a { white-space: nowrap; }

/* Platform support contact (top of the member Dashboard) */
.support-card { display: flex; gap: 24px; align-items: center; justify-content: space-between; border-left: 4px solid #06c755; }
.support-card h2 { margin: 0 0 2px; }
.support-card .muted { margin: 0 0 10px; }
.sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sc-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc-list li > span:first-child { min-width: 52px; color: var(--ink2); font-size: 13px; }
.sc-list a { font-weight: 600; }
.sc-line-btn { background: #06c755; color: #fff !important; padding: 3px 12px; border-radius: 99px; font-size: 12.5px; }
.sc-qr { text-align: center; flex: none; }
.sc-qr #sc-qr { padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; display: inline-block; line-height: 0; }
.sc-qr small { display: block; margin-top: 4px; color: var(--ink2); font-size: 12px; }
@media (max-width: 700px) { .support-card { flex-direction: column; align-items: flex-start; } }
