/* SaacidPos — Modern professional POS UI */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-muted: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;
  --border: #e2e8f0;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --table-available: #15803d;
  --table-occupied: #0f766e;
  --table-reserved: #0369a1;
  --table-cleaning: #64748b;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --transition: 160ms cubic-bezier(.4, 0, .2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  --bg: #020617;
  --bg-elevated: #0f172a;
  --bg-sidebar: #020617;
  --bg-muted: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;
  --border: #1e293b;
  --accent: #14b8a6;
  --accent-hover: #2dd4bf;
  --accent-soft: rgba(20, 184, 166, 0.16);
  --success-bg: rgba(21,128,61,.2);
  --warning-bg: rgba(180,83,9,.2);
  --danger-bg: rgba(185,28,28,.2);
  --info-bg: rgba(3,105,161,.2);
  --shadow: 0 1px 3px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.45);
}
[data-theme="dark"] .form-control {
  background: var(--bg-muted);
}
[data-theme="dark"] .form-control:hover { border-color: #334155; }
[data-theme="dark"] table.data th { background: rgba(255,255,255,.03); }
[data-theme="dark"] table.data tr:hover td { background: rgba(20, 184, 166, 0.08); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #132033 0%, var(--bg-sidebar) 42%, #0b1220 100%);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  transition: transform var(--transition);
  box-shadow: 4px 0 32px rgba(15, 23, 42, 0.22);
}
.sidebar-brand {
  padding: 1.15rem 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), #14b8a6);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.4);
  flex-shrink: 0;
}
.sidebar-brand .logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.sidebar-brand .tag {
  font-size: .7rem;
  color: #94a3b8;
  margin-top: 2px;
  font-weight: 500;
}
.restaurant-badge {
  margin-top: .85rem;
  padding: .6rem .7rem;
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.28);
  color: #5eead4;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
}
.restaurant-badge small {
  display: block;
  font-weight: 600;
  font-size: .65rem;
  color: #94a3b8;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.restaurant-badge .badge-note {
  font-size: .68rem;
  font-weight: 500;
  opacity: .75;
  margin-top: 3px;
}
.tenant-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), var(--bg-elevated));
  border: 1px solid var(--border);
}
.tenant-banner h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tenant-banner p {
  color: var(--text-muted);
  font-size: .88rem;
  margin-top: .2rem;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: .75rem .65rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18);
  border-radius: 99px;
}
.nav-section { margin-bottom: .85rem; }
.nav-section-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  padding: .3rem .8rem .4rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .58rem .75rem;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 2px;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.nav-item.active {
  background: rgba(20, 184, 166, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.3);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  flex-shrink: 0;
}
.nav-item.active .nav-icon {
  background: rgba(20, 184, 166, 0.3);
}
.nav-item svg { width: 16px; height: 16px; opacity: .95; }
.nav-label { flex: 1; min-width: 0; }
.sidebar-footer {
  padding: .85rem .9rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.2);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .4rem .45rem;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), #14b8a6);
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem;
  color: #fff;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta .name { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .role { font-size: .72rem; color: #94a3b8; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: .75rem 1.35rem;
  background: var(--bg-elevated);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.topbar-title-wrap { min-width: 0; }
.topbar-subtitle {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.topbar-actions { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; }
.btn-logout .logout-icon { display: none; }
.content { padding: 1.35rem 1.35rem calc(1.35rem + var(--safe-bottom)); flex: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .58rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  background: var(--bg-muted);
  color: var(--text);
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: var(--bg-elevated); border-color: var(--border); }
.btn-outline:hover { border-color: #cbd5e1; background: var(--bg); }
.btn-ghost { background: transparent; }
.btn-sm { padding: .38rem .65rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.2rem; font-size: 1rem; }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  border: 1px solid transparent;
  cursor: pointer;
  display: grid; place-items: center;
}
.btn-icon:hover { background: var(--border); }
.menu-toggle svg { width: 20px; height: 20px; }

/* Cards & grids */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; margin-top: .35rem; letter-spacing: -0.03em; }
.stat-sub { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* Forms */
.form-group { margin-bottom: 1.05rem; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: .45rem;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  padding: .72rem .95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  min-height: 42px;
}
.form-control:hover { border-color: #cbd5e1; }
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.form-control-sm { padding: .42rem .7rem; min-height: 34px; font-size: .85rem; border-radius: 10px; }
.form-control-lg { padding: .9rem 1.1rem; min-height: 50px; font-size: 1.02rem; border-radius: 14px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.2rem;
}
textarea.form-control { min-height: 96px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .35rem; }
.form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.search-box {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-box input {
  width: 100%;
  padding: .72rem .95rem .72rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.search-box svg {
  position: absolute;
  left: .85rem; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
table.data th {
  text-align: left;
  padding: .8rem .95rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  background: var(--bg-muted);
  position: sticky;
  top: 0;
}
table.data td {
  padding: .8rem .95rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(15, 118, 110, 0.04); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .85rem 0 0;
  margin-top: .5rem;
}
.pagination-info {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}
.pagination-btns {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.pagination-btns .btn {
  min-width: 36px;
  padding: .4rem .65rem;
}
.pagination-btns .btn.active-page {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pagination-btns .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Reports polish */
.rep-filters {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
#reportTabs.chips { gap: .45rem; }
#reportTabs .chip {
  border-radius: 999px;
  padding: .55rem 1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
#reportTabs .chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.25);
}
.rep-panel .card {
  overflow: hidden;
}
.pay-footer-box {
  background: var(--bg-muted);
  border-radius: 12px;
  padding: .85rem 1rem;
  border: 1px dashed var(--border);
}
.pay-footer-box .cart-row.total {
  margin-top: .35rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
  font-size: 1.05rem;
}

/* Profit & Loss — Hyper-style statement */
.pnl-card {
  background: #fff !important;
  border: 1px solid #d0d7de;
  box-shadow: none;
}
.pnl-sheet {
  background: #fff;
  color: #111;
  padding: 1.25rem 1.5rem 1.5rem;
  font-family: Arial, Helvetica, sans-serif;
  max-width: 920px;
  margin: 0 auto;
}
.pnl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: .35rem;
}
.pnl-rest-name {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: #111;
}
.pnl-rest-phone {
  margin-top: .25rem;
  font-size: .95rem;
  font-weight: 600;
  color: #222;
}
.pnl-title-block {
  text-align: right;
}
.pnl-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: #111;
}
.pnl-period {
  margin-top: .2rem;
  font-size: .95rem;
  font-weight: 600;
  color: #333;
  letter-spacing: .02em;
}
.pnl-section {
  background: #2f6fed;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  padding: .45rem .75rem;
  margin: .85rem 0 .15rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pnl-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .55rem .35rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 1rem;
  font-weight: 500;
}
.pnl-row span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}
.pnl-row.pnl-bold {
  font-weight: 800;
  border-bottom-color: #cbd5e1;
}
.pnl-row.pnl-bold span:last-child {
  font-weight: 800;
}
.pnl-row.pnl-total {
  margin-top: .35rem;
  border-bottom: 2px solid #111;
  font-size: 1.1rem;
  font-weight: 900;
}
.pnl-row.pnl-total span:last-child {
  font-weight: 900;
}

/* P&L summary cards — flex so Hostinger/old CSS caches still lay out as cards */
.pnl-summary {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .85rem !important;
  margin-bottom: 1rem !important;
  align-items: stretch !important;
}
.pnl-vat-entry {
  position: relative;
}
.pnl-sum-vat {
  border-color: #93c5fd !important;
}
.pnl-sum-card {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 1rem 1.1rem !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06) !important;
  min-height: 8.5rem;
  flex: 1 1 200px !important;
  min-width: min(100%, 200px) !important;
  max-width: 100%;
  box-sizing: border-box !important;
}
.pnl-sum-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: .5rem;
  margin-bottom: .55rem;
}
.pnl-sum-label {
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b !important;
  line-height: 1.3;
}
.pnl-sum-icon {
  width: 1.75rem !important;
  height: 1.75rem !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: .85rem;
  font-weight: 800;
  flex-shrink: 0;
}
.pnl-sum-icon-up { background: #dcfce7 !important; color: #16a34a !important; }
.pnl-sum-icon-down { background: #fee2e2 !important; color: #dc2626 !important; }
.pnl-sum-icon-net { background: #e0f2fe !important; color: #0284c7 !important; }
.pnl-sum-icon-vat { background: #dbeafe !important; color: #2563eb !important; }
.pnl-sum-value {
  font-size: 1.55rem !important;
  font-weight: 800 !important;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.pnl-sum-income .pnl-sum-value { color: #16a34a !important; }
.pnl-sum-expense .pnl-sum-value { color: #dc2626 !important; }
.pnl-sum-net .pnl-sum-value { color: #0f172a !important; }
.pnl-sum-vat .pnl-sum-value { color: #2563eb !important; }
.pnl-sum-sub {
  margin-top: .4rem;
  font-size: .78rem !important;
  color: #94a3b8 !important;
  font-weight: 500;
}
@media (max-width: 560px) {
  .pnl-sum-card {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--bg-muted); color: var(--text-muted); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
  border: 1px solid var(--border);
}
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header .btn-icon {
  position: relative;
  z-index: 2;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text);
}
body.modal-open {
  overflow: hidden;
}
.modal-body { padding: 1.25rem; }
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 260px;
  animation: slideUp .25s ease;
  font-size: .88rem;
  font-weight: 500;
}
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }

/* Chips / tabs */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover, .chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Menu categories manager */
.menu-page { display: flex; flex-direction: column; gap: 1rem; }
.menu-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: space-between;
  align-items: center;
}
.menu-toolbar-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}
.menu-cats-panel { padding: 0; overflow: hidden; }
.menu-cats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.menu-cats-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.menu-cats-head p {
  margin: .15rem 0 0;
  font-size: .8rem;
  color: var(--text-muted);
}
.menu-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .65rem;
  padding: 1rem 1.1rem 1.15rem;
}
.menu-cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem .8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  min-width: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.menu-cat-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow);
  background: var(--bg-elevated);
}
.menu-cat-info { min-width: 0; flex: 1; }
.menu-cat-name {
  font-weight: 700;
  font-size: .92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-cat-sub {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .1rem;
}
.menu-cat-actions {
  display: flex;
  gap: .25rem;
  flex-shrink: 0;
}
.menu-cat-actions .btn-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.menu-cat-actions .btn-icon:hover { color: var(--text); border-color: #cbd5e1; }
.menu-cat-actions .btn-icon.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}
.menu-cat-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.menu-items-card .table-wrap { border: none; border-radius: 0; }
@media (max-width: 600px) {
  .menu-cat-grid { grid-template-columns: 1fr 1fr; gap: .5rem; padding: .85rem; }
  .menu-cat-card { padding: .65rem .7rem; }
  .menu-cat-name { font-size: .85rem; }
  .menu-toolbar-actions { width: 100%; }
  .menu-toolbar-actions .btn { flex: 1; justify-content: center; }
  .menu-toolbar .search-box { max-width: none; width: 100%; }
}

/* Empty state */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}
.empty svg { width: 48px; height: 48px; margin: 0 auto 1rem; opacity: .4; }

/* Mobile toggle */
.menu-toggle { display: none; }
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  z-index: 99;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}
.login-visual {
  background:
    linear-gradient(160deg, rgba(15,23,42,.72), rgba(15,118,110,.5)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230f766e' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-visual::after {
  content: '';
  position: absolute;
  inset: auto -20% -30% 20%;
  height: 70%;
  background: radial-gradient(circle, rgba(20,184,166,.35), transparent 70%);
  pointer-events: none;
}
.login-visual h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  position: relative;
  z-index: 1;
  max-width: 12ch;
}
.login-visual p {
  margin-top: 1rem;
  opacity: .85;
  font-size: 1.05rem;
  max-width: 32ch;
  position: relative;
  z-index: 1;
}
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card { width: 100%; max-width: 400px; }
.login-card .brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: .25rem;
  letter-spacing: -0.03em;
}
.login-card .welcome { color: var(--text-muted); margin-bottom: 2rem; }


/* POS specific */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 380px);
  gap: 1rem;
  height: calc(100dvh - var(--topbar-h, 64px) - 2.7rem);
  min-height: 480px;
  max-height: calc(100dvh - var(--topbar-h, 64px) - 2.7rem);
}
.pos-menu-panel {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  min-height: 0;
  overflow: hidden;
}
.pos-menu-panel .menu-grid {
  flex: 1 1 auto;
  min-height: 220px;
}
.pos-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  flex-shrink: 0;
}
.menu-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 180px;
  padding: .2rem .1rem .75rem;
  align-content: flex-start;
  align-items: stretch;
}
.menu-grid .menu-tile {
  position: static;
  box-sizing: border-box;
  width: calc((100% - 3.25rem) / 6);
  min-width: 110px;
  max-width: 160px;
  flex: 0 0 auto;
  height: auto !important;
  min-height: 0 !important;
  margin: 0;
  padding: .45rem .45rem .55rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font: inherit;
  outline: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.menu-grid .menu-tile:hover,
.menu-grid .menu-tile:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.menu-grid .menu-tile.unavailable {
  opacity: .45;
  pointer-events: none;
}
.menu-tile-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  max-height: 88px;
  border-radius: 8px;
  background: var(--bg-muted);
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-tile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: 0;
  border: 0;
}
.menu-tile-thumb.no-img {
  background: var(--bg-muted);
}
.menu-tile-letter {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  flex: 0 0 auto;
  opacity: .55;
}
.menu-tile-name {
  font-weight: 700;
  font-size: .78rem;
  line-height: 1.25;
  color: var(--text);
  display: block;
  word-break: break-word;
  max-height: 2.5em;
  overflow: hidden;
}
.menu-tile-price {
  margin-top: auto;
  color: var(--accent);
  font-weight: 800;
  font-size: .88rem;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .menu-grid .menu-tile {
    width: calc((100% - 2.6rem) / 5);
  }
}
@media (max-width: 900px) {
  .menu-grid .menu-tile {
    width: calc((100% - 1.95rem) / 4);
  }
}
@media (max-width: 600px) {
  .menu-grid .menu-tile {
    width: calc((100% - 1.3rem) / 3);
    min-width: 96px;
    padding: .4rem .4rem .5rem;
  }
  .menu-tile-thumb { max-height: 72px; }
  .menu-tile-name { font-size: .72rem; }
  .menu-tile-price { font-size: .8rem; }
}
.cart-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 0;
  height: 100%;
}
.cart-header {
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.cart-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.cart-header-top > strong {
  display: block;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.cart-options {
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--border);
}
.cart-header .order-type-tabs { margin-top: 0 !important; margin-bottom: .35rem; }
.cart-header .form-row { margin-top: .35rem !important; gap: .35rem; }
.cart-header .form-group { margin: 0 !important; }
.cart-header .form-control {
  min-height: 34px;
  padding: .35rem .55rem;
  font-size: .8rem;
}
.cart-items {
  flex: 1 1 auto;
  min-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .55rem .65rem;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
.cart-note-wrap {
  display: none !important;
}
.cart-note {
  display: none !important;
}
.cart-item-note {
  margin-top: .35rem;
  width: 100%;
  min-height: 32px !important;
  padding: .3rem .5rem !important;
  font-size: .78rem !important;
  font-weight: 500;
  border-radius: 8px !important;
}
.cart-footer {
  border-top: 1px solid var(--border);
  padding: .55rem .75rem .7rem;
  background: var(--bg-elevated);
  flex-shrink: 0;
  max-height: none;
  overflow: visible;
}
.cart-totals {
  margin-bottom: .45rem;
}
.cart-row {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  margin-bottom: .15rem;
  color: var(--text-muted);
  line-height: 1.25;
}
.cart-row.total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-top: .25rem;
  padding-top: .3rem;
  border-top: 1px dashed var(--border);
}
.cart-main-btn {
  width: 100%;
  margin-top: .35rem;
  min-height: 40px;
  padding: .55rem .75rem;
}
.cart-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem;
  margin-top: .35rem;
}
.cart-pay-grid .btn { min-height: 32px; padding: .3rem .4rem; font-size: .75rem; }
.cart-items .empty {
  padding: 1.5rem .75rem;
  font-size: .9rem;
}
.cart-item {
  display: flex;
  gap: .65rem;
  align-items: center;
  padding: .7rem .75rem;
  border-radius: 10px;
  margin-bottom: .45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name {
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.25;
  word-break: break-word;
}
.cart-item .line-total {
  font-weight: 800;
  color: var(--accent);
  font-size: .95rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .4rem;
}
.qty-ctrl button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.qty-ctrl button:hover { border-color: var(--accent); color: var(--accent); }
.qty-ctrl span {
  min-width: 1.25rem;
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
}
.order-type-tabs { display: flex; gap: .35rem; margin-bottom: .75rem; flex-wrap: wrap; }
.order-type-tabs .chip { flex: 1; text-align: center; justify-content: center; display: flex; min-width: 0; padding: .4rem .5rem; font-size: .78rem; }

/* Kitchen KOT */
.kot-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.kot-col {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 400px;
  display: flex;
  flex-direction: column;
}
.kot-col-header {
  padding: .9rem 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kot-col.pending .kot-col-header { border-top: 3px solid var(--warning); }
.kot-col.preparing .kot-col-header { border-top: 3px solid var(--info); }
.kot-col.ready .kot-col-header { border-top: 3px solid var(--success); }
.kot-list { padding: .75rem; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .65rem; }
.kot-ticket {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem;
  animation: slideUp .3s ease;
}
.kot-ticket .meta { font-size: .75rem; color: var(--text-muted); margin-bottom: .35rem; }
.kot-ticket .item-name { font-weight: 700; font-size: .95rem; }
.kot-ticket .qty { color: var(--accent); font-weight: 700; }
.kot-ticket .actions { margin-top: .65rem; display: flex; gap: .35rem; }

/* Tables floor — professional floor plan cards */
.tables-page { display: flex; flex-direction: column; gap: 1rem; }
.tables-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: space-between;
  align-items: center;
}
.tables-toolbar .chip-avail.active,
.tables-toolbar .chip[data-filter="available"].active { background: var(--success-bg); color: var(--success); border-color: transparent; }
.tables-toolbar .chip-busy.active,
.tables-toolbar .chip[data-filter="occupied"].active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tables-toolbar .chip-reserved.active,
.tables-toolbar .chip[data-filter="reserved"].active { background: var(--info-bg); color: var(--info); border-color: transparent; }

.tables-toolbar-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: center;
}
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .85rem;
}
.table-card {
  position: relative;
  min-height: 168px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  padding: 0;
  text-align: left;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--border);
}
.table-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.table-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.table-card.available::before { background: var(--success); }
.table-card.occupied::before { background: var(--accent); }
.table-card.reserved::before { background: var(--info); }
.table-card.cleaning::before { background: var(--table-cleaning); }
.table-card.available { background: linear-gradient(180deg, #f0fdf4 0%, var(--bg-elevated) 42%); }
.table-card.occupied { background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-elevated) 48%); }
.table-card.reserved { background: linear-gradient(180deg, var(--info-bg) 0%, var(--bg-elevated) 48%); }
.table-card.cleaning { opacity: .85; }
.table-card-body {
  flex: 1;
  padding: .95rem 1rem .75rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-width: 0;
}
.table-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.table-card .t-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.table-card .t-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.table-card.available .t-badge { background: var(--success-bg); color: var(--success); }
.table-card.occupied .t-badge { background: var(--accent-soft); color: var(--accent); }
.table-card.reserved .t-badge { background: var(--info-bg); color: var(--info); }
.table-card.cleaning .t-badge { background: var(--bg-muted); color: var(--text-muted); }
.table-card .t-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.table-card .t-meta span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.table-card .t-order {
  margin-top: auto;
  padding: .55rem .65rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.table-card .t-order-num {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.table-card .t-order-total {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-top: .1rem;
}
.table-card-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .7rem .65rem 1.15rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.45);
}
[data-theme="dark"] .table-card.available { background: linear-gradient(180deg, rgba(21,128,61,.12) 0%, var(--bg-elevated) 50%); }
[data-theme="dark"] .table-card.occupied { background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-elevated) 50%); }
[data-theme="dark"] .table-card-actions { background: rgba(0,0,0,.15); }
.table-card-actions .btn { flex: 1; }
.table-card-actions .btn-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.table-more { position: relative; }
.table-more-menu {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 132px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
  overflow: hidden;
  padding: .25rem;
}
.table-more.open .table-more-menu { display: block; }
.table-more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .55rem .7rem;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
  color: var(--text);
}
.table-more-menu button:hover { background: var(--bg-muted); }
.table-more-menu button.danger { color: var(--danger); }
.floor-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Chart bars simple */
.bar-chart { display: flex; align-items: flex-end; gap: .5rem; height: 160px; padding-top: 1rem; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, var(--accent), #14b8a6);
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height .4s ease;
}
.bar-label { font-size: .65rem; color: var(--text-muted); margin-top: .35rem; }

/* Receipt (screen fallback — main styles in receipt.css) */
.receipt-page { background: #fff; color: #111; }
.no-screen { display: none; }

@media print {
  .no-print,
  .sidebar,
  .topbar,
  .menu-toggle,
  .sidebar-overlay,
  .chips,
  .rep-filters,
  .pagination,
  .toast-container,
  #handoverModal,
  #btnNewHandover {
    display: none !important;
  }
  .no-screen,
  .report-print-header {
    display: block !important;
  }
  .main {
    margin: 0 !important;
    padding: 0 !important;
  }
  .content,
  .page {
    padding: 0 !important;
    max-width: none !important;
  }
  body {
    background: #fff !important;
    color: #111 !important;
  }
  .rep-panel {
    display: none !important;
  }
  .rep-panel.print-active {
    display: block !important;
  }
  .pnl-sheet {
    max-width: none !important;
    padding: 0 !important;
  }
  .pnl-section {
    background: #2f6fed !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .pnl-card {
    border: none !important;
    box-shadow: none !important;
  }
  .card,
  .stat-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: .5rem !important;
  }
  .table-wrap {
    overflow: visible !important;
  }
  table.data {
    width: 100%;
    font-size: 11px;
  }
  table.data th,
  table.data td {
    padding: .35rem .4rem !important;
  }
  .report-print-header {
    margin-bottom: 1rem;
    border-bottom: 2px solid #111;
    padding-bottom: .5rem;
  }
  .report-print-header h1 {
    margin: 0;
    font-size: 1.25rem;
  }
  .report-print-header p {
    margin: .25rem 0 0;
    font-size: .9rem;
    color: #444;
  }
  a[href]::after { content: none !important; }
}

/* Orders / list page filter bar */
.page-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .65rem;
  align-items: center;
  margin-bottom: 1rem;
}
.page-filters > .form-control {
  width: auto;
  min-width: 8rem;
  flex: 0 1 auto;
}
.page-filters > input[type="date"] {
  width: auto;
  min-width: 9.5rem;
}
.page-filters > #linkUnpaid,
.page-filters > #reloadOrders {
  flex: 0 0 auto;
}

/* Responsive */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .pos-menu-panel {
    min-height: min(55dvh, 520px);
  }
  .menu-grid {
    max-height: min(55dvh, 520px);
  }
  .cart-panel {
    min-height: 0;
    height: auto;
    max-height: none;
    position: sticky;
    bottom: 0;
    z-index: 20;
  }
  .cart-items {
    min-height: 140px;
    max-height: 220px;
  }
  .kot-board { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .sidebar-overlay.open { display: block; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 200px; padding: 1.75rem; }
  .login-visual h1 { font-size: 2rem; }
  .topbar { padding: .65rem .9rem; }
  .content { padding: 1rem .9rem calc(1rem + var(--safe-bottom)); }
  .logout-label { display: none; }
  .btn-logout { padding: .45rem .65rem; min-width: 40px; }
  .btn-logout .logout-icon { display: block; }
  .table-wrap { margin: 0 -.25rem; border-radius: 10px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table.data { min-width: 640px; }
  .rep-filters {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
  }
  .rep-filters > div { width: 100%; flex-wrap: wrap; }
  .rep-filters .form-control { min-width: 0 !important; width: 100%; }
  .modal { width: calc(100vw - 1.25rem); max-width: 100%; margin: .5rem; }
  .modal-lg { max-width: 100%; }
  .page-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .65rem;
    align-items: center;
  }
  .page-filters > .form-control {
    width: auto;
    min-width: 7.5rem;
    flex: 0 1 auto;
    max-width: 100%;
  }
  .page-filters > input[type="date"] {
    min-width: 9rem;
  }
}
@media (max-width: 600px) {
  #btnChangePassword {
    padding: .45rem .55rem;
    font-size: 0;
    min-width: 44px;
    min-height: 44px;
    position: relative;
  }
  #btnChangePassword::before {
    content: '';
    display: block;
    width: 1rem;
    height: 1rem;
    margin: 0 auto;
    background: currentColor;
    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'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 018 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
    -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'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 018 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .form-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .stats-grid,
  .grid-3 { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 1.05rem; }
  .topbar-subtitle { display: none; }
  .action-tiles { grid-template-columns: 1fr; }
  .card { padding: 1rem; }
  .stat-value { font-size: 1.45rem; }
  .pos-layout { gap: .65rem; }
  .menu-grid {
    grid-template-columns: none;
    gap: .4rem;
    max-height: min(50dvh, 420px);
  }
  .cart-panel {
    min-height: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 24px rgba(0,0,0,.12);
  }
  .cart-items {
    min-height: 120px;
    max-height: 180px;
  }
  .cart-pay-grid .btn,
  .cart-main-btn,
  .order-type-tabs .chip {
    min-height: 44px;
  }
  .qty-ctrl button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  .table-wrap .btn-sm {
    min-height: 40px;
    padding: .45rem .65rem;
  }
  .pos-steps { font-size: .78rem; gap: .35rem; }
  .pos-step { padding: .35rem .45rem; }
  .floor-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .table-card { min-height: 148px; }
  .table-card .t-name { font-size: 1.15rem; }
  .tables-toolbar-actions .btn-outline .hide-sm { display: none; }
  .tables-toolbar { gap: .6rem; }
  .tables-toolbar-actions { width: 100%; }
  .tables-toolbar-actions .btn { flex: 1; justify-content: center; }
  .tables-toolbar-actions #btnAddTable { flex: 1.2; }
  .chip { padding: .45rem .75rem; font-size: .82rem; }
  table.data th, table.data td { padding: .65rem .7rem; font-size: .82rem; }
  .topbar-actions .form-control { max-width: 5.5rem; font-size: .78rem; padding-left: .5rem; padding-right: 1.5rem; }
  .page-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .5rem;
    align-items: center;
  }
  .page-filters > .form-control {
    width: calc(50% - .25rem) !important;
    min-width: 0 !important;
    flex: 1 1 calc(50% - .25rem);
    max-width: calc(50% - .25rem);
  }
  .page-filters > input[type="date"] {
    width: calc(50% - .25rem) !important;
    flex: 1 1 calc(50% - .25rem);
    max-width: calc(50% - .25rem);
  }
  .page-filters > #reloadOrders {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 44px;
  }
  .page-filters > #linkUnpaid {
    flex: 1 1 auto;
    width: auto !important;
    max-width: none;
    text-align: center;
    min-height: 42px;
  }
  .page-filters .form-hint { display: none; }
  .rep-filters .form-group { width: 100%; flex: 1 1 100%; }
  .rep-filters .form-control {
    width: 100% !important;
    min-width: 0 !important;
  }
  .chips-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: .4rem;
    padding-bottom: .35rem;
    scrollbar-width: thin;
  }
  .chips-scroll .chip { flex: 0 0 auto; }
  .menu-cat-grid { grid-template-columns: 1fr; }
}

/* Phones 320–480px — tighter pass */
@media (max-width: 480px) {
  html, body { overflow-x: hidden; }
  .app-shell { max-width: 100vw; }
  .topbar {
    padding: .55rem .65rem;
    padding-top: calc(.55rem + var(--safe-top));
    gap: .4rem;
  }
  .topbar-left { min-width: 0; flex: 1; }
  .topbar-title-wrap { min-width: 0; }
  .topbar h1 {
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(42vw, 9.5rem);
  }
  .topbar-actions { gap: .3rem; flex-shrink: 0; }
  .content {
    padding: .75rem .65rem calc(.75rem + var(--safe-bottom));
  }
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal,
  .modal-lg {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: min(92dvh, 100%);
    display: flex;
    flex-direction: column;
  }
  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
  }
  .modal-footer {
    flex-direction: column-reverse;
    gap: .5rem;
    padding-bottom: calc(.75rem + var(--safe-bottom));
  }
  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
  }
  .card-header,
  .ds-section-head,
  .ds-panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: .5rem;
  }
  .table-wrap {
    margin: 0 -.35rem;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table.data {
    min-width: 720px;
  }
  .pos-steps { display: none; }
  .easy-pos .tenant-banner p { display: none; }
  .easy-pos .tenant-banner { padding: .55rem .75rem !important; }
  .pos-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: .45rem;
  }
  .pos-toolbar .search-box { width: 100%; max-width: none; }
  .pos-toolbar #catChips,
  .pos-toolbar .chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: .35rem;
    max-width: 100%;
    padding-bottom: .2rem;
  }
  .pos-toolbar #catChips .chip,
  .pos-toolbar .chips .chip {
    flex: 0 0 auto;
  }
  .cart-items {
    max-height: min(32dvh, 160px);
  }
  .cart-header .form-row {
    grid-template-columns: 1fr;
  }
  .ss-host .ss-input,
  .cart-header .form-control {
    min-height: 40px;
    font-size: 16px; /* avoid iOS zoom */
  }
  input.form-control,
  select.form-control,
  textarea.form-control {
    font-size: 16px;
  }
  .login-page { min-height: 100dvh; }
  .login-card { margin: .75rem; padding: 1.25rem; }
  .pay-method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }
  .pay-method-grid .btn { min-height: 44px; width: 100%; }
}

@media (max-width: 360px) {
  .topbar h1 { max-width: 5.5rem; }
  #langSelect { max-width: 4.2rem; }
  .floor-grid { grid-template-columns: 1fr 1fr; gap: .45rem; }
}

/* ===== Easy mode — big, clear, simple ===== */
.btn-xl {
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
}
.form-control-lg {
  padding: .9rem 1rem;
  font-size: 1.05rem;
  min-height: 48px;
}
.easy-help {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.45;
}
.demo-box {
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--bg-muted);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.section-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin: 0 0 .75rem;
}
.action-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.action-tile {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.35rem 1.25rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), transform var(--transition);
  min-height: 140px;
}
.action-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.action-tile.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.action-tile.primary span { color: rgba(255,255,255,.85); }
.action-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: .25rem;
}
.action-tile.primary .action-num {
  background: rgba(255,255,255,.2);
  color: #fff;
}
.action-tile strong {
  font-size: 1.2rem;
  font-family: var(--font-display);
}
.action-tile > span:last-child {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.simple-stats {
  grid-template-columns: repeat(3, 1fr);
}
.simple-stats .stat-value {
  font-size: 1.6rem;
}
.pos-steps {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.pos-step {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--bg-muted);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.pos-step span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 800;
  color: var(--text);
}
.pos-step.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.pos-step.active span {
  background: var(--accent);
  color: #fff;
}
.menu-grid {
  /* keep flex wrap; ignore old grid column hints */
  grid-template-columns: none;
}
.nav-item {
  padding: .85rem 1rem;
  font-size: 1rem;
}
.chip {
  padding: .55rem 1rem;
  font-size: .9rem;
}
@media (max-width: 900px) {
  .action-tiles { grid-template-columns: 1fr; }
  .simple-stats { grid-template-columns: 1fr; }
}

/* =========================================================
   Modern Design System — forms, dashboard, surfaces
   ========================================================= */
.page-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.ds-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 1.5rem 1.6rem;
  background:
    radial-gradient(1200px 280px at 10% -20%, rgba(224,120,64,.22), transparent 55%),
    linear-gradient(135deg, #1c1917 0%, #292524 55%, #3f2a1f 100%);
  color: #fafaf9;
  box-shadow: var(--shadow);
}
.ds-hero h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 .35rem;
}
.ds-hero p { color: rgba(250,250,249,.78); font-size: .95rem; max-width: 42rem; }
.ds-hero .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}
.ds-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  font-size: .75rem;
  font-weight: 600;
  color: #5eead4;
}

.ds-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}
.ds-section-head h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ds-section-head p {
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: .15rem;
}

.ds-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.ds-stat-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.ds-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.ds-stat::after {
  content: '';
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-soft);
  pointer-events: none;
}
.ds-stat .kicker {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.ds-stat .value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: .4rem;
}
.ds-stat .sub {
  margin-top: .3rem;
  font-size: .82rem;
  color: var(--text-muted);
}

/* Colored KPI cards */
.ds-stat--sales {
  border-color: rgba(15, 118, 110, .35);
  background: linear-gradient(145deg, #ecfdf8 0%, #fff 55%);
}
.ds-stat--sales::after { background: rgba(15, 118, 110, .12); }
.ds-stat--sales .kicker { color: #0f766e; }
.ds-stat--sales .value { color: #0f766e; }

.ds-stat--purchased {
  border-color: rgba(180, 83, 9, .35);
  background: linear-gradient(145deg, #fff7ed 0%, #fff 55%);
}
.ds-stat--purchased::after { background: rgba(180, 83, 9, .12); }
.ds-stat--purchased .kicker { color: #c2410c; }
.ds-stat--purchased .value { color: #c2410c; }

.ds-stat--orders {
  border-color: rgba(37, 99, 235, .35);
  background: linear-gradient(145deg, #eff6ff 0%, #fff 55%);
}
.ds-stat--orders::after { background: rgba(37, 99, 235, .12); }
.ds-stat--orders .kicker { color: #1d4ed8; }
.ds-stat--orders .value { color: #1d4ed8; }

.ds-stat--customers {
  border-color: rgba(190, 24, 93, .3);
  background: linear-gradient(145deg, #fdf2f8 0%, #fff 55%);
}
.ds-stat--customers::after { background: rgba(190, 24, 93, .1); }
.ds-stat--customers .kicker { color: #be185d; }
.ds-stat--customers .value { color: #be185d; }

[data-theme="dark"] .ds-stat--sales {
  background: linear-gradient(145deg, rgba(15, 118, 110, .2) 0%, var(--bg-elevated) 60%);
}
[data-theme="dark"] .ds-stat--purchased {
  background: linear-gradient(145deg, rgba(180, 83, 9, .2) 0%, var(--bg-elevated) 60%);
}
[data-theme="dark"] .ds-stat--orders {
  background: linear-gradient(145deg, rgba(37, 99, 235, .2) 0%, var(--bg-elevated) 60%);
}
[data-theme="dark"] .ds-stat--customers {
  background: linear-gradient(145deg, rgba(190, 24, 93, .18) 0%, var(--bg-elevated) 60%);
}

@media (max-width: 1100px) {
  .ds-stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .ds-stat-grid-4 { grid-template-columns: 1fr; }
}

.ds-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.ds-action {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 148px;
  padding: 1.25rem;
  border-radius: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.ds-action:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 12px 28px rgba(28,25,23,.08);
}
.ds-action.primary {
  background: linear-gradient(145deg, var(--accent), #14b8a6);
  border-color: transparent;
  color: #fff;
}
.ds-action.primary .ds-action-desc { color: rgba(255,255,255,.88); }
.ds-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.ds-action.primary .ds-action-icon {
  background: rgba(255,255,255,.2);
  color: #fff;
}
.ds-action strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.ds-action-desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ds-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ds-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-muted));
}
.ds-panel-head h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}
.ds-panel-body { padding: 1.25rem; }

/* Modern form system (reference: clean 2-col labeled fields) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.25rem;
}
.form-grid .form-group { margin-bottom: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-stack { display: flex; flex-direction: column; gap: 1rem; }

.form-label {
  color: #44403c;
  font-size: .82rem;
  font-weight: 650;
  margin-bottom: .4rem;
}
[data-theme="dark"] .form-label { color: #e7e5e4; }

.form-control {
  background: #fff;
  border: 1px solid #e4ddd3;
  border-radius: 10px;
  padding: .7rem .9rem;
  min-height: 44px;
  color: #292524;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.form-control::placeholder { color: #a8a29e; }
.form-control:hover { border-color: #cbd5e1; }
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
[data-theme="dark"] .form-control {
  background: #1c1917;
  border-color: #44403c;
  color: #fafaf9;
  box-shadow: none;
}

.form-hint {
  display: block;
  margin-top: .4rem;
  font-size: .75rem;
  line-height: 1.45;
  color: #78716c;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.modal {
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(28,25,23,.2);
}
.modal-header {
  padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-muted));
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 1.35rem 1.25rem; }
.modal-footer {
  padding: 1rem 1.25rem;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

.card {
  border-radius: 18px;
}
.stat-card {
  border-radius: 18px;
}

.cal-card { padding: 1rem 1.15rem 1.15rem; }
.cal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .4rem;
  font-size: .78rem;
  color: var(--text-muted);
}
.cal-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.cal-dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  display: inline-block;
}
.cal-dot.avail { background: #22c55e; }
.cal-dot.partial { background: #f59e0b; }
.cal-dot.busy { background: #ef4444; }
.cal-dot.today { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .35rem;
  margin-bottom: .35rem;
  font-size: .72rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .35rem;
}
.cal-day {
  min-height: 4.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: .4rem .45rem;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.cal-day:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(28,25,23,.08); }
.cal-day.muted { opacity: .38; cursor: default; }
.cal-day.muted:hover { transform: none; box-shadow: none; }
.cal-day .num { font-weight: 700; font-size: .95rem; }
.cal-day .meta { font-size: .68rem; line-height: 1.2; color: inherit; opacity: .9; }
.cal-day.avail {
  background: linear-gradient(160deg, #ecfdf5, #d1fae5);
  border-color: #86efac;
  color: #166534;
}
.cal-day.partial {
  background: linear-gradient(160deg, #fffbeb, #fde68a);
  border-color: #fbbf24;
  color: #92400e;
}
.cal-day.busy {
  background: linear-gradient(160deg, #fef2f2, #fecaca);
  border-color: #f87171;
  color: #991b1b;
}
.cal-day.is-today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.cal-day.selected {
  box-shadow: 0 0 0 2px var(--accent);
}
.cal-hint {
  margin: .75rem 0 0;
  font-size: .82rem;
  color: var(--text-muted);
}
@media (max-width: 700px) {
  .cal-day { min-height: 3.2rem; padding: .3rem; }
  .cal-day .meta { display: none; }
}

/* Searchable select (waiter / cashier pickers) */
.ss-host { position: relative; width: 100%; min-width: 0; }
.ss-wrap { position: relative; width: 100%; }
.ss-control {
  position: relative;
  display: flex;
  align-items: center;
}
.ss-icon {
  position: absolute;
  left: .7rem;
  width: 1rem;
  height: 1rem;
  color: var(--text-muted, #78716c);
  pointer-events: none;
  display: flex;
  z-index: 1;
}
.ss-icon svg { width: 100%; height: 100%; }
.ss-input {
  padding-left: 2.15rem !important;
  padding-right: 2rem !important;
  width: 100%;
}
.ss-input.ss-picked { font-weight: 650; }
.ss-clear {
  position: absolute;
  right: .35rem;
  border: 0;
  background: transparent;
  color: var(--text-muted, #78716c);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: .35rem .45rem;
  border-radius: 8px;
}
.ss-clear:hover { background: rgba(0,0,0,.06); color: #111; }
.ss-list {
  position: fixed;
  z-index: 4000;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e4ddd3;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(28, 25, 23, .14);
  padding: .25rem;
}
.ss-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: .55rem .7rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  color: #292524;
  cursor: pointer;
}
.ss-item:hover,
.ss-item.is-active { background: var(--accent-soft, #ecfdf5); color: var(--accent, #0f766e); }
.ss-item.is-selected { background: rgba(15, 118, 110, .12); }
.ss-empty {
  padding: .65rem .7rem;
  font-size: .85rem;
  color: var(--text-muted, #78716c);
}
.ss-wrap.is-disabled .ss-input {
  opacity: .85;
  cursor: default;
  background: #f5f5f4;
}
.ss-wrap.is-open .ss-input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn.is-busy,
.btn:disabled.is-busy {
  opacity: .72;
  pointer-events: none;
  position: relative;
}
.btn.is-busy::after {
  content: '';
  width: .7em;
  height: .7em;
  margin-left: .4em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -0.1em;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
[data-theme="dark"] .ss-list {
  background: #1c1917;
  border-color: #44403c;
}
[data-theme="dark"] .ss-item { color: #fafaf9; }
[data-theme="dark"] .ss-wrap.is-disabled .ss-input { background: #292524; }

/* Menu price lock — cashiers with edit but no menu.manage */
.form-control.is-locked,
input.is-locked {
  background: var(--bg) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: .85;
  pointer-events: none;
}

