/* ============================================================
   Restaurant SaaS · Hotel UI Design System
   Ported from Hotel SaaS — keeps design tokens & components
   identical so both apps share the same visual language.
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Brand */
  --accent:         #1B2B6B;
  --accent-h:       #E8194B;
  --sd-navy:        #1B2B6B;
  --sd-navy-dark:   #0f1a46;
  --sd-red:         #E8194B;
  --sd-red-dark:    #c0133c;
  --sd-purple:      #4A3080;

  /* Surfaces */
  --bg:             #F4F2EF;
  --surface:        #FFFFFF;
  --surface2:       #F8F7F5;
  --border:         #E2DDD8;
  --border2:        #CCC8C2;
  --sd-light:       #F5F6FA;
  --sd-light2:      #ECEEF6;
  --sd-text2:       #555771;
  --sd-border:      rgba(27,43,107,0.10);

  /* Text */
  --text-primary:   #18181B;
  --text-secondary: #71717A;
  --text-tertiary:  #A1A1AA;

  /* Status — Available / Success */
  --green:          #16A34A;
  --green-bg:       #F0FDF4;
  --green-border:   #BBF7D0;

  /* Status — Occupied / Error */
  --red:            #DC2626;
  --red-bg:         #FEF2F2;
  --red-border:     #FECACA;

  /* Status — Reserved / Warning */
  --amber:          #D97706;
  --amber-bg:       #FFFBEB;
  --amber-border:   #FDE68A;

  /* Shadows */
  --shadow-xs:      0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.14);
  --sd-shadow-lg:   0 24px 80px rgba(27,43,107,0.12);

  /* Border Radius */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 999px;
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg);
  margin: 0;
  padding: 12px 12px 40px;
}

/* ── App Wrapper ──────────────────────────────────────────── */
.app-wrap {
  background: var(--bg);
  min-height: calc(100vh - 52px);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ── Navigation (pill nav) ────────────────────────────────── */
.proto-nav {
  position: sticky;
  top: 8px;
  z-index: 200;
  background: var(--surface);
  padding: 6px 10px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 10px 10px 0;
}

.proto-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 4px;
}

.sd-logo-text {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.sd-logo-n { color: var(--sd-navy); }
.sd-logo-r { color: var(--sd-red); }

.proto-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.16s ease-out;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-link:hover  { background: var(--surface2); color: var(--text-primary); }
.nav-link.active { background: var(--sd-navy);  color: #fff; }
.nav-link i { font-size: 13px; }

.proto-nav-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 8px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sd-light2);
  border: 1px solid var(--sd-border);
  font-size: 12px;
  font-weight: 800;
  color: var(--sd-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-role {
  font-size: 11px;
  color: var(--text-secondary);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Offline Banner ───────────────────────────────────────── */
.offline-banner {
  background: var(--amber-bg);
  border-bottom: 1px solid var(--amber-border);
  color: var(--amber);
  padding: 8px 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--r-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  transition: all 0.16s ease-out;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--sd-navy);
  outline-offset: 2px;
}

.btn[disabled], .btn.disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

/* Sizes */
.btn-sm { font-size: 12px; padding: 7px 13px; }
.btn-md { font-size: 14px; padding: 10px 18px; }
.btn-lg { font-size: 15px; padding: 13px 22px; }

/* Primary — navy → red on hover */
.btn-primary {
  background: var(--sd-navy);
  color: #fff;
  box-shadow: 0 4px 16px rgba(27,43,107,0.25);
}
.btn-primary:hover  { background: var(--sd-red); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,25,75,0.30); }
.btn-primary:active { background: var(--sd-red-dark); transform: translateY(0); }

/* Secondary */
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

/* Ghost */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text-primary); }

/* Danger */
.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220,38,38,0.20);
}
.btn-danger:hover  { background: #B91C1C; color: #fff; transform: translateY(-1px); }
.btn-danger:active { background: #991B1B; transform: translateY(0); }

/* Outline */
.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--sd-navy);
  color: var(--sd-navy);
}
.btn-outline-primary:hover { background: var(--sd-red); border-color: var(--sd-red); color: #fff; }

/* ── Fields / Inputs ──────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 0.16s, box-shadow 0.16s;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--sd-navy);
  box-shadow: 0 0 0 3px rgba(27,43,107,0.12);
  outline: none;
}

.field input.is-error,
.field select.is-error,
.field textarea.is-error { border-color: var(--red); }

.field-error {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .span2 { grid-column: 1 / -1; }

/* ── Cards / Surface Containers ───────────────────────────── */
.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.surface-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.surface-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.surface-card-body { padding: 20px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-green     { background: var(--green-bg);  color: var(--green); border-color: var(--green-border); }
.badge-red       { background: var(--red-bg);    color: var(--red);   border-color: var(--red-border);   }
.badge-amber     { background: var(--amber-bg);  color: var(--amber); border-color: var(--amber-border); }
.badge-secondary { background: var(--surface2);  color: var(--text-secondary); border-color: var(--border); }
.badge-navy      { background: rgba(27,43,107,0.08); color: var(--sd-navy); border-color: rgba(27,43,107,0.20); }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  min-width: 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-secondary);
}

.stat-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: break-word;
}

.stat-card-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.sc-green { color: var(--green) !important; }
.sc-red   { color: var(--red)   !important; }
.sc-navy  { color: var(--accent)!important; }
.sc-amber { color: var(--amber) !important; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  padding: 16px 28px 8px;
}

/* ── KPI Strip ────────────────────────────────────────────── */
.kpi-strip {
  padding: 12px 28px 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-pill {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.kpi-pill strong { color: var(--text-primary); font-weight: 700; }

.kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kpi-dot.navy  { background: var(--accent); }
.kpi-dot.green { background: var(--green); }
.kpi-dot.amber { background: var(--amber); }
.kpi-dot.red   { background: var(--red); }
.kpi-dot.slate { background: var(--text-secondary); }

/* ── Table Tiles (room tiles adapted for restaurant tables) ── */
.table-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 16px 28px;
}

.table-tile {
  border-radius: var(--r-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease-out;
}

.table-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.table-tile.available { background: var(--green-bg); border-color: var(--green-border); }
.table-tile.reserved  { background: var(--amber-bg); border-color: var(--amber-border); }
.table-tile.occupied  { background: var(--red-bg);   border-color: var(--red-border);   }
.table-tile.cleaning  { background: var(--surface2); border-color: var(--border); }

.tt-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.table-tile.available .tt-icon { background: var(--green-border); color: var(--green); }
.table-tile.reserved  .tt-icon { background: var(--amber-border); color: var(--amber); }
.table-tile.occupied  .tt-icon { background: var(--red-border);   color: var(--red);   }
.table-tile.cleaning  .tt-icon { background: var(--border);       color: var(--text-secondary); }

.tt-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}
.table-tile.available .tt-num { color: var(--green); }
.table-tile.reserved  .tt-num { color: var(--amber); }
.table-tile.occupied  .tt-num { color: var(--red);   }
.table-tile.cleaning  .tt-num { color: var(--text-secondary); }

.tt-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.tt-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: var(--r-full);
  align-self: flex-start;
}
.table-tile.available .tt-badge { background: var(--green-border); color: var(--green); }
.table-tile.reserved  .tt-badge { background: var(--amber-border); color: var(--amber); }
.table-tile.occupied  .tt-badge { background: var(--red-border);   color: var(--red);   }
.table-tile.cleaning  .tt-badge { background: var(--border);       color: var(--text-secondary); }

/* Order screen variant: tiles rendered as <button>s, with a selected state */
button.table-tile { font: inherit; align-items: center; width: 100%; }
button.table-tile .tt-badge { align-self: center; }
.table-tile.selected { outline: 2.5px solid var(--sd-navy); outline-offset: 2px; }

/* ── Data Tables ──────────────────────────────────────────── */
.table-wrap {
  padding: 0 28px 28px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.data-table thead { background: var(--surface2); }

.data-table th {
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: left;
}

.data-table td {
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface2); }

.data-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

/* ── Modals ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 32, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  transition: opacity 0.2s;
}

.modal-overlay[hidden], .modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform 0.2s ease-out, opacity 0.2s;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  transition: all 0.16s;
  line-height: 1;
}
.modal-close:hover { background: var(--surface2); color: var(--text-primary); }

.modal-body { color: var(--text-secondary); font-size: 14px; line-height: 1.65; }

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-footer .btn { min-width: 80px; }

/* ── Order overlay (F-038 full-screen takeover) ──────────────── */
.order-overlay-takeover {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow-y: auto;
  background: var(--bg);
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  background: var(--surface);
}

.tab {
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2.5px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.16s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tab:hover  { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.empty-icon-bg {
  width: 64px;
  height: 64px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-tertiary);
}

.empty-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.empty-sub   { font-size: 13px; color: var(--text-secondary); line-height: 1.6; max-width: 280px; margin: 0; }

/* ── Filters Bar ──────────────────────────────────────────── */
.filters-bar {
  padding: 0 28px 12px;
}

.filters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.filters-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* ── Admin KPI Cards (colored) ────────────────────────────── */
.admin-kpi {
  min-width: 0;
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-navy  { background: var(--accent); }
.kpi-green { background: var(--green); }
.kpi-amber { background: var(--amber); }
.kpi-red   { background: var(--red); }

.admin-kpi .kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: rgba(255,255,255,0.65);
}
.admin-kpi .kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  font-family: 'JetBrains Mono', monospace;
  overflow-wrap: break-word;
}
.admin-kpi .kpi-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

/* ── Action Cards ─────────────────────────────────────────── */
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.16s ease-out;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-primary);
}
.action-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--text-primary);
}

.action-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.aci-navy  { background: rgba(27,43,107,0.08); color: var(--sd-navy); }
.aci-green { background: var(--green-bg); color: var(--green); }
.aci-amber { background: var(--amber-bg); color: var(--amber); }
.aci-red   { background: var(--red-bg);   color: var(--red);  }

.action-card-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.action-card-sub   { font-size: 12px; color: var(--text-secondary); }

/* ── Section Headers ──────────────────────────────────────── */
.section-header {
  padding: 20px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  padding: 20px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-content-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 960px;
}

.page-content-wide {
  padding: 20px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.topbar-sub   { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }

/* ── Divider ──────────────────────────────────────────────── */
.h-divider {
  height: 1px;
  background: var(--border);
  margin: 0 28px;
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(27,43,107,0.15);
  border-top-color: var(--sd-navy);
  border-radius: 50%;
  animation: hui-spin 0.7s linear infinite;
  flex-shrink: 0;
  vertical-align: middle;
}
.spinner-sm { width: 13px; height: 13px; }
.spinner-lg { width: 26px; height: 26px; border-width: 3px; }
.spinner-white { border-color: rgba(255,255,255,0.3); border-top-color: #fff; }

@keyframes hui-spin { to { transform: rotate(360deg); } }

/* ── Report Table ─────────────────────────────────────────── */
.table-report {
  border-collapse: separate;
  border-spacing: 0;
}
.table-report thead {
  background: linear-gradient(180deg, #1A3C5E 0%, #153250 100%);
}
.table-report thead th {
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 10px 14px;
}
.table-report tbody td         { background: var(--surface); padding: 11px 14px; font-size: 13px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table-report tbody tr:nth-child(even) td { background: #F8F7F5; }
.table-report tbody tr:hover td           { background: #E8F1F8; }

.report-amount     { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: var(--accent); }
.report-amount-tax { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: #C2410C; }
.report-muted      { font-size: 13px; color: var(--text-secondary); line-height: 1.35; }

.payment-mode-pill { font-size: 11px; font-weight: 600; background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; padding: 3px 8px; border-radius: var(--r-full); }
.gst-pct-pill      { font-size: 11px; font-weight: 700; background: #FFFBEF; color: #92400E; border: 1px solid #FDE68A; padding: 3px 8px; border-radius: var(--r-full); font-family: 'JetBrains Mono', monospace; }

/* ── Category tabs (order page) ───────────────────────────── */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s;
}
.cat-tab:hover  { border-color: var(--sd-navy); color: var(--sd-navy); }
.cat-tab.active { background: var(--sd-navy); border-color: var(--sd-navy); color: #fff; }

/* ── Menu item card ───────────────────────────────────────── */
.menu-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.16s;
}
.menu-item-card:hover { box-shadow: var(--shadow-sm); }
.menu-item-name  { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.menu-item-price { font-size: 13px; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }

/* ── Menu item images (F-014/F-015) ───────────────────────── */
.menu-item-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.menu-item-thumb--lg { width: 96px; height: 96px; }

/* ── Configurator panel ───────────────────────────────────── */
.config-panel {
  background: var(--green-bg);
  border: 1.5px solid var(--green-border);
  border-radius: var(--r-md);
  padding: 18px;
}
.config-panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--green-border);
  margin-bottom: 16px;
}
.config-panel-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.config-panel-sub   { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── Addon checkbox ───────────────────────────────────────── */
.addon-label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 13px;
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.16s;
}
.addon-label:hover { border-color: var(--sd-navy); background: var(--sd-light); }
.addon-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sd-navy);
  flex-shrink: 0;
}

/* ── Utility helpers ──────────────────────────────────────── */
.mono { font-family: 'JetBrains Mono', monospace; }

.text-navy   { color: var(--sd-navy) !important; }
.text-red    { color: var(--sd-red)  !important; }
.text-green  { color: var(--green)   !important; }
.text-amber  { color: var(--amber)   !important; }
.text-muted  { color: var(--text-secondary) !important; }
.text-faint  { color: var(--text-tertiary)  !important; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.gap-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--sd-border);
  border-radius: var(--r-xl);
  box-shadow: var(--sd-shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  background-image:
    radial-gradient(circle at 50% 0%,   rgba(27,43,107,0.08) 0%, transparent 55%),
    radial-gradient(circle at 90% 90%,  rgba(232,25,75,0.06) 0%, transparent 50%),
    radial-gradient(circle at 8%  50%,  rgba(74,48,128,0.06) 0%, transparent 50%);
}

.lb-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sd-navy);
  padding: 5px 14px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, rgba(27,43,107,0.08), rgba(232,25,75,0.06));
  border: 1px solid var(--sd-border);
}

.login-divider {
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sd-navy), var(--sd-red));
}

.login-heading {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin: 0;
}

.login-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.5;
}
.login-alert-error {
  background: rgba(232,25,75,0.08);
  border: 1px solid rgba(232,25,75,0.18);
  color: var(--sd-red-dark);
}
.login-alert-info {
  background: rgba(27,43,107,0.07);
  border: 1px solid rgba(27,43,107,0.15);
  color: var(--sd-navy);
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}
.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sd-navy);
}

/* ── Powered by footer ────────────────────────────────────── */
.powered-by {
  text-align: center;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--sd-border);
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

/* ── Floor item card (for manage floors list) ─────────────── */
.floor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.floor-item-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.floor-item-sub  { font-size: 12px; color: var(--text-secondary); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row   { padding: 12px 18px 8px; }
  .kpi-strip   { padding: 10px 18px 6px; }
  .table-wrap  { padding: 0 18px 18px; }
  .table-grid  { grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 18px; }
  .filters-bar { padding: 0 18px 12px; }
  .section-header { padding: 16px 18px 0; }
  .h-divider   { margin: 0 18px; }
  .topbar      { padding: 12px 18px; }
  .tabs        { padding: 0 18px; }
  .page-content      { padding: 16px 18px 24px; }
  .page-content-wide { padding: 16px 18px 24px; }
}

@media (max-width: 768px) {
  body { padding: 8px 8px 32px; }
  .proto-nav { margin: 6px 6px 0; }
  .table-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px; }
  .stats-row   { grid-template-columns: repeat(2, 1fr); padding: 10px 12px 8px; }
  .form-grid   { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; padding: 12px 14px; }
  .page-content      { padding: 14px 14px 20px; }
  .page-content-wide { padding: 14px 14px 20px; }
  .section-header    { padding: 14px 14px 0; }
  .tabs  { padding: 0 14px; }
  .h-divider { margin: 0 14px; }
  .table-wrap { padding: 0 14px 16px; }
}

@media (max-width: 576px) {
  body { padding: 6px 6px 24px; }
  .proto-nav { margin: 4px 4px 0; border-radius: var(--r-md); }
  .table-grid  { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 8px 10px; }
  .stats-row   { grid-template-columns: 1fr 1fr; padding: 8px 10px 6px; }
  .table-wrap  { padding: 0 10px 14px; }
  .filters-bar { padding: 0 10px 10px; }
  .login-card  { padding: 32px 20px; }
  .section-header    { padding: 12px 10px 0; }
  .page-content      { padding: 12px 10px 16px; }
  .page-content-wide { padding: 12px 10px 16px; }
  .tabs  { padding: 0 10px; }
  .h-divider { margin: 0 10px; }
}

@media (max-width: 400px) {
  .table-grid { grid-template-columns: 1fr; }
}

/* ── Mobile nav collapse ──────────────────────────────────── */
@media (max-width: 767.98px) {
  .proto-nav { flex-wrap: wrap; border-radius: var(--r-md); }
  .proto-nav-links { order: 3; flex-basis: 100%; flex-wrap: wrap; padding: 4px 0 6px; border-top: 1px solid var(--border); margin-top: 4px; }
  .nav-link { font-size: 12px; padding: 6px 10px; }
  .proto-nav-end { padding-left: 0; border-left: none; margin-left: 0; }
  .nav-user-name, .nav-user-role { display: none; }
}
