/* Cafe Manager design system
   Tokens follow the product brief. Radii encode hierarchy: surfaces 12px, controls 8px, pills 999px. */

:root {
  --navy: #17243A;
  --navy-2: #1E2E48;
  --navy-3: #2A3C5A;
  --teal: #0F9D8A;
  --teal-dark: #0B7F70;
  --teal-soft: #E3F4F1;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --text: #182230;
  --muted: #687386;
  --border: #E4E9F0;
  --border-strong: #CFD7E2;
  --success: #15803D;
  --success-soft: #E7F5EC;
  --warning: #D97706;
  --warning-soft: #FDF3E3;
  --error: #DC2626;
  --error-soft: #FDECEC;
  --info-soft: #EAF0FA;

  --radius-surface: 12px;
  --radius-control: 8px;
  --sidebar-w: 248px;
  --rail-w: 72px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --focus: 0 0 0 3px rgba(15, 157, 138, .35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bs-body-font-family: var(--font);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-primary: var(--navy);
  --bs-link-color: var(--teal-dark);
  --bs-link-hover-color: var(--navy);
}

* { -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); font-feature-settings: "cv11", "ss01"; }
.num, .table td.num, .metric-value { font-variant-numeric: tabular-nums; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--navy); }
:focus-visible { outline: none; box-shadow: var(--focus) !important; border-radius: var(--radius-control); }
.icon { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; vertical-align: -3px; }
.icon-lg { width: 22px; height: 22px; }
.text-muted, .muted { color: var(--muted) !important; }
.small-label { font-size: 13px; font-weight: 600; color: var(--muted); }
h1, .h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
h2, .h2 { font-size: 17px; font-weight: 650; margin: 0; }
h3, .h3 { font-size: 15px; font-weight: 650; margin: 0; }

/* ------------------------------------------------------------------ shell */

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

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1030;
  background: var(--navy); color: #C9D3E2; display: flex; flex-direction: column;
  transition: width .18s ease;
}
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { color: #fff; font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 16px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group-label { font-size: 12px; font-weight: 600; color: #7F8DA5; padding: 0 10px 6px; white-space: nowrap; }
.nav-link-item {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--radius-control);
  color: #C9D3E2; font-weight: 500; white-space: nowrap;
}
.nav-link-item:hover { background: var(--navy-2); color: #fff; }
.nav-link-item.active { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.nav-link-item.active .icon { color: #5FD3C2; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.collapse-btn { width: 100%; justify-content: flex-start; color: #9FADC3; background: transparent; border: 0; }
.collapse-btn:hover { color: #fff; background: var(--navy-2); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; transition: margin-left .18s ease; }

body.sidebar-collapsed .sidebar { width: var(--rail-w); }
body.sidebar-collapsed .main { margin-left: var(--rail-w); }
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .nav-text { display: none; }
body.sidebar-collapsed .nav-link-item { justify-content: center; padding: 0; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
body.sidebar-collapsed .collapse-btn { justify-content: center; }
body.sidebar-collapsed .collapse-btn .icon { transform: rotate(180deg); }

.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px;
}
.topbar-title { min-width: 0; }
.breadcrumb-line { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.topbar-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-search input { padding-left: 38px; background: var(--bg); border-color: transparent; }
.topbar-search input:focus { background: #fff; border-color: var(--teal); }
.topbar-meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.user-chip { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: var(--radius-control); color: var(--text); }
.user-chip:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-weight: 650; font-size: 13px; }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who small { color: var(--muted); font-size: 12px; }
.menu-btn { display: none; }

.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.content.full-bleed { padding: 0; max-width: none; }

.bottom-nav { display: none; }

/* Tablet: icon rail by default */
@media (max-width: 1279.98px) and (min-width: 768px) {
  body:not(.sidebar-expanded) .sidebar { width: var(--rail-w); }
  body:not(.sidebar-expanded) .main { margin-left: var(--rail-w); }
  body:not(.sidebar-expanded) .brand-name,
  body:not(.sidebar-expanded) .nav-group-label,
  body:not(.sidebar-expanded) .nav-text { display: none; }
  body:not(.sidebar-expanded) .nav-link-item { justify-content: center; padding: 0; }
  body:not(.sidebar-expanded) .sidebar-brand { justify-content: center; padding: 0; }
  body:not(.sidebar-expanded) .collapse-btn { justify-content: center; }
  body.sidebar-expanded .main { margin-left: var(--rail-w); }
  body.sidebar-expanded .sidebar { box-shadow: 0 10px 40px rgba(23,36,58,.35); }
  .topbar-meta { display: none; }
}

/* Mobile */
@media (max-width: 767.98px) {
  .sidebar { display: none; }
  .main { margin-left: 0 !important; }
  .topbar { padding: 0 12px; gap: 8px; height: 56px; padding-top: env(safe-area-inset-top, 0px); height: calc(56px + env(safe-area-inset-top, 0px)); }
  .topbar-search, .topbar-meta, .user-chip .who { display: none; }
  .menu-btn { display: inline-flex; }
  .topbar-title h1 { font-size: 17px; }
  .content { padding: 16px 12px calc(var(--bottomnav-h) + 24px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600;
    color: var(--muted); background: none; border: 0; min-height: 44px;
  }
  .bottom-nav .active { color: var(--teal-dark); }
  .bottom-nav .icon { width: 22px; height: 22px; }
  body.no-bottom-nav .bottom-nav { display: none; }
}

.drawer.offcanvas { background: var(--navy); color: #C9D3E2; width: 290px; }
.drawer .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.07); }
.drawer .btn-close { filter: invert(1); opacity: .7; }

/* ------------------------------------------------------------------ surfaces */

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-surface); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-body { padding: 20px; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section-gap { margin-top: 20px; }
.stack > * + * { margin-top: 16px; }

/* ------------------------------------------------------------------ controls */

.btn { border-radius: var(--radius-control); font-weight: 600; font-size: 14.5px; min-height: 40px; padding: 8px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 13.5px; }
.btn-lg { min-height: 52px; font-size: 16px; padding: 12px 20px; }
.btn-primary { background: var(--navy); border-color: var(--navy); }
.btn-primary:hover, .btn-primary:focus { background: var(--navy-2); border-color: var(--navy-2); }
.btn-accent { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-accent:hover, .btn-accent:focus { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-accent:disabled { background: #9BCFC7; border-color: #9BCFC7; color: #fff; }
.btn-outline { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: var(--muted); color: var(--text); }
.btn-ghost { background: transparent; border: 0; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger-outline { background: var(--surface); border: 1px solid #F2C2C2; color: var(--error); }
.btn-danger-outline:hover { background: var(--error-soft); color: var(--error); }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }

.form-label { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.form-control, .form-select { border-radius: var(--radius-control); border-color: var(--border-strong); min-height: 42px; font-size: 15px; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: var(--focus); }
.form-text { color: var(--muted); font-size: 13px; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.form-check-input:focus { box-shadow: var(--focus); border-color: var(--teal); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.form-check-label { cursor: pointer; }
.invalid-feedback { font-size: 13px; color: var(--error); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--error); }
.input-group-text { background: var(--bg); border-color: var(--border-strong); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 767.98px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }

.segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 3px; gap: 3px; }
.segmented button, .segmented label, .segmented a { border: 0; text-decoration: none; background: transparent; min-height: 34px; padding: 0 14px; white-space: nowrap; border-radius: 6px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented .active, .segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(23,36,58,.12); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-control, .filter-bar .form-select { min-height: 40px; font-size: 14px; }
.filter-bar .field { min-width: 140px; }
.filter-bar .field.grow { flex: 1; min-width: 200px; }

/* ------------------------------------------------------------------ status & feedback */

.badge-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: #A85B05; }
.tone-danger { background: var(--error-soft); color: var(--error); }
.tone-info { background: var(--info-soft); color: #2F4F86; }
.tone-neutral { background: #EEF1F5; color: var(--muted); }

.alert { border-radius: var(--radius-control); border: 1px solid; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 14.5px; }
.alert-success { background: var(--success-soft); border-color: #BFE3CB; color: #0F5F2D; }
.alert-danger { background: var(--error-soft); border-color: #F5C4C4; color: #A31919; }
.alert-warning { background: var(--warning-soft); border-color: #F4D9AE; color: #8A4B04; }
.alert-info { background: var(--info-soft); border-color: #CBD8EF; color: #2A4677; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .icon { width: 36px; height: 36px; color: var(--border-strong); margin-bottom: 10px; }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }
.empty-state p { max-width: 380px; margin: 0 auto 16px; }

.food-dot { width: 14px; height: 14px; border: 1.5px solid; border-radius: 3px; display: inline-grid; place-items: center; flex-shrink: 0; }
.food-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.food-veg { color: #15803D; }
.food-non_veg { color: #B42318; }
.food-egg { color: #C2780A; }
.food-na { display: none; }

/* ------------------------------------------------------------------ tables */

.data-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.data-table th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: #FAFBFD; padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #FAFBFD; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .actions { text-align: right; white-space: nowrap; }
.row-link { color: var(--text); font-weight: 600; }
.row-link:hover { color: var(--teal-dark); }
.thumb { width: 44px; height: 44px; border-radius: var(--radius-control); object-fit: cover; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); font-weight: 650; font-size: 13px; flex-shrink: 0; }

/* Tables become stacked cards on phones. Each td needs data-label. */
@media (max-width: 767.98px) {
  .data-table.stack-mobile thead { display: none; }
  .data-table.stack-mobile, .data-table.stack-mobile tbody, .data-table.stack-mobile tr, .data-table.stack-mobile td { display: block; width: 100%; }
  .data-table.stack-mobile tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .data-table.stack-mobile tr:last-child { border-bottom: 0; }
  .data-table.stack-mobile td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .data-table.stack-mobile td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; }
  .data-table.stack-mobile td.primary { font-size: 15.5px; padding-bottom: 6px; text-align: left; }
  .data-table.stack-mobile td.primary::before, .data-table.stack-mobile td.actions::before { display: none; }
  .data-table.stack-mobile td.actions { justify-content: flex-end; padding-top: 8px; }
  .data-table.stack-mobile tbody tr:hover td { background: transparent; }
}

.pagination-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.pagination-bar .btn { min-height: 36px; }

/* ------------------------------------------------------------------ dashboard */

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { padding: 18px 20px; display: block; color: inherit; }
a.metric:hover { border-color: var(--border-strong); color: inherit; }
.metric-label { font-size: 13.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.metric-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.15; }
.metric-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.chart-box { position: relative; height: 280px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.bar-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--teal); border-radius: 999px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.list-row:last-child { border-bottom: 0; }
@media (max-width: 1279.98px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 479.98px) { .metrics { grid-template-columns: 1fr 1fr; gap: 10px; } .metric { padding: 14px; } .metric-value { font-size: 20px; } .chart-box { height: 220px; } }

/* ------------------------------------------------------------------ auth */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { background: var(--navy); color: #C9D3E2; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .brand-mark { width: 44px; height: 44px; font-size: 18px; }
.auth-side h2 { color: #fff; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; max-width: 360px; line-height: 1.25; }
.auth-side p { max-width: 360px; }
.receipt-strip { width: 220px; background: #fff; color: var(--text); border-radius: 4px 4px 0 0; padding: 16px 18px 26px; font-size: 12px; line-height: 1.7; position: relative;
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) bottom / 14px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) bottom / 14px 100% repeat-x; }
.receipt-strip .rs-row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.receipt-strip .rs-total { border-top: 1px dashed var(--border-strong); margin-top: 6px; padding-top: 6px; font-weight: 700; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
@media (max-width: 899.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ------------------------------------------------------------------ POS */

.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: calc(100vh - var(--topbar-h)); }
.pos-catalog { display: flex; flex-direction: column; min-height: 0; }
.pos-toolbar { padding: 14px 18px 10px; display: flex; gap: 10px; align-items: center; background: var(--bg); }
.pos-search { position: relative; flex: 1; }
.pos-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pos-search input { padding-left: 38px; min-height: 44px; background: #fff; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding: 0 18px 12px; scrollbar-width: none; }
.pos-cats::-webkit-scrollbar { display: none; }
.cat-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 0 16px; min-height: 40px; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--text); }
.cat-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pos-grid { flex: 1; overflow-y: auto; padding: 4px 18px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; }
.product-tile {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-surface); padding: 0; text-align: left; display: flex; flex-direction: column;
  overflow: hidden; min-height: 120px; transition: border-color .12s, transform .06s; color: var(--text);
}
.product-tile:hover { border-color: var(--teal); }
.product-tile:active { transform: scale(.98); }
.product-tile .pt-img { aspect-ratio: 4 / 3; background: #EEF2F7; display: grid; place-items: center; color: #8B97AA; font-weight: 650; font-size: 22px; letter-spacing: .02em; }
.product-tile .pt-img img { width: 100%; height: 100%; object-fit: cover; }
.product-tile .pt-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-tile .pt-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: flex; gap: 6px; align-items: flex-start; }
.product-tile .pt-name .food-dot { margin-top: 3px; }
.product-tile .pt-price { margin-top: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.product-tile .pt-price small { color: var(--muted); font-weight: 500; }
.product-tile.sold-out { opacity: .55; cursor: not-allowed; }
.product-tile.sold-out .pt-price::after { content: " · Sold out"; color: var(--error); font-weight: 600; font-size: 13px; }
.pos-grid.compact .pt-img { display: none; }

.cart { background: #fff; border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-head .segmented { width: 100%; }
.cart-head .segmented button { flex: 1; justify-content: center; }
.cart-lines { flex: 1; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cart-line .cl-name { font-weight: 600; font-size: 14.5px; background: none; border: 0; padding: 0; text-align: left; color: var(--text); }
.cart-line .cl-meta { font-size: 13px; color: var(--muted); grid-column: 1; }
.cart-line .cl-note { font-size: 13px; color: #A85B05; grid-column: 1; }
.cart-line .cl-total { font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.cart-line .cl-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-control); overflow: hidden; }
.qty button { width: 40px; height: 36px; border: 0; background: #fff; display: grid; place-items: center; color: var(--text); }
.qty button:hover { background: var(--bg); }
.qty span { min-width: 34px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.cart-line.invalid { background: var(--error-soft); }
.cart-empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.cart-foot { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: #FCFDFE; }
.totals { font-size: 14px; }
.totals .t-row { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.totals .t-row.muted { color: var(--muted); }
.totals .t-grand { font-size: 20px; font-weight: 700; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--border-strong); letter-spacing: -0.01em; }
.totals.loading { opacity: .55; }
.cart-actions { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; margin-top: 12px; }
.cart-actions .btn-pay { min-height: 52px; font-size: 16px; }
.cart-inline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip-btn { border: 1px dashed var(--border-strong); background: transparent; border-radius: 999px; padding: 0 12px; min-height: 34px; font-size: 13.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chip-btn.on { border-style: solid; border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.pos-error { margin: 10px 16px 0; }

.cart-bar { display: none; }

.option-group + .option-group { margin-top: 18px; }
.option-list { display: grid; gap: 8px; }
.option-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); padding: 10px 14px; min-height: 48px; cursor: pointer; }
.option-item:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.option-item input { margin-right: 10px; }

.pay-total { text-align: center; padding: 8px 0 18px; }
.pay-total .amount { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.method-btn { border: 1.5px solid var(--border-strong); background: #fff; border-radius: var(--radius-surface); min-height: 64px; font-weight: 650; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text); }
.method-btn.active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); }
.quick-cash { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.change-due { font-size: 15px; margin-top: 10px; font-weight: 600; }
.split-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.success-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; margin: 0 auto 12px; }

@media (max-width: 1279.98px) { .pos { grid-template-columns: minmax(0, 1fr) 340px; } .pos-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); } }
@media (max-width: 767.98px) {
  .pos { display: block; height: auto; }
  .pos-toolbar { padding: 12px 12px 8px; position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 5; }
  .pos-cats { padding: 0 12px 10px; position: sticky; top: calc(120px + env(safe-area-inset-top, 0px)); z-index: 5; background: var(--bg); }
  .pos-grid { padding: 4px 12px calc(96px + env(safe-area-inset-bottom, 0px)); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: visible; }
  .cart { display: none; }
  .cart.sheet-open { display: flex; position: fixed; inset: 0; z-index: 1050; border: 0; padding-top: env(safe-area-inset-top, 0px); }
  .cart-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 1040;
    background: var(--navy); color: #fff; border: 0; border-radius: var(--radius-surface); min-height: 56px; padding: 0 18px; align-items: center; justify-content: space-between;
    font-weight: 650; box-shadow: 0 8px 24px rgba(23,36,58,.28);
  }
  .cart-bar[hidden] { display: none; }
  .split-row { grid-template-columns: 1fr 1fr; }
  .modal-fullscreen-sm-down .modal-content { border-radius: 0; }
}
@media (max-width: 359.98px) { .pos-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .product-tile .pt-body { padding: 8px 10px 10px; } .method-grid { gap: 6px; } }

/* ------------------------------------------------------------------ misc */

.modal-content { border-radius: var(--radius-surface); border: 0; }
.modal-header, .modal-footer { border-color: var(--border); }
.dropdown-menu { border-radius: var(--radius-control); border-color: var(--border); box-shadow: 0 10px 30px rgba(23,36,58,.12); padding: 6px; }
.dropdown-item { border-radius: 6px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 14.5px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-module td { background: #FAFBFD; font-weight: 650; font-size: 13px; color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--border); position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.option-rows .opt-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin-bottom: 8px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(246,248,251,.92); backdrop-filter: blur(4px); padding: 12px 0; margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; z-index: 3; }
@media (max-width: 767.98px) { .sticky-actions { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px)); } }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar, .bottom-nav, .no-print { display: none !important; } .main { margin: 0 !important; } .content { padding: 0; } .panel { border: 0; } }

/* ================================================================== Phase 3 */
[hidden] { display: none !important; }

.app-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 2000; font-weight: 600; max-width: 90vw; box-shadow: 0 8px 24px rgba(23,36,58,.3); }

/* Table status palette, shared by floor, POS picker and waiter app */
.st-available { --st: var(--success); --st-bg: var(--success-soft); }
.st-occupied { --st: #2F4F86; --st-bg: var(--info-soft); }
.st-reserved { --st: #A85B05; --st-bg: var(--warning-soft); }
.st-cleaning { --st: var(--muted); --st-bg: #EEF1F5; }
.floor-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.floor-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--st); margin-right: 6px; vertical-align: -1px; }

.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.table-tile { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-surface); padding: 14px 14px 12px 18px; min-height: 112px; display: flex; flex-direction: column; gap: 3px; color: var(--text); overflow: hidden; }
.table-tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--st); }
.table-tile:hover { border-color: var(--border-strong); }
.table-tile.selected { outline: 2px solid var(--teal); outline-offset: 1px; }
.tt-top { display: flex; justify-content: space-between; align-items: baseline; }
.tt-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.tt-seats { font-size: 13px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.tt-seats .icon { width: 14px; height: 14px; }
.tt-status { font-size: 13px; font-weight: 600; color: var(--st); }
.tt-total { font-weight: 650; font-variant-numeric: tabular-nums; }
.tt-meta { font-size: 12.5px; color: var(--muted); }
.tt-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #EEF1F5; color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--success-soft); color: var(--success); }
.chip.warn { background: var(--warning-soft); color: #A85B05; }
.table-tile.st-occupied { background: linear-gradient(0deg, #FBFCFE, #FBFCFE); }
@media (max-width: 479.98px) { .floor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tt-name { font-size: 18px; } }

/* Dashboard live strip */
.live-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 18px; }
.live-item { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.live-item:hover { color: var(--teal-dark); }
.live-item.danger, .live-item.danger .icon { color: var(--error); }

/* POS open-bill lines */
.tab-head { padding: 10px 16px 6px; font-size: 12.5px; color: var(--muted); background: #FAFBFD; border-bottom: 1px solid var(--border); }
.cart-line.sent { background: #FCFDFE; }
.cart-line.sent .cl-name { font-weight: 500; }
.cart-line.cancelled .cl-name, .cart-line.cancelled .cl-total { text-decoration: line-through; color: var(--muted); }

/* Kitchen display */
.kds { min-height: calc(100vh - var(--topbar-h)); background: #EEF1F5; display: flex; flex-direction: column; }
.kds-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: var(--topbar-h); z-index: 5; }
.kds-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.kds-live { font-size: 13px; font-weight: 600; color: var(--success); display: inline-flex; align-items: center; gap: 6px; }
.kds-live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
.kds-live.off { color: var(--error); }
@keyframes pulse { 50% { opacity: .35; } }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; align-content: start; }
.kot-card { background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--k); border-radius: var(--radius-surface); display: flex; flex-direction: column; }
.kot-card.s-pending { --k: #2F4F86; }
.kot-card.s-preparing { --k: var(--warning); }
.kot-card.s-ready { --k: var(--success); }
.kot-card.late { border-color: var(--error); border-top-color: var(--error); box-shadow: 0 0 0 2px rgba(220,38,38,.18); }
.kot-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px 2px; }
.kot-no { font-size: 22px; font-weight: 800; margin-right: 8px; }
.kot-label { font-size: 17px; font-weight: 650; }
.kot-time { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.kot-time strong { font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.late .kot-time strong { color: var(--error); }
.late-tag { display: inline-block; background: var(--error); color: #fff; font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-right: 6px; vertical-align: 3px; }
.kot-sub { padding: 0 14px 8px; font-size: 13px; color: var(--muted); }
.kot-order-note { margin: 0 14px 8px; }
.kot-items { list-style: none; margin: 0; padding: 8px 14px; border-top: 1px dashed var(--border-strong); flex: 1; }
.kot-items li { display: flex; gap: 10px; padding: 5px 0; font-size: 16px; line-height: 1.3; }
.kot-items .q { font-weight: 800; min-width: 30px; font-variant-numeric: tabular-nums; }
.kot-items .sub { display: block; font-size: 14px; color: var(--muted); }
.kot-items li.cancelled { color: var(--muted); text-decoration: line-through; }
.kot-items em { font-style: normal; color: var(--error); font-weight: 600; text-decoration: none; display: inline-block; }
.note { display: block; font-size: 14px; font-weight: 600; color: #8A4B04; background: var(--warning-soft); border-radius: 6px; padding: 3px 8px; margin-top: 3px; }
.kot-card footer { display: flex; gap: 8px; padding: 10px 14px 14px; }
.kot-card footer .btn:not(.btn-icon) { flex: 1; min-height: 48px; font-size: 15.5px; }
.kds.large .kot-items li { font-size: 20px; }
.kds.large .kot-label { font-size: 20px; }
.kds.large .kds-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 767.98px) { .kds-bar { top: calc(56px + env(safe-area-inset-top, 0px)); } .kds-tools { margin-left: 0; width: 100%; justify-content: space-between; } .kds-grid { grid-template-columns: 1fr; padding: 12px; } }

/* Waiter app */
.waiter { max-width: 720px; margin: 0 auto; min-height: calc(100vh - var(--topbar-h)); background: var(--surface); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.waiter-head { position: sticky; top: var(--topbar-h); z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 12px; }
.waiter-head .segmented { width: 100%; }
.waiter-head .segmented button { flex: 1; justify-content: center; }
@media (max-width: 767.98px) { .waiter-head { top: calc(56px + env(safe-area-inset-top, 0px)); } }
.waiter-list { padding: 4px 0; }
.waiter-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border); color: var(--text); position: relative; min-height: 64px; }
.waiter-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 0 4px 4px 0; background: var(--st); }
.waiter-row:hover { background: #FAFBFD; color: var(--text); }
.wr-name { font-size: 22px; font-weight: 700; }
.wr-body { font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.wr-total { font-weight: 650; font-variant-numeric: tabular-nums; }
.waiter-menu { padding: 0 0 8px; }
.menu-row { width: 100%; display: grid; grid-template-columns: auto 1fr auto 44px; gap: 10px; align-items: center; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 10px 12px 10px 16px; min-height: 60px; color: var(--text); }
.menu-row .mr-name { font-weight: 600; }
.menu-row .mr-price { font-variant-numeric: tabular-nums; font-weight: 600; }
.menu-row .mr-add { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--teal); color: var(--teal-dark); display: grid; place-items: center; font-weight: 700; }
.menu-row .mr-add.on { background: var(--teal); color: #fff; }
.menu-row.sold-out { opacity: .5; }
.sent-group { border-bottom: 1px solid var(--border); }
.sent-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 16px; font-size: 14.5px; }
.sent-line.cancelled strong { text-decoration: line-through; color: var(--muted); }
.waiter-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255,255,255,.96); border-top: 1px solid var(--border); }
.waiter-bar .btn { max-width: 696px; margin: 0 auto; display: flex; }

/* ================================================================== Phase 4 */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--warning); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
body.sidebar-collapsed .nav-badge { position: absolute; margin: -18px 0 0 22px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
.nav-link-item { position: relative; }

.qr-order { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.qr-order:last-child { border-bottom: 0; }
.qr-order .tt-name { font-size: 18px; }
.token-no { display: inline-grid; place-items: center; min-width: 48px; height: 40px; padding: 0 10px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.done-token { display: inline-flex; flex-direction: column; align-items: center; border: 2px solid var(--navy); border-radius: 12px; padding: 6px 22px; margin: 6px 0 4px; }
.done-token span { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.done-token strong { font-size: 40px; line-height: 1; }

.waiter-alerts { padding: 8px 12px 0; display: grid; gap: 8px; }
.waiter-alert { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-control); background: var(--warning-soft); color: #7A4304; border: 1px solid #F4D9AE; font-size: 14.5px; }
a.waiter-alert:hover { color: #7A4304; background: #FBEBD0; }

/* Guest (QR) menu */
body.public { background: var(--surface); }
.guest { max-width: 640px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.guest-head { padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.guest-cafe { font-weight: 700; font-size: 17px; }
.guest-table { font-size: 13.5px; color: var(--muted); }
.guest-cats { position: sticky; top: 0; z-index: 4; background: var(--surface); padding: 10px 16px; border-bottom: 1px solid var(--border); }
.guest-cat { font-size: 17px; font-weight: 700; padding: 18px 16px 6px; margin: 0; scroll-margin-top: 64px; }
.guest-item { width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; color: var(--text); }
.gi-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gi-name { font-weight: 650; display: flex; gap: 8px; align-items: flex-start; }
.gi-name .food-dot { margin-top: 4px; }
.gi-desc { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gi-price { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.gi-img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.guest-item .mr-add { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--teal); color: var(--teal-dark); display: grid; place-items: center; font-weight: 700; }
.guest-item .mr-add.on { background: var(--teal); color: #fff; }
.guest-item.sold-out { opacity: .5; }
.guest-order { padding: 12px 14px; margin-bottom: 8px; }
.guest-bar { display: flex !important; }
.guest-bar[hidden] { display: none !important; }
@media (min-width: 768px) { .guest-bar { max-width: 616px; left: 50% !important; right: auto !important; transform: translateX(-50%); width: calc(100% - 24px); } }
.cart-bar.guest-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 1040; background: var(--navy); color: #fff; border: 0; border-radius: var(--radius-surface); min-height: 56px; padding: 0 18px; align-items: center; justify-content: space-between; font-weight: 650; box-shadow: 0 8px 24px rgba(23,36,58,.28); }

/* Token display (customer-facing screen) */
.token-display { min-height: 100vh; background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 2.5vh 3vw; }
.token-display header { display: flex; justify-content: space-between; align-items: center; font-size: clamp(16px, 2.2vw, 28px); font-weight: 650; color: #C9D3E2; }
.td-sound { background: transparent; border: 1px solid #3A4D6D; color: #C9D3E2; border-radius: 8px; padding: 6px 14px; font-size: 14px; }
.td-called { margin: 2vh 0; background: var(--teal); border-radius: 18px; text-align: center; padding: 1.5vh; }
.td-called-label { font-size: clamp(16px, 2.4vw, 30px); font-weight: 700; letter-spacing: .04em; }
.td-called-no { font-size: clamp(80px, 16vw, 240px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.td-cols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; margin-top: 2vh; }
.td-cols h2 { font-size: clamp(18px, 2.6vw, 34px); font-weight: 700; color: #C9D3E2; border-bottom: 2px solid #2A3C5A; padding-bottom: 1vh; margin-bottom: 2vh; }
.td-cols .ready h2 { color: #5FD3C2; }
.td-list { display: flex; flex-wrap: wrap; gap: 1.6vw; align-content: flex-start; }
.td-list span { min-width: 2.6em; text-align: center; font-size: clamp(32px, 5.5vw, 84px); font-weight: 800; font-variant-numeric: tabular-nums; background: var(--navy-2); border-radius: 12px; padding: .1em .3em; }
.td-cols .ready .td-list span { background: #0B5E54; }
.td-list em { color: #7F8DA5; font-size: clamp(20px, 3vw, 40px); }
.td-offline { position: fixed; bottom: 12px; right: 16px; color: #F5C4C4; }
@media (max-width: 640px) { .td-cols { grid-template-columns: 1fr; } }

/* ================================================================== Phase 5 */
.option-rows .opt-row.po-row, .po-head { display: grid; grid-template-columns: minmax(220px, 2fr) 90px 120px 80px 100px 40px; gap: 8px; align-items: center; min-width: 680px; }
.po-head { padding: 0 0 6px; }
.po-line-total { font-weight: 600; text-align: right; }
.option-rows .opt-row.recipe-row { grid-template-columns: minmax(0, 1fr) 140px auto; }

/* ================================================================== Phase 6 */
.drawer-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #EEF1F5; color: var(--muted); white-space: nowrap; }
.drawer-pill.open { background: var(--success-soft); color: var(--success); }
.drawer-pill:hover { color: var(--text); }
@media (max-width: 1279.98px) { .drawer-pill span { display: none; } }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.denom { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.denom span { min-width: 50px; }
.report-groups { display: grid; gap: 20px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.report-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; color: var(--text); }
.report-card span { font-size: 13.5px; color: var(--muted); }
.report-card:hover { border-color: var(--teal); color: var(--text); }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); background: #FAFBFD; }
.report-table tr.row-subtotal td { font-weight: 650; background: #FAFBFD; }
.report-table tr.row-total td { font-weight: 800; border-top: 2px solid var(--border-strong); }
.report-print-head { margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.report-print-head h1 { color: var(--text); font-size: 22px; margin: 4px 0; }
.sign-row { display: flex; justify-content: space-between; gap: 40px; margin-top: 48px; }
.sign-row span { flex: 1; border-top: 1px solid var(--text); padding-top: 6px; font-size: 13px; }
@media print { .report-sheet { border: 0; } .report-table th, .report-table td { padding: 4px 6px; font-size: 11px; } }

/* ================================================================== Phase 7 */
.cust-info { background: var(--teal-soft); color: #0B5E54; border-radius: var(--radius-control); padding: 8px 10px; line-height: 1.45; }
.stars { color: #E3A008; letter-spacing: 1px; font-size: 16px; }
.stars .off { color: var(--border-strong); }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; border: 0; padding: 0; margin: 0; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 40px; line-height: 1; color: var(--border-strong); cursor: pointer; min-width: 44px; text-align: center; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #E3A008; }
.star-input input:focus-visible + label { outline: 2px solid var(--teal); border-radius: 6px; }
