/* ==========================================================================
   HotelMS — hotel operations console design system
   One stylesheet: tokens, app shell, components, dashboard, front desk, billing.
   Light + dark themes. Brand: deep hospitality blue + warm brass accent.
   ========================================================================== */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eceff5;
  --border: #e2e7ef;
  --border-strong: #ccd5e1;
  --text: #15202f;
  --text-soft: #556172;
  --text-faint: #8794a6;
  --brand: #1f4d7a;
  --brand-strong: #16436c;
  --brand-soft: #e7eef7;
  --accent: #b3873f;
  --accent-soft: #f8f0e2;
  --danger: #d64545;
  --danger-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fbf0e0;
  --ok: #15803d;
  --ok-soft: #e5f4ea;
  --shadow-sm: 0 1px 2px rgba(20, 33, 54, .06), 0 1px 3px rgba(20, 33, 54, .04);
  --shadow-md: 0 4px 14px rgba(20, 33, 54, .09), 0 2px 4px rgba(20, 33, 54, .04);
  --shadow-lg: 0 18px 48px rgba(20, 33, 54, .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: #0c111b;
  --surface: #141c28;
  --surface-2: #1a2432;
  --surface-3: #212d3e;
  --border: #2b3648;
  --border-strong: #3a4759;
  --text: #e7ecf3;
  --text-soft: #a3afc0;
  --text-faint: #717f93;
  --brand: #3f83c8;
  --brand-strong: #6aa4dc;
  --brand-soft: #16273b;
  --accent: #d3a463;
  --accent-soft: #2c2416;
  --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: #0c111b;
    --surface: #141c28;
    --surface-2: #1a2432;
    --surface-3: #212d3e;
    --border: #2b3648;
    --border-strong: #3a4759;
    --text: #e7ecf3;
    --text-soft: #a3afc0;
    --text-faint: #717f93;
    --brand: #3f83c8;
    --brand-strong: #6aa4dc;
    --brand-soft: #16273b;
    --accent: #d3a463;
    --accent-soft: #2c2416;
    --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;
}
/* A <button class="nav-item"> (e.g. the logout form, which must POST) needs
   its browser button chrome reset to look identical to the <a> variants. */
.nav-item-form { margin: 0; }
button.nav-item { width: 100%; background: none; border: none; text-align: left; font: inherit; }
.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, .tenant-switch-form { margin: 0; }
.language-select, .tenant-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, .tenant-select { cursor: pointer; }
.tenant-select { max-width: 190px; }
.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-card > .table-toolbar {
  justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.table-search { flex: 1 1 320px; min-width: 0; }
.table-search input {
  flex: 1 1 220px; min-width: 0; max-width: 380px; padding: 9px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.table-search .button { flex: 0 0 auto; }
.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); }

/* Access control statuses (credential / grant / card / device / event) */
.status-badge.active, .status-badge.online, .status-badge.granted, .status-badge.success,
.status-badge.issued { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.status-badge.revoked, .status-badge.expired, .status-badge.denied, .status-badge.lost,
.status-badge.fault, .status-badge.offline { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.status-badge.low_battery, .status-badge.tamper, .status-badge.suspended, .status-badge.encoding,
.status-badge.queued { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.status-badge.stock { 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; }
/* Two fields per row, filling the card's full width — never squeezed to
   three-or-more-wide, but also never a narrow single column stranding a
   sea of empty space beside it. minmax(320px, …) is wide enough that the
   card's actual width only ever fits two; it folds to one column on its
   own on a narrow/mobile viewport, no separate breakpoint needed. Long
   fields (notes, checkboxes, multi-selects) still take the full row. */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.form-grid .field-group:has(textarea),
.form-grid .field-group:has(.textarea-input),
.form-grid .field-group:has(input[type="file"]),
.form-grid .field-group:has(.file-input),
.form-grid .field-group:has(select[multiple]),
.form-grid .field-group:has(input[type="checkbox"]) { grid-column: 1 / -1; }

/* Detail-page field grid: CSS columns instead of row-based Grid. A row-based
   grid forces every cell in a row to the height of its tallest neighbour, so
   a long value (an address, a notes field) leaves empty space under every
   short field beside it. Columns flow each field independently — masonry,
   without JS — while `break-inside: avoid` keeps a label+value pair intact.
   Shared by every model's detail page (templates/partials/object_detail_content.html). */
.detail-grid { columns: 2; column-gap: 16px; }
.detail-grid > .detail-item { break-inside: avoid; margin: 0 0 16px; }
.field-group { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); align-content: start; }
.form-card, .side-card { padding: 20px; }

/* Checkbox: box first, label beside it, help wrapping underneath. */
.field-group:has(> input[type="checkbox"]) {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); font-weight: 550;
}
.field-group:has(> input[type="checkbox"]) > input[type="checkbox"] { order: -1; flex: none; }
.field-group:has(> input[type="checkbox"]) .field-help { flex-basis: 100%; margin-left: 26px; }
.form-grid textarea, .form-grid .textarea-input { min-height: 110px; }

: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; }

/* ---- Searchable select (JS-enhanced <select class="select-input">) ------ */
.ss { position: relative; }
.ss-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none; margin: 0; min-height: 0;
}
.ss-control {
  width: 100%; min-height: 38px; text-align: left; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--text);
  padding: 8px 34px 8px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2);
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.ss-control::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 7px; height: 7px; pointer-events: none;
  border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: translateY(-70%) rotate(45deg);
}
.ss.is-open .ss-control {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface);
}
.ss-ph { color: var(--text-faint); }
.ss-chip {
  background: var(--brand-soft); color: var(--brand-strong);
  border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600;
}
.ss-panel {
  position: absolute; z-index: 50; 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);
  padding: 6px; display: grid; gap: 6px;
}
.ss-search {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 13px; outline: none;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface-2); color: var(--text);
}
.ss-search:focus { border-color: var(--brand); }
.ss-list { max-height: 240px; overflow-y: auto; display: grid; gap: 1px; }
.ss-opt {
  padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* Grid's auto row-sizing treats a non-visible-overflow item's automatic
     minimum size as 0, collapsing the row to just its padding (16px) and
     clipping the text to a sliver — min-height opts back out of that. */
  min-height: 36px; display: flex; align-items: center;
}
.ss-opt:hover, .ss-opt.is-active { background: var(--surface-2); }
.ss-opt.is-selected { color: var(--brand-strong); font-weight: 600; }
.ss-opt.is-selected::before { content: "\2713  "; }
.ss-opt.is-disabled { color: var(--text-faint); cursor: not-allowed; }

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

.detail-hero, .detail-columns { display: grid; align-items: start; }
.detail-hero { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 20px; margin-bottom: 20px; }
.detail-columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px 12px; margin-bottom: 18px; }
.detail-side-stack { display: grid; gap: 16px; }
/* Grid `gap` alone spaces cards out inside these grids — a leftover
   flow-layout margin on the .card children would double up with it
   (reported as "excessive vertical space between stacked cards"), so it's
   zeroed here. Spacing *after* each grid, before whatever section comes
   next, now lives on the grid itself (margin-bottom above) instead. */
.detail-hero > .card, .detail-columns > .card, .detail-side-stack > .card { margin-bottom: 0; }
.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 { columns: 170px; column-gap: 12px; margin-top: 20px; }
.detail-summary-chip {
  break-inside: avoid; margin: 0 0 12px;
  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 { columns: 220px; column-gap: 16px; }
.gallery-grid > .detail-item { break-inside: avoid; margin: 0 0 16px; }
.detail-support-card .detail-section-head,
.detail-side-stack .detail-section-head { margin-bottom: 10px; }
.detail-support-card > .muted,
.detail-side-stack .detail-section > .muted { margin: 0 0 14px; font-size: 12.5px; }
.detail-columns > .detail-section > .muted { margin: 0 0 16px; font-size: 12.5px; }

/* ---- Workflow card (module detail: reservations, billing, housekeeping…) --- */
.workflow-card { display: grid; gap: 18px; }
.workflow-card .workspace-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; padding: 0; border: 0;
}
.workflow-card .workspace-panel-head h3 { font-size: 15px; margin: 0; }
.workflow-card .workspace-panel-head p { margin: 4px 0 0; }
.workflow-card .detail-section-head { margin: 0; }
.workflow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.workflow-actions form { margin: 0; }

/* ---- Take-payment panel (cash vs. AmatoPay, invoice detail) ------------
   Built on the Retail POS tokens above (.retail-totals/.retail-payments/
   .pos-*) so this reads as the same "payment workspace" as the outlets POS,
   not a bolted-on mini form. */
.pos-pay-card { display: grid; gap: 4px; }
.pos-pay-card .retail-totals { margin-bottom: 2px; }
[data-pay-panel] { padding-top: 12px; }
.amatopay-pay { display: grid; gap: 10px; }
.amatopay-pay .pos-tender { grid-template-columns: 1fr; }
.amatopay-pay .pos-tender input { width: 100%; }

/* ---- Danger zone (delete row on detail pages) -------------------------- */
.danger-zone {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}
.danger-zone p { margin-top: 2px; }

/* ---- Generic CRUD: app index, confirm dialogs, form helpers ----------- */
.card-accent { border-top: 3px solid var(--brand); }
.kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 2px;
}
.metric { font-size: 30px; font-weight: 720; letter-spacing: -.02em; margin: 4px 0 14px; }
.narrow-card { max-width: 480px; margin-inline: auto; }
.alert {
  background: var(--danger-soft); color: var(--danger);
  padding: 12px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 12.5px;
}
.alert strong { font-size: 13px; }
.alert p { margin: 6px 0 0; }
.alert:focus { outline: 2px solid var(--danger); outline-offset: 2px; }
.field-help { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }

/* Invalid field: flag the input itself, not just the small text below it —
   the label text and any asterisk turn red too, so the eye lands on exactly
   which fields need fixing without having to read every help line. */
.required-mark { color: var(--danger); }
.field-group.has-error > .field-label { color: var(--danger); }
.field-group.has-error :where(.text-input, .textarea-input, .select-input, .file-input,
input, select, textarea) {
  border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--surface-2));
}
.field-group.has-error :where(.text-input, .textarea-input, .select-input, .file-input,
input, select, textarea):focus {
  border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft);
}
.field-group.has-error .ss-control { border-color: var(--danger); background: var(--danger-soft); }

/* ==========================================================================
   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-kpi { border-left: 3px solid var(--border-strong); }
.workspace-kpi.tone-green { border-left-color: var(--ok); }
.workspace-kpi.tone-blue { border-left-color: var(--brand); }
.workspace-kpi.tone-orange, .workspace-kpi.tone-warning { border-left-color: var(--warn); }
.workspace-kpi.tone-dark { border-left-color: var(--text); }
.workspace-kpi.tone-danger { border-left-color: var(--danger); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .6fr); gap: 16px; }
.workspace-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 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, .workspace-split .card { margin-bottom: 0; }
.workspace-panel { padding: 0; }
.workspace-panel-head { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.workspace-panel-head h2, .workspace-panel-head h3 { 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); }

/* Shared with the public booking site (apps/public/templates/public/base_public.html)
   — one header look for every page a visitor (not a logged-in staff member)
   can land on, defined once here since app.css loads on both. */
.site-header {
  background: var(--brand);
}
.site-header-inner {
  max-width: 1180px; margin: 0 auto; padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.site-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: #fff; }
.site-brand:hover { text-decoration: none; }
.site-brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
  background: rgba(255, 255, 255, .16);
}
.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav a { color: #fff; opacity: .9; font-weight: 500; font-size: 13.5px; }
.site-nav a:hover { opacity: 1; color: #fff; text-decoration: underline; }
.site-nav a.is-active { opacity: 1; text-decoration: underline; }

.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; }
}

/* ==========================================================================
   Front desk workspace
   ========================================================================== */

.desk-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr);
  gap: 16px; align-items: start;
}
.desk-shell .card { margin-bottom: 0; }
.desk-board { padding: 16px; }
.desk-rail { padding: 16px; position: sticky; top: calc(var(--topbar-h) + 16px); display: grid; gap: 18px; }

.desk-search { display: flex; gap: 8px; margin-bottom: 14px; }
.desk-search input { flex: 1; min-width: 0; }

.desk-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.desk-tab {
  border: 0; background: transparent; cursor: pointer; font: 600 12.5px var(--font);
  color: var(--text-soft); padding: 9px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 6px;
}
.desk-tab b {
  font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-soft);
}
.desk-tab:hover { color: var(--text); }
.desk-tab.is-active { color: var(--brand-strong); border-bottom-color: var(--brand); }
.desk-tab.is-active b { background: var(--brand-soft); color: var(--brand-strong); }

.desk-panel { display: none; }
.desk-panel.is-active { display: block; }
.desk-row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.desk-row-actions form { margin: 0; }

.desk-floor { margin-bottom: 18px; }
.desk-floor .eyebrow { display: block; margin-bottom: 8px; }

.room-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.room-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  border-top: 3px solid var(--text-faint); padding: 11px 12px; box-shadow: var(--shadow-sm);
  display: grid; gap: 7px;
}
.room-card.status-available { border-top-color: var(--ok); }
.room-card.status-occupied { border-top-color: var(--brand); }
.room-card.status-dirty, .room-card.status-cleaning { border-top-color: var(--warn); }
.room-card.status-maintenance, .room-card.status-out_of_order { border-top-color: var(--danger); }
.room-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.room-card-num { font-size: 17px; font-weight: 720; letter-spacing: -.01em; }
.room-card-type { margin: -3px 0 0; font-size: 11px; color: var(--text-faint); }
.room-card-stay {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 7px;
  background: var(--surface-2); color: var(--text);
}
.room-card-stay:hover { background: var(--surface-3); text-decoration: none; }
.room-card-stay strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card-stay span { font-size: 10.5px; color: var(--text-faint); }
.room-card-stay.is-upcoming strong { color: var(--brand-strong); }
p.room-card-stay { padding: 7px 9px; font-size: 11.5px; }
.room-card-more { margin-top: -2px; }
.room-card-more summary {
  list-style: none; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--brand);
}
.room-card-more summary::-webkit-details-marker { display: none; }
.room-card-more[open] summary { margin-bottom: 6px; }
.desk-room-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.desk-room-actions form { margin: 0; }

.desk-dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px; width: min(92vw, 440px);
  background: var(--surface); color: var(--text);
}
.desk-dialog::backdrop { background: rgba(10, 14, 22, .55); }
.desk-dialog h3 { margin-bottom: 4px; }
.desk-dialog .form-grid { margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.desk-dialog .actions { margin-top: 16px; }

.desk-counters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.desk-counters div {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.desk-counters b { display: block; font-size: 19px; font-weight: 720; }
.desk-counters span { font-size: 11px; color: var(--text-faint); }

.desk-quick { display: grid; gap: 2px; }
.desk-quick .eyebrow { margin-bottom: 6px; }
.desk-quick a {
  display: block; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; color: var(--text-soft);
}
.desk-quick a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }

.desk-feed .eyebrow { display: block; margin-bottom: 8px; }
.desk-feed p { font-size: 12px; margin: 7px 0; color: var(--text-soft); }
.desk-feed p b { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Room board
   ========================================================================== */

.board-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.board-filters select { max-width: 170px; }
table.room-board th.num, table.room-board td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.room-board td small.record-meta { display: block; }
.pill-flag {
  display: inline-block; font: 700 9.5px var(--mono); letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px; margin-right: 3px;
}
.pill-flag.hk { background: var(--warn-soft); color: var(--warn); }
.pill-flag.mt { background: var(--danger-soft); color: var(--danger); }

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

@media (max-width: 1080px) {
  .desk-shell { grid-template-columns: 1fr; }
  .desk-rail { position: static; }
}

@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(10, 14, 22, .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 { grid-template-columns: 1fr; }
  .detail-grid { columns: 1; }
  .table-header, .table-card > .table-toolbar, .pagination-bar { flex-direction: column; align-items: stretch; }
  .table-search { flex-basis: auto; }
  .table-search input { max-width: none; }
  .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; }
}
