/* BarManager — Mobile-first dark theme */

:root {
  --bg-base:        #0f0f1a;
  --bg-surface:     #1a1a2e;
  --bg-elevated:    #252540;
  --bg-card:        #1e1e30;
  --accent:         #f59e0b;
  --accent-hover:   #d97706;
  --accent-subtle:  rgba(245,158,11,.15);
  --success:        #10b981;
  --success-subtle: rgba(16,185,129,.15);
  --danger:         #ef4444;
  --danger-subtle:  rgba(239,68,68,.15);
  --info:           #3b82f6;
  --info-subtle:    rgba(59,130,246,.15);
  --warning:        #f59e0b;
  --text:           #e2e8f0;
  --text-muted:     #94a3b8;
  --text-dim:       #64748b;
  --border:         #2d2d4a;
  --radius:         .5rem;
  --radius-lg:      .75rem;
  --nav-h:          56px;
  --sidebar-w:      200px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
  gap: .75rem;
}

.navbar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.navbar-name { color: var(--text-muted); font-size: .875rem; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.sidenav {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--nav-h));
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: .5rem 0;
  z-index: 90;
}

.sidenav-section {
  padding: .75rem 1rem .25rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}

.sidenav-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
}

.sidenav-link:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}

.sidenav-link.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.sidenav-link .icon { width: 1.25rem; text-align: center; }

/* ── Main content ─────────────────────────────────────────────────────────── */

.main-content {
  padding: calc(var(--nav-h) + 1.25rem) 1rem 2rem;
}

.main-content.with-nav {
  margin-left: var(--sidebar-w);
}

/* ── Page header ─────────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.section-title   { font-size: 1rem; font-weight: 600; color: var(--text-muted); }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-highlight { border-color: var(--accent); }

.card-header {
  padding: .75rem 1rem;
  font-weight: 600;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  color: var(--text-muted);
}

.card-footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  gap: .5rem;
}

.card-body { padding: 1rem; }
.card-body.p-0 { padding: 0; }

.mb-3 { margin-bottom: 1rem; }
.mt-1 { margin-top: .375rem; }
.mt-2 { margin-top: .75rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-3  { padding: .75rem 1rem; }

/* ── Badges ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-success { background: var(--success-subtle);  color: var(--success); }
.badge-warning  { background: var(--accent-subtle);   color: var(--accent);  }
.badge-danger   { background: var(--danger-subtle);   color: var(--danger);  }
.badge-info     { background: var(--info-subtle);     color: var(--info);    }
.badge-muted    { background: var(--bg-elevated);     color: var(--text-dim);}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: .55rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
  min-height: 44px;
}

.btn:hover      { opacity: .88; text-decoration: none; }
.btn:disabled   { opacity: .4; pointer-events: none; }

.btn-primary  { background: var(--accent);   color: #000; }
.btn-success  { background: var(--success);  color: #000; }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-secondary{ background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-sm       { padding: .3rem .65rem; font-size: .8rem; min-height: 36px; }
.btn-lg       { padding: .75rem 1.25rem; font-size: 1rem; min-height: 52px; }
.btn-xl       { padding: 1rem 1.5rem; font-size: 1.1rem; min-height: 60px; }
.btn-block    { width: 100%; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  font-size: .85rem;
  background: transparent;
  color: var(--text-muted);
  transition: background .15s;
}
.btn-icon:hover { background: var(--bg-elevated); }
.btn-danger-icon { color: var(--danger); }
.btn-danger-icon:hover { background: var(--danger-subtle); }

.d-inline { display: inline; }

/* ── Forms ─────────────────────────────────────────────────────────────── */

.form-group { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.form-label { font-size: .8rem; font-weight: 500; color: var(--text-muted); }

.form-control {
  background: var(--bg-base);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .75rem;
  font-size: .95rem;
  min-height: 44px;
  width: 100%;
  transition: border-color .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.form-control::placeholder { color: var(--text-dim); }

select.form-control { appearance: none; cursor: pointer; }

.form-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.form-row .form-group { flex: 1; min-width: 140px; }
.form-row .flex-2 { flex: 2; }
.form-row .flex-3 { flex: 3; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

.align-center { align-items: center; }
.align-self-end { align-self: flex-end; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  margin-bottom: 1rem;
  border-left: 4px solid currentColor;
}

.alert-success { background: var(--success-subtle); color: var(--success); }
.alert-error   { background: var(--danger-subtle);  color: var(--danger);  }
.alert-warning { background: var(--accent-subtle);  color: var(--accent);  }
.alert-info    { background: var(--info-subtle);    color: var(--info);    }

/* ── Tables ─────────────────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.table th {
  padding: .6rem .75rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-elevated); }
.table-total td { background: var(--bg-elevated) !important; font-weight: 600; }
.row-highlight { background: var(--accent-subtle) !important; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.fs-sm { font-size: .8rem; }

.action-row { display: flex; gap: .375rem; flex-wrap: wrap; align-items: center; }

/* ── Stats grid ─────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}

.stat-card.accent  { border-color: var(--accent); }
.stat-card.success { border-color: var(--success); }

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: .25rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Button grid ─────────────────────────────────────────────────────────── */

.btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .5rem;
}

.btn-grid .btn { justify-content: flex-start; }

/* ── Login ─────────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 360px;
}

.login-logo { font-size: 3rem; text-align: center; }
.login-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-top: .5rem; }
.login-subtitle { text-align: center; color: var(--text-muted); font-size: .875rem; }

/* ── Order dashboard ─────────────────────────────────────────────────────── */

.new-order-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.new-order-form .form-control { flex: 1; min-width: 180px; }

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}

.order-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}

.order-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .25rem;
}

.order-number { font-weight: 700; font-size: .9rem; color: var(--accent); }
.order-time   { font-size: .75rem; color: var(--text-dim); }
.order-customer { font-size: .9rem; margin-bottom: .25rem; }

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

.order-items { font-size: .8rem; color: var(--text-muted); }
.order-total { font-weight: 700; color: var(--accent); }

/* ── Order layout (2-panel) ─────────────────────────────────────────────── */

.order-layout {
  display: flex;
  gap: .75rem;
  height: calc(100vh - var(--nav-h) - 1.5rem);
  overflow: hidden;
}

.menu-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.order-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.panel-header h2 { font-size: 1rem; font-weight: 700; }

.order-total-display {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

/* Menu */

.menu-categories {
  flex: 1;
  overflow-y: auto;
  padding: .5rem;
  -webkit-overflow-scrolling: touch;
}

.menu-category { margin-bottom: .75rem; }

.menu-category-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  padding: .25rem .5rem;
}

.menu-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .375rem;
}

.menu-item-form { display: contents; }

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .75rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .1s, background .1s;
  min-height: 60px;
  width: 100%;
}

.menu-item:hover, .menu-item:active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.menu-item-name  { font-size: .85rem; font-weight: 500; color: var(--text); }
.menu-item-price { font-size: .8rem; color: var(--accent); font-weight: 600; }

/* Order items */

.order-items-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  gap: .5rem;
}

.order-item:last-child { border-bottom: none; }

.order-item-info {
  flex: 1;
  min-width: 0;
}

.order-item-name {
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.order-item-price { font-size: .75rem; color: var(--text-muted); }

.order-item-controls {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
}

.qty-form { display: flex; align-items: center; gap: .25rem; }

.qty-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.qty-btn:hover { background: var(--accent-subtle); border-color: var(--accent); }
.qty-btn:disabled { opacity: .35; pointer-events: none; }

.qty-display {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: .875rem;
}

.order-item-subtotal {
  font-weight: 600;
  font-size: .875rem;
  color: var(--accent);
  min-width: 52px;
  text-align: right;
}

/* Order footer */

.order-footer {
  padding: .75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  margin-bottom: .75rem;
}

.order-actions { display: flex; flex-direction: column; gap: .25rem; }

/* ── Payment ─────────────────────────────────────────────────────────────── */

.payment-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem 0;
}

.payment-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 440px;
}

.payment-header { margin-bottom: 1.25rem; }
.payment-header h1 { font-size: 1.4rem; }

.payment-summary {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: .75rem;
  margin-bottom: 1.25rem;
}

.payment-item {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  color: var(--text-muted);
  padding: .2rem 0;
}

.payment-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

.payment-label { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

.payment-input {
  font-size: 1.8rem !important;
  font-weight: 700 !important;
  text-align: center;
  letter-spacing: .05em;
  min-height: 64px !important;
}

.payment-input-group { margin-bottom: 1rem; }

.change-display {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  border: 2px solid var(--border);
  transition: border-color .2s;
}

.change-display.change-positive { border-color: var(--success); }

.change-label  { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.change-amount { font-size: 2rem; font-weight: 700; margin-top: .25rem; }
.change-display.change-positive .change-amount { color: var(--success); }

.quick-amounts { }
.quick-amounts-label { font-size: .75rem; color: var(--text-dim); text-transform: uppercase; margin-bottom: .375rem; }
.quick-amounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .375rem;
}

.quick-amount-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .6rem;
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .1s, background .1s;
  min-height: 44px;
}

.quick-amount-btn:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ── Receipt ─────────────────────────────────────────────────────────────── */

.receipt-layout {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.receipt-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 360px;
}

.receipt-header { text-align: center; margin-bottom: 1rem; }
.receipt-logo   { font-size: 2.5rem; }
.receipt-header h2 { font-size: 1.25rem; margin-top: .25rem; }

.receipt-info { margin-bottom: .75rem; }
.receipt-row  { display: flex; justify-content: space-between; padding: .2rem 0; font-size: .875rem; }
.receipt-divider { border: none; border-top: 1px dashed var(--border); margin: .75rem 0; }

.receipt-item { margin-bottom: .5rem; }
.receipt-item-name { font-size: .875rem; font-weight: 500; }
.receipt-item-line { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-muted); }

.receipt-totals { margin-top: .5rem; }
.receipt-change .receipt-row span { font-size: 1rem; }

.receipt-footer { text-align: center; margin-top: 1rem; font-size: 1.1rem; }
.receipt-actions { margin-top: 1.25rem; }

/* ── Prices page ─────────────────────────────────────────────────────────── */

.btn-group-wrap { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }

.price-category-header {
  padding: .6rem 1rem .3rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.price-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.price-row:last-of-type { border-bottom: none; }

.price-drink-name { flex: 1; font-weight: 500; font-size: .9rem; min-width: 120px; }
.price-drink-desc { font-size: .8rem; flex: 1; min-width: 80px; }

.price-input-wrap {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-shrink: 0;
}

.price-input {
  width: 90px !important;
  min-height: 40px !important;
  text-align: right;
  font-weight: 600;
}

.price-currency { color: var(--text-muted); font-size: .9rem; }

/* ── Charts ─────────────────────────────────────────────────────────────── */

.chart-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
}

.chart-row:last-child { border-bottom: none; }
.chart-label { width: 130px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chart-bar-wrap {
  flex: 1;
  height: 20px;
  background: var(--bg-elevated);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .3s ease;
  min-width: 4px;
}

.chart-bar-alt { background: var(--info); }

.chart-value {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  font-size: .7rem;
  font-weight: 600;
  color: var(--bg-base);
}

.chart-rev { width: 70px; text-align: right; flex-shrink: 0; color: var(--text-muted); font-size: .75rem; }

/* ── Grid layouts ────────────────────────────────────────────────────────── */

.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .75rem;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state.large { padding: 5rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: .75rem; }

/* ── Print styles ────────────────────────────────────────────────────────── */

.print-header { display: none; }

@media print {
  :root { --bg-base: #fff; --bg-card: #fff; --bg-elevated: #f5f5f5; --bg-surface: #f0f0f0; --text: #000; --text-muted: #555; --border: #ccc; --accent: #000; }
  .navbar, .sidenav, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; padding: 0 !important; }
  .print-header { display: block; margin-bottom: 1.5rem; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  .btn { display: none; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }

  .sidenav { display: none; }
  .main-content.with-nav { margin-left: 0; }
  .d-none-xs { display: none; }

  .order-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .order-panel { width: 100%; }
  .menu-categories { max-height: 50vh; }
  .order-items-list { max-height: 40vh; }

  .form-row { flex-direction: column; }
  .form-row .flex-2, .form-row .flex-3 { width: 100%; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2col  { grid-template-columns: 1fr; }
  .order-grid { grid-template-columns: 1fr; }
}

@media (min-width: 641px) and (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidenav { display: none; }
  .main-content.with-nav { margin-left: 0; }
}

/* Hamburger menu for mobile (hidden by default, shown via JS) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: .25rem;
  min-height: auto;
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }

  .sidenav.open {
    display: block;
    width: 220px;
    position: fixed;
    z-index: 200;
  }
}
