/* ==========================================================================
   MarketFlow Retail — operations console design system
   One stylesheet: tokens, app shell, components, dashboard, POS, cash control.
   Light + dark themes. Brand: retail green.
   ========================================================================== */

:root {
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-3: #eef2f0;
  --border: #e2e8e4;
  --border-strong: #d0dad4;
  --text: #16211c;
  --text-soft: #566b62;
  --text-faint: #8a9a92;
  --brand: #0d8065;
  --brand-strong: #0a6a53;
  --brand-soft: #e4f4ee;
  --accent: #0d9488;
  --danger: #d64545;
  --danger-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fbf0e0;
  --ok: #15803d;
  --ok-soft: #e5f4ea;
  --shadow-sm: 0 1px 2px rgba(16, 33, 28, .06), 0 1px 3px rgba(16, 33, 28, .04);
  --shadow-md: 0 4px 14px rgba(16, 33, 28, .09), 0 2px 4px rgba(16, 33, 28, .04);
  --shadow-lg: 0 18px 48px rgba(16, 33, 28, .18);
  --radius: 13px;
  --radius-sm: 9px;
  --sidebar-w: 266px;
  --sidebar-collapsed: 76px;
  --topbar-h: 62px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  /* Legacy token aliases — kept so pre-consolidation templates
     (storefront, auth, some CRUD pages) stay theme-aware. */
  --panel: var(--surface);
  --panel-soft: var(--surface-2);
  --line: var(--border);
  --muted: var(--text-soft);
  --primary: var(--brand);
  --success: var(--ok);
  --warning: var(--warn);
  --shadow: var(--shadow-md);
}

:root[data-theme="dark"] {
  --bg: #0d1210;
  --surface: #151d1a;
  --surface-2: #1a2320;
  --surface-3: #202a27;
  --border: #29332f;
  --border-strong: #37433e;
  --text: #e6ece9;
  --text-soft: #a3b1ab;
  --text-faint: #71827b;
  --brand: #34c79e;
  --brand-strong: #56d6b3;
  --brand-soft: #16302a;
  --accent: #2dd4bf;
  --danger: #f27a7a;
  --danger-soft: #2c1a1c;
  --warn: #f0b45f;
  --warn-soft: #2c2416;
  --ok: #52c47f;
  --ok-soft: #16281d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1210;
    --surface: #151d1a;
    --surface-2: #1a2320;
    --surface-3: #202a27;
    --border: #29332f;
    --border-strong: #37433e;
    --text: #e6ece9;
    --text-soft: #a3b1ab;
    --text-faint: #71827b;
    --brand: #34c79e;
    --brand-strong: #56d6b3;
    --brand-soft: #16302a;
    --accent: #2dd4bf;
    --danger: #f27a7a;
    --danger-soft: #2c1a1c;
    --warn: #f0b45f;
    --warn-soft: #2c2416;
    --ok: #52c47f;
    --ok-soft: #16281d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Shared SVG icon sizing (sidebar + topbar use inline stroked SVGs) */
.nav-icon, .topbar-icon,
.sidebar-toggle svg, .mobile-toggle svg, .top-action svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ==========================================================================
   App shell
   ========================================================================== */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .22s ease;
}
.shell.collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px 12px 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

.sidebar-header { display: grid; gap: 8px; margin-bottom: 8px; }

.brand-card {
  display: flex; align-items: center; gap: 11px;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.brand-mark {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--brand), var(--accent));
  color: #fff; font-weight: 800; font-size: 16px;
}
.brand-copy { overflow: hidden; line-height: 1.25; }
.brand-copy strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy span { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 1px; }

.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; background: var(--surface-2); color: var(--text-soft);
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.sidebar-toggle:hover { background: var(--surface-3); color: var(--text); }
.sidebar-toggle-label { font-weight: 600; }

.nav-section-title {
  color: var(--text-faint);
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 16px 10px 6px;
}

.nav-stack { display: grid; gap: 1px; }

.nav-group { border-radius: var(--radius-sm); }
.nav-group[open] .chevron { transform: rotate(90deg); }

.nav-summary, .nav-item, .subnav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-soft); font-weight: 550; font-size: 13.5px;
  cursor: pointer; list-style: none;
  transition: background .12s ease, color .12s ease;
}
.nav-summary::-webkit-details-marker { display: none; }
.nav-summary:hover, .nav-item:hover, .subnav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item.active, .subnav-item.active, .nav-summary.active {
  background: var(--brand-soft); color: var(--brand-strong);
}
.nav-summary.active .icon-pill, .nav-item.active .icon-pill { color: var(--brand-strong); }

.icon-pill {
  flex: 0 0 22px; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-faint);
}
.nav-summary:hover .icon-pill, .nav-item:hover .icon-pill,
.subnav-item:hover .icon-pill { color: currentColor; }

.subnav { display: grid; gap: 1px; margin: 1px 0 4px; padding: 0 0 0 26px; border-left: 1px solid var(--border); margin-left: 20px; }
.subnav-item { font-size: 12.75px; color: var(--text-faint); font-weight: 500; padding: 6px 10px; }
.subnav-item .icon-pill { flex-basis: 16px; width: 16px; height: 16px; }
.subnav-item .icon-pill svg { width: 14px; height: 14px; }

.chevron { margin-left: auto; color: var(--text-faint); transition: transform .15s ease; display: inline-flex; }
.chevron svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Collapsed sidebar */
.shell.collapsed .brand-copy,
.shell.collapsed .nav-text,
.shell.collapsed .nav-section-title,
.shell.collapsed .subnav,
.shell.collapsed .chevron,
.shell.collapsed .sidebar-toggle-label { display: none; }
.shell.collapsed .brand-card,
.shell.collapsed .nav-summary,
.shell.collapsed .nav-item,
.shell.collapsed .sidebar-toggle { justify-content: center; }
.shell.collapsed .brand-mark { flex-basis: 34px; width: 34px; height: 34px; }

/* ==========================================================================
   Workspace column + topbar
   ========================================================================== */

.main { min-width: 0; padding: 0; display: flex; flex-direction: column; }
.content { width: 100%; margin: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.mobile-toggle {
  display: none; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; background: var(--surface); color: var(--text-soft);
  cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
}

.search-wrap { position: relative; flex: 1; max-width: 440px; min-width: 0; }
.search-wrap input {
  width: 100%; padding: 9px 12px 9px 34px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px;
  outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
.search-wrap input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.search-wrap span {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 13px; pointer-events: none;
}

.language-form { margin: 0; }
.language-select, .top-action, .icon-button, .role-chip, .user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  width: auto; height: 36px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-soft);
  font: inherit; font-size: 12.5px; font-weight: 550;
}
.language-select { cursor: pointer; }
.top-action, .icon-button { cursor: pointer; min-width: 36px; justify-content: center; }
.top-action:hover, .icon-button:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }

.role-chip { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; font-weight: 650; }

.notification-link b {
  display: inline-grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
}

.user-chip { gap: 8px; }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 11.5px;
}

.shell-overlay { display: none; }

/* Console body region */
.main > .content > .topbar + *,
.messages, .page-head, .workspace-head, .retail-page-head { margin-top: 0; }
.main .content > :not(.topbar) { padding-left: 26px; padding-right: 26px; }
.main .content > .topbar { padding-left: 24px; padding-right: 24px; }
.main .content { padding-bottom: 56px; }
.main .content > .messages:first-of-type,
.main .content > *:nth-child(2) { margin-top: 22px; }
@media (min-width: 1700px) {
  .main .content > :not(.topbar) { padding-left: 40px; padding-right: 40px; }
}

/* ==========================================================================
   Messages / toasts
   ========================================================================== */

.messages { display: grid; gap: 10px; margin-bottom: 18px; }
.message {
  padding: 12px 15px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--brand);
  font-size: 13px; box-shadow: var(--shadow-sm);
}
.message.success { border-left-color: var(--ok); }
.message.error { border-left-color: var(--danger); }
.message.warning { border-left-color: var(--warn); }

/* ==========================================================================
   Page header
   ========================================================================== */

.page-head, .workspace-head, .retail-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head > div, .workspace-head > div, .retail-page-head > div { min-width: 0; }
.page-head h1, .page-head h2,
.workspace-head h1, .workspace-head h2,
.retail-page-head h1, .retail-page-head h2 { font-size: 23px; letter-spacing: -.02em; margin: 4px 0 3px; }
.page-head p, .workspace-head p, .retail-page-head p {
  color: var(--text-soft); font-size: 13.5px; max-width: 64ch; margin: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand);
}

.workspace-head-actions, .retail-head-actions, .page-actions, .actions {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--brand); color: #fff;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: filter .12s ease, background .12s ease, border-color .12s ease;
}
.button:hover { filter: brightness(1.07); text-decoration: none; }
.button-light {
  background: var(--surface); color: var(--text); border-color: var(--border-strong);
}
.button-light:hover { background: var(--surface-3); filter: none; }
.danger-button { background: var(--danger); color: #fff; }
.danger-link { color: var(--danger); }
.button-small { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.button:disabled, .button[disabled] { opacity: .5; cursor: not-allowed; filter: none; }

.action-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-faint);
  transition: background .13s ease, color .13s ease, border-color .13s ease;
}
.action-icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.action-icon-btn:hover { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.action-icon-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ==========================================================================
   Cards / panels
   ========================================================================== */

.card, .hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
}

.muted { color: var(--text-soft); }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-card { padding: 0; overflow: hidden; }
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); flex-wrap: wrap;
}
.table-header h3 { font-size: 15px; margin: 2px 0 0; }
.table-header p { margin: 0; color: var(--text-soft); font-size: 12.5px; }
.table-toolbar, .table-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-search input {
  min-width: 220px; padding: 9px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.table-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 16px; text-align: left; vertical-align: middle; }
thead th {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-faint); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: var(--surface-2); }
td .record-meta, td small.record-meta { display: block; color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }
.record-cell { display: grid; gap: 3px; }
.record-title { font-weight: 600; }
.record-meta { color: var(--text-faint); font-size: 11.5px; }
.text-mono { font-family: var(--mono); font-size: 12.5px; }

.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--surface); flex-wrap: wrap; font-size: 12.5px; color: var(--text-faint);
}
.pagination-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination-current {
  padding: 7px 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; color: var(--text);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.status-badge, .status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; line-height: 1.4; white-space: nowrap;
  background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border);
}
.status-success, .status-pill.green { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.status-warning, .status-pill.orange { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.status-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.status-neutral { background: var(--surface-3); color: var(--text-soft); border-color: var(--border); }
.status-pill.blue { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }

/* eBMS / OBR sync statuses (keyed by the raw status string) */
.status-badge.sent { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.status-badge.pending, .status-badge.processing { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.status-badge.failed, .status-badge.blocked { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.status-badge.cancelled, .status-badge.not_required { background: var(--surface-3); color: var(--text-soft); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.form-grid, .detail-grid, .field-guide { display: grid; gap: 16px; }
.form-grid, .detail-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field-group { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.form-card, .side-card { padding: 20px; }

/* Selectable option card — storefront checkout's fulfillment/payment-method
   radio choices. Theme-aware (was previously hardcoded to a literal white
   background, which broke in dark mode). */
.option-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface);
  cursor: pointer; transition: border-color .15s ease;
}
.option-card.is-selected { border-color: var(--primary); }
.option-card input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.option-card strong { display: block; }
.option-card .muted { font-size: .85rem; }
.option-card .status-badge { margin-left: auto; }

:where(.text-input, .textarea-input, .select-input, .file-input,
input[type="text"], input[type="number"], input[type="search"], input[type="email"],
input[type="password"], input[type="date"], input[type="tel"], select, textarea) {
  width: 100%; padding: 9px 11px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13px; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
:where(.text-input, .textarea-input, .select-input, .file-input,
input, select, textarea):focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface);
}
textarea, .textarea-input { resize: vertical; min-height: 88px; }
.checkbox-input, input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
select[multiple] { min-height: 132px; padding: 6px; }
select[multiple] option { padding: 7px 8px; border-radius: 6px; }
.field-error { color: var(--danger); font-size: 11.5px; font-weight: 550; }

/* ==========================================================================
   Detail pages
   ========================================================================== */

.detail-hero, .detail-columns { display: grid; gap: 20px; align-items: start; }
.detail-hero { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); }
.detail-columns { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); }
.detail-side-stack { display: grid; gap: 18px; }
.detail-section { margin-top: 20px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.detail-section-head h3 { font-size: 15px; }
.detail-section-head p { margin: 0; color: var(--text-soft); font-size: 12.5px; }
.detail-label {
  display: block; color: var(--text-faint);
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px;
}
.detail-value { display: block; font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.detail-text { white-space: pre-wrap; }
.detail-meta-list { display: grid; gap: 10px; }
.detail-meta-row {
  display: grid; gap: 5px; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
}
.detail-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 20px; }
.detail-summary-chip {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.detail-summary-chip strong { display: block; margin-top: 6px; font-size: 15px; }
.detail-image-card { overflow: hidden; padding: 0; }
.detail-image-frame {
  min-height: 220px; display: grid; place-items: center;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.detail-image-frame img { max-width: 100%; max-height: 320px; object-fit: contain; }
.detail-image-meta { padding: 16px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* ==========================================================================
   Panels / connection screens (AmatoPay, integrations)
   ========================================================================== */

.breadcrumbs { font-size: 12px; color: var(--text-faint); margin-bottom: 10px; }
.breadcrumbs a { color: var(--text-faint); }
.breadcrumbs a:hover { color: var(--brand); }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 18px; }

.form-two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.form-two-col .panel { margin-bottom: 0; }
.management-form { padding: 20px; }
.form-section-head { margin-bottom: 16px; }
.form-section-head h2 { font-size: 15px; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
}
.form-global-error {
  background: var(--danger-soft); color: var(--danger);
  padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 12.5px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full-span { grid-column: 1 / -1; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.field small { font-size: 11.5px; color: var(--text-faint); }
.field.has-error .text-input, .field.has-error input { border-color: var(--danger); }

.check-field {
  display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
  grid-column: 1 / -1; padding: 11px 13px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.check-field input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); }
.check-field .check-copy strong { display: block; font-size: 12.5px; }
.check-field .check-copy small { font-size: 11.5px; color: var(--text-faint); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 650;
  background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border);
}

.record-banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-soft);
}
.record-banner strong { color: var(--text); }

.setup-steps { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.setup-steps li { font-size: 12.5px; color: var(--text-soft); }
.setup-steps code, .copy-box code { font-family: var(--mono); font-size: 11.5px; }

.mini-label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-faint); margin: 12px 0 5px;
}
.copy-box {
  position: relative; font-family: var(--mono); font-size: 11.5px; word-break: break-all;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; color: var(--text); cursor: pointer; transition: border-color .12s ease;
}
.copy-box:hover { border-color: var(--brand); }
.copy-box.is-copied { border-color: var(--ok); }
.copy-box.is-copied::after {
  content: "Copied"; position: absolute; top: 6px; right: 8px;
  font-family: var(--font); font-size: 10px; font-weight: 700; color: var(--ok);
}
.small-note { font-size: 11.5px; color: var(--text-faint); margin-top: 10px; }

.entry-list { display: flex; flex-direction: column; }
.entry-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.entry-row:last-child { border-bottom: 0; }
.entry-row:hover { background: var(--surface-2); }
.entry-main { flex: 1; min-width: 0; }
.entry-main strong { font-size: 13.5px; }
.entry-main p { font-size: 12px; color: var(--text-faint); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }

@media (max-width: 900px) {
  .form-two-col { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty-state { text-align: center; padding: 52px 20px; color: var(--text-soft); }
.empty-state h3 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ==========================================================================
   Hero / landing (customer + auth surfaces)
   ========================================================================== */

.hero { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); display: grid; gap: 20px; }
.hero-panel {
  padding: 26px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-strong), var(--accent));
  color: #fff; display: grid; gap: 12px; align-content: end; min-height: 260px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; width: fit-content;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
}
.hero-mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.mini-stat { padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .14); }
.mini-stat strong { display: block; font-size: 17px; margin-bottom: 4px; }
.mini-stat span { display: block; color: rgba(255, 255, 255, .82); font-size: 12px; }
.landing-grid, .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

/* ==========================================================================
   Dashboard — workspace layout
   ========================================================================== */

.workspace-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.workspace-kpi {
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.workspace-kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.workspace-kpi-icon {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800;
}
.workspace-kpi-status { font-size: 10.5px; font-weight: 650; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.workspace-kpi small { display: block; color: var(--text-faint); font-size: 11.5px; }
.workspace-kpi strong { display: block; font-size: 26px; font-weight: 720; letter-spacing: -.02em; margin: 5px 0 2px; }
.workspace-kpi p { font-size: 12px; color: var(--text-soft); margin: 0; }
.workspace-kpi.tone-warning .workspace-kpi-icon { background: var(--warn-soft); color: var(--warn); }
.workspace-kpi.tone-danger .workspace-kpi-icon { background: var(--danger-soft); color: var(--danger); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .6fr); gap: 16px; }
.workspace-main { min-width: 0; display: grid; gap: 16px; align-content: start; }
.workspace-side { display: grid; gap: 16px; align-content: start; }
.workspace-grid .card { margin-bottom: 0; }
.workspace-panel { padding: 0; }
.workspace-panel-head { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.workspace-panel-head h2 { font-size: 15px; margin: 3px 0 0; }
.workspace-panel-head p { margin: 4px 0 0; color: var(--text-soft); font-size: 12.5px; }

.workspace-modules { display: grid; gap: 10px; padding: 16px 18px; }
.workspace-module {
  display: grid; grid-template-columns: minmax(180px, .5fr) 1fr; gap: 14px;
  padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.workspace-module-title { display: flex; gap: 10px; }
.workspace-module-title > span {
  display: grid; place-items: center; flex: none; width: 28px; height: 28px;
  border-radius: 8px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
}
.workspace-module-title strong { display: block; font-size: 13px; }
.workspace-module-title small { display: block; color: var(--text-faint); font-size: 11px; margin-top: 2px; }
.workspace-module-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.workspace-module-links a {
  display: grid; grid-template-columns: 1fr auto auto; gap: 7px; align-items: center;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; color: var(--text-soft);
}
.workspace-module-links a:hover { border-color: var(--brand); color: var(--text); text-decoration: none; }
.workspace-module-links a b { color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.workspace-module-links a i { font-style: normal; color: var(--text-faint); }

.workspace-actions { display: grid; gap: 7px; padding: 16px 18px; }
.workspace-actions a {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-soft);
}
.workspace-actions a:hover { border-color: var(--brand); color: var(--text); text-decoration: none; }
.workspace-actions a > span {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); font-size: 16px;
}
.workspace-actions strong { display: block; font-size: 13px; color: var(--text); }
.workspace-actions small { display: block; color: var(--text-faint); font-size: 11px; }
.workspace-actions i { font-style: normal; color: var(--text-faint); }
.workspace-actions .muted { padding: 4px 2px; font-size: 12.5px; }

.workspace-board { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.workspace-board:last-child { border-bottom: 0; }
.workspace-board > strong { font-size: 12.5px; }
.workspace-board p { display: flex; gap: 9px; align-items: flex-start; margin: 8px 0 0; color: var(--text-soft); font-size: 12px; }
.workspace-board p span { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-top: 6px; }

.workspace-role {
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-strong), var(--accent)); color: #fff; border: 0;
}
.workspace-role .eyebrow { color: rgba(255, 255, 255, .8); }
.workspace-role strong { display: block; font-size: 17px; margin: 6px 0; }
.workspace-role p { font-size: 12px; color: rgba(255, 255, 255, .85); }
.workspace-role a { color: #fff; font-weight: 650; }

.user-list-avatar {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; font-size: 12px;
}

/* ==========================================================================
   Cash control / sessions
   ========================================================================== */

.cash-session-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px;
}
.cash-session-strip strong { display: block; font-size: 13.5px; margin-top: 2px; }
.cash-session-strip small { display: block; color: var(--text-soft); margin-top: 3px; font-size: 12px; }
.cash-close-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.cash-close-form input { max-width: 150px; }

.cash-session-open {
  display: grid; grid-template-columns: 56px minmax(220px, 1fr) minmax(300px, .8fr);
  align-items: center; gap: 18px; padding: 24px;
}
.cash-open-icon {
  display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 15px; background: var(--brand-soft); color: var(--brand-strong); font-size: 24px;
}
.cash-session-open h2 { font-size: 18px; margin: 3px 0; }
.cash-session-open p { color: var(--text-soft); margin: 0; font-size: 13px; }
.cash-session-open form { display: flex; align-items: flex-end; gap: 8px; margin: 0; }
.cash-session-open label { display: grid; gap: 4px; flex: 1; }
.cash-session-open label span { font-size: 10.5px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }

.session-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.session-actions form { display: flex; gap: 5px; align-items: center; margin: 0; }
.session-actions input { max-width: 130px; }

/* ==========================================================================
   Retail POS
   ========================================================================== */

.retail-live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-strong); font-weight: 650; font-size: 12px;
}
.retail-live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
}

.retail-pos-shell {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, .72fr);
  gap: 16px; align-items: start;
}
.retail-catalog, .retail-cart { padding: 16px; }
.retail-pos-shell .card { margin-bottom: 0; }
.retail-cart { position: sticky; top: calc(var(--topbar-h) + 16px); }

.retail-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.retail-panel-head h3 { font-size: 16px; margin: 3px 0 0; display: flex; align-items: center; gap: 8px; }
.retail-panel-head h3 b {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 7px; background: var(--brand-soft); color: var(--brand-strong); font-size: 12px;
}

.pos-shop { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-faint); }
.pos-shop select { max-width: 190px; padding: 7px 9px; }

.retail-scan {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 11px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2);
}
.retail-scan:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.retail-scan span { color: var(--text-faint); }
.retail-scan input { border: 0 !important; background: transparent; padding: 11px 0; box-shadow: none !important; }
.retail-scan kbd {
  font: 11px var(--mono); color: var(--text-faint); white-space: nowrap;
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; background: var(--surface);
}

.retail-category-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }
.retail-category-row button, .retail-category-row a {
  white-space: nowrap; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); padding: 7px 11px; color: var(--text-soft);
  font: inherit; font-size: 12px; cursor: pointer;
}
.retail-category-row .active { background: var(--brand); color: #fff; border-color: var(--brand); }

.retail-product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 9px; margin-top: 13px; max-height: 580px; overflow-y: auto;
}
.retail-product {
  display: flex; flex-direction: column; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0; overflow: hidden; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.retail-product:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.retail-product-image {
  height: 88px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-faint); font-size: 30px;
}
.retail-product-image img { width: 100%; height: 100%; object-fit: cover; }
.retail-product-copy { display: grid; gap: 3px; padding: 10px; }
.retail-product-copy strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retail-product-copy small, .retail-product-copy em { color: var(--text-faint); font-size: 10.5px; font-style: normal; }
.retail-product-copy b { color: var(--brand-strong); font-size: 12.5px; }

.retail-empty-catalog, .retail-cart-empty {
  display: grid; place-content: center; justify-items: center; text-align: center; color: var(--text-soft);
}
.retail-empty-catalog { min-height: 380px; }
.retail-empty-catalog > span { font-size: 42px; color: var(--text-faint); }
.retail-empty-catalog strong { color: var(--text); font-size: 16px; margin-top: 8px; }
.retail-empty-catalog p { max-width: 380px; margin: 7px 0 0; font-size: 12.5px; }

.pos-customer { margin: 14px 0; }
.pos-customer-bar {
  display: grid; grid-template-columns: 30px 1fr 30px; gap: 8px; align-items: center;
  padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.pos-customer-icon {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); font-size: 14px;
}
.pos-customer-field { position: relative; }
.pos-customer-field input { width: 100%; padding: 7px 9px; background: var(--surface); }
.pos-customer-add {
  width: 30px; height: 30px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--surface-3); color: var(--text-soft); font-size: 15px; line-height: 1;
}
.pos-customer-results {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto; padding: 4px;
}
.pos-customer-results button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 7px 9px; border-radius: 6px; cursor: pointer; font: inherit; color: var(--text);
}
.pos-customer-results button:hover { background: var(--surface-2); }
.pos-customer-results button strong { display: block; font-size: 12.5px; }
.pos-customer-results button small { color: var(--text-faint); font-size: 11px; }
.pos-customer-results-new { color: var(--brand-strong); font-weight: 600; border-top: 1px solid var(--border); margin-top: 3px; }
.pos-customer-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--brand-soft); border: 1px solid var(--brand);
}
.pos-customer-chip strong { display: block; font-size: 12.5px; }
.pos-customer-chip small { color: var(--text-soft); font-size: 11px; }
.pos-customer-chip button { border: 0; background: transparent; cursor: pointer; color: var(--text-soft); font-size: 13px; }
.pos-customer-new { display: grid; gap: 6px; margin-top: 8px; }
.pos-customer-new input { padding: 7px 9px; background: var(--surface); }
.check-inline { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-soft); }
.check-inline input { width: 15px; height: 15px; accent-color: var(--brand); }

.retail-cart-lines { max-height: 300px; overflow-y: auto; }
.retail-cart-empty { min-height: 170px; }
.retail-cart-empty > span { font-size: 32px; color: var(--text-faint); }
.retail-cart-empty strong { color: var(--text); margin: 6px 0 2px; }
.retail-cart-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 24px; gap: 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.retail-cart-line small { display: block; color: var(--text-faint); font-size: 10.5px; }
.line-stepper { display: flex; align-items: center; gap: 5px; }
.line-stepper button, .line-remove, .cart-clear {
  border: 0; border-radius: 7px; background: var(--surface-3); color: var(--text-soft);
  width: 25px; height: 25px; cursor: pointer; font: inherit; display: inline-flex; align-items: center; justify-content: center;
}
.line-remove { background: var(--danger-soft); color: var(--danger); }
.cart-clear { width: auto; padding: 4px 10px; font-size: 12px; }

.retail-totals { border-top: 1px solid var(--border); padding-top: 9px; margin-top: 4px; }
.retail-totals p { display: flex; justify-content: space-between; margin: 9px 0; font-size: 13px; color: var(--text-soft); }
.retail-totals strong { color: var(--text); }
.retail-totals .total { font-size: 16px; color: var(--text); border-top: 1px dashed var(--border-strong); padding-top: 11px; }
.retail-totals .total strong { font-weight: 720; }

.retail-payments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.retail-payments button {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 4px;
  background: var(--surface); color: var(--text-soft); font: inherit; font-size: 12px; cursor: pointer;
}
.retail-payments .active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 650; }

.pos-discount, .pos-tender { display: grid; gap: 4px; margin: 10px 0; }
.pos-discount { grid-template-columns: 1fr minmax(90px, 130px) auto; align-items: center; }
.pos-discount span, .pos-tender span { font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.pos-tender small, .pos-discount small { color: var(--text-faint); font-size: 11px; }

.pos-alert {
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 12px;
  background: var(--danger-soft); color: var(--danger); border: 1px solid transparent; font-size: 12.5px;
}
.pos-alert[data-type="success"] { background: var(--ok-soft); color: var(--ok); }

.retail-checkout { width: 100%; margin-top: 11px; justify-content: space-between; }
.retail-checkout span { font: 700 11px var(--mono); opacity: .8; }

.pos-phone-hint {
  margin: 8px 0 0; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-soft); font-size: 11.5px;
}
.pos-amatopay-wait {
  display: grid; gap: 8px; justify-items: start; margin-top: 12px;
  border: 1px solid var(--brand); background: var(--brand-soft);
}
.pos-amatopay-wait strong { font-size: 18px; color: var(--text); }
.pos-amatopay-wait p { margin: 0; font-size: 12.5px; color: var(--text-soft); }
.pos-amatopay-wait .button { width: auto; }

/* ==========================================================================
   Public marketing site (landing) + auth screens
   ========================================================================== */

body.public { background: var(--bg); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 28px;
  height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.site-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15.5px; color: var(--text); letter-spacing: -.01em; }
.site-brand:hover { text-decoration: none; }
.site-brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800;
  background: linear-gradient(140deg, var(--brand), var(--accent));
}
.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav a { color: var(--text-soft); font-weight: 550; font-size: 13.5px; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.is-active { color: var(--brand); }

.notice-wrap { max-width: 1180px; margin: 16px auto 0; padding: 0 28px; }
.notice {
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 10px;
  background: var(--brand-soft); color: var(--text); border: 1px solid transparent;
}
.notice.success { background: var(--ok-soft); color: var(--ok); }
.notice.error { background: var(--danger-soft); color: var(--danger); }

.hero-band {
  background:
    radial-gradient(900px 420px at 12% -20%, var(--brand-soft), transparent),
    radial-gradient(720px 380px at 92% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 1180px; margin: 0 auto; padding: 74px 28px 62px; }
.hero-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.hero-inner h1 {
  font-size: clamp(30px, 5vw, 50px); line-height: 1.06; letter-spacing: -.03em;
  margin: 14px 0; max-width: 17ch;
}
.hero-inner > p { font-size: 16px; color: var(--text-soft); max-width: 52ch; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.btn-lg { padding: 12px 22px; font-size: 14px; border-radius: 10px; }
.hero-stats { display: flex; gap: 40px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 25px; font-weight: 780; letter-spacing: -.02em; }
.hero-stats span { font-size: 12.5px; color: var(--text-faint); }

.section { max-width: 1180px; margin: 0 auto; padding: 56px 28px; }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head .eyebrow { display: block; margin-bottom: 8px; }
.section-head h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; }
.section-head p { color: var(--text-soft); font-size: 14.5px; margin-top: 8px; max-width: 56ch; margin-inline: auto; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.feature-card .fc-icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-size: 19px; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 12px;
}
.feature-card h3 { font-size: 15px; margin-bottom: 5px; }
.feature-card p { font-size: 13px; color: var(--text-soft); line-height: 1.6; }

.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: step; }
.step-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.step-card b {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 12px;
}
.step-card h3 { font-size: 14.5px; margin-bottom: 4px; }
.step-card p { font-size: 12.5px; color: var(--text-soft); line-height: 1.55; }

.shop-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.shop-chip {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease;
}
.shop-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; border-color: var(--border-strong); }
.shop-chip strong { font-size: 14px; color: var(--text); }
.shop-chip span { font-size: 12px; color: var(--text-faint); }
.shop-chip small { font-size: 11.5px; color: var(--brand-strong); font-weight: 650; margin-top: 2px; }

.cta-band {
  max-width: 1180px; margin: 0 auto 64px; padding: 36px;
  background: linear-gradient(120deg, var(--brand-strong), var(--accent));
  border-radius: 18px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { font-size: 22px; letter-spacing: -.01em; }
.cta-band p { color: rgba(255,255,255,.86); margin-top: 6px; font-size: 14px; max-width: 48ch; }
.cta-band .button { background: #fff; color: var(--brand-strong); }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 36px 28px 24px;
  display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.site-footer-inner strong { font-size: 14.5px; display: inline-flex; align-items: center; gap: 8px; }
.site-footer-inner p { font-size: 13px; color: var(--text-faint); margin-top: 6px; max-width: 40ch; }
.site-footer-inner nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer-inner nav a { font-size: 13px; color: var(--text-soft); }
.site-footer-base {
  max-width: 1180px; margin: 0 auto; padding: 14px 28px 28px;
  font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--border);
}

/* ---- Auth screens ---------------------------------------------------- */

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 460px) 1fr; }
.auth-form-col { display: flex; align-items: center; justify-content: center; padding: 44px 30px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-mark {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 18px;
  background: linear-gradient(140deg, var(--brand), var(--accent));
}
.auth-card h1 { font-size: 22px; letter-spacing: -.01em; }
.auth-card .sub { color: var(--text-soft); font-size: 13px; margin: 6px 0 22px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-field label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.auth-field .help-text { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }
.auth-card .button { width: 100%; justify-content: center; margin-top: 6px; padding: 11px 16px; }
.auth-note {
  padding: 10px 12px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px;
  background: var(--danger-soft); color: var(--danger);
}
.auth-note.success { background: var(--ok-soft); color: var(--ok); }
.field-error { color: var(--danger); font-size: 11.5px; font-weight: 550; }
.auth-alt { text-align: center; font-size: 12.5px; color: var(--text-soft); margin-top: 16px; }
.auth-foot-note { font-size: 12px; color: var(--text-faint); margin-top: 16px; line-height: 1.55; }
.auth-pw { position: relative; display: flex; }
.auth-pw input { padding-right: 58px; }
.auth-pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; font: inherit; font-size: 11px; font-weight: 700;
  color: var(--text-soft); cursor: pointer; padding: 6px 8px; border-radius: 6px;
}
.auth-pw-toggle:hover { color: var(--brand); }

.auth-aside {
  position: relative; overflow: hidden; color: #fff;
  padding: 56px 52px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, var(--brand-strong), var(--brand) 55%, var(--accent));
}
.auth-aside .brand-mark { background: rgba(255,255,255,.16); color: #fff; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; }
.auth-aside h2 { font-size: 26px; font-weight: 700; line-height: 1.25; max-width: 16ch; }
.auth-aside p { font-size: 13.5px; color: rgba(255,255,255,.85); margin-top: 12px; line-height: 1.65; max-width: 38ch; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; gap: 11px; align-items: center; font-size: 13px; color: rgba(255,255,255,.92); }
.auth-points .tick { width: 22px; height: 22px; flex: none; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 12px; }
.auth-aside .foot { font-size: 12px; color: rgba(255,255,255,.7); }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .site-nav a:not(.button) { display: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .workspace-kpis { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    width: var(--sidebar-w); transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .shell.mobile-open .sidebar { transform: translateX(0); }
  .shell.mobile-open .shell-overlay {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(8, 12, 10, .5);
  }
  .shell.collapsed { grid-template-columns: 1fr; }
  .mobile-toggle { display: inline-flex; }
  .retail-pos-shell { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .hero, .form-layout, .detail-hero, .detail-columns { grid-template-columns: 1fr; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .table-header, .pagination-bar { flex-direction: column; align-items: stretch; }
  .table-search input { min-width: 0; width: 100%; }
  .cash-session-open { grid-template-columns: 1fr; }
  .cash-session-open form { flex-direction: column; align-items: stretch; }
}

@media (max-width: 760px) {
  .page-head, .workspace-head, .retail-page-head { flex-direction: column; align-items: flex-start; }
  .workspace-module { grid-template-columns: 1fr; }
  .workspace-module-links { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .main .content > :not(.topbar) { padding-left: 16px; padding-right: 16px; }
  .retail-payments { grid-template-columns: 1fr; }
  .pos-discount { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .workspace-kpis { grid-template-columns: 1fr; }
  .retail-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retail-cart-line { grid-template-columns: 1fr auto; }
}
