/* Sanad One — dashboard, auth & shared UI */
:root {
  --ink: #1B1F3B;
  --ink-2: #464C6B;
  --muted: #6A7088;
  --brand: #1E6B5C;
  --brand-ink: #134D41;
  --brand-tint: #E5F1EE;
  --saffron: #F2B632;
  --saffron-tint: #FDF3DA;
  --paper: #F4F5F8;
  --surface: #FFFFFF;
  --line: #E1E4EB;
  --line-2: #CDD2DC;
  --danger: #B8341F;
  --danger-tint: #FBEAE6;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(27, 31, 59, .06), 0 4px 16px rgba(27, 31, 59, .05);
  --font: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --side-w: 236px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.65;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 700; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.08rem; }
h3 { font-size: .98rem; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* Icons */
.ic { width: 20px; height: 20px; flex: none; }
.ic.xs { width: 15px; height: 15px; vertical-align: -2px; }
.ic.big { width: 36px; height: 36px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.12rem; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; padding: 0 10px; }
.btn-danger-ghost:hover { background: var(--danger-tint); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.is-static { cursor: default; color: var(--brand); border-color: var(--brand); }
.link-btn { background: none; border: 0; padding: 4px 0; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: .9rem; }
.link-btn:hover { color: var(--ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm);
  background: transparent; border: 0; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.icon-btn .ic { width: 18px; height: 18px; }

/* Forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .9rem; }
.field small, .form small { color: var(--muted); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=date], input[type=url], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input[dir=ltr] { text-align: left; }
input[type=file] { font-size: .88rem; }
.slug-input { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.slug-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.slug-prefix { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted); background: var(--paper); border-right: 1px solid var(--line); font-size: .9rem; white-space: nowrap; }
.slug-input input { border: 0; box-shadow: none !important; min-width: 0; padding-left: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-inline .grow { flex: 1 1 220px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--paper) 70%, transparent); z-index: 2; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset[disabled] { opacity: .5; }
h3.sub { font-size: .9rem; color: var(--ink-2); margin-top: 4px; }

/* Toasts */
.toasts { position: fixed; inset-block-start: 16px; inset-inline: 0; display: grid; justify-items: center; gap: 8px; z-index: 50; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r);
  background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(27, 31, 59, .2);
  animation: toast-in .25s ease-out, toast-out .3s ease-in 4.2s forwards; max-width: min(92vw, 560px);
}
.toast-success .ic { color: #7FD4BE; }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-8px); opacity: 0; visibility: hidden; } }

/* ---------- App shell ---------- */
body.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px;
  padding: 22px 16px; background: var(--surface); border-inline-end: 1px solid var(--line);
}
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 600; }
.side-nav a:hover { background: var(--paper); text-decoration: none; color: var(--ink); }
.side-nav a.on { background: var(--brand-tint); color: var(--brand-ink); }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.plan-chip { display: grid; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); color: var(--ink); line-height: 1.4; }
.plan-chip span { font-size: .78rem; color: var(--muted); }
.plan-chip:hover { text-decoration: none; background: var(--line); }
.plan-chip.plan-pro, .plan-chip.plan-business { background: var(--saffron-tint); }
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lang-toggle { font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.head p { margin-top: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 18px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.note.warn { margin-top: 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--saffron-tint); font-size: .88rem; }
.upsell { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--saffron-tint); }
.upsell > .ic { color: #9A6B00; }
.upsell p { flex: 1 1 240px; font-weight: 600; font-size: .92rem; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 12px; color: var(--muted); text-align: center; }
.meter { font-size: .82rem; font-weight: 700; color: var(--ink-2); background: var(--paper); padding: 2px 10px; border-radius: 99px; }
.meter.full { background: var(--saffron-tint); color: #7A5500; }

.avatar { display: grid; place-items: center; border-radius: 50%; background: var(--brand-tint); color: var(--brand-ink); font-weight: 800; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 44px; height: 44px; font-size: 1.1rem; }
.avatar.lg { width: 84px; height: 84px; font-size: 2rem; }

/* Pages list */
.page-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.page-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); }
.page-row:hover { text-decoration: none; border-color: var(--line-2); }
.page-row-main { display: grid; flex: 1; min-width: 0; line-height: 1.45; }
.page-row-main .muted { font-size: .85rem; text-align: start; }
.page-row-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .85rem; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; max-width: 1240px; }
.ed-head { margin-bottom: 14px; }
.crumb { font-size: .85rem; font-weight: 600; }
.url-pill { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; padding: 2px 4px 2px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); max-width: 100%; }
.url-pill > a:first-child { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-pill .icon-btn { width: 32px; height: 32px; border-radius: 99px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-weight: 700; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a .ic { width: 18px; height: 18px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand-ink); border-bottom-color: var(--brand); }

.preview { position: sticky; top: 24px; display: grid; justify-items: center; gap: 10px; }
.phone {
  width: 320px; height: 650px; border-radius: 44px; padding: 10px; background: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(27, 31, 59, .45), inset 0 0 0 2px #2E3360;
}
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 34px; background: #fff; }
.preview-cap { font-size: .82rem; color: var(--muted); }

/* Link type picker */
.type-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 99px; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--ink-2); background: var(--surface); }
.type-opt span .ic { width: 16px; height: 16px; }
.type-opt input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.type-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.link-fields { display: grid; gap: 14px; }

/* Link list */
.link-list, .social-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.link-item { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.link-item.off .li-row > :not(.toggle-form):not(.icon-btn):not(.grip) { opacity: .45; }
.link-item.is-header { background: var(--paper); }
.li-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; min-height: 60px; }
html[dir=rtl] .li-row { padding: 8px 10px 8px 8px; }
.grip { display: grid; place-items: center; width: 28px; height: 40px; background: none; border: 0; color: var(--line-2); cursor: grab; border-radius: 6px; padding: 0; flex: none; touch-action: none; }
.grip:hover { color: var(--ink-2); background: var(--paper); }
.li-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--paper); color: var(--ink-2); flex: none; }
.li-text { display: grid; flex: 1; min-width: 0; line-height: 1.45; }
.li-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-text .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.clicks { font-weight: 800; font-size: .95rem; white-space: nowrap; color: var(--ink-2); }
.clicks small { font-weight: 600; color: var(--muted); font-size: .75rem; }
.li-edit { border-top: 1px solid var(--line); padding: 16px; display: grid; gap: 10px; }
.del-form { justify-self: end; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 10px 30px rgba(27, 31, 59, .15); }

/* Switch */
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; border: 0; background: var(--line-2); cursor: pointer; padding: 0; flex: none; transition: background-color .15s; }
.switch span { position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .15s; }
.switch[aria-checked=true] { background: var(--brand); }
.switch[aria-checked=true] span { inset-inline-start: 21px; }

/* Socials */
.social-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.social-field { flex: 1; display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; min-width: 0; }
.social-field > span { font-weight: 700; font-size: .9rem; }
.empty-inline { padding: 8px 0; }
.add-social { margin-top: 8px; }
.add-social h3 { margin-bottom: 10px; font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px dashed var(--line-2); background: var(--surface); cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-style: solid; border-color: var(--ink-2); color: var(--ink); }
.chip .ic { width: 16px; height: 16px; }

/* Design */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.theme-card { display: grid; gap: 6px; cursor: pointer; }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch { display: grid; align-content: start; justify-items: center; gap: 6px; height: 150px; padding: 16px 12px; border-radius: var(--r); border: 2px solid var(--line); transition: border-color .15s, transform .15s; }
.theme-card input:checked + .theme-swatch { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.theme-card input:focus-visible + .theme-swatch { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-card.locked { cursor: not-allowed; }
.theme-card.locked .theme-swatch { opacity: .6; }
.theme-name { font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 4px; }
.ts-dot { width: 26px; height: 26px; border-radius: 50%; opacity: .9; margin-bottom: 4px; }
.ts-btn { display: block; width: 100%; height: 18px; background: var(--b, var(--ink)); }
.ts-rounded { border-radius: 6px; }
.ts-pill { border-radius: 99px; }
.ts-square { border-radius: 0; }
.ts-outline { background: transparent !important; border: 1.5px solid var(--c, var(--ink)); border-radius: 6px; }
.ts-soft { border-radius: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.color-field { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; }
.color-field input { width: 100%; height: 44px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.custom-fields { display: grid; gap: 14px; }
.style-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.style-opt input { position: absolute; opacity: 0; pointer-events: none; }
.style-opt span { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: .85rem; font-weight: 600; cursor: pointer; text-align: center; --b: var(--ink-2); --c: var(--ink-2); }
.style-opt input:checked + span { border-color: var(--brand); background: var(--brand-tint); }
.style-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.is-locked h2 { color: var(--muted); }

/* Settings */
.avatar-edit { display: flex; align-items: center; gap: 18px; margin-bottom: 4px; }
.avatar-edit > div { display: grid; gap: 6px; justify-items: start; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.danger-zone { border-color: #F0C9C1; }
.danger-zone h2 { color: var(--danger); margin-bottom: 6px; }
.danger-zone .form { margin-top: 12px; }

/* QR */
.qr-studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.qr-stage { display: grid; justify-items: center; gap: 14px; text-align: center; position: sticky; top: 24px; }
.qr-canvas { width: min(100%, 300px); aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r); background-image: linear-gradient(45deg, #EEF0F4 25%, transparent 25%), linear-gradient(-45deg, #EEF0F4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #EEF0F4 75%), linear-gradient(-45deg, transparent 75%, #EEF0F4 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.qr-canvas svg { width: 100%; height: 100%; display: block; }
.qr-target { word-break: break-all; }
.qr-dl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qr-opts { display: grid; gap: 14px; }
.qr-opts > h2 { margin-bottom: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-weight: 600; font-size: .88rem; cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Stats */
.range-pick { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.range-pick a { padding: 6px 14px; border-radius: 6px; font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.range-pick a:hover { text-decoration: none; background: var(--paper); }
.range-pick a.on { background: var(--ink); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.tiles-5 { grid-template-columns: repeat(5, 1fr); }
.tile { display: grid; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tile span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.tile strong { font-size: 1.75rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.chart { position: relative; margin: 0; padding-left: 40px; direction: ltr; }
.chart-plot { position: relative; height: 200px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .base { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .bar { fill: var(--brand); }
.chart .hit { fill: transparent; }
.chart .bar-g:hover .bar, .chart .bar-g.on .bar { fill: var(--brand-ink); }
.chart .bar-g:hover .hit, .chart .bar-g.on .hit { fill: rgba(27, 31, 59, .05); }
.yl { position: absolute; right: calc(100% + 8px); transform: translateY(50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-x { position: relative; height: 24px; }
.chart-x span { position: absolute; top: 6px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); padding: 6px 10px; border-radius: var(--r-sm); background: var(--ink); color: #fff; font-size: .8rem; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 3; }
.table-view { margin-top: 10px; }
.table-view summary { cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.tbl { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .9rem; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.tbl th { font-size: .8rem; color: var(--muted); font-weight: 700; }
.tbl-wrap { overflow-x: auto; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 12px; font-size: .9rem; }
.hb-label { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.hb-track { height: 10px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.hb-val { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: end; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + .panel { margin-top: 18px; }

/* Account / plans */
.current-plan { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.plan-name { font-size: 1.4rem; font-weight: 800; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan { display: grid; gap: 10px; align-content: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.plan.featured { border: 2px solid var(--ink); }
.plan.current { border-color: var(--brand); background: var(--brand-tint); }
.plan h3 { font-size: 1.05rem; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price strong { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.price span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.feat { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.feat li { display: flex; align-items: center; gap: 8px; }
.feat li .ic { color: var(--brand); }
.feat li.no { color: var(--muted); }
.feat li.no .ic { color: var(--line-2); }

/* Admin */
.search input { min-height: 38px; width: min(320px, 70vw); }
.admin-tbl td { min-width: 110px; }
.admin-tbl select, .admin-tbl input { min-height: 36px; padding: 4px 8px; font-size: .88rem; }
.admin-tbl tr.is-off td { background: #FAFAFB; color: var(--muted); }

/* ---------- Billing ---------- */
.verify-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; margin-bottom: 18px; border-radius: var(--r); background: var(--saffron-tint); }
.verify-bar > .ic { color: #9A6B00; }
.verify-bar p { flex: 1 1 260px; font-weight: 600; font-size: .92rem; }
.note.ok { padding: 8px 12px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand-ink); font-size: .86rem; font-weight: 600; }
.note.danger { margin-top: 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--danger-tint); color: var(--danger); font-size: .88rem; font-weight: 600; }
.warn-text { color: #9A6B00; }
.ok-text { color: var(--brand) !important; font-weight: 700; }
.center { text-align: center; }
.inline { display: inline-flex; align-items: center; gap: 10px; }
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; max-width: 1000px; }
.order-lines { margin: 0; display: grid; }
.order-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.order-lines dt { color: var(--muted); font-weight: 600; }
.order-lines dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.order-lines .total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; }
.order-lines .total dt { color: var(--ink); font-weight: 800; }
.order-lines .total dd { font-size: 1.3rem; font-weight: 800; }
.order-note { margin: 12px 0 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand-ink); font-weight: 600; font-size: .92rem; }
.pay-box .mysr-form { min-height: 200px; }
.terms-line { margin-top: 12px; }
.result-card { max-width: 560px; margin: 24px auto; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 36px 24px; }
.result-ic { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; }
.result-ic.ok { background: var(--brand-tint); color: var(--brand); }
.result-ic.bad { background: var(--danger-tint); color: var(--danger); }
.result-ic.wait { background: var(--saffron-tint); color: #9A6B00; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
.sub-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.renew-box { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--paper); min-width: 240px; }
.card-line { font-weight: 700; font-size: .9rem; }
.plan-buy { display: grid; gap: 8px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.pill-paid { background: var(--brand-tint); color: var(--brand-ink); }
.pill-failed, .pill-abandoned { background: var(--danger-tint); color: var(--danger); }
.pill-initiated, .pill-review { background: var(--saffron-tint); color: #7A5500; }
.pill-refunded { background: #ECEEF4; color: var(--ink-2); }

/* ---------- Admin ---------- */
.admin-tabs .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .72rem; }
.set-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.set-jump a { padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.set-jump a:hover { text-decoration: none; border-color: var(--ink-2); }
.panel[id] { scroll-margin-top: 20px; }
.copy-row { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); direction: ltr; }
.copy-row code { flex: 1; font-size: .82rem; overflow-x: auto; white-space: nowrap; }
.checks-row { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.field.narrow { max-width: 220px; }
.row-2.tight { gap: 10px; }
.plans-tbl input { min-height: 38px; padding: 6px 8px; }
.plans-tbl td { min-width: 0; }
.plans-tbl input[type=text] { min-width: 110px; }
.plans-tbl input[type=number] { width: 96px; }
.plans-tbl input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.legal-edit { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.legal-edit summary { cursor: pointer; font-weight: 700; }
.legal-edit summary a { margin-inline-start: 8px; font-weight: 600; }
.legal-edit .row-2 { margin-top: 12px; }
.legal-edit textarea { font-size: .88rem; line-height: 1.7; }
.report-list { display: grid; gap: 12px; }
.report { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; }
.report-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.report-items { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: .9rem; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.report-actions input[type=text] { min-height: 34px; width: min(280px, 60vw); }
.blocked-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.field-legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
fieldset.field { display: grid; gap: 8px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- Menu editor ---------- */
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.menu-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.menu-top .url-pill { margin-top: 0; }
.menu-intro { display: flex; align-items: center; gap: 16px; }
.menu-intro h2 { margin-bottom: 4px; }
.menu-meter { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: .88rem; }
.menu-cats { display: grid; gap: 0; }
.menu-cat.off .cat-title h2 { opacity: .5; }
.cat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; position: relative; }
.cat-title { flex: 1; min-width: 0; }
.cat-title h2 { font-size: 1.05rem; }
.cat-title h2 small { font-weight: 600; font-size: .85rem; }
.cat-edit summary { list-style: none; cursor: pointer; }
.cat-edit summary::-webkit-details-marker { display: none; }
.cat-edit[open] summary { background: var(--paper); }
.cat-edit-box { position: absolute; inset-inline-end: 0; top: 44px; z-index: 5; width: min(340px, 86vw); display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.item-list { margin-bottom: 12px; }
.item-thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--paper); color: var(--muted); flex: none; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb.lg { width: 84px; height: 84px; border-radius: 14px; }
.img-pick { display: flex; align-items: center; gap: 14px; }
.img-pick > div { display: grid; gap: 6px; justify-items: start; }
.add-item > summary { list-style: none; display: inline-flex; cursor: pointer; }
.add-item > summary::-webkit-details-marker { display: none; }
.add-item[open] > summary { margin-bottom: 14px; }
.add-item-form { padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--r); }
.variants { display: grid; gap: 8px; }
.var-rows { display: grid; gap: 8px; }
.var-row { display: grid; grid-template-columns: 1.2fr 1.2fr .8fr auto; gap: 8px; align-items: center; }
.var-row input { min-height: 40px; }
.add-var { justify-self: start; color: var(--brand); font-weight: 700; }
.tag-groups { display: grid; gap: 12px; }
.checks-col { display: grid; gap: 10px; }
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
.tile small { font-size: .8rem; font-weight: 600; }

/* Orders */
.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.order { border: 1px solid var(--line); border-inline-start: 4px solid var(--saffron); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.order-done { border-inline-start-color: var(--brand); opacity: .78; }
.order-cancelled { border-inline-start-color: var(--line-2); opacity: .55; }
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.order-total { margin-inline-start: auto; font-size: 1.05rem; }
.order-who { font-weight: 700; font-size: .92rem; }
.order-lines-list { margin: 0; padding-inline-start: 18px; font-size: .9rem; color: var(--ink-2); }
.order-status { margin-top: 4px; }
.order-status span { padding: 5px 12px; font-size: .82rem; }

/* ---------- Branches & reviews ---------- */
.branch-list { display: grid; gap: 0; }
.branch-card { padding: 0; }
.branch-card .li-row { padding: 12px 14px; }
.branch-card .li-edit { padding: 18px; }
.temp-check { align-self: end; min-height: 44px; }
.hours { display: grid; gap: 10px; }
.hours-grid { display: grid; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--paper); }
.hours-row.is-closed .hours-times, .hours-row.is-allday .hours-times { opacity: .35; }
.hours-times { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hours-times input[type=time] { width: 116px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); font: inherit; direction: ltr; }
.shift2 { display: inline-flex; align-items: center; gap: 6px; }
.hours-flags { display: flex; gap: 12px; }
.copy-hours { justify-self: start; color: var(--brand); font-weight: 700; }
.br-status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; padding: 2px 10px; border-radius: 99px; background: var(--paper); white-space: nowrap; }
.br-status i { width: 8px; height: 8px; border-radius: 50%; }
.br-open { color: #17663A; background: #E2F4E9; } .br-open i { background: #22B35E; }
.br-closed { color: #8E2B14; background: #FBEAE6; } .br-closed i { background: #D64545; }
.br-temp { color: #7A5500; background: var(--saffron-tint); } .br-temp i { background: #E3A008; }
.stars-big { font-size: 2rem; letter-spacing: 2px; color: var(--saffron); line-height: 1; }
.rev-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.rev-avg { display: grid; justify-items: center; gap: 4px; min-width: 120px; }
.rev-avg strong { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.rev-dist { flex: 1; min-width: 220px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fb { border: 1px solid var(--line); border-inline-start: 4px solid var(--saffron); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.fb.read { border-inline-start-color: var(--line-2); opacity: .75; }
.fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.fb-stars { color: #E3A008; letter-spacing: 1px; }
.fb-who { margin-inline-start: auto; }

/* ---------- Auth ---------- */
body.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.auth-top { display: flex; justify-content: space-between; align-items: center; padding: 20px clamp(16px, 4vw, 40px); }
.auth-main { flex: 1; display: grid; place-items: start center; padding: 20px 16px 60px; }
.auth-card { width: min(100%, 440px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .lead { color: var(--muted); margin: 6px 0 22px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: .92rem; }
.err { margin: auto; display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 20px; max-width: 460px; }
.err img { border-radius: 12px; margin-bottom: 8px; }
.err-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }


/* ---------- v5: pages list, team, hand-over ---------- */
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 14px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.search-box .ic { color: var(--muted); }
.search-box input[type=search] { flex: 1; border: 0; background: none; padding: 11px 0; min-width: 0; box-shadow: none; }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.list-h { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: 1rem; }
.tag.ok { background: var(--brand-tint); border-color: transparent; color: var(--brand-ink); }
.member-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.member-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.member-list .grow { flex: 1; min-width: 0; display: grid; }
.member-list .grow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-list form { margin: 0; }
.grow { flex: 1; min-width: 0; }
.tr-pending { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.tr-pending form { margin: 0; }
.alt-fields { padding: 14px; border-radius: var(--r); background: var(--paper); display: grid; gap: 12px; margin-bottom: 10px; }
.invite-page { display: flex; align-items: center; gap: 14px; padding: 12px; margin-bottom: 18px; border-radius: var(--r); background: var(--paper); }
.invite-page > div { display: grid; min-width: 0; }
.invite-card .btn-block + .btn-block, .nfc-card .btn-block + .btn-block { margin-top: 10px; }
.nfc-card .btn-block + p { margin-top: 12px; }
.invite-card .note { margin-bottom: 12px; }

/* ---------- v5: NFC cards ---------- */
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .06em; }
.nfc-visual {
  position: relative; aspect-ratio: 1.586; width: min(100%, 300px); margin: 0 auto 22px; padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between; border-radius: 16px; color: #F4EFE3;
  background: radial-gradient(120% 140% at 100% 0%, #2A7A69 0%, #1E4D43 45%, #12302A 100%);
  box-shadow: 0 18px 40px -18px rgba(18, 48, 42, .65);
}
.nfc-visual::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.12) 50%, transparent 65%); }
.nfc-visual.off { filter: grayscale(1); opacity: .7; }
.nfc-chip { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: rgba(244, 239, 227, .14); }
.nfc-chip .ic { width: 26px; height: 26px; }
.nfc-visual > span { align-self: flex-end; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: .14em; opacity: .9; }
.nfc-card h1 { text-align: center; }
.nfc-card .lead { text-align: center; }
.center { text-align: center; }
.cards-empty { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: center; }
.cards-empty .nfc-visual { margin: 0; }
.steps-mini { margin: 10px 0; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.card-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.nfc-row { display: grid; gap: 14px; margin: 0; }
.nfc-row.is-off { opacity: .7; }
.nfc-row-head { display: flex; align-items: center; gap: 12px; }
.nfc-row-head .grow { display: grid; }
.nfc-mini { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #F4EFE3; background: linear-gradient(135deg, #2A7A69, #1E4D43); }
.nfc-taps { display: grid; justify-items: center; line-height: 1.1; }
.nfc-taps strong { font-size: 1.25rem; }
.nfc-taps small { color: var(--muted); }
.nfc-row-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.nfc-row-foot form { margin: 0; }
.admin-cards-top { margin-bottom: 0; }
.admin-cards-top .panel { height: calc(100% - 18px); }
td.actions { white-space: nowrap; }
td.actions .link-btn + .link-btn { margin-inline-start: 10px; }

/* ---------- v5: AI builder ---------- */
.ai-panel { border: 1px solid transparent; background:
  linear-gradient(var(--surface), var(--surface)) padding-box,
  linear-gradient(120deg, #1E6B5C, #F2B632, #1E6B5C) border-box; }
.ai-panel summary { list-style: none; cursor: pointer; margin: 0; }
.ai-panel summary::-webkit-details-marker { display: none; }
.ai-panel details[open] summary { margin-bottom: 14px; }
.ai-panel h2 { display: flex; align-items: center; gap: 10px; }
.ai-badge { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #1E6B5C, #2E8E78); }
.ai-badge .ic { width: 18px; height: 18px; }
.ai-draft { display: grid; gap: 10px; }
.ai-pick { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.ai-pick:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.ai-pick input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.ai-pick > span:last-child { display: grid; gap: 2px; min-width: 0; }
.ai-pick small { color: var(--muted); font-size: .78rem; font-weight: 700; }
.ai-link { align-items: center; }
.ai-link .li-ic { display: grid; }
.ai-theme { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.ai-theme i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); }
.ai-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-chip { cursor: pointer; }
.ai-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ai-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.ai-chip span .ic { width: 16px; height: 16px; }
.ai-chip input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-ink); }
.ai-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.is-busy { pointer-events: none; opacity: .8; }
.btn.is-busy .ic { animation: ai-spin 1.2s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }


/* ---------- v6: growth ---------- */
.order-lines .disc dd, .order-lines .disc dt { color: var(--brand); }
.coupon-form { margin-top: 16px; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; min-width: 0; }
.coupon-row select { width: auto; }
.coupon-form .note { margin-top: 8px; }
.cp-limits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.coupon-top { margin-bottom: 18px; }
.tiles-3 { grid-template-columns: repeat(3, 1fr); margin: 12px 0; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag.hl { background: var(--saffron-tint); border-color: transparent; color: #7A5500; }
.tag.sch-upcoming { background: #EAF0FB; border-color: transparent; color: #234A8F; }
.tag.sch-live { background: var(--brand-tint); border-color: transparent; color: var(--brand-ink); }
.tag.sch-ended { background: var(--paper); color: var(--muted); }
.tag .ic.xs { width: 12px; height: 12px; vertical-align: -1px; }
.link-tools { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 10px 14px; }
.link-tools summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.link-tools[open] summary { margin-bottom: 12px; }
.link-tools .row-2 { margin-bottom: 6px; }
.lead-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lead { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-inline-start: 3px solid var(--saffron); border-radius: var(--r); }
.lead.done { border-inline-start-color: var(--line); opacity: .78; }
.lead-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lead-main p { color: var(--ink-2); }
.lead-contacts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 700; font-size: .9rem; }
.lead-contacts a { display: inline-flex; align-items: center; gap: 4px; }
.lead-actions { display: flex; align-items: center; gap: 6px; }
.lead-actions form { margin: 0; }
.ref-panel { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center; background: linear-gradient(135deg, #FFFBEF, #FDF3DA); border-color: #F3DFA6; }
.ref-copy { display: grid; gap: 10px; }
.ref-copy h2 { display: flex; align-items: center; gap: 8px; }
.ref-link { justify-self: start; max-width: 100%; background: var(--surface); }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ref-stats div { display: grid; justify-items: center; padding: 14px 6px; border-radius: var(--r); background: var(--surface); text-align: center; }
.ref-stats strong { font-size: 1.5rem; line-height: 1.2; }
.ref-stats span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.weekly-row, .export-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.weekly-row > span, .export-row > span { display: grid; flex: 1; }
.export-row { border-top: 1px solid var(--line); justify-content: space-between; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.metric span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.metric strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); }
.metric.main { background: var(--ink); color: #fff; border-color: var(--ink); }
.metric.main span, .metric.main small { color: rgba(255, 255, 255, .7); }


/* ---------- v7: bookings & broadcasts ---------- */
.seg-links { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--paper); }
.seg-links a { padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.seg-links a:hover { text-decoration: none; color: var(--ink); }
.seg-links a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.bk-day { margin: 18px 0 8px; font-size: .98rem; display: flex; gap: 8px; align-items: baseline; }
.bk-day:first-of-type { margin-top: 4px; }
.bk-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; }
.bk-row.st-pending { border-inline-start: 3px solid var(--saffron); }
.bk-row.st-confirmed { border-inline-start: 3px solid var(--brand); }
.bk-row.st-cancelled, .bk-row.st-noshow { opacity: .6; }
.bk-time { display: grid; text-align: center; padding: 6px 4px; border-radius: var(--r-sm); background: var(--paper); line-height: 1.3; }
.bk-time strong { font-size: .95rem; }
.bk-time small { color: var(--muted); font-size: .75rem; }
.bk-main { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; margin: 0; }
.tag.bk-st-pending { background: var(--saffron-tint); border-color: transparent; color: #7A5500; }
.tag.bk-st-confirmed, .tag.bk-st-done { background: var(--brand-tint); border-color: transparent; color: var(--brand-ink); }
.svc { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; }
.svc summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.svc[open] summary { margin-bottom: 12px; }
.svc.add { border-style: dashed; }
.svc.add summary { color: var(--brand); }
.bc-langs { margin: 4px 0 8px; }
.bc-langs > div { padding: 14px; border-radius: var(--r); background: var(--paper); display: grid; gap: 10px; }

/* ---------- Responsive ---------- */
/* AI menu import */
.mai .form { gap: 12px; }
.mai-drop { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line-2); border-radius: var(--r); background: var(--surface); text-align: center; cursor: pointer; position: relative; transition: border-color .15s, background .15s; }
.mai-drop:hover, .mai-drop.over { border-color: var(--brand); background: var(--brand-tint); }
.mai-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.mai-drop:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.mai-drop-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-tint); color: var(--brand); }
.mai-files { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.mai-files li { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 10px; font-size: .84rem; font-weight: 600; max-width: 100%; }
.mai-files img, .mai-files .ic { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; flex: none; }
.mai-files .ic { padding: 9px; background: var(--paper); }
.mai-files span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mai-tips { margin: 0; padding-inline-start: 18px; display: grid; gap: 2px; }
.mai-progress { display: grid; gap: 8px; }
.mai-progress .bar { height: 6px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.mai-progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #2E8E78); border-radius: inherit; transition: width .8s ease; }
.form-error { color: var(--danger); background: var(--danger-tint); padding: 10px 12px; border-radius: var(--r-sm); font-weight: 600; font-size: .9rem; }
.mai-sum { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--brand-tint); }
.mai-sum > .ic { color: var(--brand); flex: none; margin-top: 2px; }
.mai-cat { border: 1px solid var(--line); border-radius: var(--r); padding: 0 0 6px; margin: 0; min-width: 0; }
.mai-cat legend { display: flex; align-items: center; gap: 8px; padding: 0 8px; margin-inline-start: 8px; max-width: calc(100% - 16px); }
.mai-cat legend small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mai .mai-cat-name { font-weight: 800; flex: 0 1 auto; width: 12em; min-width: 6em; field-sizing: content; max-width: 100%; }
.mai-cat input[type=checkbox], .mai-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.mai-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 10px; align-items: start; padding: 8px 12px; border-top: 1px solid var(--line); }
.mai-cat legend + .mai-item { border-top: 0; }
.mai-item > input[type=checkbox] { margin-top: 9px; }
.mai-item:has(> input:not(:checked)) { opacity: .45; }
.mai-names { display: grid; gap: 4px; min-width: 0; }
.mai .mai-names input, .mai .mai-cat-name { padding: 6px 10px; min-height: 0; height: auto; border-color: transparent; background: transparent; box-shadow: none; }
.mai .mai-names input:hover, .mai .mai-cat-name:hover { border-color: var(--line); }
.mai .mai-names input:focus, .mai .mai-cat-name:focus { border-color: var(--brand); background: var(--surface); }
.mai .mai-names input { font-weight: 700; }
.mai .mai-names input.en { font-weight: 500; font-size: .86rem; padding-block: 2px; color: var(--ink-2); }
.mai .mai-names small { padding-inline: 11px; line-height: 1.5; }
[dir=rtl] .mai .mai-names input.en { text-align: right; }
.mai-names { gap: 0; }
.mai-price { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); font-weight: 700; }
.mai .mai-price input { width: 84px; padding: 6px 8px; min-height: 0; text-align: center; font-weight: 800; }
.mai-item.needs .mai-price input, .mai-price input.bad { border-color: var(--saffron); background: var(--saffron-tint); }
.mai-vars { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 220px; padding-top: 6px; }
.mai-vars span { font-size: .78rem; padding: 3px 8px; border-radius: 99px; background: var(--paper); white-space: nowrap; }
.mai-mode { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
@media (max-width: 600px) {
  .mai-item { grid-template-columns: auto minmax(0, 1fr); }
  .mai-price, .mai-vars { grid-column: 2; justify-content: flex-start; max-width: none; }
  .mai-cat-name { width: 100%; }
}

@media (max-width: 1180px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .preview { display: none; }
}
@media (max-width: 900px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; height: auto; z-index: 10; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 8px 14px; padding: 10px 16px; border-inline-end: 0; border-bottom: 1px solid var(--line);
  }
  .side .brand span { display: none; }
  .side-nav { display: flex; flex: 1; gap: 2px; overflow-x: auto; }
  .side-nav a { padding: 8px 10px; }
  .side-nav a span { display: none; }
  .side-foot { margin: 0; display: flex; align-items: center; gap: 10px; }
  .plan-chip { display: none; }
  .side-row .link-btn span { display: none; }
  .main { padding-top: 20px; }
  .qr-studio, .grid-2, .checkout { grid-template-columns: minmax(0, 1fr); }
  .qr-stage { position: static; }
  .tiles-5, .tiles-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .row-3 { grid-template-columns: 1fr 1fr; }
  .var-row { grid-template-columns: 1fr 1fr; }
  .var-row input:nth-child(3) { grid-column: 1; }
  .hours-row { grid-template-columns: 1fr; }
  body { font-size: 14.5px; }
  h1 { font-size: 1.35rem; }
  .row-2 { grid-template-columns: 1fr; }
  .panel { padding: 16px; border-radius: var(--r); }
  .tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile { padding: 12px; }
  .tile strong { font-size: 1.3rem; }
  .tiles-5 { grid-template-columns: repeat(2, 1fr); }
  .social-field { grid-template-columns: 1fr; gap: 4px; }
  .clicks small { display: none; }
  .li-ic { display: none; }
  .page-row-meta { display: none; }
  .auth-card { padding: 22px; }
  .cards-empty { grid-template-columns: 1fr; }
  .ref-panel { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .lead { flex-direction: column; }
  .bk-row { grid-template-columns: 64px minmax(0, 1fr); }
  .bk-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .nfc-row-head .tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Loyalty */
.loy-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 16px; }
.loy-steps li { display: grid; gap: 4px; }
.loy-steps li::marker { font-weight: 800; color: var(--brand); }
.loy-urls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.loy-search { display: flex; gap: 6px; }
.loy-search input { width: 220px; padding: 7px 12px; }
.loy-list { list-style: none; margin: 0; padding: 0; }
.loy-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.loy-row:first-child { border-top: 0; }
.loy-row.ready { background: linear-gradient(90deg, transparent, var(--saffron-tint)); }
.loy-who { display: grid; gap: 1px; min-width: 0; }
.loy-who .muted[dir=ltr] { text-align: start; }
[dir=rtl] .loy-who .muted[dir=ltr] { text-align: right; }
.loy-prog { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loy-bar { flex: 1 1 80px; max-width: 140px; height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.loy-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.loy-ready { background: var(--saffron-tint); color: #7A5500; display: inline-flex; align-items: center; gap: 4px; }
.loy-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.more-menu { position: relative; }
.more-menu summary { list-style: none; cursor: pointer; font-weight: 800; font-size: 1.1rem; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-box { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; display: grid; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.more-box a, .more-box button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--ink); width: 100%; text-align: start; }
.more-box a:hover, .more-box button:hover { background: var(--paper); }
.more-box .danger { color: var(--danger); }
@media (max-width: 700px) {
  .loy-row { grid-template-columns: minmax(0, 1fr) auto; }
  .loy-prog { grid-column: 1 / -1; grid-row: 2; }
  .loy-actions { grid-row: 1; grid-column: 2; }
  .loy-search input { width: 100%; }
  .loy-search { flex: 1 1 100%; }
}

/* Menu kind & product photos */
.menu-intro:has(.kind-pick) { align-items: flex-start; }
.kind-pick { margin-top: 14px; display: grid; gap: 8px; }
.kind-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kind-opt { font: inherit; text-align: start; cursor: pointer; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); }
.kind-opt .ic { grid-row: span 2; width: 26px; height: 26px; color: var(--brand); }
.kind-opt small { color: var(--muted); font-size: .8rem; line-height: 1.5; }
.kind-opt:hover, .kind-opt.on { border-color: var(--brand); background: var(--brand-tint); }
.extra-photos { display: grid; gap: 8px; justify-items: start; }
.photo-row { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb { display: grid; gap: 4px; justify-items: center; cursor: pointer; }
.photo-thumb img { width: 76px; height: 95px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.photo-thumb:has(input:checked) img { opacity: .35; outline: 2px solid var(--danger); }
@media (max-width: 600px) { .kind-opts { grid-template-columns: 1fr; } }
