/* ==========================================================================
   Shared mockup stylesheet
   Tokens mirror the shadcn/zinc palette used by the brand workspace and the
   company console. The QR landing page keeps its own --brand-* palette scoped
   to .qr-page, copied from the sections package's brand.css.
   No external fonts or assets.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 240 10% 3.9%;
  --radius: 0.5rem;

  --bg: hsl(var(--background));
  --fg: hsl(var(--foreground));
  --card-bg: hsl(var(--card));
  --muted-bg: hsl(var(--muted));
  --muted-fg: hsl(var(--muted-foreground));
  --border-c: hsl(var(--border));
  --primary-bg: hsl(var(--primary));
  --primary-fg: hsl(var(--primary-foreground));
  --accent-blue: #2563eb;
  --active: #00b0ff;
  --success: #059669;
  --warning: #b45309;

  --sidebar-w: 16rem;
  --header-h: 4rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 2px 8px -3px rgb(0 0 0 / 0.08), 0 2px 5px -3px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 4px 12px -4px rgb(0 0 0 / 0.1), 0 2px 8px -4px rgb(0 0 0 / 0.06);
  color-scheme: light;
}

html[data-theme='dark'] {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 5.5%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 5.5%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 45%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 18%;
  --input: 240 3.7% 18%;
  --ring: 240 4.9% 83.9%;
  --sidebar-bg: hsl(240 10% 5%);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 2px 8px -3px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 4px 12px -4px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, svg { display: block; }
table { border-collapse: collapse; width: 100%; }

.icon {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-2x { width: 32px; height: 32px; }
.icon-3x { width: 48px; height: 48px; stroke-width: 1.4; }

.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-fg); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--sidebar-bg, var(--bg));
  border-inline-end: 1px solid var(--border-c);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}
.sidebar-logo {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #1e1e33, #3f3f5c);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
}
.sidebar-divider-v { width: 1px; height: 24px; background: var(--border-c); }
.sidebar-ws { min-width: 0; }
.sidebar-ws strong { display: block; font-size: 13px; font-weight: 600; }
.sidebar-ws span { display: block; font-size: 11px; color: var(--muted-fg); }

.side-nav { flex: 1; overflow-y: auto; padding: 4px 16px 8px; }
.nav-section { margin-bottom: 20px; }
.nav-section-title {
  margin-bottom: 6px; padding: 0 8px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-fg);
  border-bottom: 1px solid var(--border-c);
}
.nav-item {
  display: flex; align-items: center;
  border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--fg);
  position: relative;
}
.nav-item + .nav-item { margin-top: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  padding: 8px 10px; border-radius: 8px;
}
.nav-add {
  display: grid; place-items: center; width: 24px; height: 24px;
  margin-inline-end: 6px; border-radius: 6px; color: var(--muted-fg);
  opacity: 0; transition: opacity .15s, background .15s;
}
.nav-item:hover .nav-add, .nav-item.active .nav-add { opacity: 1; }
.nav-add:hover { background: var(--bg); color: var(--fg); }
.nav-item:hover { background: var(--muted-bg); }
.nav-item.active { background: hsl(var(--secondary)); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; inset-inline-start: -16px;
  top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--active);
}
.nav-item.disabled { opacity: 0.55; cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; }
.nav-item .badge { margin-inline-start: auto; }

.sidebar-links { padding: 4px 16px; display: grid; gap: 4px; }
.sidebar-links .nav-item { font-size: 13px; }
.sidebar-footer { border-top: 1px solid var(--border-c); padding: 8px 8px 6px; }
.sidebar-footer .menu-wrap { width: 100%; }
.sidebar-user {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px; border-radius: 12px; background: var(--card-bg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-c);
}
.sidebar-user:hover { box-shadow: var(--shadow-md); }
.sidebar-user .meta { min-width: 0; flex: 1; text-align: start; }
.sidebar-user .meta strong { display: block; font-size: 12.5px; font-weight: 600; }
.sidebar-user .meta span { display: block; font-size: 11px; color: var(--muted-fg); }
.sidebar-version { padding: 4px 10px 2px; font-size: 10px; color: var(--muted-fg); opacity: 0.45; }

.avatar {
  width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #1d4ed8; color: #fff; font-weight: 600; font-size: 13px;
}

.app-main {
  flex: 1; min-width: 0;
  margin-inline-start: var(--sidebar-w);
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--bg);
  border-bottom: 1px solid var(--border-c);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.crumbs .sep { color: var(--muted-fg); }
.crumbs .current { font-weight: 600; }
.crumbs .root { color: var(--muted-fg); }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }

.content { flex: 1; padding: 16px; min-width: 0; }
.content.narrow { max-width: 1100px; }
.content.tight { padding: 8px 16px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.page-head p { margin-top: 6px; color: var(--muted-fg); font-size: 13.5px; }
.page-head .rule { height: 1px; background: var(--border-c); margin-top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  background: var(--primary-bg); color: var(--primary-fg);
  transition: opacity .15s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { opacity: 0.9; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px;
}
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border-c); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: var(--muted-bg); opacity: 1; }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--muted-bg); opacity: 1; }
.btn-danger { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border-c); background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow-sm);
}
.icon-btn:hover { background: var(--muted-bg); }
.icon-btn.plain { border-color: transparent; box-shadow: none; background: transparent; }
.icon-btn.plain:hover { background: var(--muted-bg); }
.icon-btn.sm { width: 28px; height: 28px; }

/* ---------- cards ---------- */
.card {
  background: var(--card-bg); border: 1px solid var(--border-c);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-header { padding: 20px 20px 0; }
.card-content { padding: 20px; }
.card-footer { padding: 0 20px 20px; display: flex; align-items: center; gap: 8px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-desc { font-size: 12.5px; color: var(--muted-fg); margin-top: 2px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.label { font-size: 13px; font-weight: 500; }
.label .req { color: hsl(var(--destructive)); }
.hint { font-size: 11.5px; color: var(--muted-fg); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--bg); color: var(--fg);
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  font-size: 13px; box-shadow: var(--shadow-sm);
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 92px; }
.input::placeholder, .textarea::placeholder { color: var(--muted-fg); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-inline-end: 34px;
}
.input-group { position: relative; }
.input-group .input { padding-inline-start: 36px; }
.input-group > .icon { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); }
.input-group .trail {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.checkbox, .radio {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer;
}
.checkbox input, .radio input { accent-color: hsl(var(--primary)); width: 15px; height: 15px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 40px; height: 22px; border-radius: 999px; background: hsl(var(--input));
  position: relative; transition: background .18s; flex-shrink: 0;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; inset-inline-start: 2px;
  width: 18px; height: 18px; border-radius: 999px; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .18s;
}
.switch input:checked + .track { background: var(--accent-blue); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- badges / tabs / misc ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  background: hsl(var(--secondary)); color: var(--secondary-foreground);
  border: 1px solid var(--border-c);
}
.badge-soon { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.badge-success { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.badge-warn { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.badge-dot::before { content: ''; width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
html[data-theme='dark'] .badge-soon { background: #172554; color: #bfdbfe; border-color: #1e3a8a; }
html[data-theme='dark'] .badge-success { background: #052e21; color: #6ee7b7; border-color: #065f46; }
html[data-theme='dark'] .badge-warn { background: #3b2a06; color: #fcd34d; border-color: #78400b; }

.tabs {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px;
  border: 1px solid var(--border-c); border-radius: calc(var(--radius) + 2px);
  background: var(--card-bg);
}
.tab {
  padding: 6px 14px; border-radius: calc(var(--radius) - 1px);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted-fg);
}
.tab:hover { color: var(--fg); }
.tab.active { background: var(--primary-bg); color: var(--primary-fg); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 220px; }

.alert {
  display: flex; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border-c); border-radius: var(--radius);
  background: var(--muted-bg); font-size: 13px;
}
.alert .icon { margin-top: 1px; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
html[data-theme='dark'] .alert-info { background: #172554; border-color: #1e3a8a; color: #dbeafe; }

.empty {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 56px 20px; color: var(--muted-fg);
}
.empty .icon { width: 40px; height: 40px; opacity: 0.5; }

/* ---------- table ---------- */
.table-wrap { border: 1px solid var(--border-c); border-radius: var(--radius); overflow: auto; background: var(--card-bg); }
table.data { min-width: 680px; }
table.data th {
  text-align: center; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted-fg);
  padding: 12px 14px; background: var(--muted-bg);
  border-bottom: 1px solid var(--border-c); white-space: nowrap;
}
table.data td {
  padding: 12px 14px; text-align: center; font-size: 13px;
  border-bottom: 1px solid var(--border-c);
}
table.data tbody tr:hover { background: var(--muted-bg); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.left, table.data th.left { text-align: start; }
.cell-strong { font-weight: 600; text-transform: capitalize; }
.table-actions { display: inline-flex; align-items: center; gap: 2px; }
.table-actions .icon-btn { width: 28px; height: 28px; border-color: transparent; box-shadow: none; color: var(--muted-fg); }
.table-actions .icon-btn:hover { background: var(--muted-bg); color: var(--fg); }
.table-actions .icon-btn.danger:hover { color: hsl(var(--destructive)); background: #fef2f2; }
.table-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-top: 1px solid var(--border-c); font-size: 12px;
  color: var(--muted-fg); background: var(--card-bg);
}

/* ---------- dropdowns / popovers ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute; z-index: 60; min-width: 190px;
  inset-inline-end: 0; top: calc(100% + 6px);
  padding: 4px; border-radius: var(--radius);
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  border: 1px solid var(--border-c); box-shadow: var(--shadow-lg);
}
.menu[hidden] { display: none; }
.menu.start { inset-inline-start: 0; inset-inline-end: auto; }
.menu-label { padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .06em; }
.menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 8px; border-radius: calc(var(--radius) - 2px);
  font-size: 13px; text-align: start;
}
.menu-item:hover { background: var(--muted-bg); }
.menu-item .check { margin-inline-start: auto; color: var(--accent-blue); }
.menu-sep { height: 1px; margin: 4px -4px; background: var(--border-c); }
.menu-item.danger { color: hsl(var(--destructive)); }

/* ---------- dialog ---------- */
dialog.dialog {
  padding: 0; border: 1px solid var(--border-c); border-radius: calc(var(--radius) + 4px);
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  box-shadow: var(--shadow-lg); max-width: 440px; width: calc(100% - 32px);
}
dialog.dialog::backdrop { background: rgb(9 9 11 / 0.55); backdrop-filter: blur(2px); }
.dialog-head { padding: 20px 20px 6px; display: flex; align-items: flex-start; gap: 12px; }
.dialog-head h3 { font-size: 16px; font-weight: 600; }
.dialog-head p { font-size: 13px; color: var(--muted-fg); margin-top: 4px; }
.dialog-body { padding: 10px 20px 20px; }
.dialog-foot { padding: 0 20px 20px; display: flex; justify-content: flex-end; gap: 8px; }
dialog.dialog.wide { max-width: 620px; }

/* ---------- toast ---------- */
.toast-host {
  position: fixed; z-index: 90; inset-block-end: 20px; inset-inline-end: 20px;
  display: grid; gap: 8px; width: min(360px, calc(100vw - 40px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius);
  background: hsl(var(--popover)); border: 1px solid var(--border-c);
  box-shadow: var(--shadow-lg); font-size: 13px;
  animation: toast-in .18s ease-out;
}
.toast .icon { color: var(--success); margin-top: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- metric tiles ---------- */
.metrics-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card-bg); border: 1px solid var(--border-c);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.metric-tile { padding: 22px 24px; min-width: 0; }
.metric-tile:nth-child(3n+2), .metric-tile:nth-child(3n+3) { border-inline-start: 1px solid var(--border-c); }
.metric-tile:nth-child(n+4) { border-top: 1px solid var(--border-c); }
.metric-head { display: flex; align-items: center; gap: 12px; }
.metric-label { font-size: 12px; color: var(--muted-fg); font-weight: 500; }
.metric-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.metric-sub { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.metric-sub .k { font-size: 11px; color: var(--muted-fg); }
.metric-sub .v { font-size: 13px; font-weight: 600; }
.metric-sub .div { width: 1px; height: 26px; background: var(--border-c); }
.metric-link { margin-inline-start: auto; }
.icon-ring {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 2px solid var(--border-c);
  background: radial-gradient(circle at 50% 50%, hsl(var(--secondary)), transparent 70%);
}
.corners {
  position: relative; padding: 8px 12px; display: inline-block;
}
.corners::before, .corners::after {
  content: ''; position: absolute; width: 9px; height: 9px;
  border: 2px solid var(--accent-blue); opacity: .75;
}
.corners::before { top: 0; inset-inline-start: 0; border-inline-end: 0; border-bottom: 0; }
.corners::after { bottom: 0; inset-inline-end: 0; border-inline-start: 0; border-top: 0; }
.corners span { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- chart ---------- */
.chart-shell { padding: 8px 20px 20px; border-top: 1px solid var(--border-c); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 8px; }
.chart-head h3 { font-size: 14px; font-weight: 600; }
.chart-area {
  position: relative; height: 240px; display: flex; align-items: flex-end;
  gap: 10px; padding: 8px 0 0; border-bottom: 1px solid var(--border-c);
  background-image: repeating-linear-gradient(to top, var(--border-c) 0 1px, transparent 1px 60px);
}
.chart-area .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.chart-area .bar {
  width: 100%; max-width: 34px; border-radius: 4px 4px 0 0;
  background: linear-gradient(to top, hsl(var(--primary)), hsl(var(--primary) / .55));
  min-height: 4px;
}
.chart-area .bar:hover { background: var(--accent-blue); }
.chart-x { display: flex; gap: 10px; margin-top: 6px; }
.chart-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted-fg); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted-fg); }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: hsl(var(--primary)); }

/* ---------- card grid / selection tiles ---------- */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-card {
  display: flex; align-items: center; gap: 20px; padding: 22px;
  border: 1px solid var(--border-c); border-radius: 14px;
  background: linear-gradient(to bottom, var(--bg), var(--card-bg));
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #bfdbfe; }
.pick-icon {
  width: 60px; height: 60px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; background: #eff6ff; color: #2563eb;
}
html[data-theme='dark'] .pick-icon { background: #172554; color: #93c5fd; }
html[data-theme='dark'] .pick-card:hover { border-color: #1e3a8a; }
.pick-card h3 { font-size: 15px; font-weight: 600; }
.pick-card p { font-size: 12.5px; color: var(--muted-fg); margin-top: 4px; }
.pick-arrow {
  margin-inline-start: auto; width: 38px; height: 38px; border-radius: 999px;
  display: grid; place-items: center; flex-shrink: 0;
  background: #eff6ff; color: #2563eb; transition: background .18s, color .18s;
}
.pick-card:hover .pick-arrow { background: #2563eb; color: #fff; }
html[data-theme='dark'] .pick-arrow { background: #172554; color: #93c5fd; }

/* ---------- dashboard chrome bits ---------- */
.section-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted-fg); }
.kv dd { margin: 0; font-weight: 500; }

/* ---------- auth ---------- */
.auth {
  min-height: 100vh; display: flex; flex-direction: column;
  background: hsl(240 20% 99%);
}
html[data-theme='dark'] .auth { background: hsl(240 10% 3.5%); }
.auth-top { display: flex; justify-content: flex-end; gap: 8px; padding: 16px; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 16px 16px 48px; }
.auth-card {
  width: 100%; max-width: 900px; display: grid; grid-template-columns: 2fr 3fr;
  background: var(--card-bg); border: 1px solid var(--border-c);
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.auth-brand {
  padding: 40px 36px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
  background: linear-gradient(140deg, #18181b, #27272a 60%, #3f3f46);
  color: #fff;
}
.auth-brand .wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark-mark {
  width: 40px; height: 40px; border-radius: 10px;
  border: 2px solid currentColor; position: relative; opacity: .95;
}
.wordmark-mark::before, .wordmark-mark::after {
  content: ''; position: absolute; width: 9px; height: 9px; border: 2px solid currentColor;
}
.wordmark-mark::before { top: 3px; left: 3px; border-right: 0; border-bottom: 0; }
.wordmark-mark::after { bottom: 3px; right: 3px; border-left: 0; border-top: 0; }
.wordmark-text { font-size: 20px; font-weight: 700; letter-spacing: 0.34em; }
.auth-brand .tagline { font-size: 15px; font-weight: 600; text-align: center; letter-spacing: .01em; color: #f4f4f5; }
.auth-brand .brand-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.auth-brand .brand-chips span {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.22); color: #e4e4e7;
}
.auth-form { padding: 36px 40px 40px; }
.auth-logo {
  width: 88px; height: 88px; border-radius: 14px; margin: 0 auto 22px;
  display: grid; place-items: center; background: var(--muted-bg);
  border: 1px solid var(--border-c); font-weight: 700; letter-spacing: .06em; color: var(--muted-fg);
}
.auth-heading { text-align: center; margin-bottom: 24px; }
.auth-heading h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.auth-heading p { font-size: 13px; color: var(--muted-fg); margin-top: 6px; }
.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 20px; font-size: 12.5px; }
.link { color: #2563eb; font-weight: 500; }
.link:hover { text-decoration: underline; }
.auth-note { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-c); text-align: center; font-size: 12px; color: var(--muted-fg); }
.pw-toggle { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--muted-fg); }
.pw-toggle:hover { background: var(--muted-bg); color: var(--fg); }

.auth-simple {
  width: 100%; max-width: 460px; padding: 36px 32px;
  background: var(--card-bg); border: 1px solid var(--border-c);
  border-radius: 20px; box-shadow: var(--shadow-lg);
}
.auth-simple .auth-heading { margin-bottom: 20px; }
.requirements { display: grid; gap: 6px; margin: 14px 0 22px; font-size: 12px; color: var(--muted-fg); }
.requirements li { display: flex; align-items: center; gap: 8px; }
.requirements .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: .5; }

/* ---------- brand cards (company app) ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.brand-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 26px; min-height: 300px;
  border: 2px solid var(--border-c); border-radius: 10px;
  background: var(--card-bg); transition: transform .2s, background .2s;
}
.brand-card:hover { transform: scale(1.02); background: var(--muted-bg); }
.brand-card .logo {
  width: 90px; height: 90px; border-radius: 8px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--border-c);
  font-weight: 700; font-size: 22px; letter-spacing: .04em; color: #18181b;
}
.brand-card .name { font-size: 18px; font-weight: 600; }
.brand-card .meta {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 2px solid hsl(var(--primary) / .28); border-radius: 10px;
  background: var(--bg);
}
.brand-card .meta code { font-size: 11.5px; background: var(--muted-bg); padding: 4px 6px; border-radius: 5px; }
.add-card { border-style: dashed; background: transparent; }
.add-card .plus-ring {
  width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center;
  background: var(--muted-bg); color: var(--muted-fg);
}
.add-card:hover .plus-ring { color: var(--accent-blue); }
.add-card .add-label { font-size: 15px; font-weight: 600; opacity: .6; }
.add-card:hover .add-label { opacity: 1; }

/* ---------- products form ---------- */
.form-shell {
  border: 2px solid var(--border-c); border-radius: var(--radius);
  background: var(--card-bg); padding: 20px 24px 24px;
}
.tab-strip { display: flex; justify-content: center; margin-bottom: 22px; }
.form-section-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb {
  width: 92px; height: 92px; border-radius: 8px; border: 1px dashed var(--border-c);
  display: grid; place-items: center; color: var(--muted-fg);
  background: var(--muted-bg); position: relative;
}
.thumb.filled { border-style: solid; background: #f4f4f5; color: #71717a; }
.thumb .remove {
  position: absolute; top: -6px; inset-inline-end: -6px; width: 20px; height: 20px;
  border-radius: 999px; background: hsl(var(--destructive)); color: #fff;
  display: grid; place-items: center;
}
.attribute-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 8px; }

/* ---------- section manager ---------- */
.section-list { display: grid; gap: 10px; }
.section-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border: 1px solid var(--border-c); border-radius: var(--radius);
  background: var(--card-bg);
}
.section-row:hover { box-shadow: var(--shadow-md); }
.drag-handle { color: var(--muted-fg); cursor: grab; }
.section-type {
  width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center;
  background: var(--muted-bg); color: var(--muted-fg); flex-shrink: 0;
}
.section-row h4 { font-size: 13.5px; font-weight: 600; }
.section-row p { font-size: 11.5px; color: var(--muted-fg); }

/* ---------- QR generator ---------- */
.split-panel { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.preview-panel {
  display: grid; place-items: center; gap: 14px; padding: 28px;
  border: 1px solid var(--border-c); border-radius: var(--radius);
  background:
    linear-gradient(45deg, var(--muted-bg) 25%, transparent 25%, transparent 75%, var(--muted-bg) 75%),
    linear-gradient(45deg, var(--muted-bg) 25%, transparent 25%, transparent 75%, var(--muted-bg) 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px;
  background-color: var(--card-bg);
}
.qr-swatch { width: 200px; height: 200px; background: #fff; padding: 12px; border-radius: 8px; box-shadow: var(--shadow-md); }
.qr-swatch .qr-grid-img { width: 100%; height: 100%; }
.code-box {
  display: grid; place-items: center; gap: 4px; padding: 10px;
  border: 1px solid var(--border-c); border-radius: 8px; background: var(--card-bg);
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; text-align: center;
}

/* ---------- phone preview (styles/brand) ---------- */
.style-layout { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
.control-panel { display: grid; gap: 18px; }
.control-block { border: 1px solid var(--border-c); border-radius: var(--radius); background: var(--card-bg); }
.control-block > header { padding: 12px 14px; border-bottom: 1px solid var(--border-c); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.control-block .body { padding: 14px; display: grid; gap: 12px; }
.color-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border-c); flex-shrink: 0;
}
.slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px;
  background: var(--border-c); outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 999px;
  background: var(--fg); border: 2px solid var(--bg); box-shadow: var(--shadow-sm); cursor: pointer;
}
.phone {
  width: 100%; max-width: 390px; margin: 0 auto; border-radius: 32px;
  border: 10px solid #18181b; background: #fff; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.phone-notch {
  height: 22px; display: grid; place-items: center; background: #18181b;
}
.phone-notch i { width: 78px; height: 6px; border-radius: 999px; background: #3f3f46; }
.phone-screen { max-height: 640px; overflow-y: auto; }

/* ---------- map ---------- */
.map-shell {
  position: relative; height: 520px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-c);
  background:
    radial-gradient(circle at 18% 24%, rgb(37 99 235 / .08), transparent 42%),
    radial-gradient(circle at 78% 68%, rgb(16 185 129 / .08), transparent 40%),
    repeating-linear-gradient(0deg, #eef2f7 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, #eef2f7 0 1px, transparent 1px 44px),
    #f8fafc;
}
html[data-theme='dark'] .map-shell {
  background:
    radial-gradient(circle at 18% 24%, rgb(37 99 235 / .18), transparent 42%),
    radial-gradient(circle at 78% 68%, rgb(16 185 129 / .16), transparent 40%),
    repeating-linear-gradient(0deg, #1f2937 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, #1f2937 0 1px, transparent 1px 44px),
    #0f172a;
}
.map-road { position: absolute; background: #fff; box-shadow: 0 0 0 1px #e2e8f0; }
html[data-theme='dark'] .map-road { background: #1e293b; box-shadow: 0 0 0 1px #334155; }
.road-h { height: 14px; left: 0; right: 0; }
.road-v { width: 14px; top: 0; bottom: 0; }
.pin {
  position: absolute; transform: translate(-50%, -100%);
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 999px 999px 999px 4px; rotate: -45deg;
  background: #2563eb; color: #fff; box-shadow: 0 6px 14px rgb(37 99 235 / .35);
  border: 2px solid #fff;
}
.pin > * { rotate: 45deg; }
.pin.partner { background: #059669; box-shadow: 0 6px 14px rgb(5 150 105 / .35); }
.map-search {
  position: absolute; z-index: 5; top: 16px; inset-inline-start: 16px;
  width: 280px; padding: 12px; border-radius: 12px;
  background: var(--card-bg); border: 1px solid var(--border-c); box-shadow: var(--shadow-lg);
}
.map-controls {
  position: absolute; z-index: 5; top: 16px; inset-inline-end: 16px;
  display: grid; gap: 6px;
}
.map-popup {
  position: absolute; z-index: 6; left: 48%; top: 42%;
  width: 260px; padding: 14px; border-radius: 12px;
  background: var(--card-bg); border: 1px solid var(--border-c);
  box-shadow: var(--shadow-lg);
}
.map-popup h4 { font-size: 13px; font-weight: 600; }
.map-popup p { font-size: 12px; color: var(--muted-fg); margin-top: 3px; }
.map-legend {
  position: absolute; z-index: 5; bottom: 16px; inset-inline-start: 16px;
  display: flex; gap: 14px; padding: 8px 12px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--border-c); font-size: 11.5px;
  box-shadow: var(--shadow-sm);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 8px; height: 8px; border-radius: 999px; }

/* ---------- support ---------- */
.support-card { max-width: 480px; padding: 28px; }
.support-card .head { border-bottom: 1px solid var(--border-c); padding-bottom: 20px; margin-bottom: 22px; }
.support-card .head h1 { font-size: 26px; font-weight: 500; }
.support-card .head p { color: var(--muted-fg); font-size: 14px; margin-top: 6px; }
.channel { display: flex; gap: 18px; align-items: flex-start; }
.channel + .channel { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border-c); }
.channel .badge-icon {
  width: 72px; height: 72px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; border: 1px solid var(--border-c); background: var(--bg);
}
.channel h3 { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.channel p { font-size: 12.5px; color: var(--muted-fg); margin-bottom: 10px; }
.wa { color: #16a34a; }

/* ---------- index hub ---------- */
.hub { max-width: 1180px; margin: 0 auto; padding: 40px 24px 72px; }
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.hub-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.hub-head p { color: var(--muted-fg); margin-top: 6px; max-width: 640px; }
.hub-group { margin-top: 34px; }
.hub-group > header { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border-c); margin-bottom: 16px; }
.hub-group h2 { font-size: 17px; font-weight: 600; }
.hub-group header p { font-size: 12.5px; color: var(--muted-fg); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.hub-link {
  display: flex; flex-direction: column; gap: 6px; padding: 16px;
  border: 1px solid var(--border-c); border-radius: 10px; background: var(--card-bg);
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.hub-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #bfdbfe; }
.hub-link strong { font-size: 13.5px; font-weight: 600; }
.hub-link code { font-size: 10.5px; color: var(--muted-fg); }
.hub-link .tag { font-size: 10px; color: #1d4ed8; }
.hub-note { margin-top: 40px; padding: 16px 18px; border-radius: 10px; background: var(--muted-bg); border: 1px solid var(--border-c); font-size: 12.5px; color: var(--muted-fg); }

/* ==========================================================================
   QR landing page — --brand-* tokens from brand.css, scoped to .qr-page
   ========================================================================== */
.qr-page {
  --brand-section-border-size: 2px;
  --brand-section-border-radius: 0.5rem;
  --brand-section-padding-size: 16px;
  --brand-section-margin-size: 16px;
  --brand-section-background: #e6e6e6;
  --brand-section-border-color: #161616;
  --brand-background: #ffffff;
  --brand-foreground: #1a1a40;
  --brand-card: #ffffff;
  --brand-card-foreground: #1a1a40;
  --brand-primary: #1e1e33;
  --brand-primary-foreground: #573b3b;
  --brand-secondary: #f2f2f2;
  --brand-secondary-foreground: #1e1e33;
  --brand-muted: #f2f2f2;
  --brand-muted-foreground: #7a7a7a;
  --brand-accent: #f2f2f2;
  --brand-accent-foreground: #1e1e33;
  --brand-border: #161616;
  --brand-input: #e6e6e6;
  --brand-ring: #1e1e33;
  --brand-radius: 0.5rem;
  --brand-chart-1: #ffcc00;
  --brand-chart-2: #2bae7e;
  --brand-chart-3: #3197b8;

  --brand-product-price-color: #1e1e33;
  --brand-product-price-background: #ffffff;
  --brand-product-price-font-size: 16px;
  --brand-product-main-info-color: #1e1e33;
  --brand-product-main-info-background: #ffffff;
  --brand-product-main-info-border-color: #161616;
  --brand-product-main-info-border-size: 2px;
  --brand-product-main-info-border-radius: 0.5rem;

  --brand-table-border-size: 2px;
  --brand-table-padding-size: 12px;
  --brand-attributes-border-size: 2px;
  --brand-attributes-border-color: #161616;
  --brand-attributes-border-radius: 0.5rem;
  --brand-attributes-table-row-odd-background: #ffffff;
  --brand-attributes-table-row-even-background: #f7f7f7;
  --brand-attributes-table-divider-color: #161616;

  color: var(--brand-primary);
  background: var(--brand-background);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html, body.qr-body { background: var(--brand-background, #fff); }
body.qr-body { display: flex; justify-content: center; }

.qr-shell { width: 100%; max-width: 700px; min-height: 100vh; display: flex; flex-direction: column; }
.qr-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 8px 20px; border-radius: 12px;
  background: var(--brand-background);
  backdrop-filter: blur(12px);
}
.qr-logo { display: flex; align-items: center; gap: 10px; }
.qr-logo-mark {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  border: 2px solid var(--brand-primary); color: var(--brand-primary);
  font-size: 13px; font-weight: 800; letter-spacing: .04em;
}
.qr-logo-name { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.qr-lang {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--brand-border);
  background: var(--brand-section-background); color: var(--brand-primary);
  font-size: 12px; font-weight: 600;
}
.qr-body-inner { flex: 1; display: flex; flex-direction: column; }
.qr-section {
  margin: 16px;
  margin-block-start: var(--brand-section-margin-size);
  margin-block-end: var(--brand-section-margin-size);
  margin-inline: var(--brand-section-margin-size);
  border: var(--brand-section-border-size) solid var(--brand-section-border-color);
  border-radius: var(--brand-section-border-radius);
  background: var(--brand-section-background);
  overflow: hidden;
}
.qr-section > h2 {
  padding: 14px; text-align: center; font-size: 18px; font-weight: 700;
  border-bottom: var(--brand-section-border-size) solid var(--brand-section-border-color);
}
.qr-section .pad { padding: 16px; }

.qr-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; }
.qr-gallery .shot {
  aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 30%, #ffffff 0 28%, transparent 29%),
    repeating-linear-gradient(135deg, #fafafa 0 12px, #f0f0f0 12px 24px);
  color: #a1a1aa; border: 1px solid #e4e4e7;
}
.qr-gallery .shot:first-child { grid-column: span 3; aspect-ratio: 16/9; }

.qr-product {
  margin: 16px var(--brand-section-margin-size);
  border: var(--brand-product-main-info-border-size) solid var(--brand-product-main-info-border-color);
  border-radius: var(--brand-product-main-info-border-radius);
  background: var(--brand-product-main-info-background);
  color: var(--brand-product-main-info-color);
  padding: 18px;
  box-shadow: inset 0 2px 10px rgb(0 0 0 / .06);
}
.qr-product h1 {
  font-size: 20px; font-weight: 600; text-transform: uppercase;
  text-align: center; letter-spacing: .02em; margin-bottom: 22px;
}
.qr-product-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.qr-product-meta .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.qr-product-meta .v { display: block; font-size: 18px; font-weight: 600; margin-top: 2px; }
.qr-product-meta .right { text-align: end; }

.qr-attr { padding: 12px; }
.qr-attr .inner { border: var(--brand-attributes-border-size) solid var(--brand-attributes-border-color); border-radius: var(--brand-attributes-border-radius); overflow: hidden; }
.qr-attr-row { display: grid; grid-template-columns: 4fr 6fr; font-size: 15px; }
.qr-attr-row:nth-child(odd) { background: var(--brand-attributes-table-row-odd-background); }
.qr-attr-row:nth-child(even) { background: var(--brand-attributes-table-row-even-background); }
.qr-attr-row + .qr-attr-row { border-top: 1px solid var(--brand-attributes-table-divider-color); }
.qr-attr-row span { padding: 10px; text-align: center; }
.qr-attr-row span:first-child { border-inline-end: 2px solid var(--brand-attributes-table-divider-color); }

.qr-desc { padding: 18px; font-size: 14.5px; line-height: 1.65; color: var(--brand-primary); }
.qr-desc p + p { margin-top: 10px; }

.qr-table { padding: 12px; }
.qr-table table { border: 2px solid var(--brand-section-border-color); border-radius: 8px; overflow: hidden; }
.qr-table td { padding: 10px; text-align: center; font-size: 14px; }
.qr-table tr + tr { border-top: 1px solid var(--brand-section-border-color); }
.qr-table td:first-child { width: 33%; border-inline-end: 2px solid var(--brand-section-border-color); font-weight: 600; }

.qr-btn-wrap { padding: 18px; display: grid; place-items: center; }
.qr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 220px; height: 46px; padding: 0 22px;
  border-radius: var(--brand-radius); border: 2px solid var(--brand-primary);
  background: var(--brand-primary); color: var(--brand-background);
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
}

.qr-faq { padding: 8px 14px 14px; }
.qr-faq details { border-bottom: 1px solid rgb(22 22 22 / .15); }
.qr-faq details:last-child { border-bottom: 0; }
.qr-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 2px; font-size: 14px; font-weight: 600; cursor: pointer;
  list-style: none;
}
.qr-faq summary::-webkit-details-marker { display: none; }
.qr-faq summary .plus { font-size: 18px; font-weight: 400; transition: transform .18s; }
.qr-faq details[open] summary .plus { transform: rotate(45deg); }
.qr-faq .answer { padding: 0 2px 14px; font-size: 13.5px; line-height: 1.6; color: #3f3f5c; }

.qr-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px; }
.qr-product-tile {
  border: 1px solid rgb(22 22 22 / .25); border-radius: 8px; overflow: hidden;
  background: #fff;
}
.qr-product-tile .img {
  aspect-ratio: 4/3; display: grid; place-items: center; color: #a1a1aa;
  background: repeating-linear-gradient(135deg, #fafafa 0 10px, #f1f1f1 10px 20px);
}
.qr-product-tile .body { padding: 8px 10px 10px; }
.qr-product-tile strong { display: block; font-size: 13px; }
.qr-product-tile span { font-size: 12px; color: #555; }

.qr-files { padding: 12px; display: grid; gap: 8px; }
.qr-file {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid rgb(22 22 22 / .2); border-radius: 8px; background: #fff;
}
.qr-file .ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: #f4f4f5; color: #52525b; }
.qr-file strong { font-size: 13px; }
.qr-file span { font-size: 11px; color: #71717a; }

.qr-video { padding: 14px; }
.qr-video .frame {
  aspect-ratio: 16/9; border-radius: 8px; border: 1px solid rgb(22 22 22 / .25);
  background: linear-gradient(135deg, #27272a, #3f3f46); display: grid; place-items: center;
  color: #fff; position: relative;
}
.qr-video .play {
  width: 52px; height: 52px; border-radius: 999px; background: rgb(255 255 255 / .92);
  display: grid; place-items: center; color: #18181b;
}
.qr-video .frame .label { position: absolute; inset-block-end: 10px; inset-inline-start: 12px; font-size: 11px; opacity: .8; }

.qr-map { position: relative; height: 220px; margin: 14px; border-radius: 10px; overflow: hidden; border: 1px solid rgb(22 22 22 / .2); background: #eef2f7; }
.qr-map .road { position: absolute; background: #fff; box-shadow: 0 0 0 1px #e2e8f0; }
.qr-map .pin { background: var(--brand-primary); }

.qr-footer { margin: 16px; display: grid; gap: 14px; }
.qr-socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 16px; }
.qr-social {
  width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-section-background); border: 1px solid rgb(22 22 22 / .18);
  color: var(--brand-primary);
}
.qr-social:hover { transform: scale(1.08); }
.qr-powered {
  display: flex; align-items: center; justify-content: center; gap: 24px;
  height: 36px; border-radius: var(--brand-section-border-radius);
  background: var(--brand-section-background); color: var(--brand-primary);
  font-size: 12px; font-weight: 700;
}
.qr-wordmark { font-size: 13px; font-weight: 800; letter-spacing: .28em; }

/* Consumer page inside a phone frame, mirroring the distributor mock. */
body.qr-stage-page { background: var(--muted-bg); }

.qr-stage {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgb(30 30 51 / .07), transparent 70%),
    var(--muted-bg);
}

.qr-device-figure { margin: 0; }

.qr-device-caption {
  margin-block-end: 10px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-fg);
}

.qr-device {
  width: 330px;
  padding: 9px;
  border-radius: 30px;
  background: #101a3d;
  border: 1px solid rgb(255 255 255 / .08);
  box-shadow: 0 20px 44px -18px rgb(10 18 46 / .55);
}

.qr-device-inner {
  height: 660px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 23px;
  background: var(--brand-background);
}

.qr-device-status {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px 4px;
  background: var(--brand-background);
  color: #7a7a7a;
  font-size: 9.5px;
}

.qr-notch { width: 58px; height: 14px; border-radius: 999px; background: #0b1238; }

.qr-device .qr-shell {
  flex: 1;
  width: 100%;
  max-width: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--brand-background);
}

/* promo dialog inside QR mock */
.promo-body { display: grid; gap: 14px; }
.promo-art {
  height: 130px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-primary), #3f3f5c); color: #fff;
  font-size: 26px; font-weight: 800; letter-spacing: .08em; text-align: center;
}
.promo-code {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px dashed var(--brand-border); border-radius: 8px;
  background: var(--brand-section-background); color: var(--brand-primary);
  font-family: ui-monospace, Menlo, monospace; font-size: 13px;
}
.promo-dialog {
  padding: 0; border: 2px solid var(--brand-border); border-radius: 14px;
  background: var(--brand-background); color: var(--brand-primary);
  max-width: 380px; width: calc(100% - 32px);
}
.promo-dialog::backdrop { background: rgb(9 9 11 / .55); backdrop-filter: blur(2px); }
.promo-dialog .inner { padding: 18px; display: grid; gap: 14px; }
.promo-dialog h3 { font-size: 19px; font-weight: 700; }
.promo-dialog p { font-size: 13.5px; line-height: 1.55; color: #3f3f5c; }
.promo-dialog .actions { display: flex; gap: 10px; }
.promo-dialog .btn { flex: 1; background: var(--brand-primary); color: var(--brand-background); border-radius: 8px; height: 40px; }
.promo-dialog .btn-outline { background: transparent; color: var(--brand-primary); border-color: var(--brand-border); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-tile:nth-child(3n+2), .metric-tile:nth-child(3n+3) { border-inline-start: 0; }
  .metric-tile:nth-child(even) { border-inline-start: 1px solid var(--border-c); }
  .metric-tile:nth-child(n+3) { border-top: 1px solid var(--border-c); }
  .style-layout { grid-template-columns: 320px 1fr; }
}

@media (max-width: 1024px) {
  .split-panel { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; max-width: 520px; }
  .auth-brand { padding: 28px 24px; }
  .auth-brand .brand-chips { display: none; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  [dir='rtl'] .sidebar { transform: translateX(102%); }
  body.nav-open .sidebar { transform: none; }
  .app-main { margin-inline-start: 0; }
  .nav-toggle { display: inline-grid; }
  .style-layout { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (min-width: 901px) {
  .nav-toggle { display: none; }
}

@media (max-width: 720px) {
  .content { padding: 12px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-tile:nth-child(even) { border-inline-start: 0; }
  .metric-tile:nth-child(n+2) { border-top: 1px solid var(--border-c); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .qr-gallery .shot:first-child { aspect-ratio: 4/3; }
  .auth-form { padding: 26px 22px 30px; }
  .brand-grid { grid-template-columns: 1fr; }
  .map-search { width: calc(100% - 32px); }
  .map-shell { height: 420px; }
  .table-footer { flex-direction: column; align-items: flex-start; }
}

/* ---------- helpers added while building screens ---------- */
.qr-render { display: block; width: 100%; height: 100%; }
.qr-render svg { width: 100%; height: 100%; }
.subtle-rule { border: 0; border-top: 1px solid var(--border-c); margin: 18px 0; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.promo-card { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; }
.promo-art-sm {
  height: 130px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #18181b, #3f3f46); color: #fff;
  font-weight: 700; letter-spacing: .1em; font-size: 14px; text-align: center; padding: 10px;
}
@media (max-width: 720px) { .promo-card { grid-template-columns: 1fr; } }

/* ---------- QR template picker ---------- */
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.template-card {
  position: relative; display: grid; place-items: center; gap: 8px;
  padding: 10px; border: 1px solid var(--border-c); border-radius: 10px;
  background: var(--card-bg); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: border-color .15s, box-shadow .15s;
}
.template-card:hover { border-color: #bfdbfe; }
.template-card input { position: absolute; opacity: 0; pointer-events: none; }
.template-card:has(input:checked) { border-color: #2563eb; box-shadow: 0 0 0 3px rgb(37 99 235 / .14); }
.template-card:last-child:nth-child(odd) { grid-column: span 2; }
.qr-mini {
  width: 64px; height: 64px; padding: 5px; border-radius: 5px;
  border: 1px solid var(--border-c); display: block;
}
input.color-swatch {
  padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
input.color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
input.color-swatch::-webkit-color-swatch { border: 1px solid var(--border-c); border-radius: 7px; }
input.color-swatch::-moz-color-swatch { border: 1px solid var(--border-c); border-radius: 7px; }

@media (max-width: 720px) {
  .crumbs { font-size: 12px; white-space: nowrap; overflow: hidden; min-width: 0; }
  .crumbs .root, .crumbs .sep { display: none; }
  .crumbs .current { overflow: hidden; text-overflow: ellipsis; }
}

body.nav-open::after {
  content: ''; position: fixed; inset: 0; z-index: 38;
  background: rgb(9 9 11 / .45); pointer-events: none;
}

/* ---------- ownership ---------- */
.auth-brand .brand-url {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: #a1a1aa; border-bottom: 1px solid rgb(255 255 255 / .25);
  padding-bottom: 2px; margin-top: -14px;
}
.auth-brand .brand-url:hover { color: #fff; }
.hub-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--border-c); font-size: 12px; color: var(--muted-fg);
}
.hub-foot a.mono { color: var(--muted-fg); }
.hub-foot a.mono:hover { color: var(--fg); }

/* The consumer page is previewed inside a phone frame, so the gallery stays
   visible; it is part of the page, like on a real handset. */
