/* Navy & Amber theme */

/* ── Skip navigation link (WCAG 2.4.1) ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 99999;
  background: #0F1F3D;
  color: #F59E0B;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #F59E0B;
  outline-offset: 2px;
}

/* ── Touch & click responsiveness ──────────────────────────────────────────── */

/* Eliminate the 300ms tap delay on all clickable elements globally.
   This is the #1 fix for "tap doesn't respond" on touchscreens. */
* {
  -webkit-tap-highlight-color: transparent;
}

button, a, [role="button"], label, select,
.nav-item, .btn, .order-card, .modal-close,
.admin-tab, .qa-link, .panel-link, .sidebar-counter,
.ordering-toggle-btn, .btn-refresh, .btn-pay-now,
.item-row, .qa-link, .alert-row, .ticker-row,
.shift-row, .billing-card-head, .detail-row,
.hist-table tr, .order-row, .ticker-row {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Ensure children of buttons never accidentally block the click */
button > *, a > *, .nav-item > *, .btn > * {
  pointer-events: none;
}

/* Minimum 44px touch target for all interactive elements (Apple HIG / WCAG) */
button, .btn, .nav-item, .admin-tab, .ordering-toggle-btn,
.btn-refresh, .btn-pay-now, .modal-close {
  min-height: 44px;
}

/* Visual press feedback for touch — instant, no hover needed */
button:active, .btn:active, .nav-item:active, .qa-link:active,
.admin-tab:active, .order-card:active, .sidebar-counter:active {
  opacity: 0.75;
  transform: scale(0.98);
  transition: opacity 0.05s, transform 0.05s;
}

:root {
  --bg: #ffffff;
  --panel: #f8fafc;
  --panel-solid: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #F59E0B;
  --accent-2: #D97706;
  --accent-3: #10b981;
  --accent-4: #3b82f6;
  --grad-1: linear-gradient(135deg, #0F1F3D 0%, #1e3a5f 100%);
  --grad-2: linear-gradient(135deg, #F59E0B 0%, #FCD34D 100%);
  --grad-soft: #f8fafc;

  --sidebar-bg: #0F1F3D;
  --sidebar-text: #e2e8f0;
  --sidebar-muted: #94a3b8;
  --sidebar-border: rgba(255, 255, 255, 0.10);
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active: rgba(245, 158, 11, 0.15);

  --received-bg: #fef3c7;
  --received-text: #92400e;
  --preparing-bg: #dbeafe;
  --preparing-text: #1e40af;
  --dispatched-bg: #ccfbf1;
  --dispatched-text: #0f766e;
  --delivered-bg: #d1fae5;
  --delivered-text: #065f46;
  --prepared-bg: #d1fae5;
  --prepared-text: #065f46;

  --red: #ef4444;
  --amber: #f59e0b;
  --green: #10b981;

  --shadow-sm: 0 1px 3px rgba(15, 31, 61, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 31, 61, 0.12);
  --shadow-lg: 0 12px 32px rgba(15, 31, 61, 0.15);

  --hover-bg: #f1f5f9;
  --workspace-bg: #f8fafc;
  --text2: #475569;
  --text3: #64748b;
  --border2: #cbd5e1;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --color-error: #ef4444;
  --color-success: #10b981;
  --color-success-dark: #16a34a;
  --color-blue: #3b82f6;
  --color-purple: #8b5cf6;

  --font-size-xs: 10px;
  --font-size-sm: 11px;
  --font-size-base: 13px;
  --font-size-md: 14px;
  --font-size-lg: 17px;
  --font-size-xl: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "DM Sans", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Low-specificity fallback so every plain input/select/textarea gets themed even outside
   .field (e.g. the many inline filter-bar toolbars across reports.html) — more specific
   rules further down (.field input, .sort-bar select, etc.) still take precedence. */
input, select, textarea {
  color: var(--text);
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #3a4050;
  border-radius: 999px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Shared admin components ────────────────────────────────────────────────── */

/* Stats */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-bottom:20px; }
.stat-card  { background:var(--bg); border:1px solid var(--border); border-radius:12px; padding:16px 18px;
              box-shadow:var(--shadow-sm); position:relative; overflow:hidden; }
.stat-card::before { content:''; position:absolute; top:0; left:0; width:4px; height:100%; background:var(--border); border-radius:2px 0 0 2px; }
.stat-card.green::before { background:var(--green); }
.stat-card.amber::before { background:var(--amber); }
.stat-card.red::before   { background:var(--red); }
.stat-card.blue::before  { background:#3b82f6; }
.stat-label { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
.stat-value { font-size:24px; font-weight:800; color:var(--text); line-height:1.1; }
.stat-value.green { color:var(--green); }
.stat-value.amber { color:var(--amber); }
.stat-value.red   { color:var(--red); }

/* Section bar (filter toolbar) */
.section-bar       { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.section-bar-left  { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.section-bar-right { display:flex; gap:8px; align-items:center; }

/* Table */
.table-wrap { overflow-x:auto; border-radius:var(--radius-md); border:1px solid var(--border); box-shadow:var(--shadow-sm); }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { background:var(--panel); color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase;
     letter-spacing:.5px; padding:10px 14px; text-align:left; border-bottom:1px solid var(--border); white-space:nowrap; }
td { padding:11px 14px; border-bottom:1px solid var(--border); color:var(--text); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tr:hover td { background:var(--panel); }
.td-bold { font-weight:700; }
.table-cap { font-size:12px; color:var(--muted); padding:10px 14px; text-align:center; }

/* Badges */
.badge       { display:inline-block; padding:3px 9px; border-radius:999px; font-size:11px; font-weight:700; }
.badge-green { background:#d1fae5; color:#065f46; }
.badge-amber { background:#fef3c7; color:#92400e; }
.badge-red   { background:#fee2e2; color:#991b1b; }
.badge-gray  { background:var(--panel); color:var(--muted); }
.badge-blue  { background:#dbeafe; color:#1e40af; }

/* Buttons */
.btn-secondary { background:var(--panel); border-color:var(--border); color:var(--text); }
.btn-secondary:hover { background:var(--border); }
.btn-amber  { background:#f59e0b; border-color:#f59e0b; color:#fff; }
.btn-amber:hover { background:#d97706; }
.btn-danger { background:#ef4444; border-color:#ef4444; color:#fff; }
.btn-danger:hover { background:var(--color-error); }

/* Search */
.search { position:relative; }
.search input { padding-left:32px; }
.search::before { content:'🔍'; position:absolute; left:10px; top:50%; transform:translateY(-50%); font-size:12px; }

/* Empty state */
.empty-state { text-align:center; padding:48px 24px; color:var(--muted); }
.empty-state .icon { font-size:40px; margin-bottom:12px; }

/* Divider */
.divider { border:none; border-top:1px solid var(--border); margin:16px 0; }

/* Modal overlay (new-style used by admin pages) */
.modal-overlay { position:fixed; inset:0; background:rgba(15,31,61,.6); backdrop-filter:blur(2px);
                 display:none; align-items:center; justify-content:center; z-index:1000; padding:16px; }
.modal-overlay.show { display:flex; }
.modal-box { background:var(--bg); border:1px solid var(--border); border-radius:16px;
             width:100%; max-width:520px; max-height:90vh; overflow-y:auto;
             box-shadow:var(--shadow-lg); display:flex; flex-direction:column; }
.modal-box.wide { max-width:720px; }
.modal-header { padding:20px 24px 0; display:flex; align-items:flex-start; justify-content:space-between; flex-shrink:0; }
.modal-title  { font-size:16px; font-weight:700; color:var(--text); }
.modal-sub    { font-size:12px; color:var(--muted); margin-top:3px; }
.modal-close  { background:none; border:none; font-size:20px; color:var(--muted); cursor:pointer; line-height:1; padding:0; flex-shrink:0; }
.modal-body   { padding:20px 24px; flex:1; overflow-y:auto; }
.modal-footer { padding:0 24px 20px; display:flex; gap:8px; justify-content:flex-end; flex-shrink:0; }

/* ── Admin page layout (app-layout + main + content) ── */
.app-layout { display:flex; height:100vh; overflow:hidden; }
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }
.topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:0 24px; height:60px; min-height:60px;
  border-bottom:1px solid var(--border); background:var(--bg); flex-shrink:0; gap:12px;
}
.topbar-title { font-size:17px; font-weight:700; color:var(--text); }
.topbar-sub   { font-size:12px; color:var(--muted); margin-top:1px; }
.topbar-right { display:flex; align-items:center; gap:8px; }
.content { flex:1; overflow-y:auto; padding:24px; }

/* ── Card component ── */
.card {
  background:var(--bg); border:1px solid var(--border); border-radius:12px;
  padding:20px; margin-bottom:16px; box-shadow:var(--shadow-sm);
}
.card-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:16px; }
.card-title  { font-size:14px; font-weight:700; color:var(--text); }
.card-sub    { font-size:12px; color:var(--muted); margin-top:2px; }

/* ── Form components ── */
.form-grid   { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.form-group  { display:flex; flex-direction:column; gap:6px; }
.form-group:last-child { margin-bottom:0; }
.form-label  { font-size:12px; font-weight:600; color:var(--muted); }
.form-control {
  width:100%; background:var(--panel); border:1px solid var(--border);
  border-radius:8px; padding:9px 12px; font-size:13px; color:var(--text);
  font-family:inherit; transition:border-color .15s;
}
.form-control:focus {
  border-color:var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
textarea.form-control { resize:vertical; min-height:80px; }
select.form-control { cursor:pointer; }

/* ── Button extras ── */
.btn-ghost { background:transparent !important; border:1px solid var(--border); color:var(--muted); }
.btn-ghost:hover { background:var(--panel) !important; }
.btn-sm, .btn-small { padding:6px 12px !important; font-size:12px !important; border-radius:8px !important; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-wordmark {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-store {
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-text);
  margin-top: 2px;
}

.brand-sub {
  font-size: 11px;
  color: var(--sidebar-muted);
  font-weight: 500;
}

.sidebar .role-badge {
  align-self: flex-start;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-counters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-counter {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-counter:hover { background: var(--sidebar-hover); }
.sidebar-counter:focus {
  background: var(--sidebar-hover);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sidebar-counter .num {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.sidebar-counter .label {
  font-size: 11px;
  color: var(--sidebar-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-actions label {
  font-size: 11px;
  color: var(--sidebar-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: -2px;
}

.sidebar-actions select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
}

.sidebar .btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  width: 100%;
  text-align: left;
}

.sidebar .btn:hover {
  background: var(--sidebar-hover);
  box-shadow: none;
  transform: none;
}

.sidebar .btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: white;
}

.sidebar .btn-primary:hover {
  background: var(--accent-2);
  transform: none;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-border);
}

.nav-item-locked {
  opacity: 0.7;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav .nav-section-label {
  font-size: 11px;
  color: var(--sidebar-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 2px;
}

.sidebar-nav a {
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
}

.sidebar-nav a.active {
  background: var(--sidebar-active);
  color: var(--accent);
}

/* ── Sidebar nav items (shared across all pages via app.js) ──────────────── */
.nav-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  padding: 14px 4px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
  text-decoration: none;
  min-height: 44px;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #F59E0B;
}

.nav-icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.5);
}

.nav-item.active .nav-icon {
  color: #F59E0B;
}

.nav-label {
  flex: 1;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 4px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F59E0B;
  color: #000;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-text);
}

.user-role {
  font-size: 11px;
  color: var(--sidebar-muted);
  font-weight: 500;
}

.main-content {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  border: 1px solid var(--border);
  background: var(--panel-solid);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: var(--grad-soft);
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
  background: var(--accent-2);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger-outline {
  color: var(--red);
  border-color: var(--red);
}

.btn-navy {
  background: var(--sidebar-bg);
  color: #fff;
  border: none;
}
.btn-navy:hover {
  background: #1e3a5f;
}

/* .btn-small is aliased to .btn-sm above */

.layout-two-panel {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100vh;
}

/* ── New order: split-panel layout (items left, form right — no modal, no scrolling form) */
.split-order {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  height: 100vh;
}

.split-items {
  border-right: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.split-items-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.split-items-header h2 { font-size: 19px; margin-bottom: 4px; }

.split-category-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 24px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.split-category-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.split-category-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.split-items-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  align-content: start;
}

.split-cart-strip {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--grad-soft);
}

.split-cart-strip .chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.split-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.split-form-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  position: relative;
}

.split-form h2 { font-size: 19px; margin-bottom: 14px; }

.split-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.split-form-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--panel-solid);
}

.panel {
  overflow-y: auto;
  padding: 16px;
}

.panel-left {
  border-right: 1px solid var(--border);
  background: var(--card-bg);
}

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filters button {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  border-radius: 999px;
  padding: 7px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.filters button.active {
  background: var(--grad-1);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(15, 31, 61, 0.25);
}

.order-card {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-left: 5px solid transparent;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.order-card.selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.order-card.urgent {
  border-left-color: var(--red);
  animation: pulse-urgent 2.2s ease-in-out infinite;
}

@keyframes pulse-urgent {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12), var(--shadow-md); }
}

.order-card.accepted, .kanban-card.accepted {
  border-left-color: var(--green);
}

.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.sort-bar label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.sort-bar select {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  background: var(--panel-solid);
  color: var(--text);
}

.timestamp-text {
  font-size: 11px;
  color: var(--muted);
}

.accepted-pill {
  display: inline-block;
  background: var(--delivered-bg);
  color: var(--delivered-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.order-card .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.order-card .order-num {
  font-weight: 800;
  color: var(--accent);
}

.order-card .address {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.order-card .row2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-elapsed {
  font-size: 12px;
  color: var(--muted);
}

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.pill-RECEIVED { background: var(--received-bg); color: var(--received-text); }
.pill-PREPARING { background: var(--preparing-bg); color: var(--preparing-text); }
.pill-DISPATCHED { background: var(--dispatched-bg); color: var(--dispatched-text); }
.pill-DELIVERED { background: var(--delivered-bg); color: var(--delivered-text); }
.pill-PREPARED { background: var(--prepared-bg); color: var(--prepared-text); }

.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  margin: 18px 0 8px;
}

.rider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 7px;
  font-size: 13px;
  transition: box-shadow 0.15s ease;
}

.rider-row:hover { box-shadow: var(--shadow-sm); }

.rider-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.rider-status.free { background: var(--delivered-bg); color: var(--delivered-text); }
.rider-status.on_delivery { background: var(--preparing-bg); color: var(--preparing-text); }

.detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-weight: 500;
}

.detail-card {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  max-width: 640px;
  box-shadow: var(--shadow-md);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

.detail-header h2 {
  margin: 0;
  font-size: 24px;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.progress-bar {
  display: flex;
  margin-bottom: 22px;
  background: var(--grad-soft);
  border-radius: var(--radius-md);
  padding: 4px;
}

.progress-step {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 4px;
  border-radius: 12px;
  color: var(--muted);
}

.progress-step.done {
  background: var(--delivered-bg);
  color: var(--delivered-text);
  font-weight: 700;
}

.progress-step.current {
  background: var(--grad-1);
  color: white;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(15, 31, 61, 0.25);
}

.info-card {
  background: var(--grad-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  margin-bottom: 12px;
}

.info-card .label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.info-card.note {
  background: var(--preparing-bg);
  color: var(--preparing-text);
}

.info-card.note .label { color: var(--preparing-text); }

.items-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.items-list li {
  padding: 5px 0;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  border-bottom: 1px dashed var(--border);
}

.items-list li:last-child { border-bottom: none; }

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 31, 61, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: var(--panel-solid);
  border-radius: var(--radius-lg);
  padding: 26px;
  width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.modal h3 {
  margin-top: 0;
  font-size: 17px;
}

.modal .modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  float: right;
  margin-top: -4px;
}

.modal-wide {
  width: 640px;
}

.modal-xwide {
  width: 960px;
  max-width: 92vw;
}

.menu-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 12px;
  background: var(--grad-soft);
}

.menu-category summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 0;
  color: var(--accent);
}

.menu-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0 5px 12px;
  font-size: 13px;
}

.menu-item-row .menu-item-name {
  flex: 1;
}

.menu-item-row .menu-item-qty {
  width: 60px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
}

.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--panel-solid);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder, .field textarea::placeholder {
  color: var(--muted);
}

.sign-off-select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  color: var(--accent);
  background: var(--panel-solid);
  margin-top: 4px;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.sign-off-select:invalid {
  color: var(--muted);
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.item-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.item-row input:first-child { flex: 2; }
.item-row input:last-child { flex: 1; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Kanban */
.kanban {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 18px;
  height: 100vh;
  overflow: hidden;
}

.kanban-col {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.kanban-col-header {
  padding: 16px;
  font-weight: 800;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  background: var(--grad-soft);
}

.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  align-content: start;
}

.kanban-card {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-left: 5px solid transparent;
  border-radius: 16px;
  padding: 13px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kanban-card .row1 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}

.timer {
  font-weight: 800;
  font-size: 13px;
  padding: 2px 9px;
  border-radius: 999px;
}

.timer.normal { color: var(--delivered-text); background: var(--delivered-bg); }
.timer.amber { color: var(--preparing-text); background: var(--preparing-bg); }
.timer.red { color: white; background: #b91c1c; animation: pulse-urgent 1.6s ease-in-out infinite; }

.zone-tag {
  display: inline-block;
  background: var(--grad-2);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.note-tag {
  display: inline-block;
  background: var(--preparing-bg);
  color: var(--preparing-text);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 4px 0;
}

.kanban-card .full-btn {
  width: 100%;
  margin-top: 10px;
}

/* Login */
.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(15, 31, 61, 0.06), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(245, 158, 11, 0.08), transparent 35%),
    #f8fafc;
}

.login-page::before, .login-page::after { content: none; }

.login-wordmark {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: #0F1F3D;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  line-height: 1;
}

.login-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 380px;
  box-shadow: 0 8px 40px rgba(15, 31, 61, 0.12);
}

.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--text);
}

.login-card .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
  font-weight: 500;
}

.pin-dot.filled {
  background: #F59E0B;
  border-color: transparent;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 14px;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  transition: background 0.1s ease, border-color 0.1s ease;
}

.pin-dot.filled {
  background: #F59E0B;
  border-color: transparent;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pin-key {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 14px 0;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: transform 0.05s ease, background 0.1s ease;
}

.pin-key:hover {
  background: var(--grad-soft);
}

.pin-key:active {
  transform: scale(0.94);
}

.pin-key-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.error-text {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
}

.hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

/* Toasts */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: var(--grad-1);
  color: white;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  animation: toast-in 0.25s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Reports */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 20px;
}

.report-card {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

.report-card:hover { box-shadow: var(--shadow-md); }

.report-card h3 {
  margin-top: 0;
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.report-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.report-card td {
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}

.nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-tabs a {
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-tabs a:hover {
  background: var(--sidebar-hover);
}

.nav-tabs a.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 700;
}

/* Item gallery (pop-up menu picker) */
.gallery-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 31, 61, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}

.gallery-card {
  background: var(--panel-solid);
  border-radius: var(--radius-lg);
  width: min(900px, 94vw);
  height: min(720px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.gallery-header {
  padding: 18px 22px 0;
  flex-shrink: 0;
}

.gallery-header h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.gallery-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  flex-shrink: 0;
}

.gallery-tabs button {
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.gallery-tabs button.active {
  background: var(--grad-1);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(15, 31, 61, 0.25);
}

.gallery-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 22px 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.gallery-tile {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: var(--grad-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.gallery-tile.has-qty {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.20);
}

.gallery-tile-unavailable {
  opacity: 0.55;
}

.gallery-sold-out {
  align-self: flex-start;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gallery-tile .gallery-tile-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 34px;
}

.gallery-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.gallery-stepper button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: var(--grad-1);
  color: white;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.gallery-stepper button:disabled {
  background: var(--border);
  cursor: not-allowed;
}

.gallery-stepper .gallery-qty {
  font-weight: 800;
  font-size: 15px;
  min-width: 24px;
  text-align: center;
}

.gallery-footer {
  border-top: 1px solid var(--border);
  padding: 12px 22px;
  flex-shrink: 0;
  background: var(--grad-soft);
}

.gallery-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  max-height: 70px;
  overflow-y: auto;
}

.gallery-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-1);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
}

.gallery-chip button {
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}

.gallery-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.items-summary-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  background: var(--grad-soft);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
}

/* Point of Sale */
.pos-card {
  background: var(--panel-solid);
  border-radius: var(--radius-lg);
  width: min(1100px, 96vw);
  height: min(760px, 92vh);
  display: flex;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.pos-main {
  flex: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.pos-cart {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  max-width: 360px;
}

.pos-header {
  padding: 16px 18px 0;
  flex-shrink: 0;
}

.pos-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
}

.pos-tabs button {
  border: 1px solid var(--border);
  background: var(--panel-solid);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pos-tabs button.active {
  background: var(--grad-1);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(15, 31, 61, 0.25);
}

.pos-grid {
  flex: 1;
  overflow-y: auto;
  padding: 4px 18px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  align-content: start;
}

.pos-tile {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: var(--grad-soft);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.pos-tile.has-qty {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.20);
}

.pos-tile .pos-tile-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 34px;
  display: block;
}

.pos-tile .pos-tile-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 6px;
  display: block;
}

.pos-tile .pos-tile-qty {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.pos-cart-header {
  padding: 16px 16px 0;
  flex-shrink: 0;
}

.pos-cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}

.pos-cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.pos-cart-row .pos-cart-name {
  flex: 1;
}

.pos-cart-row .pos-cart-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pos-cart-row .pos-cart-stepper button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--grad-1);
  color: white;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.pos-cart-footer {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  flex-shrink: 0;
  background: var(--grad-soft);
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

/* Address autocomplete (Nominatim/OpenStreetMap) — internal-dashboard theme equivalent of
   the public site's .address-suggestions, used via attachAddressAutocomplete() in common.js */
.address-suggestions-box {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.address-suggestion-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.address-suggestion-item:last-child { border-bottom: none; }
.address-suggestion-item:hover { background: var(--grad-soft); }

.paid-badge {
  display: inline-block;
  background: var(--delivered-bg);
  color: var(--delivered-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 6px;
}

/* ── Mobile responsive ── */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--sidebar-hover);
  border-radius: 8px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 22px;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 199;
}
.sidebar-overlay.show { display: block; }

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--sidebar-text);
}

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

  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }

  .sidebar.open { transform: translateX(0); }

  .main-content {
    padding: 12px;
  }

  .layout-two-panel {
    flex-direction: column;
  }

  .panel-left {
    width: 100% !important;
    max-height: 40vh;
    overflow-y: auto;
  }

  .split-order {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════
   TABLET-FIRST OPERATIONAL LAYOUT
   Target: 10-inch Android tablet (approx 960×600 landscape,
   800×1280 portrait). Kitchen mounted on wall; CS at counter.
   Touch targets ≥ 48px. Text legible at arm's length.
   ═══════════════════════════════════════════════════════════ */

/* ── Touch target baseline — every tappable element ──────── */
@media (max-width: 1100px) {
  /* Buttons: taller, wider tap area, larger text */
  .btn {
    padding: 12px 20px;
    font-size: 14px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-sm, .btn-small {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 44px;
  }

  /* Base body text slightly larger */
  body { font-size: 14px; }

  /* Sidebar nav links — finger-friendly */
  .sidebar .nav-item, .admin-tab, .sidebar a {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 14px;
  }

  /* ── ORDER CARDS (CS left panel) ─────────────────────── */
  .order-card {
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: var(--radius-md);
  }

  .order-card .order-num {
    font-size: 16px;
  }

  .order-card .address {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .time-elapsed, .timestamp-text {
    font-size: 13px;
  }

  .pill {
    font-size: 12px;
    padding: 5px 13px;
  }

  /* ── KANBAN (Kitchen) ────────────────────────────────── */
  .kanban {
    padding: 12px;
    gap: 12px;
    /* On tablet landscape: still 2 columns */
  }

  .kanban-col-header {
    padding: 14px 16px;
    font-size: 16px;
  }

  .kanban-col-body {
    padding: 12px;
    /* Wider min so each card isn't too narrow on a 10" screen */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }

  .kanban-card {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .kanban-card .row1 {
    margin-bottom: 9px;
  }

  .timer {
    font-size: 14px;
    padding: 4px 12px;
  }

  .kanban-card .full-btn {
    margin-top: 12px;
    min-height: 48px;
    font-size: 14px;
  }

  /* ── DETAIL CARD (Kitchen order detail) ─────────────── */
  .detail-card {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .detail-header h2 {
    font-size: 22px;
  }

  /* Checklist items — easy tap */
  .checklist-item {
    font-size: 15px;
    padding: 8px 0;
    gap: 12px;
  }

  /* Checkboxes in item checklists */
  .checklist-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    cursor: pointer;
  }

  /* ── RIDER ROWS (Dispatch) ───────────────────────────── */
  .rider-row {
    padding: 13px 16px;
    font-size: 14px;
    border-radius: 16px;
    margin-bottom: 10px;
  }

  .rider-status {
    font-size: 12px;
    padding: 5px 14px;
  }

  /* ── LAYOUT: two-panel on tablet ─────────────────────── */
  .layout-two-panel {
    grid-template-columns: 340px 1fr;
  }

  /* ── FORM INPUTS — bigger tap area ──────────────────── */
  input[type="text"], input[type="number"], input[type="email"],
  input[type="tel"], input[type="password"], input[type="search"],
  select, textarea {
    font-size: 15px;
    padding: 11px 14px;
    min-height: 48px;
  }

  /* ── TOPBAR ──────────────────────────────────────────── */
  .topbar-title { font-size: 18px; }
  .topbar-sub   { font-size: 13px; }

  /* ── SECTION / COLUMN HEADERS ────────────────────────── */
  .section-title {
    font-size: 13px;
  }

  /* ── ZONE TAG ─────────────────────────────────────────── */
  .zone-tag {
    font-size: 12px;
    padding: 4px 10px;
  }

  /* ── SORT BAR ─────────────────────────────────────────── */
  .sort-bar select {
    font-size: 13px;
    padding: 8px 12px;
    min-height: 40px;
  }
}

/* ── Tablet portrait / narrow tablet (≤768px) ──────────── */
@media (max-width: 768px) {
  /* Kanban: stack columns vertically in portrait */
  .kanban {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    padding-bottom: 80px; /* safe area for scrolling */
  }

  .kanban-col {
    max-height: 60vh;
  }

  .kanban-col-body {
    grid-template-columns: 1fr;
  }

  /* Two-panel: stack */
  .layout-two-panel {
    grid-template-columns: 1fr;
    height: auto;
  }

  /* Detail card full width */
  .detail-card {
    max-width: 100%;
  }

  /* Larger order cards for finger tapping */
  .order-card {
    padding: 16px 18px;
  }

  .order-card .order-num {
    font-size: 17px;
  }

  /* POS grid tile — one column on small screens */
  .pos-grid-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .pos-grid-tile {
    padding: 12px 8px;
    border-radius: var(--radius-md);
  }

  .pos-grid-tile-name {
    font-size: 13px;
  }

  .pos-grid-stepper button {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .pos-grid-stepper .qty-num {
    font-size: 16px;
  }
}
