* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f6f1e8;
  color: #231f20;
  font-family: Arial, sans-serif;
}
.employee-gate { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:16px;
  overflow:auto; background:linear-gradient(145deg,#17332d,#2f5d50); }
.employee-gate.hidden { display:none; }
.employee-login-card { width:min(430px,100%); padding:24px; border-radius:16px; background:#fff;
  box-shadow:0 22px 80px #0007; display:grid; gap:13px; }
.employee-login-card h1,.employee-login-card p { margin:0; }
.employee-pin-display { display:block; min-height:48px; padding:12px; border-radius:8px; background:#f2f4f6;
  text-align:center; font-size:20px; letter-spacing:.22em; }
.employee-pin-pad button { min-width:48px; min-height:52px; }
.device-hub { display:grid; gap:12px; }
.device-card header,.device-pair-actions { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.device-card header > div { display:grid; margin-right:auto; }
.device-status { padding:5px 9px; border-radius:999px; background:#737b88; color:#fff; text-transform:capitalize; }
.device-status.online { background:#237c51; }.device-status.pending,.device-status.stale { background:#a76500; }
.device-status.revoked,.device-status.offline { background:#a32626; }
.device-hub-overview { padding:16px; border:1px solid var(--line); border-radius:18px; background:linear-gradient(135deg,rgba(20,184,166,.1),rgba(59,130,246,.08)); }
.device-hub-overview header { display:flex; justify-content:space-between; align-items:center; }
.device-hub-overview h3,.hub-level h3 { margin:0 0 8px; }
.device-hub-overview p { margin:0; color:var(--muted); }
.device-metrics { display:grid; grid-template-columns:repeat(5,minmax(72px,1fr)); gap:8px; margin-top:14px; }
.device-metrics article { display:grid; place-items:center; padding:10px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.device-metrics strong { font-size:1.35rem; }.device-metrics span { text-transform:capitalize; color:var(--muted); font-size:.78rem; }
.device-topology { display:grid; gap:18px; margin-top:18px; }
.hub-level { position:relative; }.hub-level>h3 span { color:var(--muted); font-weight:500; }
.topology-connector { width:2px; height:24px; background:linear-gradient(var(--accent),var(--line)); margin:-18px 0 -18px 28px; }
.device-card.primary-hub { border:2px solid var(--accent); box-shadow:0 0 0 4px rgba(20,184,166,.08); }
.system-badge { display:inline-flex; margin:10px 0 4px; padding:5px 9px; border-radius:999px; background:rgba(20,184,166,.14); color:var(--accent); font-size:.72rem; font-weight:800; letter-spacing:.06em; }
.device-details { display:grid; gap:4px; margin:10px 0; }.device-details small { color:var(--muted); }
.hub-explanation { padding:10px; border-left:3px solid var(--accent); background:rgba(20,184,166,.08); color:var(--muted); }
.empty-state.compact { min-height:auto; padding:18px; }
@media(max-width:640px) { .device-metrics { grid-template-columns:repeat(3,1fr); } }
.device-pair-actions { margin-top:12px; }.device-pair-actions input,.device-pair-actions select { width:auto; min-width:150px; }
.topbar { position:sticky; top:0; z-index:10; display:flex; gap:8px; align-items:center; padding:10px 14px; background:#203c35; color:white; }
.topbar strong { margin-right:auto; font-size:20px; }
.topbar span { padding:6px 10px; border-radius:20px; background:#2d6b53; }
.topbar button { background:transparent; }
.topbar button.active, .chips button.active { background:#f2c36b; color:#231f20; }
.topbar-employee { display:flex; align-items:center; gap:7px; margin-left:auto; }
.topbar-employee span { max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar-employee button { border:1px solid #ffffff55; color:#fff; }
.view { display:none; }
.view:not(.active) { display:none !important; }
.view.active { display:grid; }
.page { padding:20px; gap:14px; }
.page.active { display:block; }

/* POS staff register and KDS */
.pos-register {
  --pos-ink:#20252d;
  --pos-muted:#697386;
  --pos-line:#dfe3e8;
  --pos-soft:#f5f6f7;
  --pos-accent:#b83a32;
  grid-template-columns:minmax(0,1fr) 390px;
  grid-template-rows:auto auto minmax(0,1fr);
  min-height:calc(100vh - 58px);
  background:#eef0f2;
}
.pos-register.active { display:grid; }
.register-header {
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:72px;
  padding:10px 18px;
  background:#fff;
  border-bottom:1px solid var(--pos-line);
}
.register-header > div:first-child,.register-user { display:flex; align-items:center; gap:10px; }
.register-header small,.service-clock small,.register-user small { display:block; color:var(--pos-muted); font-weight:500; margin-top:3px; }
.register-mark,.register-user > span {
  display:grid; place-items:center; width:42px; height:42px; border-radius:8px; background:#20252d; color:#fff; font-weight:800;
}
.register-user { padding:7px 10px; background:#fff; color:var(--pos-ink); border:1px solid var(--pos-line); text-align:left; }
.register-user > span { width:34px; height:34px; border-radius:50%; background:#e7ecef; color:#25313a; }
.register-user-actions { display:flex; align-items:center; gap:8px; }
.display-mode-button { min-height:48px; padding:9px 13px; white-space:nowrap; background:#20252d; color:#fff; }
.service-clock { text-align:center; }
.service-clock strong { color:#24805b; }
.order-context {
  grid-column:1/2;
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px 14px;
  background:#fff;
  border-bottom:1px solid var(--pos-line);
}
.segmented { display:flex; gap:4px; padding:4px; border-radius:9px; background:#e9ecef; overflow:auto; }
.segmented button { white-space:nowrap; padding:9px 12px; background:transparent; color:#46505c; }
.segmented button.active { background:#fff; color:var(--pos-ink); box-shadow:0 1px 4px #0002; }
.menu-search { position:relative; flex:1; margin:0; display:block; }
.menu-search span { position:absolute; left:12px; top:10px; color:var(--pos-muted); }
.menu-search input { padding-left:34px; background:#f8f9fa; border-color:var(--pos-line); }
.register-workspace { grid-column:1/2; display:grid; grid-template-columns:156px minmax(0,1fr); min-height:0; }
.category-rail { padding:14px 10px; background:#fff; border-right:1px solid var(--pos-line); overflow:auto; }
.category-rail > p { margin:4px 8px 10px; color:var(--pos-muted); font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.category-stack { display:grid; gap:4px; }
.category-stack button { padding:11px 12px; background:transparent; color:#46505c; text-align:left; }
.category-stack button.active { background:#f2e5e3; color:#9e2f28; }
.rail-action { width:100%; margin-top:18px; display:flex; justify-content:space-between; background:#20252d; }
.rail-action span { background:#fff2; border-radius:12px; padding:1px 7px; }
.pos-register .menu-pane { padding:16px; overflow:auto; background:#f5f6f7; }
.menu-heading { display:flex; justify-content:space-between; align-items:end; margin-bottom:14px; }
.menu-heading h1 { margin:0; font-size:24px; }
.menu-heading > span { color:var(--pos-muted); font-size:13px; }
.group-tabs { display:flex; gap:6px; overflow:auto; margin:-3px 0 12px; padding-bottom:2px; }
.group-tabs button { padding:8px 11px; white-space:nowrap; color:#5f6874; background:#e7eaed; }
.group-tabs button.active { color:#fff; background:#9e2f28; }
.pos-register .menu-grid { grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); gap:9px; }
.pos-register .menu-item { min-height:112px; padding:13px; display:flex; flex-direction:column; background:#fff; color:var(--pos-ink); border:1px solid var(--pos-line); box-shadow:0 1px 2px #0001; }
.pos-register .menu-item.with-photo { min-height:172px; padding:0 13px 13px; overflow:hidden; }
.menu-item-photo { width:calc(100% + 26px); height:88px; margin:0 -13px 9px; object-fit:cover; pointer-events:none; }
.pos-register .menu-item small { color:var(--pos-muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; }
.pos-register .menu-item strong { margin-top:8px; line-height:1.25; }
.pos-register .menu-item span { margin-top:auto; color:#9e2f28; }
.pos-register .ticket-pane {
  grid-column:2/3; grid-row:2/4; padding:16px; overflow:auto; background:#fff; border-left:1px solid var(--pos-line);
}
.check-header { display:flex; justify-content:space-between; align-items:flex-start; padding-bottom:13px; border-bottom:1px solid var(--pos-line); }
.check-header h2 { margin:2px 0 3px; }
.check-header small { color:var(--pos-muted); }
.check-header > strong { font-size:24px; color:#9e2f28; }
.pos-register .cart { min-height:130px; padding:10px 0; }
.pos-register .cart:empty::after { content:"Add an item to begin this check"; display:grid; place-items:center; min-height:110px; color:var(--pos-muted); border:1px dashed #cdd3d9; border-radius:8px; }
.check-fields { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.check-fields label,.notes-field { margin:6px 0; font-size:12px; color:#4b5563; }
.check-fields input,.check-fields select,.notes-field textarea { padding:9px; border-color:var(--pos-line); }
.check-actions { display:grid; grid-template-columns:.7fr 1.2fr 1fr; gap:7px; margin-top:10px; }
.check-actions button { min-height:48px; }
.accent-action { background:#d96830; }
.full-action { width:100%; margin-top:8px; }

.kitchen-app { min-height:calc(100vh - 58px); padding:16px; background:#151a1d; color:#f4f6f7; }
.kitchen-app.active { display:block; }
.kitchen-header { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:16px; padding:3px 2px 16px; }
.kitchen-header p { color:#75d7b0; }
.kitchen-header h1 { margin:3px 0 0; }
.kitchen-summary { display:flex; gap:8px; }
.kitchen-summary article { min-width:90px; padding:8px 12px; border:1px solid #374047; border-radius:7px; background:#20272b; }
.kitchen-summary span { display:block; color:#9facb4; font-size:11px; text-transform:uppercase; }
.kitchen-summary strong { display:block; margin-top:3px; font-size:20px; }
.kitchen-header > button { background:#38434a; }
.kitchen-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px; border-radius:8px; background:#20272b; }
.kitchen-toolbar .segmented { background:#131719; }
.kitchen-toolbar .segmented button { color:#aeb8be; }
.kitchen-toolbar .segmented button.active { background:#445159; color:#fff; box-shadow:none; }
.kitchen-toolbar label { display:flex; align-items:center; gap:8px; margin:0; color:#aeb8be; font-size:12px; }
.kitchen-toolbar select { width:auto; padding:8px; color:#fff; background:#151a1d; border-color:#455159; }
.kitchen-board { display:grid; grid-template-columns:repeat(auto-fill,minmax(285px,1fr)); align-items:start; gap:12px; margin-top:12px; }
.kitchen-ticket { overflow:hidden; border:2px solid #455159; border-radius:8px; background:#f8f9f9; color:#1f2933; }
.kitchen-ticket.new { --ticket-urgency:#e9a23b; border-color:#e9a23b; }
.kitchen-ticket.accepted,.kitchen-ticket.fired { --ticket-urgency:#4b9bd7; border-color:#4b9bd7; }
.kitchen-ticket.ready { --ticket-urgency:#38a56d; border-color:#38a56d; }
.kitchen-ticket > header { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; color:#fff; background:#455159; }
.kitchen-ticket.new > header { background:#b96c18; }
.kitchen-ticket.accepted > header,.kitchen-ticket.fired > header { background:#236b9f; }
.kitchen-ticket.ready > header { background:#237c51; }
@keyframes kitchen-quote-pulse { 50% { filter:brightness(1.38); box-shadow:0 0 0 5px var(--ticket-urgency,currentColor); } }
.kitchen-ticket.quote-warning { animation:kitchen-quote-pulse 1.4s ease-in-out infinite; }
.kitchen-ticket.quote-critical,.kitchen-ticket.quote-overdue { --ticket-urgency:#c91f17; border-color:#c91f17; color:#c91f17; animation:kitchen-quote-pulse .8s ease-in-out infinite; }
.kitchen-ticket.quote-critical > header,.kitchen-ticket.quote-overdue > header { background:#c91f17; }
.kitchen-ticket.quote-overdue > header time { font-weight:900; text-transform:uppercase; }
@media (prefers-reduced-motion:reduce) {
  .kitchen-ticket.quote-warning,.kitchen-ticket.quote-critical,.kitchen-ticket.quote-overdue { animation:none; border-width:5px; }
}
.kitchen-ticket header div { display:flex; align-items:center; gap:8px; }
.kitchen-ticket header strong { font-size:21px; }
.kitchen-ticket header span { padding:3px 6px; border-radius:4px; background:#fff2; font-size:11px; text-transform:uppercase; }
.kitchen-ticket header time { font-weight:800; font-size:18px; }
.ticket-guest { display:flex; justify-content:space-between; padding:10px 12px; border-bottom:1px solid #d9dee2; }
.ticket-guest span { color:#67727b; text-transform:capitalize; font-size:12px; }
.kitchen-ticket ol { list-style:none; margin:0; padding:4px 12px; }
.kitchen-ticket li { display:grid; grid-template-columns:28px 1fr; gap:6px; padding:8px 0; border-bottom:1px solid #e5e8ea; }
.kitchen-ticket li > strong { color:#9e2f28; }
.kitchen-ticket li small { display:block; margin-top:3px; color:#67727b; }
.kitchen-note { margin:8px 12px; padding:8px; background:#fff1ca; border-radius:5px; font-weight:700; }
.kitchen-ticket footer { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px 12px; }
.kitchen-ticket footer button { flex:1; background:#24343d; }
.status-chip { color:#5c6871; text-transform:uppercase; font-size:11px; font-weight:800; }
.kitchen-empty { grid-column:1/-1; display:grid; place-items:center; min-height:300px; color:#9facb4; }
.kitchen-empty strong { color:#fff; font-size:20px; }
.chips { display:flex; gap:6px; overflow:auto; margin-bottom:12px; }
.chips button { white-space:nowrap; padding:8px 12px; background:#e7ded0; color:#231f20; }
.shell {
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 12px;
  min-height: 100vh;
  padding: 12px;
}
.shell.active { display:grid; }
.mobile-ticket-button, .close-mobile-ticket, .order-notice { display:none; }
.ticket-message { min-height:20px; color:#2d6b53; font-weight:700; }
.pane {
  background: #fffaf2;
  border: 1px solid #d8c7aa;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
}
header p {
  margin: 0 0 4px;
  color: #8b2d22;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}
h1, h2 { margin: 0 0 16px; }
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
button {
  border: 0;
  border-radius: 6px;
  background: #8b2d22;
  color: white;
  padding: 12px;
  font-weight: 700;
}
.menu-item {
  min-height: 86px;
  background: #203c35;
  text-align: left;
}
.menu-item span { display: block; margin-top: 8px; color: #f2c36b; }
.cart, .orders { display: grid; gap: 10px; }
.cart-row, .order-card {
  background: #ffffff;
  border: 1px solid #e3d5bd;
  border-radius: 8px;
  padding: 12px;
}
.cart-row, .order-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.cart-row small { display:block; color:#6f6253; margin-top:4px; }
.qty { display:flex; align-items:center; gap:6px; }
.qty button { padding:6px 9px; }
.secondary { background:#6f6253; }
.totals { border-top:1px solid #d8c7aa; margin-top:12px; padding-top:10px; }
.totals p { display:flex; justify-content:space-between; }
.workspace { margin-top:14px; min-height:260px; }
#resourceForm { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; align-items:end; }
#resourceForm label { margin:0; }
#resourceContent pre { white-space:pre-wrap; overflow:auto; background:#231f20; color:#f6f1e8; padding:12px; border-radius:6px; max-height:500px; }
dialog { border:0; border-radius:10px; padding:20px; max-width:520px; width:90%; }
dialog::backdrop { background:#0008; }
dialog fieldset { border:1px solid #d8c7aa; border-radius:8px; }
dialog label { display:flex; grid-template-columns:auto 1fr; align-items:center; }
dialog input { width:auto; }
dialog menu { display:flex; justify-content:flex-end; gap:8px; padding:0; }
label { display: grid; gap: 6px; margin: 16px 0; font-weight: 700; }
input, select, textarea { border: 1px solid #d8c7aa; border-radius: 6px; padding: 12px; font: inherit; width:100%; }
.dashboard { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin-bottom:14px; }
.dashboard article { background:white; border:1px solid #d8c7aa; border-radius:8px; padding:14px; display:grid; gap:8px; }
.dashboard strong { font-size:24px; color:#8b2d22; }
.backoffice-nav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.backoffice-nav button { background:#6f6253; }
.backoffice-nav button.active { background:#f2c36b; color:#231f20; }
.backoffice-section { display:none; }
.backoffice-section.active { display:block; }
.module-launchers { display:grid; grid-template-columns:repeat(3,minmax(180px,1fr)); gap:12px; }
.module-launchers button { min-height:110px; text-align:left; display:grid; align-content:center; gap:8px; background:#203c35; }
.module-launchers button span { color:#f2c36b; font-weight:400; }
.operations-tile { margin-bottom:14px; }
.menu-row { display:grid; grid-template-columns:1fr auto auto auto; gap:10px; align-items:center; border-bottom:1px solid #e3d5bd; padding:10px 0; }
.menu-row div, .list-card { display:grid; gap:4px; }
.menu-row small, .list-card span, .list-card small { color:#6f6253; }
.menu-row label { display:flex; align-items:center; gap:5px; margin:0; font-size:12px; }
.menu-row input { width:auto; }
.list-card { border-bottom:1px solid #e3d5bd; padding:12px 0; }
.ops { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.board { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.meta { color: #6f6253; font-size: 13px; margin-top: -4px; }
@media (max-width: 920px) {
  .shell { display:block; min-height:100vh; padding:8px 8px 92px; }
  .shell.active { display:block; }
  .order-notice {
    display:block;
    position:fixed;
    left:50%;
    bottom:94px;
    z-index:40;
    transform:translate(-50%,20px);
    width:max-content;
    max-width:calc(100vw - 32px);
    padding:10px 14px;
    border-radius:24px;
    background:#203c35;
    color:white;
    font-weight:700;
    opacity:0;
    pointer-events:none;
    transition:.18s ease;
  }
  .order-notice.show { opacity:1; transform:translate(-50%,0); }
  .mobile-ticket-button {
    display:flex;
    position:sticky;
    z-index:35;
    top:8px;
    width:100%;
    margin-bottom:10px;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:58px;
    box-shadow:0 5px 18px #0005;
  }
  .mobile-ticket-button span {
    min-width:28px;
    padding:4px 8px;
    border-radius:16px;
    background:#f2c36b;
    color:#231f20;
  }
  .ticket-pane {
    display:none;
    position:fixed;
    inset:0;
    z-index:30;
    border:0;
    border-radius:0;
    padding:18px 16px 94px;
    overflow-y:auto;
  }
  body.mobile-ticket-open { overflow:hidden; }
  body.mobile-ticket-open .ticket-pane { display:block; }
  body.mobile-ticket-open .mobile-ticket-button { display:none; }
  .close-mobile-ticket { display:block; margin-bottom:14px; width:100%; }
  .ticket-pane > #sendOrder,
  .ticket-pane > #holdOrder,
  .ticket-pane > #resumeHeldOrder { width:100%; margin-top:8px; min-height:52px; }
  .kds-pane { display:none !important; }
  .module-launchers { grid-template-columns:1fr; }
  .topbar { flex-wrap:wrap; }
  .topbar strong { width:100%; }
  .menu-row { grid-template-columns:1fr 1fr; }
}

/* POS Back Office shell */
.backoffice-app { background:#f5f6f8; color:#252a34; min-height:calc(100vh - 58px); }
.backoffice-app.active { display:block; }
.bo-global-header {
  position:sticky; top:0; z-index:25; display:grid; grid-template-columns:auto minmax(170px,220px) minmax(220px,1fr) auto auto;
  gap:14px; align-items:center; min-height:72px; padding:10px 18px; background:#fff; border-bottom:1px solid #dfe2e7;
}
.bo-location { display:grid; line-height:1.15; }
.bo-location span,.bo-breadcrumb small,.bo-page-header span { color:#687180; font-size:12px; }
.bo-search { margin:0; display:flex; align-items:center; gap:8px; padding:0 13px; border:1px solid #c9ced6; border-radius:7px; background:#fff; }
.bo-search input { border:0; padding:11px 0; background:transparent; }
.bo-search input:focus { outline:none; }
.bo-role { margin:0; font-size:11px; color:#687180; }
.bo-role select { min-width:125px; margin-top:2px; padding:8px; }
.bo-icon-button { width:42px; height:42px; padding:0; border-radius:7px; background:#fff; color:#242a35; border:1px solid #dfe2e7; }
.publish-pill { background:#fff4ed; color:#c94814; border:1px solid #ffc8ad; font-size:12px; white-space:nowrap; }
.bo-layout { display:grid; grid-template-columns:228px minmax(0,1fr); min-height:calc(100vh - 130px); }
.bo-rail { position:sticky; top:72px; align-self:start; height:calc(100vh - 130px); overflow:auto; padding:12px 8px 30px; background:#fff; border-right:1px solid #dfe2e7; }
.bo-rail button { width:100%; display:grid; grid-template-columns:34px 1fr; align-items:center; gap:5px; padding:9px 10px; margin:2px 0; border-radius:7px; background:transparent; color:#343b48; text-align:left; font-weight:500; }
.bo-rail button span { display:grid; place-items:center; width:30px; height:30px; font-size:17px; }
.bo-rail button.active { background:#fff0e8; color:#d54d17; }
.bo-rail button:hover { background:#f3f5f7; }
.bo-main { min-width:0; padding:0 24px 40px; }
.bo-breadcrumb { display:flex; justify-content:space-between; align-items:center; min-height:44px; color:#687180; font-size:13px; }
.bo-page-header { display:flex; justify-content:space-between; align-items:end; gap:16px; margin:8px 0 20px; }
.bo-page-header p,.bo-card header p { margin:0 0 3px; color:#d54d17; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.bo-page-header h1 { margin:0; color:#1e2633; font-size:30px; }
.dashboard { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:12px; margin-bottom:16px; }
.dashboard article,.report-kpis article { display:grid; gap:8px; padding:17px; background:#fff; border:1px solid #e0e3e8; border-radius:9px; box-shadow:0 1px 2px #1e26330a; }
.dashboard article span,.report-kpis span { color:#687180; font-size:12px; }
.dashboard article strong,.report-kpis strong { color:#1f2a3a; font-size:23px; }
.bo-card { padding:18px; margin:0 0 16px; background:#fff; border:1px solid #e0e3e8; border-radius:9px; box-shadow:0 1px 2px #1e26330a; }
.bo-card header { display:flex; justify-content:space-between; margin-bottom:14px; }
.bo-card h2 { margin:0; font-size:18px; }
.bo-grid { display:grid; grid-template-columns:1.3fr 1fr; gap:16px; }
.quick-actions,.module-actions { display:grid; grid-template-columns:repeat(4,minmax(130px,1fr)); gap:10px; }
.quick-actions button,.module-actions button { min-height:76px; padding:13px; display:grid; gap:7px; align-content:center; text-align:left; color:#283140; background:#fff; border:1px solid #dfe2e7; border-radius:8px; }
.quick-actions button:hover,.module-actions button:hover { border-color:#e65f28; box-shadow:0 0 0 2px #fff0e8; }
.quick-actions button span { color:#d54d17; }
.module-actions { grid-template-columns:repeat(3,minmax(170px,1fr)); margin-bottom:16px; }
.module-actions button strong { font-size:15px; }
.module-actions button span { color:#687180; font-size:12px; font-weight:400; }
.metric-row { display:flex; justify-content:space-between; gap:12px; padding:10px 2px; border-bottom:1px solid #eef0f3; font-size:13px; }
.progress { height:10px; overflow:hidden; border-radius:8px; background:#eceff2; margin:16px 0 10px; }
.progress span { display:block; height:100%; background:#e65f28; border-radius:inherit; }
.empty-state { min-height:120px; display:grid; place-content:center; gap:5px; text-align:center; color:#687180; }
.empty-state strong { color:#283140; }
.settings-grid,#resourceForm { display:grid; grid-template-columns:repeat(3,minmax(150px,1fr)); gap:10px; align-items:end; margin-bottom:14px; }
.settings-grid label,#resourceForm label { margin:0; text-transform:capitalize; }
.data-table { max-width:100%; overflow:auto; border:1px solid #e1e4e9; border-radius:8px; }
.data-table table { width:100%; border-collapse:collapse; font-size:12px; }
.data-table th { color:#596273; background:#f5f6f8; text-transform:capitalize; text-align:left; }
.data-table th,.data-table td { padding:10px 12px; border-bottom:1px solid #e7e9ed; white-space:nowrap; }
.report-kpis { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:10px; margin-bottom:18px; }
.report-kpis article { padding:13px; }
.report-kpis strong { font-size:18px; }
.workspace h3 { margin:22px 0 8px; }

@media (max-width:1100px) {
  .bo-global-header { grid-template-columns:auto minmax(150px,1fr) auto auto; }
  .bo-search { grid-column:1/-1; grid-row:2; }
  .bo-layout { grid-template-columns:82px minmax(0,1fr); }
  .bo-rail { top:126px; height:calc(100vh - 184px); }
  .bo-rail button { grid-template-columns:1fr; text-align:center; }
  .bo-rail button strong { font-size:10px; overflow:hidden; text-overflow:ellipsis; }
  .dashboard { grid-template-columns:repeat(2,minmax(130px,1fr)); }
  .quick-actions { grid-template-columns:repeat(2,minmax(140px,1fr)); }
}
@media (max-width:680px) {
  .bo-global-header { position:relative; grid-template-columns:auto 1fr; padding:9px 10px; }
  .bo-role,.publish-pill { grid-column:1/-1; width:100%; }
  .bo-role select { width:100%; }
  .bo-location { display:none; }
  .bo-layout { display:block; }
  .bo-rail { display:none; position:fixed; inset:58px 15% 0 0; z-index:50; height:auto; box-shadow:12px 0 30px #0002; }
  .bo-rail.open { display:block; }
  .bo-rail button { grid-template-columns:34px 1fr; text-align:left; }
  .bo-rail button strong { font-size:13px; }
  .bo-main { padding:0 12px 28px; }
  .bo-grid,.settings-grid,#resourceForm { grid-template-columns:1fr; }
  .dashboard { grid-template-columns:1fr 1fr; }
  .dashboard article strong { font-size:19px; }
  .quick-actions,.module-actions { grid-template-columns:1fr 1fr; }
  .bo-page-header { align-items:start; flex-direction:column; }
  .bo-page-header h1 { font-size:25px; }
}

/* Register hardening: fixed work area, operational states, and accessible dialogs */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (min-width:921px) {
  .pos-register.active { height:calc(100vh - 58px); min-height:620px; overflow:hidden; }
  .register-workspace { min-height:0; overflow:hidden; }
  .category-rail,.menu-pane,.ticket-pane,.cart { min-height:0; overflow:auto; }
  .menu-pane { overscroll-behavior:contain; }
  .ticket-pane { height:100%; }
}
.category-rail > [data-smart-list] { width:100%; margin:2px 0; padding:8px 10px; text-align:left; color:var(--system-ink); background:transparent; border:1px solid transparent; }
.category-rail > [data-smart-list].active { color:var(--system-accent); background:var(--system-accent-soft); border-color:#ffd2bc; }
.menu-item { position:relative; }
.menu-item .favorite-toggle { position:absolute; top:7px; right:8px; color:#a85a16; font-size:20px; line-height:1; }
.menu-item.sold-out { opacity:.66; cursor:not-allowed; background:#eceff1; border-style:dashed; }
.menu-item.sold-out strong { text-decoration:line-through; }
.menu-item em { display:block; color:var(--system-muted); font-size:10px; font-style:normal; }
.line-main { min-width:0; flex:1; padding:4px; text-align:left; color:var(--system-ink); background:transparent; }
.line-main small { display:block; color:var(--system-muted); }
.line-main:hover { background:var(--system-accent-soft); }
.verification-panel { padding:10px 12px; color:#684411; background:#fff8dc; border:1px solid #ead28d; border-radius:7px; }
.order-hub-tabs { display:flex; gap:4px; flex-wrap:wrap; }
.order-hub-tabs button { padding:8px 10px; color:var(--system-muted); background:#eef0f2; }
.order-hub-tabs button.active { color:#fff; background:var(--system-ink); }
.kitchen-ticket li.held { opacity:.65; border-left:4px solid #e1a535; padding-left:6px; }
.kitchen-ticket li.fired { border-left:4px solid #d54d17; padding-left:6px; }
.kitchen-ticket footer { flex-wrap:wrap; }
.kitchen-ticket footer button { flex:1; min-width:88px; }
dialog { width:min(620px,calc(100vw - 28px)); border:0; border-radius:12px; box-shadow:0 20px 70px #0006; }
dialog::backdrop { background:#111827aa; }
dialog form { display:grid; gap:14px; }
dialog menu { display:flex; justify-content:flex-end; gap:8px; padding:0; margin:8px 0 0; }
.dialog-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.tender-methods { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.tender-methods button { color:var(--system-ink); background:#eef0f2; }
.tender-methods button.active { color:#fff; background:var(--system-accent); }
.payment-summary { display:flex; justify-content:space-between; padding:14px; background:var(--system-canvas); border-radius:8px; font-size:18px; }
.danger { background:#a32626; }
.connection-banner { position:fixed; z-index:100; left:50%; bottom:18px; translate:-50%; width:min(760px,calc(100vw - 30px)); padding:13px 16px; color:#fff; background:#8c2f1d; border-radius:9px; box-shadow:0 6px 25px #0004; }

@media (max-width:920px) {
  .category-rail > [data-smart-list] { display:inline-block; width:auto; }
  .dialog-grid,.tender-methods { grid-template-columns:1fr 1fr; }
  .pos-register.active {
    display:flex; flex-direction:column; height:calc(100dvh - 104px); min-height:0;
    padding-bottom:0; overflow:hidden;
  }
  .pos-register .mobile-ticket-button { position:relative; top:auto; flex:0 0 auto; min-height:48px; margin:7px 9px; width:calc(100% - 18px); }
  .pos-register .register-header,.pos-register .order-context { flex:0 0 auto; }
  .pos-register .register-workspace { display:flex; flex:1 1 auto; flex-direction:column; min-height:0; overflow:hidden; }
  .pos-register .category-rail { flex:0 0 auto; max-height:132px; overflow:auto; }
  .pos-register .menu-pane { flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; }
}

@media (max-width:920px) {
  .pos-register,.pos-register.active { display:block; padding-bottom:86px; min-height:100vh; }
  .register-header { min-height:62px; padding:8px 10px; }
  .register-mark { width:36px; height:36px; }
  .service-clock { display:none; }
  .register-user { padding:5px; }
  .register-user div { display:none; }
  .register-user-actions { gap:5px; }
  .display-mode-button { min-width:48px; padding:7px 9px; font-size:12px; }
  .order-context { display:block; padding:9px; }
  .order-context .segmented { margin-bottom:8px; }
  .register-workspace { display:block; }
  .category-rail { padding:8px; border:0; border-bottom:1px solid var(--pos-line); }
  .category-rail > p,.rail-action { display:none; }
  .category-stack { display:flex; gap:5px; overflow:auto; }
  .category-stack button { white-space:nowrap; }
  .pos-register .menu-pane { padding:12px 9px; }
  .pos-register .menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pos-register .menu-item { min-height:104px; }
  .pos-register .ticket-pane {
    display:none; position:fixed; inset:0; z-index:60; padding:16px; border:0; overflow:auto;
  }
  body.mobile-ticket-open .pos-register .ticket-pane { display:block; }
  .check-fields { grid-template-columns:1fr; }
  .check-actions { position:sticky; bottom:0; padding:8px 0; background:#fff; grid-template-columns:.7fr 1fr; }
  .check-actions .accent-action { grid-column:1/-1; }
  .kitchen-app { padding:9px; }
  .kitchen-header { grid-template-columns:1fr auto; }
  .kitchen-summary { grid-column:1/-1; display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .kitchen-header > button { grid-column:2; grid-row:1; }
  .kitchen-toolbar { align-items:stretch; flex-direction:column; }
  .kitchen-toolbar label { justify-content:space-between; }
  .kitchen-board { grid-template-columns:1fr; }
}

/* Unified POS product language across register, KDS, and Back Office */
:root {
  --system-ink:#1f2933;
  --system-muted:#687180;
  --system-line:#dfe2e7;
  --system-canvas:#f5f6f8;
  --system-surface:#ffffff;
  --system-accent:#d54d17;
  --system-accent-soft:#fff0e8;
  --system-success:#237c51;
}
body { background:var(--system-canvas); color:var(--system-ink); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.topbar {
  min-height:58px; padding:8px 16px; gap:6px; background:var(--system-ink); border-bottom:1px solid #101820;
}
.topbar strong { font-size:18px; letter-spacing:.01em; }
.topbar button { min-height:40px; padding:9px 14px; border-radius:7px; color:#dce2e6; }
.topbar button:hover { background:#ffffff12; }
.topbar button.active { color:#fff; background:var(--system-accent); }
.topbar span { padding:7px 10px; background:#ffffff12; border:1px solid #ffffff1c; }
button { border-radius:7px; background:var(--system-accent); }
input,select,textarea { border-color:var(--system-line); border-radius:7px; }

.pos-register { --pos-ink:var(--system-ink); --pos-muted:var(--system-muted); --pos-line:var(--system-line); --pos-soft:var(--system-canvas); --pos-accent:var(--system-accent); background:var(--system-canvas); }
.register-header,.order-context,.category-rail,.pos-register .ticket-pane { background:var(--system-surface); }
.register-mark { background:var(--system-ink); }
.service-clock strong { color:var(--system-success); }
.segmented button.active { color:var(--system-accent); box-shadow:0 1px 3px #1f29331c; }
.category-stack button.active { background:var(--system-accent-soft); color:var(--system-accent); }
.group-tabs button.active { background:var(--system-accent); }
.rail-action { background:var(--system-ink); }
.pos-register .menu-item span,.check-header > strong { color:var(--system-accent); }
.pos-register .menu-item:hover { border-color:#f0a17b; box-shadow:0 0 0 2px var(--system-accent-soft); }
.qty button,#sendOrder { background:var(--system-accent); }
.accent-action { background:#b84512; }
.ticket-message { color:var(--system-success); }

.kitchen-app { background:var(--system-canvas); color:var(--system-ink); }
.kitchen-header { padding:10px 4px 16px; }
.kitchen-header p { color:var(--system-accent); }
.kitchen-header h1 { color:var(--system-ink); }
.kitchen-summary article { border-color:var(--system-line); background:var(--system-surface); box-shadow:0 1px 2px #1f29330a; }
.kitchen-summary span { color:var(--system-muted); }
.kitchen-header > button { color:#fff; background:var(--system-ink); }
.kitchen-toolbar { border:1px solid var(--system-line); background:var(--system-surface); box-shadow:0 1px 2px #1f29330a; }
.kitchen-toolbar .segmented { background:#eef0f2; }
.kitchen-toolbar .segmented button { color:var(--system-muted); }
.kitchen-toolbar .segmented button.active { color:#fff; background:var(--system-accent); }
.kitchen-toolbar label { color:var(--system-muted); }
.kitchen-toolbar select { color:var(--system-ink); background:#fff; border-color:var(--system-line); }
.kitchen-ticket { border-color:#aab3ba; box-shadow:0 2px 5px #1f29331a; }
.kitchen-ticket.new { border-color:#e58b42; }
.kitchen-ticket.new > header { background:#c86a20; }
.kitchen-ticket footer button { background:var(--system-ink); }
.kitchen-empty { color:var(--system-muted); }
.kitchen-empty strong { color:var(--system-ink); }

.backoffice-app { background:var(--system-canvas); }
.bo-global-header { min-height:72px; border-color:var(--system-line); }
.bo-icon-button { border-color:var(--system-line); }
.publish-pill { color:var(--system-accent); background:var(--system-accent-soft); border-color:#ffc8ad; }
.bo-rail button.active { color:var(--system-accent); background:var(--system-accent-soft); }
.bo-page-header p,.bo-card header p,.quick-actions button span { color:var(--system-accent); }
.progress span { background:var(--system-accent); }
.quick-actions button:hover,.module-actions button:hover { border-color:var(--system-accent); box-shadow:0 0 0 2px var(--system-accent-soft); }

.pin-dialog {
  width:min(92vw,390px);
  border:0;
  border-radius:16px;
  padding:20px;
  box-shadow:0 24px 80px #1118;
}
.pin-dialog::backdrop { background:#111b; backdrop-filter:blur(4px); }
.pin-dialog output {
  display:block;
  min-height:48px;
  padding:12px;
  border-radius:8px;
  background:#f2f4f6;
  text-align:center;
  font-size:20px;
  letter-spacing:.2em;
}
.pin-pad { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.pin-pad button { min-height:52px; font-size:17px; }
.pin-dialog menu { margin:0; }

@media (max-width:680px) {
  .topbar {
    position:sticky; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px;
    overflow:visible; padding:7px 9px;
  }
  .topbar strong { grid-column:1/3; grid-row:1; width:auto; min-width:0; align-self:center; }
  .topbar > span { grid-column:3; grid-row:1; justify-self:end; }
  .topbar button { grid-row:2; min-width:0; padding:8px 4px; font-size:11px; white-space:nowrap; }
  .topbar-employee { grid-column:1/3; grid-row:3; margin:0; }
  .topbar-employee button { min-width:96px; padding:8px; }
  .category-stack,.group-tabs { flex-wrap:wrap; overflow:visible; }
  .category-stack button,.group-tabs button { flex:1 1 auto; text-align:center; }
  .pos-register .menu-grid { grid-template-columns:1fr; }
  .employee-login-card { padding:18px; }
}
@media (orientation:landscape) and (max-height:600px) {
  .employee-gate { align-items:start; }
  .employee-login-card { grid-template-columns:1fr 1fr; width:min(760px,100%); }
  .employee-login-card > h1,.employee-login-card > p,.employee-login-card > .eyebrow,
  .employee-login-card > button,.employee-login-card > .ticket-message { grid-column:1/-1; }
}
.menu-heading-actions{display:flex;align-items:center;gap:10px}.menu-heading-actions button{padding:9px 14px;border:1px solid #9c9486;border-radius:8px;background:#fff;font-weight:800}.menu-heading-actions #finishQuickEdit{background:#1f6f4a;color:#fff;border-color:#1f6f4a}.quick-edit-active .menu-pane{outline:3px solid #f0a52b;outline-offset:-3px}.quick-edit-active .menu-heading{background:#fff4dd}.quick-edit-active .menu-item{position:relative;padding-top:38px;border-style:dashed}.quick-edit-active .menu-item:disabled{pointer-events:auto}.quick-remove{position:absolute;right:8px;top:8px;display:grid;place-items:center;width:25px;height:25px;border:0;border-radius:50%;background:#b42318;color:#fff;font-weight:900}.quick-edit-badge{position:absolute;left:9px;top:9px;padding:4px 7px;border-radius:5px;background:#fff4dd;color:#825400;font-size:10px;font-weight:900}.add-menu-slot{min-height:150px;border:2px dashed #9c9486!important;background:#f8f6f1!important;color:#5b554c!important}.stock-controls,.add-item-choice{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}.stock-controls button,.add-item-choice button{padding:12px;border:1px solid #aaa;border-radius:8px;background:#fff;color:#222;font-weight:800}.stock-controls button.active,.add-item-choice button.active{background:#222;color:#fff}.recipe-dialog{width:min(700px,calc(100vw - 28px))}.recipe-summary{display:flex;gap:7px;overflow:auto;margin:10px 0 16px}.recipe-summary span{flex:0 0 auto;padding:6px 9px;border-radius:999px;background:#ece8df;font-size:12px}.recipe-summary span.active{background:#222;color:#fff}.recipe-total{display:flex;justify-content:space-between;margin-top:14px;padding:13px;border-top:2px solid #222;font-size:18px}.recipe-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 3px;border-bottom:1px solid #ddd}.recipe-choice>span{display:flex;align-items:center;gap:9px}.recipe-choice .repeat-controls{display:flex;align-items:center;gap:6px}.recipe-choice .repeat-controls button{width:30px;height:30px;padding:0}.recipe-choice .quantity{min-width:20px;text-align:center;font-weight:800}.region-chip{display:inline-block;margin-left:6px;padding:3px 7px;border-radius:999px;background:#eee1c5;font-size:11px}.cart-row .modifier-groups{display:grid;gap:3px;margin-top:4px}.cart-row .modifier-groups span{font-size:11px;color:#666}.cart-row .modifier-groups strong{font-size:11px;color:#222}.quick-tile-color{position:absolute;inset:0;z-index:-1;border-radius:inherit}
@media(max-width:720px){.menu-heading{align-items:flex-start!important}.menu-heading-actions{flex-wrap:wrap;justify-content:flex-end}.stock-controls,.add-item-choice{grid-template-columns:1fr}.recipe-dialog menu{display:grid;grid-template-columns:1fr 1fr;gap:8px}.recipe-dialog menu button{margin:0}}
.recipe-needed{justify-self:start;padding:3px 6px;border-radius:5px;background:#fff0c2;color:#7a4b00;font-size:10px;font-weight:900;letter-spacing:.03em}

/* Final adaptive POS rules: window-width driven and WebView-safe. */
@media (max-width:920px) {
  html,body { min-height:100%; height:100%; }
  body { min-height:100dvh; overflow:hidden; }
  button,input,select { min-height:48px; font-size:max(14px,1rem); }
  .topbar { flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-inline:contain; }
  .topbar button { flex:0 0 auto; min-width:96px; font-size:13px; }
  .pos-register { height:calc(100dvh - 58px); min-height:0; }
  .category-stack,.group-tabs {
    display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden;
    scroll-snap-type:x proximity; scrollbar-width:thin;
  }
  .category-stack button,.group-tabs button {
    flex:0 0 auto; min-width:112px; min-height:48px; scroll-snap-align:start;
  }
  .pos-register .menu-item { min-height:96px; padding:14px; }
  .pos-register .menu-grid { align-content:start; overflow-y:auto; }
  dialog { max-height:calc(100dvh - 24px); overflow-y:auto; }
}
@media (min-width:480px) and (max-width:920px) {
  .pos-register .menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:479px) {
  .pos-register .menu-grid { grid-template-columns:1fr; }
}

/* Android/WebView reachability: keep the document scrollable in every
   orientation and reserve body locking for the open ticket drawer only. */
@media (max-width:920px) {
  html,body { height:auto; min-height:100%; }
  body { min-height:100dvh; overflow-x:hidden; overflow-y:auto; }
  body.mobile-ticket-open { overflow:hidden; }

  .pos-register,.pos-register.active {
    display:block;
    height:auto;
    min-height:calc(100dvh - 58px);
    overflow:visible;
    padding-bottom:86px;
  }
  .pos-register .register-workspace {
    display:block;
    min-height:0;
    overflow:visible;
  }
  .pos-register .category-rail {
    max-height:none;
    overflow:visible;
  }
  .pos-register .menu-pane,
  .pos-register .menu-grid {
    min-height:0;
    overflow:visible;
    overscroll-behavior:auto;
  }
  .topbar,.segmented,.category-stack,.group-tabs,.order-hub-tabs {
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;
  }
  .data-table,.bo-card,.workspace {
    max-width:100%;
  }
  .data-table {
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;
  }
  .backoffice-app,.kitchen-app,.bo-layout,.bo-main {
    height:auto;
    min-height:0;
    overflow:visible;
  }
}

@media (orientation:landscape) and (max-height:600px) and (max-width:920px) {
  .register-header { min-height:50px; padding:5px 8px; }
  .order-context { padding:6px 8px; }
  .pos-register .mobile-ticket-button { min-height:42px; margin:5px 8px; }
  .pos-register .menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .pos-register .menu-item { min-height:84px; }
}

.app-installer {
  margin:16px 0 22px;
  padding:18px;
  border:1px solid var(--system-line);
  border-radius:10px;
  background:var(--system-surface);
  box-shadow:0 2px 8px #1f293312;
}
.app-installer > header p { margin:0 0 4px; color:var(--system-accent); font-size:12px; font-weight:800; text-transform:uppercase; }
.app-installer > header h3 { margin:0 0 5px; font-size:22px; }
.app-installer > header span,.app-download-card p,.app-download-card small,.app-installer-note { color:var(--system-muted); }
.app-download-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.app-download-card { min-width:0; padding:16px; border:1px solid var(--system-line); border-radius:9px; background:var(--system-canvas); }
.app-download-card h4 { margin:12px 0 6px; font-size:18px; }
.app-download-card p { min-height:38px; margin:0 0 13px; }
.platform-badge { display:inline-block; padding:5px 8px; border-radius:999px; color:var(--system-accent); background:var(--system-accent-soft); font-size:12px; font-weight:900; }
.app-download-button { display:inline-flex; min-height:48px; align-items:center; justify-content:center; padding:10px 14px; border-radius:7px; color:#fff; background:var(--system-accent); font-weight:850; text-decoration:none; }
.app-download-card details { margin-top:12px; }
.app-download-card code { display:block; max-width:100%; margin-top:8px; overflow-wrap:anywhere; color:var(--system-muted); font-size:11px; }
.app-download-card small { display:block; margin-top:10px; }
.app-installer-note { margin:14px 0 0; font-size:12px; }
@media (max-width:680px) {
  .app-download-grid { grid-template-columns:1fr; }
  .app-download-card p { min-height:0; }
  .app-download-button { width:100%; }
}
@media (display-mode:standalone) {
  body {
    padding-left:env(safe-area-inset-left);
    padding-right:env(safe-area-inset-right);
    padding-bottom:env(safe-area-inset-bottom);
  }
  .topbar { padding-top:max(8px,env(safe-area-inset-top)); }
}
/* Kitchen urgency is deliberately last so ordinary status colors cannot override it. */
.kitchen-ticket.quote-warning {
  --ticket-urgency:#b45309;
  border-color:#b45309;
}
.kitchen-ticket.quote-warning > header {
  background:#b45309;
}
.kitchen-ticket.quote-warning header time,
.kitchen-ticket.quote-warning .status-chip {
  color:#fff;
  background:#78350f;
}
.kitchen-ticket.quote-critical {
  --ticket-urgency:#dc2626;
  border-color:#dc2626;
  border-width:5px;
}
.kitchen-ticket.quote-critical > header {
  background:#dc2626;
}
.kitchen-ticket.quote-critical header time,
.kitchen-ticket.quote-critical .status-chip {
  color:#fff;
  background:#7f1d1d;
}
.kitchen-ticket.quote-overdue {
  --ticket-urgency:#7f1d1d;
  border-color:#7f1d1d;
  border-width:6px;
}
.kitchen-ticket.quote-overdue > header {
  background:#7f1d1d;
}
.kitchen-ticket.quote-overdue header time,
.kitchen-ticket.quote-overdue .status-chip {
  color:#fff;
  background:#450a0a;
}
@media (prefers-reduced-motion:reduce) {
  .kitchen-ticket.quote-warning,
  .kitchen-ticket.quote-critical,
  .kitchen-ticket.quote-overdue {
    animation:none;
  }
}
