:root {
  --bg: #F4FAFA;
  --surface: #ffffff;
  --surface-muted: #f8f9fb;
  --text: #172B2D;
  --muted: #697586;
  --border: #D8E5E6;
  --accent: #007C83;
  --accent-dark: #005B61;
  --success: #287A4B;
  --danger: #B42318;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }

.app-shell { min-height: 100vh; }
.topbar {
  min-height: 82px; padding: 16px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 5;
}
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--accent); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; }
h2 { margin-bottom: 5px; font-size: 19px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.invoice-badge { background: #fff4ef; color: var(--accent-dark); padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 360px); gap: 18px; padding: 18px; max-width: 1500px; margin: auto; }
.menu-panel, .cart-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.menu-panel { padding: 18px; }
.cart-panel { display: flex; flex-direction: column; min-height: calc(100vh - 126px); position: sticky; top: 104px; }
.section-heading, .cart-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.section-heading p, .cart-header p { color: var(--muted); margin-bottom: 0; font-size: 13px; }
.search-input, .text-input {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 11px 13px; outline: none;
}
.search-input { width: 230px; }
.search-input:focus, .text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 124, 131, .12); }

.category-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 20px 0; padding-bottom: 2px; }
.category-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.category-btn.active { background: var(--text); color: white; border-color: var(--text); }

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.menu-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer;
  background: linear-gradient(180deg, #fff, #fafbfc); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.menu-card { position: relative; }
.menu-card:active { transform: scale(.97); }
.menu-card:focus-visible { outline: 3px solid rgba(0,124,131,.35); outline-offset: 2px; }
.menu-card.in-cart { border-color: var(--accent); background: linear-gradient(180deg, #f0fafa, #e3f4f4); box-shadow: 0 0 0 2px rgba(0,124,131,.18), 0 6px 16px rgba(0,124,131,.14); }
.menu-card.in-cart::after {
  content: attr(data-qty); position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 12px; background: var(--accent); color: #fff; font: 800 13px/24px Arial, sans-serif; text-align: center;
  box-shadow: 0 2px 6px rgba(0,60,64,.3);
}
.menu-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16,24,40,.08); border-color: #d3d7de; }
.menu-card h3 { margin: 0 0 5px; font-size: 15px; }
.menu-card .category { color: var(--muted); font-size: 12px; }
.menu-card .price { margin-top: 10px; font-weight: 800; font-size: 16px; }

.cart-header { padding: 20px 20px 15px; border-bottom: 1px solid var(--border); }
.text-btn { border: 0; background: transparent; color: var(--accent); cursor: pointer; font-weight: 700; }
.cart-items { flex: 1; overflow: auto; padding: 12px 20px; }
.empty-cart { height: 260px; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--muted); }
.empty-icon { font-size: 38px; margin-bottom: 6px; }
.cart-line { padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-line-main { display: flex; justify-content: space-between; gap: 12px; }
.cart-line h3 { margin: 0 0 4px; font-size: 14px; }
.cart-line .rate { color: var(--muted); font-size: 12px; }
.quantity { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.qty-btn { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; cursor: pointer; }
.qty-value { min-width: 20px; text-align: center; font-weight: 700; }
.bill-summary { padding: 18px 20px 20px; border-top: 1px solid var(--border); }
.field-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; }
.field-label span { color: var(--muted); font-weight: 400; }
.text-input { width: 100%; margin-bottom: 15px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); font-size: 14px; }
.summary-row strong { color: var(--text); }
.summary-row.total { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 13px; font-size: 18px; color: var(--text); }
.primary-btn, .secondary-btn {
  border: 0; border-radius: 10px; padding: 11px 15px; cursor: pointer; font-weight: 800;
}
.primary-btn { background: var(--accent); color: white; }
.primary-btn:hover { background: var(--accent-dark); }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }
.secondary-btn { background: var(--surface-muted); color: var(--text); border: 1px solid var(--border); }
.nav-btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .62); display: grid; place-items: center; padding: 18px; z-index: 20; }
.modal.hidden { display: none; }
.modal-card { width: min(720px, 100%); max-height: 94vh; overflow: auto; background: var(--surface); border-radius: 16px; padding: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.invoice { max-width: 640px; margin: auto; padding: 28px; border: 1px solid var(--border); background: white; }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 2px solid var(--text); }
.invoice-head h2 { margin: 0 0 5px; }
.invoice-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.invoice-meta { text-align: right; display: grid; gap: 4px; font-size: 12px; }
.invoice-meta span { color: var(--muted); }
.invoice-customer { display: flex; justify-content: space-between; padding: 18px 0; font-size: 13px; }
.invoice-customer span { color: var(--muted); }
.invoice table { width: 100%; border-collapse: collapse; font-size: 13px; }
.invoice th, .invoice td { padding: 10px 5px; border-bottom: 1px solid var(--border); text-align: left; }
.invoice th:not(:first-child), .invoice td:not(:first-child) { text-align: right; }
.invoice-total { width: 280px; max-width: 100%; margin: 18px 0 0 auto; }
.invoice-total div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.invoice-total .grand-total { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 12px; font-size: 18px; }
.invoice-footer { border-top: 1px dashed var(--border); margin-top: 28px; padding-top: 18px; text-align: center; display: grid; gap: 5px; font-size: 13px; }
.invoice-footer span { color: var(--muted); font-size: 11px; }

/* Menu management */
.management-page { padding: 22px; max-width: 1250px; margin: auto; }
.management-panel {
  margin-top: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; }
.management-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.management-header p { color: var(--muted); margin-bottom: 0; font-size: 13px; }
.management-toolbar { display: flex; gap: 12px; margin-bottom: 18px; }
.management-toolbar .search-input { flex: 1; width: auto; }
.category-filter { width: 220px; margin-bottom: 0; }
.menu-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.menu-table-wrap table { width: 100%; border-collapse: collapse; min-width: 680px; }
.menu-table-wrap th, .menu-table-wrap td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; }
.menu-table-wrap th { background: var(--surface-muted); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.menu-table-wrap tr:last-child td { border-bottom: 0; }
.managed-item { display: flex; align-items: center; gap: 10px; }
.managed-icon { width: 36px; height: 36px; display: grid; place-items: center; background: var(--surface-muted); border-radius: 9px; font-size: 20px; }
.table-actions { display: flex; gap: 8px; }
.action-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 7px 11px; cursor: pointer; font-weight: 700; }
.action-btn:hover { background: var(--surface-muted); }
.action-btn.danger { color: var(--danger); }
.action-btn.danger:hover { border-color: #f0b6b6; background: #fff5f5; }
.empty-management { min-height: 280px; display: grid; place-content: center; text-align: center; gap: 6px; color: var(--muted); }
.form-card { width: min(560px, 100%); background: var(--surface); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.modal-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-form-header h2 { margin-bottom: 0; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.form-grid .text-input { margin-bottom: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .workspace > * { min-width: 0; }
  .cart-panel { position: static; min-height: auto; }
}
@media (max-width: 620px) {
  .topbar { padding: 14px 16px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .invoice-badge { display: none; }
  .workspace, .management-page { padding: 12px; }
  .menu-panel, .management-panel { padding: 16px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .search-input { width: 100%; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice { padding: 18px; }
  .management-header { align-items: stretch; flex-direction: column; }
  .management-toolbar { flex-direction: column; }
  .category-filter { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}
@media print {
  body { background: white; }
  .app-shell, .no-print { display: none !important; }
  .modal { position: static; display: block; background: white; padding: 0; }
  .modal-card { width: 100%; max-height: none; padding: 0; overflow: visible; }
  .invoice { border: 0; max-width: none; }
  @page { margin: 10mm; }
}
/* Collapsible left navigation */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: #005B61;
  color: #fff;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  transition: width .22s ease, transform .22s ease;
  box-shadow: 8px 0 24px rgba(15, 23, 42, .12);
}
.app-sidebar.collapsed { width: 60px; }
.sidebar-brand {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 16px;
  overflow: hidden;
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: #fff;
  color: #111827;
  border-radius: 11px;
  font-size: 21px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.sidebar-logo:hover {
  transform: scale(1.04);
  box-shadow: 0 5px 14px rgba(0, 0, 0, .12);
}
.sidebar-logo:focus-visible {
  outline: 2px solid #D4A017;
  outline-offset: 3px;
}
.sidebar-brand-text { display: grid; gap: 2px; white-space: nowrap; }
.sidebar-brand-text strong { font-size: 14px; }
.sidebar-brand-text span { color: #9ca3af; font-size: 11px; }
.sidebar-link:focus-visible {
  outline: 2px solid #D4A017;
  outline-offset: 2px;
}
.sidebar-nav { display: grid; gap: 6px; }
.sidebar-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: #F4FAFA;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 9px;
  white-space: nowrap;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(212, 160, 23, .65);
  color: #fff;
  transform: translateX(2px);
}
.sidebar-link.active {
  background: rgba(212, 160, 23, .10);
  border-color: rgba(212, 160, 23, .55);
  color: #D4A017;
  font-weight: 800;
}
.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  color: #9ca3af;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-footer-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #FFF8F0;
}
.app-sidebar.collapsed .sidebar-brand-text,
.app-sidebar.collapsed .sidebar-link > span:last-child,
.app-sidebar.collapsed .sidebar-footer > span:last-child { display: none; }
.app-sidebar.collapsed .sidebar-brand,
.app-sidebar.collapsed .sidebar-link,
.app-sidebar.collapsed .sidebar-footer { justify-content: center; }
.app-sidebar.collapsed .sidebar-brand { padding-left: 0; padding-right: 0; }
.app-sidebar.collapsed .sidebar-link {
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}
.app-sidebar.collapsed .sidebar-icon {
  display: block;
  width: 28px;
  flex: 0 0 28px;
  text-align: center;
  font-size: 18px;
}
.sidebar-overlay { display: none; }

.topbar, .workspace, .dashboard-shell, .management-page, .platform-page, .customer-admin-page {
  margin-left: 238px;
  transition: margin-left .22s ease;
}
body:not(.sidebar-expanded) .topbar,
body:not(.sidebar-expanded) .workspace,
body:not(.sidebar-expanded) .dashboard-shell,
body:not(.sidebar-expanded) .management-page,
body:not(.sidebar-expanded) .platform-page,
body:not(.sidebar-expanded) .customer-admin-page { margin-left: 70px; }

@media (max-width: 760px) {
  /* Mobile navigation stays fully expanded when opened. */
  .app-sidebar,
  .app-sidebar.collapsed {
    width: 238px;
    padding: 18px 12px;
  }
  .app-sidebar.collapsed .sidebar-brand-text,
  .app-sidebar.collapsed .sidebar-link > span:last-child,
  .app-sidebar.collapsed .sidebar-footer > span:last-child {
    display: initial;
  }
  .app-sidebar.collapsed .sidebar-brand,
  .app-sidebar.collapsed .sidebar-link,
  .app-sidebar.collapsed .sidebar-footer {
    justify-content: initial;
  }
  .app-sidebar.collapsed .sidebar-brand {
    padding-left: 8px;
    padding-right: 8px;
  }
  .app-sidebar.collapsed .sidebar-link {
    padding: 10px 14px;
    justify-content: flex-start;
  }
  .app-sidebar.collapsed .sidebar-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    font-size: 16px;
  }
  .app-sidebar .sidebar-link {
    min-height: 44px;
  }
  .app-sidebar .sidebar-brand-text {
    min-width: 0;
  }
  .app-sidebar .sidebar-brand-text strong,
  .app-sidebar .sidebar-brand-text span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .app-sidebar .sidebar-link > span:last-child {
    display: inline;
  }
  .app-sidebar .sidebar-footer > span:last-child {
    display: initial;
  }

  .app-sidebar {
    transform: translateX(-100%);
    transform: translateX(-100%);
  }
  .app-sidebar.mobile-open { transform: translateX(0); }
  .app-sidebar.collapsed { width: 238px; }
  .app-sidebar.collapsed .sidebar-brand-text,
    .app-sidebar.collapsed .sidebar-footer > span:last-child { display: initial; }
  .app-sidebar.collapsed .sidebar-brand,
  .app-sidebar.collapsed .sidebar-link,
  .app-sidebar.collapsed .sidebar-footer { justify-content: initial; }
  .sidebar-overlay.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    z-index: 25;
  }
  .topbar, .workspace, .dashboard-shell, .management-page,
  body:not(.sidebar-expanded) .topbar,
  body:not(.sidebar-expanded) .workspace,
  body:not(.sidebar-expanded) .dashboard-shell,
  body:not(.sidebar-expanded) .management-page {
    margin-left: 0;
  }
}

/* Authentication */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #F4FAFA, #EAF5F5); }
.login-shell { width: min(460px, 100%); }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 30px; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-logo { width: 48px; height: 48px; display: block; border-radius: 13px; object-fit: contain; }
.login-card h1 { font-size: 24px; line-height: 1.2; margin: 0; }
.login-subtitle { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 14px 0 24px; }
.login-form { display: grid; gap: 16px; }
.login-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; }
.login-form .text-input { margin: 0; }
.login-form .primary-btn { width: 100%; min-height: 46px; }
.login-message { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; }
.login-help { margin-top: 22px; padding: 14px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 12px; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.login-help strong { color: var(--text); }
.sidebar-user { min-width: 0; display: grid; gap: 2px; overflow: hidden; }
.sidebar-user strong, .sidebar-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #fff; font-size: 11px; }
.sidebar-user small { color: #9ca3af; font-size: 9px; }
.sidebar-logout { margin-left: auto; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; border-radius: 7px; padding: 5px 7px; cursor: pointer; font-size: 10px; font-weight: 700; }
.sidebar-logout:hover { background: rgba(255,255,255,.12); }
.app-sidebar.collapsed .sidebar-user { display: none; }
.app-sidebar.collapsed .sidebar-logout {
  margin-left: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 18px;
}
.sidebar-logout-icon { display: inline; line-height: 1; }
.sidebar-logout-text { display: inline; }
.app-sidebar.collapsed .sidebar-logout-text { display: none; }


/* Profile */
.profile-page { padding: 22px; width: calc(100% - 238px); max-width: none; margin: 0 0 0 238px; transition: margin-left .22s ease, width .22s ease; }
body:not(.sidebar-expanded) .profile-page { width: calc(100% - 60px); margin-left: 60px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; }
.profile-summary { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; }
.profile-avatar { width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; border-radius: 18px; background: var(--accent); color: #fff; font-size: 24px; font-weight: 800; }
.profile-summary h2 { margin: 0 0 5px; font-size: 20px; word-break: break-word; }
.profile-muted, .profile-card-header p:not(.eyebrow) { color: var(--muted); font-size: 13px; margin: 0; }
.profile-card-header { margin-bottom: 18px; }
.profile-card-header h2 { margin-bottom: 5px; }
.profile-details { display: grid; gap: 0; }
.profile-details div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.profile-details div:last-child { border-bottom: 0; }
.profile-details span { color: var(--muted); font-size: 13px; }
.profile-details strong { text-align: right; font-size: 13px; overflow-wrap: anywhere; }
.profile-form { display: grid; gap: 14px; }
.profile-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; }
.profile-form .text-input { margin: 0; }
.profile-form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
.profile-form-actions .primary-btn, .profile-form-actions .secondary-btn { min-height: 42px; }
.login-links { display: flex; justify-content: center; margin-top: 18px; }
.login-links a { color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-message.success { color: var(--success); }

@media (max-width: 760px) {
  .profile-page { padding: 12px; }
  body:not(.sidebar-expanded) .profile-page { width: 100%; margin-left: 0; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-summary { grid-column: auto; }
  .profile-details div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .profile-details strong { text-align: left; }
}


/* Monochrome sidebar icons */
.sidebar-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
  color: #D4A017;
  fill: currentColor;
}
.sidebar-link .sidebar-icon {
  color: #FFFFFF;
  stroke-width: 1.8;
}
.sidebar-link.active .sidebar-icon {
  color: #D4A017;
  stroke-width: 2.8;
}
.sidebar-link:hover:not(.active) .sidebar-icon {
  color: #FFFFFF;
}
.sidebar-link .sidebar-icon path {
  fill: currentColor;
}
.app-sidebar.collapsed .sidebar-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}


/* Customer onboarding */
.customer-admin-page { padding: 22px; width: calc(100% - 238px); max-width: none; margin: 0 0 0 238px; transition: margin-left .22s ease, width .22s ease; }
body:not(.sidebar-expanded) .customer-admin-page { width: calc(100% - 60px); margin-left: 60px; }
.customer-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 0; padding: 0; }
.customer-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.customer-stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.customer-stat strong { font-size: 25px; }
.customer-slug { color: var(--muted); font-size: 11px; margin-top: 3px; }
.plan-badge, .status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.plan-badge { background: #EEF6F6; color: var(--accent-dark); }
.status-pending { background: #FFF5D6; color: #8A6500; }
.status-active { background: #E9F7EE; color: var(--success); }
.status-suspended, .status-cancelled { background: #FDECEC; color: var(--danger); }
.customer-empty { padding: 50px !important; text-align: center !important; color: var(--muted); }
.onboarding-note { margin-bottom: 18px; padding: 12px 14px; background: #F4FAFA; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 900px) {
  .customer-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .customer-stats { grid-template-columns: 1fr 1fr; padding: 0 12px; }
  .customer-admin-page { padding: 12px; }
}

/* Platform admin pages */
.platform-page { padding: 22px; max-width: none; width: calc(100% - 238px); margin: 0 0 0 238px; transition: margin-left .22s ease, width .22s ease; }
.platform-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 26px; }
.platform-hero h2 { margin-bottom: 8px; font-size: 22px; }
.platform-hero p { color: var(--muted); max-width: 760px; line-height: 1.6; }
.platform-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.platform-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.platform-card h3 { margin: 0 0 7px; font-size: 15px; }
.platform-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.platform-coming-soon { display: inline-flex; margin-top: 12px; padding: 5px 9px; border-radius: 999px; background: #FFF5D6; color: #8A6500; font-size: 10px; font-weight: 800; text-transform: uppercase; }
@media (max-width: 900px) { .platform-card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .platform-page { width: calc(100% - 238px); margin-left: 238px; } }
@media (max-width: 760px) { .platform-page, body:not(.sidebar-expanded) .platform-page { width: 100%; margin-left: 0; } }
@media (max-width: 620px) { .platform-page { padding: 12px; } .platform-card-grid { grid-template-columns: 1fr; } }


/* Subscription plan management */
.subscription-page { padding-bottom: 40px; }
.subscription-plan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.subscription-plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 330px;
}
.subscription-plan-card.featured { border: 2px solid var(--accent); transform: translateY(-3px); }
.plan-featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}
.subscription-plan-header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.subscription-plan-header h3 { margin: 2px 0 0; font-size: 19px; }
.subscription-plan-header > strong { font-size: 16px; white-space: nowrap; }
.subscription-price-note { color: var(--muted); font-size: 11px; margin: 5px 0 15px; }
.subscription-plan-meta { display: grid; gap: 6px; padding: 10px; background: var(--surface-muted); border-radius: 10px; font-size: 11px; font-weight: 800; }
.subscription-plan-card ul { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.subscription-plan-card li { color: var(--muted); font-size: 12px; }
.subscription-plan-card li::before { content: "✓"; color: var(--success); font-weight: 900; margin-right: 7px; }
.subscription-yearly { border-top: 1px dashed var(--border); padding-top: 12px; font-size: 11px; font-weight: 800; color: var(--accent-dark); }
.subscription-panel { margin-top: 18px; }
.status-trialing { background: #EEF6F6; color: var(--accent-dark); }
.status-past_due { background: #FFF5D6; color: #8A6500; }
.status-paused, .status-expired { background: #FDECEC; color: var(--danger); }

@media (max-width: 1200px) {
  .subscription-plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .subscription-plan-grid { grid-template-columns: 1fr 1fr; }
  .subscription-plan-card.featured { transform: none; }
}
@media (max-width: 520px) {
  .subscription-plan-grid { grid-template-columns: 1fr; }
}


.mobile-menu-button {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  width: 44px;
  height: 44px;
  z-index: 45;
  border: 1px solid rgba(0, 91, 97, .18);
  border-radius: 12px;
  background: #fff;
  color: #005B61;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .16);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.mobile-menu-button:active { transform: scale(.97); }
.mobile-menu-button:focus-visible {
  outline: 2px solid #D4A017;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .mobile-menu-button { display: grid; place-items: center; }
}

/* Receipt details (profile page) */
.receipt-settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.receipt-settings-form .rc-wide { grid-column: 1 / -1; }
.receipt-settings-form .rc-check { display: flex; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }
.receipt-settings-form textarea { resize: vertical; font: inherit; }
@media (max-width: 700px) { .receipt-settings-form { grid-template-columns: 1fr; } }

/* Billing: dine-in / takeaway switch */
.order-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 6px; }
.order-type-btn { border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 9px 8px; font-weight: 700; cursor: pointer; color: var(--text); }
.order-type-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Make the hidden attribute win over display rules (e.g. .summary-row) */
[hidden] { display: none !important; }

/* Menu table: food type badge, right-aligned prices */
.menu-table-wrap th.num, .menu-table-wrap td.num { text-align: right; }
.menu-table-wrap td { vertical-align: middle; }
.food-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.food-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.food-badge.veg { color: #157347; background: #e8f6ee; }
.food-badge.non-veg { color: #b42318; background: #fdecea; }
.food-badge.egg { color: #8a6100; background: #fff4cc; }
.food-badge.none { color: #475b5e; background: #eef3f3; }
.food-badge.none::before { display: none; }
.management-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Menu import */
.import-card { width: min(980px, 100%); max-height: 92vh; overflow: auto; }
.import-help { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.import-help a { color: var(--accent-dark, #0f766e); font-weight: 700; }
.import-drop { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px; border: 2px dashed var(--border); border-radius: 12px; background: var(--surface-muted); }
.import-drop.drag { border-color: var(--accent); background: #eef8f7; }
.import-file-name { font-weight: 700; }
.import-drop-hint { color: var(--muted); font-size: 13px; }
.import-option { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 14px; }
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.imp-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.imp-new { background: #e8f6ee; color: #157347; }
.imp-update { background: #fff4de; color: #9a5b00; }
.imp-same { background: #eef1f4; color: #5b6673; }
.imp-error { background: #fdecea; color: #b42318; }
.import-preview { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.import-preview:empty { display: none; }
.import-preview table { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-preview th, .import-preview td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.import-preview th { position: sticky; top: 0; background: var(--surface-muted); color: var(--muted); font-size: 11px; text-transform: uppercase; }
.import-preview .num { text-align: right; white-space: nowrap; }
.imp-row-error td { background: #fffafa; }
.imp-old { color: var(--muted); margin-right: 4px; }
.imp-loading, .imp-error-msg { padding: 14px; margin: 0; }
.imp-error-msg { color: var(--danger); font-weight: 700; }
.import-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
@media (max-width: 700px) { .management-actions { justify-content: stretch; } .management-actions button { flex: 1; } }

/* Modals above the sidebar (sidebar uses z-index up to 45) */
.modal { z-index: 60; }
.import-preview td:nth-child(5), .import-preview td:nth-child(2) { white-space: nowrap; }

/* Staff page */
.staff-page { display: grid; gap: 18px; }
.staff-seats { display: inline-block; margin-left: 6px; font-weight: 700; color: var(--text); }
.staff-loading { padding: 16px; margin: 0; color: var(--muted); }
.staff-hint { margin: 0; font-size: 13px; color: var(--muted); }
.role-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.role-owner { background: #efe7ff; color: #5b2bb5; }
.role-admin { background: #e5f0ff; color: #1f57b3; }
.role-cashier { background: #e8f6ee; color: #157347; }
.role-captain { background: #fff4de; color: #9a5b00; }
.staff-status-off { color: var(--danger); font-weight: 700; }
.staff-role-select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); font-weight: 600; }
.staff-roles td:not(:first-child), .staff-roles th:not(:first-child) { text-align: center; }
.staff-you { color: var(--muted); font-size: 12px; margin-left: 4px; }

.staff-userid { display: flex; align-items: stretch; }
.staff-userid .text-input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.staff-code-suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-muted); font-weight: 700; color: var(--muted); white-space: nowrap; }
.staff-code-info { display: inline-block; margin-top: 4px; font-size: 13px; }
.staff-code-info code, .staff-login-id { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-muted); padding: 2px 6px; border-radius: 6px; }

.role-kitchen { background: #ffedd5; color: #c2410c; }

/* ===================== Phone layout (≤760px) ===================== */
@media (max-width: 760px) {
  /* Leave room for the fixed ☰ button so it never covers the page title. */
  .topbar, .dashboard-header { padding-left: 68px !important; min-height: 68px; }
  .topbar h1 { font-size: 22px; line-height: 1.2; }
  .topbar .eyebrow { font-size: 10px; }
  .topbar-actions { flex-wrap: wrap; }
  .profile-card h2, .profile-card strong { overflow-wrap: anywhere; }
  .staff-code-info code { white-space: normal; overflow-wrap: anywhere; }
  .management-header .primary-btn, .management-header .secondary-btn { width: 100%; justify-content: center; }
  /* Pages must never be wider than the phone. */
  html { max-width: 100%; overflow-x: hidden; }
  /* clip (not hidden) so the body is not a scroll container and sticky bars keep working */
  body { max-width: 100%; overflow-x: clip; }
}

@media (max-width: 620px) {
  /* Menu and staff lists: each row becomes a card. */
  #menuTable table, #staffTable table { min-width: 0; }
  #menuTable thead, #staffTable thead { display: none; }
  #menuTable tbody, #staffTable tbody { display: block; }
  #menuTable tr, #staffTable tr {
    display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center;
    padding: 14px; border-bottom: 1px solid var(--border);
  }
  #menuTable tr:last-child, #staffTable tr:last-child { border-bottom: 0; }
  #menuTable td, #staffTable td { display: block; padding: 0; border: 0; min-width: 0; }
  /* Menu: name | category + price | food type | buttons */
  #menuTable td:nth-child(1) { grid-column: 1 / -1; }
  #menuTable td:nth-child(2) { grid-row: 2; grid-column: 1; color: var(--muted); font-size: 13px; }
  #menuTable td:nth-child(4) { grid-row: 2; grid-column: 2; text-align: right; font-size: 16px; }
  #menuTable td:nth-child(3) { grid-row: 3; grid-column: 1; }
  #menuTable td:nth-child(5) { grid-row: 3; grid-column: 2; }
  /* Staff: name | login id | role + status | buttons */
  #staffTable td:nth-child(1), #staffTable td:nth-child(2), #staffTable td:nth-child(5) { grid-column: 1 / -1; }
  #staffTable td:nth-child(2) { overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
  #staffTable td:nth-child(5):empty { display: none; }
  #staffTable .table-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  /* Role permission table: compact so all 6 columns fit. */
  .staff-roles table { min-width: 0 !important; font-size: 12px; }
  .staff-roles th, .staff-roles td { padding: 8px 4px !important; }
  .staff-roles th { font-size: 9px; letter-spacing: 0; }
}

/* Billing: sticky cart bar on phones */
.mobile-cart-bar { display: none; }
@media (max-width: 760px) {
  .mobile-cart-bar {
    position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 0; border-radius: 14px; padding: 14px 16px; background: #005B61; color: #fff;
    font: 800 15px/1.2 inherit; box-shadow: 0 10px 28px rgba(0,0,0,.25); cursor: pointer;
  }
  .mobile-cart-bar[hidden] { display: none !important; }
  .mobile-cart-bar span:last-child { background: rgba(255,255,255,.18); padding: 6px 10px; border-radius: 9px; font-size: 13px; }
  body.has-cart-bar .workspace { padding-bottom: 90px; }
}
/* Grid pages: wide tables scroll inside their box instead of widening the page. */
.staff-page > *, .platform-page > *, .management-page > * { min-width: 0; }


/* Account state banner (suspended / trial) */
.account-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; padding: 9px 14px; text-align: center; font-size: 13px; font-weight: 700; }
.account-banner-danger { background: #B42318; color: #fff; }
.account-banner-warn { background: #FFF1CC; color: #7A4E00; border-top: 1px solid #F5D9A3; }
body.has-account-banner { padding-bottom: 40px; }
body.has-account-banner .mobile-cart-bar { bottom: 40px; }

/* Hotel short name in the sidebar logo */
.sidebar-logo.hotel-mark { background: #D4A017; color: #0F3D3E; font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.sidebar-brand-text strong { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }

/* Sidebar footer: one full-width Logout button (hotel name is already at the top of the sidebar). */
.sidebar-footer-dot,
.sidebar-user { display: none !important; }
.sidebar-footer { padding: 12px 10px 14px; }
.app-sidebar:not(.collapsed) .sidebar-footer .sidebar-logout {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  border-radius: 10px;
  border-color: rgba(255,255,255,.3);
}
.app-sidebar:not(.collapsed) .sidebar-logout-icon { font-size: 15px; }
.app-sidebar.collapsed .sidebar-footer .sidebar-logout { flex: 0 0 40px; }
@media (max-width: 760px) {
  /* Mobile menu is always shown expanded, so the button stays full width with its label. */
  .app-sidebar.collapsed .sidebar-footer .sidebar-logout {
    flex: 1 1 auto; width: 100%; height: auto; margin: 0; padding: 11px 12px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 13px; border-radius: 10px;
  }
  .app-sidebar.collapsed .sidebar-logout-text { display: inline; }
}

/* Logout icon: door with an arrow (replaces the ↪ text glyph). */
.sidebar-logout-icon {
  font-size: 0;
  width: 18px;
  height: 18px;
  display: inline-block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* POS sidebar icons: clean line icons, one per page (replaces the old text glyphs). */
a.sidebar-link > .sidebar-icon {
  font-size: 0;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-right: 12px;
  display: block;
  background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.app-sidebar.collapsed a.sidebar-link > .sidebar-icon { width: 22px; height: 22px; flex: 0 0 22px; margin-right: 0; }
@media (max-width: 760px) { .app-sidebar.collapsed a.sidebar-link > .sidebar-icon { margin-right: 12px; } }
a.sidebar-link.active > .sidebar-icon { filter: none; }
a.sidebar-link[href="billing.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M8 8h8'/%3E%3Cpath d='M8 12h8'/%3E%3Cpath d='M8 16h5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M8 8h8'/%3E%3Cpath d='M8 12h8'/%3E%3Cpath d='M8 16h5'/%3E%3C/svg%3E"); }
a.sidebar-link[href="tables.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='4' rx='1.5'/%3E%3Cpath d='M5 11v9'/%3E%3Cpath d='M19 11v9'/%3E%3Cpath d='M9 11v4'/%3E%3Cpath d='M15 11v4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='7' width='20' height='4' rx='1.5'/%3E%3Cpath d='M5 11v9'/%3E%3Cpath d='M19 11v9'/%3E%3Cpath d='M9 11v4'/%3E%3Cpath d='M15 11v4'/%3E%3C/svg%3E"); }
a.sidebar-link[href="kitchen.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z'/%3E%3Cpath d='M6 17h12'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z'/%3E%3Cpath d='M6 17h12'/%3E%3C/svg%3E"); }
a.sidebar-link[href="menu.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2'/%3E%3Cpath d='M7 2v20'/%3E%3Cpath d='M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2'/%3E%3Cpath d='M7 2v20'/%3E%3Cpath d='M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7'/%3E%3C/svg%3E"); }
a.sidebar-link[href="dashboard.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h7v9H3z'/%3E%3Cpath d='M14 3h7v5h-7z'/%3E%3Cpath d='M14 12h7v9h-7z'/%3E%3Cpath d='M3 16h7v5H3z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h7v9H3z'/%3E%3Cpath d='M14 3h7v5h-7z'/%3E%3Cpath d='M14 12h7v9h-7z'/%3E%3Cpath d='M3 16h7v5H3z'/%3E%3C/svg%3E"); }
a.sidebar-link[href="reports.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18 17V9'/%3E%3Cpath d='M13 17V5'/%3E%3Cpath d='M8 17v-3'/%3E%3C/svg%3E"); }
a.sidebar-link[href="restaurant-customers.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
a.sidebar-link[href="staff.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='m16 11 2 2 4-4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='m16 11 2 2 4-4'/%3E%3C/svg%3E"); }
a.sidebar-link[href="profile.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7h-9'/%3E%3Cpath d='M14 17H5'/%3E%3Ccircle cx='17' cy='17' r='3'/%3E%3Ccircle cx='7' cy='7' r='3'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7h-9'/%3E%3Cpath d='M14 17H5'/%3E%3Ccircle cx='17' cy='17' r='3'/%3E%3Ccircle cx='7' cy='7' r='3'/%3E%3C/svg%3E"); }
a.sidebar-link[href="subscription.html"] > .sidebar-icon { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3C/svg%3E"); }

.consent-check { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; line-height: 1.35; color: var(--muted); margin: -2px 0 9px; cursor: pointer; }
.consent-check input { margin-top: 2px; flex: none; }

/* Compact bill panel (billing + tables): smaller inputs and buttons */
.bill-summary { padding: 12px 16px 14px; }
.bill-summary .field-label, label.field-label[for="customerName"], label.field-label[for="customerPhone"] { font-size: 11.5px; margin-bottom: 4px; }
#customerName, #customerPhone, .bill-summary #paymentMethod { padding: 7px 10px; font-size: 13.5px; border-radius: 8px; margin-bottom: 9px; }
.bill-summary .order-type-switch { margin: 6px 0 4px; }
.bill-summary .order-type-btn { padding: 6px 8px; font-size: 13px; border-radius: 8px; }
.bill-summary .summary-row { padding: 3px 0; font-size: 13px; }
.bill-summary .summary-row.total { font-size: 16px; margin-top: 5px; padding-top: 9px; }
#generateInvoiceBtn { width: 100%; padding: 9px 14px; font-size: 14px; border-radius: 9px; margin-top: 8px; }

/* Total + Generate Invoice stay in reach (sticky at the bottom on phones/tablets) */
.generate-bar { padding: 0 16px 14px; }
.generate-bar .summary-row.total { font-size: 16px; margin-top: 0; padding-top: 9px; padding-bottom: 8px; }
.generate-bar .primary-btn { width: 100%; }
@media (max-width: 900px) {
  .generate-bar {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--border);
    border-radius: 0 0 18px 18px; box-shadow: 0 -8px 14px -10px rgba(15,50,50,.3);
  }
  .generate-bar .summary-row.total { flex: 0 0 auto; flex-direction: column; gap: 0; border-top: 0; margin: 0; padding: 0; font-size: 17px; line-height: 1.15; }
  .generate-bar .summary-row.total span { font-size: 11px; font-weight: 700; }
  .generate-bar .primary-btn { flex: 1; width: auto; min-height: 44px; }
  body.has-account-banner .generate-bar { bottom: 40px; }
}

/* Laptop/desktop: the cart panel fits the screen; the item list scrolls inside it and the total + Generate Invoice stay in view */
@media (min-width: 901px) {
  .cart-panel { height: calc(100vh - 126px); min-height: 0; }
  .cart-items { flex: 1 1 110px; min-height: 110px; }
  .bill-summary { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
  .generate-bar { flex: 0 0 auto; border-top: 1px solid var(--border); padding-top: 8px; }
}

/* Customer fields fold away so the order list gets the room */
.cust-details { margin: 0 0 10px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: #fbfdfd; }
.cust-details summary { cursor: pointer; font-weight: 700; font-size: 13px; padding: 9px 0; list-style: none; }
.cust-details summary::-webkit-details-marker { display: none; }
.cust-details summary::before { content: "▸ "; color: var(--muted); }
.cust-details[open] summary::before { content: "▾ "; }
.cust-details summary span { font-weight: 400; color: var(--muted); }
.cust-details[open] { padding-bottom: 8px; }
.cust-details .text-input { margin-bottom: 8px; }

/* Menu toolbar: search and category tabs share one row */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.menu-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.menu-toolbar .search-input { width: 210px; flex: 0 0 auto; }
.menu-toolbar .category-tabs { flex: 1 1 auto; min-width: 0; margin: 0; padding: 2px 0; scrollbar-width: none; -ms-overflow-style: none; }
.menu-toolbar .category-tabs::-webkit-scrollbar { display: none; }
.menu-toolbar .category-btn { padding: 8px 14px; }
@media (max-width: 620px) {
  .menu-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .menu-toolbar .search-input { width: 100%; }
}

/* Plus/minus on the menu card, so items can be removed without going to the bill */
.menu-grid { gap: 20px 10px; padding-top: 8px; }
.menu-item { position: relative; display: flex; }
.menu-item > .menu-card { flex: 1; min-width: 0; text-align: center; padding-top: 23px; }
.menu-card.in-cart::after { display: none; }
.card-stepper {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; height: 34px; border-radius: 17px; overflow: hidden;
  background: var(--accent); color: #fff; box-shadow: 0 3px 8px rgba(0,60,64,.3);
}
.card-stepper[hidden] { display: none; }
.step-btn { width: 36px; height: 34px; border: 0; background: transparent; color: #fff; font: 800 20px/1 Arial, sans-serif; cursor: pointer; padding: 0; }
.step-btn:hover { background: rgba(255,255,255,.18); }
.step-btn:active { background: rgba(255,255,255,.3); }
.step-btn:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.step-qty { min-width: 22px; text-align: center; font: 800 15px/1 Arial, sans-serif; }

/* Arrow buttons for the category tabs */
.tabs-wrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.tabs-wrap .category-tabs { flex: 1 1 auto; }
.tabs-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 20px/1 Arial, sans-serif;
  cursor: pointer; padding: 0 0 3px; box-shadow: 0 2px 8px rgba(16,24,40,.18);
}
.tabs-arrow:hover { background: var(--text); color: #fff; }
.tabs-arrow[hidden] { display: none; }
#tabsLeft, #tmLeft { left: -2px; }
#tabsRight, #tmRight { right: -2px; }
.menu-toolbar .category-tabs { cursor: grab; }

/* Soft shadow so each menu card lifts off the panel background */
.menu-card {
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 3px 8px rgba(16, 24, 40, .07);
  border-color: #dfe5e8;
}
.menu-card:hover { box-shadow: 0 2px 4px rgba(16, 24, 40, .08), 0 8px 18px rgba(16, 24, 40, .12); }
.menu-card.in-cart { box-shadow: 0 0 0 2px rgba(0,124,131,.18), 0 4px 12px rgba(0,124,131,.18); }
