:root {
  --ink: #17201b;
  --muted: #718078;
  --line: #e6ebe7;
  --canvas: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --brand: #245c45;
  --brand-2: #34785b;
  --accent: #e8844d;
  --accent-soft: #fff0e7;
  --success: #23885c;
  --warning: #c47b19;
  --danger: #c84b45;
  --info: #3975a8;
  --shadow: 0 14px 38px rgba(28, 48, 38, 0.07);
  --radius: 18px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --sidebar-bg: #173c2e;
  --sidebar-fg: #edf7f1;
  --sidebar-fg-dim: #a9c6b7;
  --sidebar-fg-muted: #83aa96;
  --sidebar-item-fg: #cfe1d8;
  --topbar-bg: rgba(255, 255, 255, .9);
  --sidebar: 228px;
  --tabbar-h: 64px;
  /* Fluid type scale: clamp(min, preferred, max) so text scales smoothly
     between mobile/tablet/desktop instead of jumping at breakpoints. */
  --fs-h1: clamp(17px, 1.1vw + 13.5px, 21px);
  --fs-h2: clamp(21px, 2.2vw + 13px, 30px);
  --fs-h3: clamp(14px, .3vw + 13px, 15px);
  --fs-stat: clamp(19px, 1.6vw + 14px, 25px);
  --fs-body: clamp(12px, .2vw + 11.3px, 13px);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { width: 100%; min-width: 0; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: pan-x pan-y; }
body { width: 100%; margin: 0; min-height: 100vh; overflow-x: clip; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, [role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
svg { display: block; }
:where(button, a, input, select, textarea, [role="button"]):focus-visible {
  outline: 3px solid rgba(36,92,69,.24);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar);
  padding: calc(22px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  color: var(--sidebar-fg); background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  transition: transform .25s ease, background .2s ease;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 20px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 13px;
  flex: 0 0 auto; object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 18px rgba(6,31,20,.35);
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(145deg, #f3a170, #e5763b); color: #fff;
  font-family: Georgia, serif; font-size: 21px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(232,132,77,.25);
}
.brand-mark i { font-size: 18px; }
.brand strong { display: block; letter-spacing: -.02em; font-size: 16px; }
.brand span { display: block; margin-top: 2px; color: var(--sidebar-fg-dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.nav-scroll { overflow: auto; scrollbar-width: none; padding-bottom: 12px; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-label { margin: 16px 11px 7px; color: var(--sidebar-fg-muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; min-height: 48px;
  padding: 9px 11px; border-radius: 12px; color: var(--sidebar-item-fg);
  font-size: 14px; font-weight: 700; transition: .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: #fff; color: var(--brand); box-shadow: 0 8px 20px rgba(6,31,20,.18); }
.nav-icon { width: 19px; height: 19px; display: grid; place-items: center; }
.nav-icon svg { width: 19px; height: 19px; stroke-width: 1.9; }
.nav-icon i { font-size: 13.5px; }
.nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: white; font-size: 10px; }
.sidebar-footer { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.09); }
.shift-card { padding: 13px; border-radius: 16px; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.08); }
.shift-row { display: flex; align-items: center; gap: 10px; }
.shift-row > div { min-width: 0; flex: 1; }
.shift-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 11px; font-weight: 800; }
.shift-avatar img { width: 100%; height: 100%; object-fit: cover; }
.shift-card small { color: #9fc1b0; }
.shift-card strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-card small, .shift-card strong { display: block; }
.live-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #61d79b; box-shadow: 0 0 0 5px rgba(97,215,155,.14); animation: live-dot-pulse 2.2s ease infinite; }
@keyframes live-dot-pulse { 50% { box-shadow: 0 0 0 3px rgba(97,215,155,.08); } }
.shift-actions { display: grid; gap: 3px; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.09); }
.logout-form { margin: 0; }

.main-shell { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky; top: 0; z-index: 35; min-height: 76px;
  padding: env(safe-area-inset-top) calc(28px + env(safe-area-inset-right)) 0 calc(28px + env(safe-area-inset-left));
  display: flex; align-items: center; gap: 18px;
  background: var(--topbar-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.menu-toggle { display: none; }
.page-heading { min-width: 190px; }
.page-heading h1 { margin: 0; font-size: var(--fs-h1); letter-spacing: -.035em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.global-search { position: relative; max-width: 430px; flex: 1; margin-left: auto; }
.global-search input { width: 100%; height: 42px; padding: 0 42px 0 40px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #f7f9f7; color: var(--ink); }
.global-search input:focus { border-color: #82a995; box-shadow: 0 0 0 3px rgba(36,92,69,.08); background: #fff; }
.search-icon { position: absolute; left: 13px; top: 12px; color: #88958e; }
.toolbar-search i.fa-solid { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #86948c; font-size: 12px; pointer-events: none; }
.shortcut { position: absolute; right: 10px; top: 10px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; color: #8a978f; background: #fff; font-size: 9px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.pwa-status { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.sync-indicator {
  min-height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.sync-indicator i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(35,136,92,.1); }
.sync-indicator.syncing i, .sync-indicator[data-state="syncing"] i { background: var(--warning); box-shadow: 0 0 0 4px rgba(196,123,25,.1); animation: sync-pulse 1s ease-in-out infinite; }
.sync-indicator.offline, .sync-indicator.is-offline, .sync-indicator[data-state="offline"] { color: var(--danger); }
.sync-indicator.offline i, .sync-indicator.is-offline i, .sync-indicator[data-state="offline"] i { background: var(--danger); box-shadow: 0 0 0 4px rgba(200,75,69,.1); }
@keyframes sync-pulse { 50% { opacity: .4; transform: scale(.75); } }
.icon-btn { position: relative; width: 41px; height: 41px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.icon-btn i { font-size: 14px; }
.icon-btn:hover { border-color: #b9c8c0; background: #f6f8f6; }
.icon-btn.menu-toggle { display: none; }
.icon-btn.is-muted { color: #9aa5a0; background: #f6f8f6; }
.pwa-install-btn { height: 41px; border-color: #b9ccc1; color: var(--brand); background: #f2f8f4; animation: pwa-invite-pulse 2.4s ease-in-out infinite; }
.pwa-install-btn:hover { background: #e6f2ea; transform: translateY(-1px); }
.pwa-install-btn i { font-size: 13px; }
@keyframes pwa-invite-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(36,92,69,.14); } 50% { box-shadow: 0 0 0 5px rgba(36,92,69,0); } }
@media (max-width: 640px) {
  .pwa-install-btn span { display: none; }
  .pwa-install-btn { width: 41px; padding: 0; }
}
.notification-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--accent); }
.profile-button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.avatar { width: 39px; height: 39px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #dcebe3; color: var(--brand); font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-copy strong, .profile-copy span { display: block; }
.profile-copy strong { font-size: 12px; }
.profile-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.content { padding: 26px calc(28px + env(safe-area-inset-right)) calc(44px + env(safe-area-inset-bottom)) calc(28px + env(safe-area-inset-left)); }

.page-lead { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.page-lead h2 { margin: 0; font-size: var(--fs-h2); letter-spacing: -.045em; }
.page-lead p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { margin-bottom: 5px; color: var(--brand-2); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.btn { min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 750; transition: .17s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(36,92,69,.16); }
.btn-primary:hover { background: var(--brand-2); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(232,132,77,.16); }
.btn-soft { border-color: var(--line); color: #314039; }
.btn-soft:hover { border-color: #b6c8be; background: #f7faf8; }
.btn-outline-primary { border-color: #b9ccc1; color: var(--brand); background: #fff; }
.btn-outline-primary:hover { border-color: var(--brand); background: var(--surface-2); }
.btn-danger { background: #fff1f0; color: var(--danger); border-color: #f5d4d1; }
.btn-sm { min-height: 36px; padding: 0 11px; border-radius: 9px; font-size: 12px; }
.btn-icon { width: 36px; padding: 0; }
.btn[disabled] { cursor: not-allowed; opacity: .5; transform: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card { padding: 18px; position: relative; overflow: hidden; }
.stat-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.stat-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 13px; background: var(--surface-2); color: var(--brand); }
.stat-icon i { font-size: 15px; }
.stat-icon i.fa-regular { font-size: 17px; }
.stat-icon.accent { background: var(--accent-soft); color: var(--accent); }
.stat-icon.warning { background: #fff6de; color: var(--warning); }
.stat-icon.info { background: #eaf4fb; color: var(--info); }
.stat-card small { color: var(--muted); font-size: 11px; }
.stat-value { margin: 15px 0 5px; font-size: var(--fs-stat); font-weight: 800; letter-spacing: -.045em; }
.trend { font-size: 10px; font-weight: 750; color: var(--success); }
.trend.down { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 18px; margin-bottom: 18px; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-bottom: 18px; }
.card { min-width: 0; }
.card-head { min-height: 63px; padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; font-size: var(--fs-h3); letter-spacing: -.02em; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 18px; }
.card-link { color: var(--brand); font-size: 11px; font-weight: 750; }

.mini-chart { height: 244px; display: flex; align-items: stretch; gap: 14px; padding-top: 18px; }
.chart-y { width: 38px; padding: 3px 0 25px; display: flex; flex-direction: column; justify-content: space-between; color: #9aa69f; font-size: 9px; text-align: right; }
.chart-plot { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: space-around; gap: 9px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #edf1ee 25%); }
.chart-col { height: 100%; min-width: 25px; max-width: 42px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.chart-bar { width: 100%; min-height: 7px; border-radius: 7px 7px 2px 2px; background: linear-gradient(to top, var(--brand), #61a082); position: relative; transition: height .35s ease; }
.chart-bar:hover { filter: brightness(1.08); }
.chart-bar::after { content: attr(data-label); position: absolute; top: -21px; left: 50%; transform: translateX(-50%); padding: 3px 5px; border-radius: 5px; background: #20382d; color: white; font-size: 8px; opacity: 0; pointer-events: none; transition: .15s; }
.chart-bar:hover::after { opacity: 1; }
.chart-label { min-height: 19px; color: #849188; font-size: 9px; white-space: nowrap; }

.order-list { display: grid; gap: 9px; }
.order-row { padding: 11px; border: 1px solid var(--line); border-radius: 13px; display: grid; grid-template-columns: 43px minmax(0,1fr) auto; align-items: center; gap: 10px; background: #fff; cursor: pointer; }
.order-row:hover { border-color: #b9ccc1; background: #fbfdfb; }
.order-source { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--brand); font-size: 10px; font-weight: 850; }
.order-source i { font-size: 13px; }
.order-main strong, .order-main span { display: block; }
.order-main strong { font-size: 12px; }
.order-main span { margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-meta { text-align: right; }
.order-meta strong { display: block; margin-bottom: 5px; font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: #53625a; font-size: 9px; font-weight: 800; white-space: nowrap; text-transform: capitalize; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-new, .badge-placed { background: #eef1ff; color: #5d63ba; }
.badge-accepted, .badge-confirmed, .badge-received, .badge-sent { background: #e9f4fc; color: #3975a8; }
.badge-preparing, .badge-occupied { background: #fff5dd; color: #ad711f; }
.badge-ready, .badge-served, .badge-available, .badge-active, .badge-completed, .badge-paid { background: #e8f7ef; color: #23885c; }
.badge-generated, .badge-partial-ready, .badge-partially-paid, .badge-pending, .badge-needs-bill { background: #fff5dd; color: #ad711f; }
.badge-cancelled, .badge-low, .badge-overdue, .badge-offline, .badge-inactive, .badge-not-generated, .badge-void { background: #fff0ef; color: #c84b45; }
.badge-reserved, .badge-away { background: #f4ecfc; color: #8850b4; }
.badge-partially-seated { background: #eaf3fb; color: #2f6fa8; }
.badge-out-of-service { background: #eef1ef; color: #66716b; }
.badge-delivery { background: #eaf4fb; color: #3975a8; }
.badge-pickup { background: #fff0e7; color: #bd6437; }
.badge-cleaning { background: #edf7ff; color: #3975a8; }

.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 11px 15px; border-bottom: 1px solid var(--line); background: #fafcfb; color: #7b8981; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 15px; border-bottom: 1px solid #edf1ee; font-size: 11px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfb; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-avatar { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); font-size: 10px; font-weight: 850; flex: 0 0 auto; overflow: hidden; }
.cell-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- Card-head inline filter form (date range etc.) ------------------ */
.card-head .filter-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-head .filter-toolbar .field { width: auto; height: 38px; padding: 0 10px; font-size: 12px; }
.card-head .filter-toolbar .btn-sm { height: 38px; }
@media (max-width: 700px) {
  .card-head { flex-direction: column; align-items: stretch; }
  .card-head .filter-toolbar { width: 100%; }
  .card-head .filter-toolbar .field { flex: 1; min-width: 0; }
}

/* --- Role access matrix ------------------------------------------------ */
.access-matrix th:not(:first-child), .access-matrix td:not(:first-child) { text-align: center; }
.access-matrix th i { margin-right: 5px; }
.access-yes { color: var(--success, #1c7d50); font-size: 13px; }
.access-no { color: var(--muted); font-size: 11px; opacity: .45; }
.access-view { color: var(--info, #3975a8); font-size: 12px; }
.access-matrix-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 18px 4px; padding: 11px 13px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 11px; line-height: 1.5; }
.access-matrix-note i { margin-top: 1px; color: var(--brand); flex: 0 0 auto; }
.cell-copy strong, .cell-copy span { display: block; }
.cell-copy strong { font-size: 11px; }
.cell-copy span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { width: 50px; height: 50px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 15px; background: var(--surface-2); color: var(--brand); }
.empty-state .empty-icon i { font-size: 19px; }
.empty-state strong { display: block; color: var(--ink); font-size: 13px; }
.empty-state span { display: block; margin-top: 5px; font-size: 11px; }

.toolbar { min-height: 60px; padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.toolbar-search { position: relative; min-width: 220px; flex: 1; }
.toolbar-search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; font-size: 11px; }
.toolbar-search svg { position: absolute; left: 11px; top: 10px; color: #86948c; }
.field, .select { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #dbe3de; border-radius: 11px; outline: 0; background: #fff; color: var(--ink); font-size: 13px; }
.field:focus, .select:focus, .textarea:focus { border-color: #7fa691; box-shadow: 0 0 0 3px rgba(36,92,69,.07); }
.textarea { width: 100%; min-height: 92px; padding: 11px 13px; resize: vertical; border: 1px solid #dbe3de; border-radius: 11px; outline: 0; font-size: 13px; }
.filter-tabs { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease, transform .1s ease; -webkit-tap-highlight-color: transparent; }
.filter-tab.active { background: var(--surface-2); color: var(--brand); }
.filter-tab:active { transform: scale(.96); background: var(--surface-2); }
@media (hover: hover) {
  .filter-tab:hover { background: var(--surface-2); color: var(--ink); }
  .filter-tab.active:hover { color: var(--brand); }
}

.pos-layout { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 18px; align-items: start; }
.menu-categories { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.menu-categories::-webkit-scrollbar { display: none; }
.menu-grid { padding: 16px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.menu-card { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; position: relative; transition: .17s; text-align: left; }
.menu-card:hover { transform: translateY(-2px); border-color: #abc4b6; box-shadow: 0 10px 20px rgba(24,50,37,.06); }
.menu-card.sold-out { opacity: .55; cursor: not-allowed; }
.menu-visual { height: 85px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, #f1f6f2, #e1ebe5); color: var(--brand); font-family: Georgia, serif; font-size: 31px; }
.menu-card:nth-child(3n+2) .menu-visual { background: linear-gradient(145deg, #fff4ec, #fce1d2); color: var(--accent); }
.menu-card:nth-child(3n+3) .menu-visual { background: linear-gradient(145deg, #fff8df, #f4e7b6); color: #8b6c24; }
.menu-card h4 { margin: 11px 0 4px; font-size: 13px; }
.menu-card p { margin: 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-price { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; color: var(--brand); font-size: 12px; font-weight: 850; }
.plus {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 38%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.plus:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 45%, transparent); }
.plus:active { transform: scale(.92); box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 35%, transparent); }
.plus:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent); outline-offset: 2px; }
.plus[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.cart-panel { position: sticky; top: 92px; overflow: hidden; }
.cart-items { max-height: 320px; overflow: auto; padding: 8px 16px; }
.cart-line { padding: 11px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.cart-line strong { font-size: 12px; }
.cart-line small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.qty { min-width: 14px; text-align: center; font-size: 10px; font-weight: 800; }
.cart-form { padding: 14px 16px; display: grid; gap: 9px; border-top: 1px solid var(--line); background: #fafcfb; }
.cart-summary { padding: 14px 16px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.summary-row { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.summary-row.total { padding-top: 8px; border-top: 1px dashed #cfd9d3; color: var(--ink); font-size: 14px; font-weight: 850; }

.kds-summary { display: flex; gap: 9px; margin-bottom: 16px; overflow-x: auto; }
.summary-chip { min-width: 116px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.summary-chip strong, .summary-chip span { display: block; }
.summary-chip strong { font-size: 16px; }
.summary-chip span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.kds-board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; align-items: start; }
.ticket { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.ticket.urgent { border-color: #efb8b4; }
.ticket-head { padding: 13px 14px; display: flex; justify-content: space-between; gap: 9px; background: #f8faf8; border-bottom: 1px solid var(--line); }
.ticket.urgent .ticket-head { background: #fff3f2; }
.ticket-head strong { display: block; font-size: 12px; }
.ticket-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.ticket-time { font-size: 11px; font-weight: 850; color: var(--success); }
.ticket.urgent .ticket-time { color: var(--danger); }
.ticket-items { padding: 11px 14px; display: grid; gap: 8px; }
.ticket-item { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 8px; font-size: 10px; }
.ticket-item b { color: var(--brand); }
.modifier { grid-column: 2; margin-top: -4px; color: var(--accent); font-size: 9px; }
.ticket-note { margin: 0 14px 11px; padding: 8px 9px; border-radius: 8px; background: #fff6de; color: #8b681d; font-size: 9px; }
.ticket-actions { padding: 11px 14px; border-top: 1px solid var(--line); display: flex; gap: 7px; }
.ticket-actions .btn { flex: 1; }

.inventory-meter { min-width: 100px; }
.meter-track { height: 6px; margin-top: 5px; border-radius: 999px; overflow: hidden; background: #edf1ee; }
.meter-fill { height: 100%; border-radius: inherit; background: var(--success); }
.meter-fill.low { background: var(--danger); }
.meter-fill.mid { background: var(--warning); }

.floor-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(285px,.6fr); gap: 18px; }
.floor-card { min-height: 550px; }
.floor-head { padding: 14px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.floor-map { min-height: 480px; padding: 25px; display: grid; grid-template-columns: repeat(4,1fr); gap: 19px; align-content: start; background-image: radial-gradient(#dfe6e1 1px, transparent 1px); background-size: 18px 18px; }
.cafe-table { aspect-ratio: 1; max-width: 118px; width: 100%; justify-self: center; border: 2px solid #cbd7d0; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; cursor: pointer; box-shadow: 0 8px 15px rgba(27,50,38,.05); }
.cafe-table:hover { transform: translateY(-2px); }
.cafe-table.occupied { border-color: #e0b15b; background: #fff9e9; }
.cafe-table.reserved { border-color: #a98bc6; background: #f8f0ff; }
.cafe-table.cleaning { border-color: #739dbf; background: #edf7ff; }
.cafe-table strong { font-size: 12px; }
.cafe-table span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.reservation-list { padding: 12px; display: grid; gap: 8px; max-height: 500px; overflow: auto; }
.reservation { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.reservation-top { display: flex; justify-content: space-between; gap: 8px; }
.reservation strong { font-size: 11px; }
.reservation small { color: var(--muted); font-size: 9px; }
.reservation p { margin: 7px 0 0; color: var(--muted); font-size: 9px; }

.donut-wrap { padding: 15px 18px 18px; display: grid; grid-template-columns: 155px minmax(0,1fr); align-items: center; gap: 18px; }
.donut { width: 145px; height: 145px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) 0 52%, var(--accent) 52% 76%, #e7b74d 76% 91%, #d9e2dc 91%); position: relative; }
.donut::after { content: ""; width: 88px; height: 88px; border-radius: 50%; background: #fff; position: absolute; }
.donut-value { z-index: 1; text-align: center; }
.donut-value strong, .donut-value span { display: block; }
.donut-value strong { font-size: 20px; }
.donut-value span { color: var(--muted); font-size: 8px; }
.legend { display: grid; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.legend-row b { margin-left: auto; }

.settings-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 18px; }
.settings-nav { padding: 9px; align-self: start; position: sticky; top: 92px; }
.settings-link { width: 100%; min-height: 40px; padding: 0 11px; border: 0; border-radius: 10px; display: flex; align-items: center; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.settings-link.active { background: var(--surface-2); color: var(--brand); }
.settings-section { display: none; }
.settings-section.active { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-group { display: grid; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
/* Same full-width span, but for any direct child of a .form-grid — not just
   .form-group labels. Covers section wrappers (e.g. a line-item table) and
   the trailing .form-actions/.form-alert rows that popup forms outside
   admin-menu/admin-settings (which define their own scoped .full rules)
   would otherwise render squeezed into a single grid column. */
.form-grid > .full { grid-column: 1 / -1; }

/* --- Modern image-upload widget (logo / staff photo / menu image) ----- */
.file-upload-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-upload-preview {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px dashed #c9d5cd;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 20px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.file-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-upload-preview-empty { color: var(--muted); }
.file-upload-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-upload-actions input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.file-upload-remove { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-size: 11px; font-weight: 700; cursor: pointer; }
.file-upload-remove input { accent-color: var(--danger); }
.form-label { color: #48564e; font-size: 11px; font-weight: 750; }
.help { color: var(--muted); font-size: 9px; line-height: 1.45; }
.switch-row { min-height: 58px; padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.switch-row:last-child { border: 0; }
.switch-copy strong, .switch-copy span { display: block; }
.switch-copy strong { font-size: 11px; }
.switch-copy span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.switch { width: 39px; height: 22px; padding: 2px; border: 0; border-radius: 999px; background: #ccd6d0; cursor: pointer; transition: .2s; }
.switch::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: .2s; }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(17px); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(12,27,20,.55); backdrop-filter: blur(4px); animation: backdrop-in .18s ease; }
.modal-backdrop.open { display: flex; }
.modal { width: min(640px,100%); max-height: calc(100vh - 36px); overflow: auto; scrollbar-width: none; -ms-overflow-style: none; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(7,25,16,.28); animation: modal-pop .26s cubic-bezier(.2,.9,.3,1.08) backwards; }
.modal::-webkit-scrollbar { display: none; }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-head { min-height: 64px; padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); cursor: pointer; }
.modal-body { padding: 18px; }

.profile-photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.profile-photo-row > div { min-width: 0; }
.profile-photo-row strong { display: block; font-size: 13px; }
.profile-photo-upload { position: relative; flex: 0 0 auto; width: 68px; height: 68px; cursor: pointer; }
.profile-photo-upload input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.profile-photo-preview { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; overflow: hidden; background: var(--brand); color: #fff; font-weight: 800; font-size: 20px; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-badge { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 10px; border: 2px solid #fff; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.confirm-modal { width: min(420px, 100%); }
.confirm-modal .modal-body { padding: 4px 18px 18px; }
.confirm-modal .modal-body p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.order-detail-head { padding: 15px; border-radius: 13px; background: var(--surface-2); display: flex; justify-content: space-between; gap: 12px; }
.order-detail-items { margin: 15px 0; display: grid; gap: 10px; }
.detail-line { display: grid; grid-template-columns: 25px minmax(0,1fr) auto; gap: 8px; font-size: 11px; }

.toast-stack { position: fixed; z-index: 200; right: calc(20px + env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom)); width: min(350px,calc(100vw - 40px)); display: grid; gap: 9px; }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; background: #fff; box-shadow: 0 16px 40px rgba(17,38,27,.16); animation: toast-in .25s ease; }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast strong { display: block; font-size: 11px; }
.toast span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.sidebar-overlay { display: none; }
body.modal-open { overflow: hidden; }
body.sidebar-open { overflow: hidden; }
@media (min-width: 1025px) { body.sidebar-open { overflow: auto; } }
.mobile-only { display: none; }

/* --- Mobile app-style bottom tab bar (phones only) ------------------- */
.mobile-tabbar { display: none; }
@media (max-width: 700px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    z-index: 40;
    left: 0; right: 0; bottom: 0;
    padding: 6px calc(6px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left));
    gap: 2px;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 26px rgba(20,40,30,.08);
  }
  .tabbar-item {
    flex: 1; min-width: 0; min-height: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; border-radius: 14px; background: transparent;
    color: var(--muted); font-size: 9.5px; font-weight: 750; letter-spacing: -.01em;
    white-space: nowrap;
  }
  .tabbar-item span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tabbar-icon { position: relative; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; transition: background .15s ease, color .15s ease; }
  .tabbar-icon i { font-size: 16px; }
  .tabbar-item.active { color: var(--brand); }
  .tabbar-item.active .tabbar-icon { background: var(--surface-2); color: var(--brand); }
  .tabbar-icon .nav-count { position: absolute; top: -3px; right: -6px; min-width: 15px; height: 15px; padding: 0 4px; font-size: 8px; }
  body[data-page="pos"] .mobile-tabbar { display: none; }
}
.text-right { text-align: right; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }
.nowrap { white-space: nowrap; }
.mt-18 { margin-top: 18px; }
.w-full { width: 100%; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kds-board { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .menu-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-copy { display: none; }
}

@media (max-width: 1024px) {
  :root { --sidebar: 248px; }
  .sidebar { transform: translateX(-102%); box-shadow: 18px 0 45px rgba(8,28,18,.22); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(14,30,22,.45); opacity: 0; pointer-events: none; transition: .2s; }
  body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .main-shell { margin-left: 0; }
  .icon-btn.menu-toggle { display: grid; }
  .page-heading { min-width: 0; }
  .global-search { max-width: none; }
}

@media (max-width: 900px) {
  .pos-layout, .floor-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-item, .btn, .btn-sm, .icon-btn, .modal-close, .filter-tab, .choice, .qty-btn,
  .payment-method, .settings-link, .switch, .cafe-table, .menu-card { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn-icon { width: 44px; }
  .qty-btn { width: 44px; height: 44px; }
  .profile-button { min-height: 44px; }
  .switch { width: 48px; height: 44px; padding: 3px; display: flex; align-items: center; flex: 0 0 auto; }
  .switch::after { width: 22px; height: 22px; }
  .switch.on::after { transform: translateX(20px); }
  .plus { width: 32px; height: 32px; }
  .field, .select, .textarea, .toolbar-search input, .global-search input,
  input, select, textarea { font-size: 16px; }
  .field, .select, .toolbar-search input, .global-search input { min-height: 44px; height: 44px; }
  .textarea { min-height: 96px; }
  .filter-tabs, .menu-categories, .workflow-strip, .kds-summary { overscroll-behavior-inline: contain; }
  .data-table { min-width: 680px; }
}

@media (max-width: 760px) {
  .table-wrap { overflow: visible; }
  .data-table { display: block; min-width: 0; }
  .data-table thead { display: none; }
  .data-table tbody { display: block; width: 100%; }
  .data-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2px 16px; padding: 14px; border-bottom: 1px solid var(--line); background: #fff; }
  .data-table tbody tr:hover { background: #fff; }
  .data-table td { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border: 0; font-size: 12px; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .data-table td[data-label=""]::before, .data-table td:not([data-label])::before { display: none; }
  .data-table td[colspan] { grid-column: 1 / -1; }
  .data-table .row-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 8px; justify-content: stretch; margin-top: 6px; }
  .data-table .row-actions form, .data-table .row-actions .btn, .data-table .row-actions button { width: 100%; }
  .data-table .row-actions .btn { min-height: 44px; }
  .card-head { flex-wrap: wrap; row-gap: 6px; }
  .card-head .badge { margin-left: auto; }
}

@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: calc(66px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) calc(15px + env(safe-area-inset-right)) 0 calc(15px + env(safe-area-inset-left));
    gap: 10px;
  }
  .content { padding: 20px calc(15px + env(safe-area-inset-right)) calc(var(--tabbar-h) + 34px + env(safe-area-inset-bottom)) calc(15px + env(safe-area-inset-left)); }
  .page-heading p, .global-search, .top-actions .icon-btn { display: none; }
  .page-heading { flex: 1; }
  .profile-button { padding: 0; }
  .page-lead { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 1; }
  .stats-grid, .grid-equal { grid-template-columns: 1fr; }
  .stat-card { padding: 15px; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  .menu-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 11px; gap: 9px; }
  .menu-visual { height: 70px; }
  .kds-board { grid-template-columns: 1fr; }
  .floor-map { grid-template-columns: repeat(3,1fr); padding: 16px; gap: 12px; min-height: 400px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-link { min-width: max-content; width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .form-grid > .full { grid-column: auto; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .legend { width: 100%; }
  .mobile-only { display: initial; }
  .toast-stack { right: calc(12px + env(safe-area-inset-right)); bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  body[data-page="pos"] .toast-stack { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-backdrop { padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }
  .modal { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 16px; }
}

@media (max-width: 430px) {
  .page-heading h1 { font-size: 17px; }
  .profile-button { display: none; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .menu-card { padding: 9px; }
  .menu-card p { display: none; }
  .floor-map { grid-template-columns: repeat(2,1fr); }
  .toolbar { align-items: stretch; }
  .toolbar-search { min-width: 100%; }
  .pwa-status { gap: 3px; }
  .sync-indicator { width: 19px; min-height: 28px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .sync-indicator > span { display: none; }
  .page-heading { overflow: hidden; }
  .page-heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 350px) {
  .topbar { padding-left: calc(10px + env(safe-area-inset-left)); padding-right: calc(10px + env(safe-area-inset-right)); gap: 7px; }
  .content { padding-left: calc(10px + env(safe-area-inset-left)); padding-right: calc(10px + env(safe-area-inset-right)); }
  .page-heading h1 { font-size: 15px; }
  .menu-grid { grid-template-columns: 1fr; }
  .floor-map { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 10px; gap: 8px; }
}

@media (hover: none) {
  .btn:hover, .menu-card:hover, .cafe-table:hover, .role-action-card:hover, .role-gate-card:hover { transform: none; }
}

@media (pointer: coarse) {
  .btn, .btn-sm, .btn-icon { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-item, .filter-tab, .choice, .qty-btn, .modal-close, .payment-method,
  .settings-link, .switch, .cafe-table, .menu-card, .plus, .setup-table,
  .setup-service, .custom-option, .table-check-grid label, .status-check span,
  .role-switch, .card-link { min-height: 44px; }
  .plus { width: 34px; height: 34px; }
  .qty-btn { width: 40px; height: 40px; }
  .switch { width: 48px; height: 44px; padding: 3px; display: flex; align-items: center; flex: 0 0 auto; }
  .switch::after { width: 22px; height: 22px; }
  .switch.on::after { transform: translateX(20px); }
  .profile-button { min-height: 44px; }
  .field, .select, .textarea, .toolbar-search input, .global-search input,
  input, select, textarea { font-size: 16px; }
  .field, .select, .toolbar-search input, .global-search input { min-height: 44px; height: 44px; }
  .textarea { min-height: 96px; }
  .filter-tabs, .menu-categories, .workflow-strip, .kds-summary { overscroll-behavior-inline: contain; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ Charts (admin analytics) ============ */
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.chart-card { min-width: 0; }
.chart-wide { grid-column: span 2; }
.chart-body { min-height: 250px; display: flex; align-items: stretch; }
.chart-box { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chart-total {
  align-self: flex-start; min-height: 28px; padding: 0 11px;
  display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--surface-2); color: var(--brand);
  font-size: 10px; font-weight: 800; white-space: nowrap;
}
.chart-empty { padding: 42px 16px; flex: 1; display: grid; place-items: center; }

.bars-plot {
  flex: 1; min-height: 210px; padding: 6px 4px 0;
  display: flex; align-items: flex-end; gap: 6px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), #edf1ee 25%);
}
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-fill {
  width: min(100%, 42px); border-radius: 8px 8px 2px 2px;
  background: linear-gradient(to top, var(--brand), #5c9a7e);
  position: relative; transform-origin: bottom;
  animation: chart-grow .55s cubic-bezier(.25, .7, .3, 1) backwards;
}
.bar-fill:focus-visible { outline: 3px solid rgba(36, 92, 69, .3); outline-offset: 2px; }
.bar-fill:hover { filter: brightness(1.07); }
.bar-tip {
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  z-index: 2; padding: 4px 8px; border-radius: 7px;
  background: #20382d; color: #fff; font-size: 9px; font-weight: 800; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: .15s ease;
  box-shadow: 0 8px 18px rgba(20, 40, 30, .2);
}
.bar-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #20382d;
}
.bar-col:hover .bar-tip, .bar-fill:focus-visible .bar-tip { opacity: 1; }
.bar-x { min-height: 15px; max-width: 100%; color: #849188; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes chart-grow { from { transform: scaleY(0); } }

.chart-donut { width: min(150px, 100%); }
.donut-wrap { padding: 10px 0 0; }
.donut-legend { gap: 9px; }
.legend-row b { margin-left: auto; text-align: right; font-size: 10px; white-space: nowrap; }
.legend-row b small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 600; }

.hbar-list { display: grid; gap: 14px; padding: 3px 0; }
.hbar-row { display: grid; gap: 7px; }
.hbar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hbar-top span { font-size: 11px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-top b { font-size: 11px; font-weight: 850; text-align: right; white-space: nowrap; }
.hbar-top small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 600; }
.hbar-track { height: 7px; border-radius: 999px; overflow: hidden; background: #edf1ee; }
.hbar-fill {
  display: block; height: 100%; border-radius: inherit;
  background: var(--hbar-color, var(--brand));
  transform-origin: left; transform: scaleX(0);
  animation: chart-grow-x .6s cubic-bezier(.25, .7, .3, 1) forwards;
}
@keyframes chart-grow-x { to { transform: scaleX(1); } }

@media (max-width: 1180px) {
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
  .chart-body { min-height: 220px; }
  .bars-plot { min-height: 170px; }
  .bar-fill { width: min(100%, 34px); }
}

/* ============ Charts (admin analytics) end ============ */

@media print {
  .sidebar, .topbar, .page-actions, .toolbar, .btn { display: none !important; }
  html, body { width: auto; min-width: 0; overflow: visible; background: #fff; }
  .main-shell { margin: 0; }
  .content { padding: 0; }
  .card, .stat-card { box-shadow: none; break-inside: avoid; }
  body.modal-open #dashboardContent > *:not(.modal-backdrop) { display: none !important; }
  .modal-backdrop:not(.open) { display: none !important; }
  .modal-backdrop.open { position: static; background: none; padding: 0; }
  .modal-backdrop.open .modal { position: static; width: auto; max-height: none; box-shadow: none; }
}
