:root {
  --topbar-h: 52px;
  --topbar-offset: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  --ink: #151411; --ink-soft: #24221d; --paper: #f2f0eb; --panel: #fff;
  --line: #dcd8cf; --muted: #706c64; --red: #d94830; --red-dark: #b53522;
  --green: #287455; --green-soft: #e3efe8; --amber: #c98a1f; --blue: #287b9f;
  --shadow: 0 12px 30px rgba(29, 25, 18, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.4; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(40, 123, 159, .35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
/* Barra superiore unica: navigazione e sessione in una riga, per lasciare
   al banco tutta l'altezza dello schermo. */
.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; min-height: var(--topbar-h); padding: 0 14px; background: var(--ink); color: white; display: flex; align-items: center; gap: 16px; }
.brand { flex: 0 0 auto; border: 0; background: transparent; padding: 0; color: white; display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.brand-mark { width: 30px; height: 30px; border-radius: 5px; background: var(--red); display: grid; place-items: center; font-size: 17px; font-weight: 800; }
.brand-copy strong, .brand-copy small { display: block; white-space: nowrap; }
.brand-copy strong { font-size: 14px; line-height: 1.15; }
.brand-copy small { color: #9f9b92; font-size: 11px; }
.main-nav { min-width: 0; flex: 1 1 auto; align-self: stretch; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-item { flex: 0 0 auto; min-height: 44px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: #aaa69c; padding: 3px 13px 0; display: flex; align-items: center; font-size: 14px; white-space: nowrap; cursor: pointer; }
.nav-item:hover { background: #211f1b; color: white; }
.nav-item.active { border-bottom-color: var(--red); color: white; font-weight: 700; }
.topbar-session { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.store-identity { display: flex; align-items: center; gap: 10px; }
.store-identity > span { width: 36px; height: 36px; border-radius: 50%; background: #34312b; display: grid; place-items: center; color: #d5d1c8; font-weight: 700; font-size: 12px; }
.store-identity strong, .store-identity small { display: block; }
.store-identity strong { font-size: 14px; }
.store-identity small { color: #918d84; font-size: 12px; }
.plain-status i { width: 8px; height: 8px; border-radius: 50%; background: #53b77f; }
.workspace { min-width: 0; }
.view { display: none; min-height: 100vh; padding: 0 24px 34px; }
.view.active { display: block; animation: fade-in .22s ease; }
@keyframes fade-in { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.workspace-header { min-height: 88px; padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.workspace-header h1 { margin: 2px 0 0; font-size: 27px; line-height: 1.15; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.connection-chip, .plain-status { min-height: 40px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.connection-chip { cursor: pointer; }
.connection-chip i { width: 8px; height: 8px; border-radius: 50%; background: #53b77f; }
.connection-chip.offline i { background: var(--amber); }
.profile-button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--ink); color: white; font-weight: 800; cursor: pointer; }

#view-pos { padding: 12px 14px 14px; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.catalog-panel { min-width: 0; }
.device-strip { display: grid; grid-template-columns: 1.25fr .8fr .8fr; gap: 10px; }
.device-readout { min-height: 52px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 6px 10px; display: flex; align-items: center; gap: 10px; }
.scale-readout { background: var(--green-soft); border-color: #c7dbcf; }
.device-symbol { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 5px; background: var(--green); color: white; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.fiscal-readout .device-symbol { background: var(--ink); }
.device-readout small, .device-readout strong { display: block; }
.device-readout small { color: var(--muted); font-size: 11px; }
.device-readout strong { margin-top: 2px; font-size: 15px; }
.device-state { margin-left: auto; color: var(--green); font-size: 11px; font-weight: 800; }
.queue-readout { justify-content: space-between; }
.queue-readout strong { font-size: 22px; line-height: 1; }
.queue-readout button { min-height: 38px; border: 0; border-radius: 5px; background: var(--ink); color: white; padding: 0 12px; font-weight: 700; cursor: pointer; }
.catalog-tools { margin: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.category-row { min-width: 0; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.category-row::-webkit-scrollbar { display: none; }
.category-button { min-height: 40px; white-space: nowrap; border: 1px solid var(--line); border-radius: 5px; background: transparent; padding: 0 13px; cursor: pointer; }
.category-button.active { border-color: var(--ink); background: var(--ink); color: white; font-weight: 700; }
.search-field { flex: 0 0 205px; }
.search-field input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 12px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.product-card { min-height: 164px; position: relative; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 12px; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; text-align: left; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #c7c2b8; box-shadow: 0 9px 20px rgba(24,21,16,.08); }
.product-card:active { transform: translateY(0); }
.product-card.image-card { padding-top: 102px; }
.product-card .unit-label { position: relative; z-index: 2; border-radius: 3px; background: #f0eee9; padding: 4px 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.product-card .product-art { position: absolute; right: -18px; top: -20px; width: 91px; height: 91px; border-radius: 50%; background: var(--accent, #ddd); }
.product-card.image-card .product-art { top: 0; right: 0; width: 100%; height: 88px; border-radius: 0; background-size: cover; background-position: 50% 42%; }
.product-card.image-card .unit-label { position: absolute; top: 10px; left: 10px; color: white; background: rgba(21,20,17,.72); }
.product-card strong { max-width: 88%; margin-top: auto; font-size: 15px; line-height: 1.25; }
.product-card.image-card strong { max-width: 100%; margin-top: 0; }
.product-card > span:last-child { margin-top: 4px; color: var(--muted); font-size: 12px; }
.empty-products { grid-column: 1 / -1; min-height: 220px; border: 1px dashed #c9c4ba; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.order-panel { position: sticky; top: calc(var(--topbar-offset) + 12px); height: calc(100vh - var(--topbar-offset) - 26px); height: calc(100dvh - var(--topbar-offset) - 26px); min-height: 440px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 14px; display: flex; flex-direction: column; box-shadow: 0 10px 26px rgba(33,28,20,.05); }
.order-heading { display: flex; justify-content: space-between; align-items: center; }
.order-heading h2 { margin: 2px 0 0; font-size: 19px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 5px; background: white; display: grid; place-items: center; font-size: 23px; cursor: pointer; }
.segmented { margin: 10px 0; border-radius: 6px; background: #efede7; padding: 3px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.segmented button { min-height: 36px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 700; }
.segmented.compact { margin: 0; display: flex; }
.segmented.compact button { min-height: 34px; padding: 0 11px; font-size: 13px; }
.flow-selector { margin: 0 0 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.flow-selector button { min-height: 50px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 6px 7px; align-content: start; display: grid; gap: 2px; text-align: left; cursor: pointer; }
.flow-selector button.active { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--red); }
.flow-selector strong, .flow-selector span { display: block; }
.flow-selector strong { font-size: 12.5px; line-height: 1.2; }
.flow-selector span { color: var(--muted); font-size: 10.5px; line-height: 1.2; }
.order-items { flex: 1 1 auto; min-height: 60px; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; }
.order-line { min-height: 56px; border-bottom: 1px solid #ece9e2; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
.line-copy strong, .line-copy span { display: block; }
.line-copy strong { font-size: 14px; }
.line-copy span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.line-end { display: flex; align-items: center; gap: 8px; }
.qty-control { display: inline-flex; align-items: center; gap: 4px; }
.qty-control button { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 4px; background: white; cursor: pointer; }
.qty-control span { min-width: 18px; text-align: center; font-size: 12px; font-weight: 700; }
.line-end b { min-width: 47px; text-align: right; font-size: 13px; }
.empty-cart { min-height: 140px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-cart p { margin: 0; max-width: 220px; font-size: 14px; }
.text-action { align-self: flex-start; border: 0; background: none; padding: 9px 0; color: var(--red); font-weight: 700; cursor: pointer; }
.totals { padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 5px; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.grand-total { margin-top: 3px; padding-top: 9px; border-top: 1px solid var(--line); align-items: end; color: var(--ink) !important; }
.grand-total span { font-weight: 700; }
.grand-total strong { font-size: 24px; line-height: 1; }
.pay-button { min-height: 52px; margin-top: 10px; border: 0; border-radius: 6px; background: var(--red); color: white; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 7px 16px rgba(217,72,48,.22); }
.pay-button:hover { background: var(--red-dark); }
.pay-button:disabled { background: #aaa59b; box-shadow: none; cursor: not-allowed; }
.send-order-button { margin-top: 10px; min-height: 44px; border: 1px solid #d7b55c; border-radius: 6px; background: #fff6dd; color: #7c5410; font-weight: 800; cursor: pointer; }
.send-order-button:disabled { background: #eeeae3; color: #9b9488; }

.primary-small, .primary-button, .secondary-button { min-height: 40px; border-radius: 5px; padding: 0 14px; font-weight: 700; cursor: pointer; }
.primary-small, .primary-button { border: 0; background: var(--ink); color: white; }
.primary-button { min-height: 46px; background: var(--red); }
.secondary-button { border: 1px solid var(--line); background: white; }
.production-summary, .kpi-grid { margin: 18px 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.production-summary article, .kpi-grid article { min-height: 112px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 15px; }
.production-summary small, .production-summary span, .kpi-grid small, .kpi-grid p { color: var(--muted); font-size: 12px; }
.production-summary strong { display: block; margin: 7px 0 4px; font-size: 27px; line-height: 1; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.board-column { min-width: 0; }
.board-column > header { min-height: 46px; padding: 0 4px; border-bottom: 2px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.board-column > header div { display: flex; align-items: center; gap: 8px; }
.board-column h2 { margin: 0; font-size: 15px; }
.board-column header b { min-width: 27px; height: 27px; border-radius: 50%; background: white; display: grid; place-items: center; font-size: 12px; }
.column-dot { width: 8px; height: 8px; border-radius: 50%; }
.column-dot.red { background: var(--red); } .column-dot.amber { background: var(--amber); } .column-dot.green { background: var(--green); }
.board-list { padding-top: 10px; display: grid; gap: 9px; min-height: 214px; }
.order-card { min-height: 174px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 13px; display: flex; flex-direction: column; box-shadow: 0 5px 12px rgba(26,23,18,.035); }
.order-card.priority { border-left: 4px solid var(--amber); }
.order-card.ready { background: #f7fbf8; border-color: #cedfd5; }
.order-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.order-card time { color: var(--muted); font-size: 11px; }
.source-badge { border-radius: 3px; padding: 4px 6px; font-size: 9px; font-weight: 800; }
.source-badge.web { background: #dfedf3; color: #236b89; } .source-badge.counter { background: #eeeae3; color: #58544c; } .source-badge.table { background: #e0efdf; color: #27673c; }
.order-card h3 { margin: 14px 0 4px; font-size: 15px; }
.order-card p { margin: 0; color: var(--muted); font-size: 13px; }
.order-card footer { margin-top: auto; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-card footer span { color: var(--muted); font-size: 11px; }
.order-card footer button { min-height: 31px; border: 1px solid var(--line); border-radius: 4px; background: white; padding: 0 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.production-plan { margin-top: 20px; }
.section-title { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.section-title h2 { margin: 2px 0 0; font-size: 19px; }
.batch-list { border-top: 1px solid var(--line); }
.batch-list article { min-height: 62px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 13px minmax(0,1fr) 90px 70px; align-items: center; gap: 12px; }
.batch-color { width: 10px; height: 38px; border-radius: 3px; }
.batch-color.tomato { background: var(--red); } .batch-color.potato { background: var(--amber); } .batch-color.focaccia { background: #d7b97d; }
.batch-list strong, .batch-list small { display: block; }
.batch-list small { color: var(--muted); font-size: 11px; }
.batch-state { justify-self: end; border-radius: 3px; background: #e5e2dc; padding: 5px 7px; font-size: 11px; font-weight: 700; }
.batch-state.urgent { background: #f4d8d2; color: #a12e1d; }

.kpi-grid article > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-grid article strong { display: block; margin-top: 13px; font-size: 24px; }
.kpi-grid article p { margin: 3px 0 0; }
.trend { border-radius: 3px; background: #ebe8e1; padding: 3px 5px; font-size: 10px; font-weight: 700; }
.trend.positive { background: var(--green-soft); color: var(--green); } .trend.negative { background: #f3dfda; color: var(--red-dark); }
.analytics-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.85fr); gap: 12px; }
.analytics-main, .channel-panel, .product-table-section, .health-panel { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 15px; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 5px; } .legend i { width: 16px; height: 3px; display: inline-block; }
.legend-bar { background: var(--ink); } .legend-line { background: var(--red); }
.sales-chart { height: 224px; padding: 14px 4px 0; display: grid; grid-template-columns: repeat(10,1fr); gap: 8px; align-items: end; border-bottom: 1px solid var(--line); }
.chart-column { min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.chart-bars { width: 100%; height: calc(100% - 25px); display: flex; align-items: end; justify-content: center; gap: 3px; }
.chart-bars i { width: 31%; min-width: 5px; border-radius: 3px 3px 0 0; background: var(--ink); transition: height .28s ease; }
.chart-bars i:last-child { background: var(--red); } .chart-column span { color: var(--muted); font-size: 10px; }
.donut-row { padding: 10px 0 18px; display: grid; grid-template-columns: 130px 1fr; gap: 15px; align-items: center; }
.donut { width: 124px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--ink) 0 54%, var(--red) 54% 67%, #d6d1c8 67% 100%); position: relative; display: grid; place-items: center; }
.donut::after { content: ""; position: absolute; inset: 20px; border-radius: 50%; background: white; }
.donut strong, .donut span { position: relative; z-index: 1; display: block; text-align: center; }
.donut strong { margin-top: 25px; font-size: 22px; } .donut span { margin-bottom: 25px; color: var(--muted); font-size: 10px; }
.channel-list { display: grid; gap: 9px; }
.channel-list div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; font-size: 12px; }
.channel-list i { width: 8px; height: 8px; border-radius: 2px; }
.card-color { background: var(--ink); } .web-color { background: var(--red); } .cash-color { background: #d6d1c8; }
.reconcile-line { padding-top: 15px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reconcile-line small, .reconcile-line strong { display: block; } .reconcile-line small { color: var(--muted); font-size: 10px; } .reconcile-line strong { margin-top: 2px; font-size: 12px; }
.reconcile-line button { min-height: 34px; border: 1px solid var(--line); border-radius: 4px; background: white; padding: 0 10px; cursor: pointer; }
.admin-bottom-grid { margin-top: 12px; display: grid; grid-template-columns: minmax(0,1.6fr) minmax(260px,.65fr); gap: 12px; }
/* relative: anche le etichette sr-only (assolute) restano dentro lo scorrimento della tabella. */
.table-wrap, .decision-table-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); text-align: left; font-size: 10px; text-transform: uppercase; }
th, td { padding: 11px 9px; border-bottom: 1px solid #ebe8e1; } td { font-size: 12px; }
td strong, td small { display: block; } td small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.table-status { border-radius: 3px; padding: 4px 6px; font-size: 10px; font-weight: 700; }
.table-status.live { color: var(--green); background: var(--green-soft); } .table-status.draft { color: #785e24; background: #f1e5c5; }
.health-list { display: grid; }
.health-list div { min-height: 45px; border-bottom: 1px solid #ebe8e1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.health-list span { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.health-list i { width: 8px; height: 8px; border-radius: 50%; background: #53b77f; }
.health-list b { color: var(--green); font-size: 10px; } .health-list .warning i { background: var(--amber); } .health-list .warning b { color: #8a611a; }

.display-grid { margin: 22px 0; display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.tables-layout { margin-top: 20px; display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 18px; align-items: start; }
.floor-panel, .table-detail { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 16px; }
.floor-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.table-legend-button { min-height: 34px; font-size: 13px; }
.floor-map { position: relative; min-height: 560px; border: 1px solid #e3ded5; border-radius: 8px; background: linear-gradient(90deg, rgba(0,0,0,.035) 1px, transparent 1px), linear-gradient(0deg, rgba(0,0,0,.035) 1px, transparent 1px), #f7f5ef; background-size: 48px 48px; overflow: hidden; }
.table-node { position: absolute; transform: translate(-50%,-50%); width: 112px; min-height: 86px; border: 2px solid #cec7bb; border-radius: 8px; background: white; padding: 9px; display: grid; place-items: center; gap: 1px; text-align: center; cursor: pointer; box-shadow: 0 8px 20px rgba(21,20,17,.08); }
.table-node.round { border-radius: 999px; width: 104px; min-height: 104px; }
.table-node strong, .table-node span, .table-node small { display: block; }
.table-node span { color: var(--muted); font-size: 12px; }
.table-node small { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.table-node.free { border-color: #9ec7ad; }
.table-node.seated { border-color: #d5b35a; background: #fff9e8; }
.table-node.ordered { border-color: #cc7656; background: #fff3ed; }
.table-node.ready { border-color: #55a173; background: #effaf2; }
.table-node.dirty { border-color: #a9a39a; background: #eeeae3; }
.table-node.reserved { border-color: #78a9c1; background: #eef7fb; }
.table-node.selected { outline: 3px solid rgba(21,20,17,.16); }
.table-detail { min-height: 560px; display: flex; flex-direction: column; gap: 14px; }
.table-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.table-detail-head h2 { margin: 2px 0 0; font-size: 28px; }
.table-pill { border-radius: 999px; background: #eeeae3; padding: 6px 10px; font-size: 11px; font-weight: 850; }
.table-pill.ready { background: #dff2e5; color: #28664d; } .table-pill.ordered { background: #fee6dc; color: #9f3928; } .table-pill.seated { background: #fff0c7; color: #7c5410; }
.table-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.table-meta span { border: 1px solid #ebe7df; border-radius: 6px; padding: 9px; color: var(--muted); font-size: 11px; }
.table-meta strong { margin-top: 3px; display: block; color: var(--ink); font-size: 14px; }
.table-order-card { border: 1px solid #ead0c4; border-radius: 7px; background: #fff8f4; padding: 13px; display: grid; gap: 5px; }
.table-order-card small, .table-order-card p, .table-order-card span { color: var(--muted); font-size: 12px; }
.table-order-card strong { font-size: 18px; }
.table-actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.table-actions button { min-height: 42px; border: 1px solid var(--line); border-radius: 5px; background: white; font-weight: 800; cursor: pointer; }
.table-actions button[data-table-command="order"] { grid-column: 1 / -1; background: var(--ink); color: white; }
.empty-state.compact { min-height: 82px; }
.table-legend-grid { display: grid; gap: 9px; }
.table-legend-grid article { min-height: 64px; border: 1px solid var(--line); border-radius: 7px; padding: 10px; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 10px; }
.table-legend-grid strong, .table-legend-grid p { display: block; margin: 0; }
.table-legend-grid p { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.legend-table-dot { width: 34px; height: 34px; border: 3px solid #cec7bb; border-radius: 8px; background: white; }
.legend-table-dot.free { border-color: #9ec7ad; }
.legend-table-dot.seated { border-color: #d5b35a; background: #fff9e8; }
.legend-table-dot.ordered { border-color: #cc7656; background: #fff3ed; }
.legend-table-dot.ready { border-color: #55a173; background: #effaf2; }
.legend-table-dot.dirty { border-color: #a9a39a; background: #eeeae3; }
.legend-table-dot.reserved { border-color: #78a9c1; background: #eef7fb; }
.customer-display { min-height: 540px; border-radius: 8px; background: var(--ink); color: white; padding: 28px; display: flex; flex-direction: column; overflow: hidden; }
.display-brand { display: flex; align-items: center; gap: 10px; } .display-brand strong { font-size: 18px; }
.now-serving { margin: auto 0; text-align: center; }
.now-serving small { color: #aaa69c; font-size: 16px; text-transform: uppercase; }
.now-serving strong { display: block; margin: 12px 0 0; color: #f05a3f; font-size: clamp(96px, 14vw, 170px); line-height: .9; }
.now-serving p { margin: 17px 0 0; font-size: 20px; }
.next-up { display: flex; justify-content: center; align-items: center; gap: 20px; }
.next-up span { color: #8f8a82; } .next-up b { font-size: 20px; }
.display-order-ready { margin-top: 25px; padding: 16px 18px; border: 1px solid #444039; border-radius: 6px; display: flex; justify-content: space-between; gap: 20px; color: #bbb7af; }
.display-order-ready strong { color: white; }
.staff-clock { min-height: 540px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 22px; display: flex; flex-direction: column; }
.clock-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.store-identity.dark > span { background: var(--ink); color: white; } .store-identity.dark small { color: var(--muted); }
.clock-top time { font-size: 23px; font-weight: 700; }
.badge-target { margin: auto 0; text-align: center; }
.nfc-rings { width: 105px; height: 105px; margin: 0 auto 22px; position: relative; display: grid; place-items: center; }
.nfc-rings i { position: absolute; border: 3px solid var(--red); border-left-color: transparent; border-bottom-color: transparent; border-radius: 50%; transform: rotate(45deg); }
.nfc-rings i:nth-child(1) { width: 35px; height: 35px; } .nfc-rings i:nth-child(2) { width: 65px; height: 65px; opacity: .72; } .nfc-rings i:nth-child(3) { width: 95px; height: 95px; opacity: .42; }
.badge-target h2 { margin: 0; font-size: 24px; } .badge-target p { max-width: 310px; margin: 8px auto 0; color: var(--muted); font-size: 13px; }
.last-clock { min-height: 66px; border: 1px solid var(--line); border-radius: 6px; background: #f6f4f0; padding: 9px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 9px; }
.avatar-large { width: 38px; height: 38px; border-radius: 50%; background: #ded9d0; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.last-clock small, .last-clock strong { display: block; } .last-clock small { color: var(--muted); font-size: 10px; } .last-clock strong { margin-top: 2px; font-size: 11px; }
.last-clock > span { color: var(--green); font-size: 10px; font-weight: 700; }
.badge-demo { min-height: 39px; margin-top: 10px; border: 1px solid var(--line); border-radius: 5px; background: white; cursor: pointer; }
.queue-console { min-height: 84px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; }
.queue-console h2 { margin: 2px 0 0; font-size: 17px; }
.queue-controls { display: flex; gap: 7px; }
.queue-controls button { min-height: 39px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 12px; font-weight: 700; cursor: pointer; }
.queue-controls .primary-small { background: var(--ink); color: white; border-color: var(--ink); }
.queue-metrics { display: flex; gap: 18px; } .queue-metrics span { color: var(--muted); font-size: 11px; } .queue-metrics strong { display: block; margin-top: 2px; color: var(--ink); font-size: 15px; }

.architecture-header { align-items: flex-end; }
.architecture-principle { margin: 18px 0 12px; border-left: 4px solid var(--red); padding: 7px 0 7px 14px; display: flex; align-items: baseline; gap: 12px; }
.architecture-principle strong { font-size: 15px; } .architecture-principle p { margin: 0; color: var(--muted); font-size: 12px; }
.architecture-canvas { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 14px; }
.architecture-lane { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 13px; align-items: stretch; }
.architecture-lane > header { border-right: 1px solid var(--line); padding: 9px 13px 9px 4px; display: flex; flex-direction: column; justify-content: center; }
.architecture-lane > header span { font-weight: 800; font-size: 13px; } .architecture-lane > header small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.lane-nodes { display: grid; gap: 8px; }
.lane-people .lane-nodes { grid-template-columns: repeat(4, minmax(0,1fr)); } .lane-edge .lane-nodes { grid-template-columns: repeat(6, minmax(0,1fr)); } .lane-cloud .lane-nodes { grid-template-columns: repeat(5, minmax(0,1fr)); }
.arch-node { min-width: 0; min-height: 83px; border: 1px solid var(--line); border-radius: 6px; background: #f7f5f1; padding: 10px; display: flex; flex-direction: column; justify-content: center; transition: background .18s ease, border-color .18s ease, opacity .18s ease; }
.arch-node.primary-node { background: var(--ink); color: white; border-color: var(--ink); }
.arch-node b, .arch-node span, .arch-node small { display: block; } .arch-node b { font-size: 12px; } .arch-node span { margin-top: 4px; color: var(--red-dark); font-size: 10px; font-weight: 700; } .arch-node small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.arch-node.primary-node span { color: #f08c79; } .arch-node.primary-node small { color: #aaa69c; }
.architecture-canvas[data-flow="sale"] [data-node="tablet"], .architecture-canvas[data-flow="sale"] [data-node="gateway"], .architecture-canvas[data-flow="sale"] [data-node="scale"], .architecture-canvas[data-flow="sale"] [data-node="payment"], .architecture-canvas[data-flow="sale"] [data-node="fiscal"], .architecture-canvas[data-flow="sale"] [data-node="orders"] { border-color: var(--red); background: #fff5f2; }
.architecture-canvas[data-flow="sale"] [data-node="gateway"] { background: var(--ink); }
.architecture-canvas[data-flow="web"] [data-node="web"], .architecture-canvas[data-flow="web"] [data-node="integrations"], .architecture-canvas[data-flow="web"] [data-node="orders"], .architecture-canvas[data-flow="web"] [data-node="gateway"], .architecture-canvas[data-flow="web"] [data-node="production"] { border-color: var(--blue); background: #eef8fb; }
.architecture-canvas[data-flow="web"] [data-node="gateway"] { background: var(--ink); }
.architecture-canvas[data-flow="offline"] [data-node="tablet"], .architecture-canvas[data-flow="offline"] [data-node="gateway"], .architecture-canvas[data-flow="offline"] [data-node="scale"], .architecture-canvas[data-flow="offline"] [data-node="fiscal"], .architecture-canvas[data-flow="offline"] [data-node="cash"], .architecture-canvas[data-flow="offline"] [data-node="queue"] { border-color: var(--green); background: #edf7f1; }
.architecture-canvas[data-flow="offline"] [data-node="gateway"] { background: var(--ink); } .architecture-canvas[data-flow="offline"] .lane-cloud .arch-node { opacity: .35; }
.flow-arrow { min-height: 31px; margin-left: 158px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.flow-arrow::before, .flow-arrow::after { content: ""; width: 31%; border-top: 1px dashed #c8c3b9; } .flow-arrow::before { margin-right: 11px; } .flow-arrow::after { margin-left: 11px; }
.flow-detail { margin: 10px 0 22px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.flow-step { min-height: 69px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 9px; display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
.flow-step > span { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.flow-step p { margin: 0; color: var(--muted); font-size: 10px; } .flow-step p strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 11px; }
.decision-section { margin-top: 4px; } .decision-note { color: var(--muted); font-size: 11px; }
.decision-table-wrap { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 0 10px; }
.decision-table th, .decision-table td { padding: 11px 8px; } .decision-table td:nth-child(1) { color: var(--muted); font-weight: 700; } .decision-table td:nth-child(3) { min-width: 250px; }
.phase { border-radius: 3px; padding: 4px 6px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.phase-one { background: var(--green-soft); color: var(--green); } .phase-two { background: #eee7d4; color: #7c612a; }
.source-links { padding: 10px 2px 0; display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 10px; } .source-links a { color: var(--blue); text-underline-offset: 2px; }
.architecture-bottom { margin-top: 19px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 13px; }
.state-machine, .guardrails { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 15px; }
.state-track { padding: 14px 0 17px; display: flex; align-items: center; }
.state-track span { min-height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 4px; background: #f5f3ee; padding: 0 8px; display: grid; place-items: center; text-align: center; font-size: 10px; font-weight: 700; }
.state-track i { flex: 1 1 20px; border-top: 1px solid #aaa49a; }
.exception-state { border-left: 3px solid var(--amber); background: #f8f3e7; padding: 10px 11px; }
.exception-state strong, .exception-state span { display: block; } .exception-state strong { color: #8c641e; font-size: 9px; text-transform: uppercase; } .exception-state span { margin-top: 3px; font-size: 12px; font-weight: 700; } .exception-state p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.guardrail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.guardrail-list article { min-height: 87px; border-top: 1px solid var(--line); padding-top: 9px; display: grid; grid-template-columns: 22px 1fr; gap: 7px; }
.guardrail-list article > span { color: var(--red); font-size: 10px; font-weight: 800; }
.guardrail-list p { margin: 0; color: var(--muted); font-size: 10px; } .guardrail-list strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 11px; }
.roadmap-section { margin-top: 19px; }
.roadmap { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.roadmap article { min-height: 145px; border-right: 1px solid var(--line); padding: 15px 14px; display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.roadmap article:last-child { border-right: 0; }
.roadmap article > span { width: 27px; height: 27px; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.roadmap strong { font-size: 12px; } .roadmap p { margin: 5px 0 0; color: var(--muted); font-size: 10px; } .roadmap small { grid-column: 2; color: var(--red); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.compliance-note { margin: 7px 0 0; border: 1px solid #e0d0a8; border-radius: 5px; background: #f6f0e2; padding: 10px 12px; color: #695831; font-size: 10px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(21,20,17,.58); padding: 22px; display: grid; place-items: center; }
.modal-backdrop[hidden] { display: none; }
.modal-backdrop:has(.access-login-modal) { z-index: 130; background: rgba(21,20,17,.78); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; border-radius: 8px; background: white; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.26); }
.access-login-modal { width: min(430px, 100%); }
.access-login-modal .modal-actions { justify-content: stretch; }
.access-login-modal .primary-button { width: 100%; justify-content: center; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; } .modal-head h2 { margin: 2px 0 0; font-size: 22px; }
.weight-display { margin: 20px 0 12px; border-radius: 7px; background: var(--ink); color: white; padding: 22px; text-align: center; }
.weight-display small, .weight-display span { display: block; color: #aaa69c; } .weight-display strong { display: block; margin: 8px 0 4px; font-size: 46px; line-height: 1; }
.tare-line, .calculated-total { min-height: 53px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tare-line span { color: var(--muted); } .tare-line button { border: 0; background: none; color: var(--red); font-weight: 700; cursor: pointer; }
.calculated-total { border-bottom: 0; } .calculated-total strong { font-size: 21px; }
.modal-actions { margin-top: 15px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.payment-total { margin: 22px 0 14px; display: flex; align-items: end; justify-content: space-between; }
.payment-total span { color: var(--muted); } .payment-total strong { font-size: 27px; }
.payment-methods { display: grid; gap: 8px; }
.payment-methods button { min-height: 72px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 10px; display: grid; grid-template-columns: 43px 1fr auto; align-items: center; gap: 11px; text-align: left; cursor: pointer; }
.payment-methods button:hover { border-color: var(--ink); }
.method-icon { width: 42px; height: 42px; border-radius: 5px; background: #ebe8e1; display: grid; place-items: center; font-weight: 800; }
.payment-methods strong, .payment-methods small { display: block; } .payment-methods small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.payment-progress { padding-top: 22px; text-align: center; }
.terminal-visual { width: 150px; height: 205px; margin: 0 auto 18px; border-radius: 20px; background: var(--ink); padding: 16px; box-shadow: 0 14px 25px rgba(0,0,0,.2); }
.terminal-screen { height: 110px; border-radius: 7px; background: #e6efe9; padding: 13px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.terminal-screen span { color: var(--muted); font-size: 9px; } .terminal-screen strong { margin-top: 6px; font-size: 20px; }
.terminal-screen i { width: 10px; height: 10px; margin-top: 10px; border-radius: 50%; background: var(--amber); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { transform: scale(1.35); opacity: .55; } }
.payment-progress h3 { margin: 0; font-size: 20px; } .payment-progress p { margin: 6px auto 17px; color: var(--muted); font-size: 13px; } .payment-progress .primary-button { width: 100%; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 130; max-width: 360px; border-radius: 6px; background: var(--ink); color: white; padding: 13px 16px; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1180px) {
  .brand-copy { display: none; } .nav-item { padding-inline: 10px; font-size: 13px; }
  .pos-grid { grid-template-columns: minmax(0,1fr) 300px; } .device-strip { grid-template-columns: 1fr 1fr; } .fiscal-readout { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .lane-edge .lane-nodes { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .architecture-bottom { grid-template-columns: 1fr; } .state-track { overflow-x: auto; }
  .roadmap { grid-template-columns: repeat(2,minmax(0,1fr)); } .roadmap article:nth-child(2) { border-right: 0; }
}
@media (max-width: 920px) {
  :root { --topbar-h: 94px; }
  .topbar { flex-wrap: wrap; gap: 0 10px; padding: 0 10px; }
  .brand { min-height: 48px; } .topbar-session { margin-left: auto; }
  .main-nav { order: 3; flex: 1 0 100%; margin: 0 -10px; padding: 0 4px; border-top: 1px solid #2d2a25; }
  .view { padding-inline: 15px; } #view-pos { padding-inline: 12px; } .pos-grid { grid-template-columns: 1fr; }
  .order-panel { position: static; height: auto; min-height: 520px; } .order-items { overflow: visible; }
  .production-summary, .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .board { grid-template-columns: 1fr; } .board-list { min-height: 0; } .order-card { min-height: 150px; }
  .analytics-grid, .admin-bottom-grid, .display-grid, .tables-layout { grid-template-columns: 1fr; } .queue-console { grid-template-columns: 1fr; gap: 13px; }
  .queue-metrics { border-top: 1px solid var(--line); padding-top: 11px; }
  .architecture-lane { grid-template-columns: 1fr; } .architecture-lane > header { border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .flow-arrow { margin-left: 0; } .lane-people .lane-nodes, .lane-cloud .lane-nodes { grid-template-columns: repeat(2,minmax(0,1fr)); } .flow-detail { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .workspace-header { align-items: flex-start; } .workspace-header h1 { font-size: 23px; } .header-actions .plain-status { display: none; }
  .device-strip { grid-template-columns: 1fr; } .fiscal-readout { display: flex; }
  .catalog-tools { align-items: stretch; flex-direction: column-reverse; } .search-field { flex-basis: auto; }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .product-card { min-height: 143px; }
  .production-summary, .kpi-grid { grid-template-columns: 1fr 1fr; } .production-summary article, .kpi-grid article { min-height: 104px; padding: 12px; } .kpi-grid article strong { font-size: 19px; }
  .batch-list article { grid-template-columns: 10px minmax(0,1fr) auto; } .batch-list article > b { display: none; }
  .sales-chart { gap: 3px; } .donut-row { grid-template-columns: 120px 1fr; }
  .customer-display, .staff-clock { min-height: 470px; padding: 18px; } .display-order-ready { align-items: flex-start; flex-direction: column; gap: 4px; }
  .last-clock { grid-template-columns: 40px 1fr; } .last-clock > span { display: none; }
  .queue-controls { display: grid; grid-template-columns: 1fr 1fr; } .queue-controls button:last-child { grid-column: 1 / -1; } .queue-metrics { justify-content: space-between; gap: 9px; }
  .architecture-header { display: block; } .flow-switch { margin-top: 12px !important; overflow-x: auto; } .architecture-principle { align-items: flex-start; flex-direction: column; }
  .lane-edge .lane-nodes, .lane-cloud .lane-nodes, .lane-people .lane-nodes, .flow-detail { grid-template-columns: 1fr 1fr; }
  .state-track { padding-bottom: 8px; } .state-track span { min-width: 92px; }
  .guardrail-list, .roadmap { grid-template-columns: 1fr; } .roadmap article { border-right: 0; border-bottom: 1px solid var(--line); } .roadmap article:last-child { border-bottom: 0; }
  .modal-backdrop { padding: 10px; align-items: end; } .modal { max-height: calc(100vh - 20px); border-radius: 8px 8px 0 0; }
}
@media (max-width: 420px) {
  .view { padding-inline: 11px; } .nav-item { padding-inline: 9px; font-size: 12px; } .product-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .product-card { padding: 10px; } .product-card strong { font-size: 14px; } .production-summary, .kpi-grid { grid-template-columns: 1fr; }
  .lane-edge .lane-nodes, .lane-cloud .lane-nodes, .lane-people .lane-nodes, .flow-detail { grid-template-columns: 1fr; }
}

/* Shared store, fiscal customers, invoicing and laboratory */
.shared-sync-status { margin-left: auto; min-height: 34px; max-width: 340px; border: 1px solid #d8d2c8; border-radius: 999px; background: #fff; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
.shared-sync-status i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #c79332; box-shadow: 0 0 0 4px rgba(199,147,50,.12); }
.shared-sync-status[data-tone="success"] i { background: #24845d; box-shadow: 0 0 0 4px rgba(36,132,93,.12); }
.shared-sync-status[data-tone="error"] { border-color: #e6b6ac; background: #fff4f1; color: #8e3022; }
.shared-sync-status[data-tone="error"] i { background: #c7422e; box-shadow: 0 0 0 4px rgba(199,66,46,.12); }
.shared-sync-status[data-tone="pending"] i { animation: syncPulse 1.2s ease-in-out infinite; }
@keyframes syncPulse { 50% { opacity: .35; transform: scale(.8); } }

.product-card-shell { position: relative; min-width: 0; }
.product-card-shell .product-card { width: 100%; height: 100%; }
.product-card-shell.sold-out .product-card { filter: grayscale(.45); opacity: .72; }
.product-card-shell.sold-out .product-card .unit-label { background: #9d2e21; color: #fff; }
.availability-action { position: absolute; right: 7px; top: 7px; z-index: 2; min-height: 28px; border: 1px solid rgba(21,20,17,.2); border-radius: 6px; background: rgba(255,255,255,.94); padding: 0 8px; color: var(--ink); font-size: 11px; font-weight: 800; cursor: pointer; }
.availability-action:hover { border-color: var(--red); color: var(--red); }

.settings-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 22px; }
.settings-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.settings-choice-grid .switch-field { min-height: 110px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; background: #faf9f6; padding: 16px; }
.settings-footer { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.settings-footer p { margin: 0; color: var(--muted); font-size: 13px; }
.settings-footer .primary-button { width: auto; min-width: 210px; }
.form-grid.three-cols { grid-template-columns: repeat(3,minmax(0,1fr)); }
.span-2 { grid-column: 1 / -1; }
.span-3 { grid-column: 1 / -1; }
.existing-customer-picker { border: 1px solid #d8d2c8; border-radius: 8px; background: #f7f4ed; padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.existing-customer-picker .secondary-button { margin-bottom: 1px; }
.customer-validation-hint { margin-top: 12px; border-left: 4px solid #2a6f57; background: #edf7f2; padding: 12px 14px; display: grid; gap: 3px; }
.customer-validation-hint strong { font-size: 13px; }
.customer-validation-hint span { color: #46685b; font-size: 12px; line-height: 1.45; }

.invoice-operation-list { display: grid; gap: 10px; }
.invoice-operation-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; }
.invoice-operation-card header, .invoice-operation-card footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.invoice-operation-card h3 { margin: 5px 0 0; font-size: 17px; }
.invoice-operation-card header > strong { font-size: 21px; }
.invoice-fiscal-line { margin: 13px 0; border-block: 1px solid #ece8e1; padding: 10px 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 13px; }
.invoice-operation-card footer > span { color: var(--muted); font-size: 12px; }
.invoice-operation-card footer > div { display: flex; gap: 8px; }
.invoice-operation-card footer button { min-height: 34px; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 0 11px; cursor: pointer; }
.invoice-status { display: inline-flex; min-height: 24px; align-items: center; border-radius: 999px; padding: 0 9px; background: #f0ede7; color: #5f5a52; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.invoice-status.to_invoice { background: #fff0d2; color: #82540d; }
.invoice-status.invoiced { background: #e4edf6; color: #285b82; }
.invoice-status.collected { background: #e3f4eb; color: #246747; }
.invoice-status.cancelled { background: #f5e2df; color: #8c3126; }
.invoice-history-head { display: flex; justify-content: space-between; gap: 16px; font-size: 18px; }
.invoice-history { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 0; }
.invoice-history li { position: relative; padding: 0 0 20px 28px; }
.invoice-history li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 13px; bottom: -2px; width: 1px; background: #d7d2c9; }
.invoice-history li > i { position: absolute; left: 0; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--red); }
.invoice-history li div { display: grid; gap: 3px; }
.invoice-history li span, .invoice-history li p { margin: 0; color: var(--muted); font-size: 12px; }

.invoice-checkout-summary { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.invoice-checkout-summary > div { border: 1px solid var(--line); border-radius: 7px; background: #f8f6f1; padding: 13px; display: grid; gap: 4px; }
.invoice-checkout-summary span { color: var(--muted); font-size: 12px; }
.invoice-checkout-summary strong { font-size: 21px; }
.fiscal-preview { min-height: 112px; border: 1px solid #d8d2c8; border-radius: 8px; background: #f8f6f1; padding: 14px; }
.fiscal-preview > div { display: grid; gap: 5px; }
.fiscal-preview span { color: var(--muted); font-size: 12px; }
.fiscal-preview b { width: max-content; margin-top: 4px; border-radius: 999px; padding: 4px 8px; font-size: 11px; }
.fiscal-preview b.ready { background: #dff2e7; color: #246747; }
.fiscal-preview b.not-ready { background: #f8dfdb; color: #8c3126; }
.order-mini-summary { border-top: 1px solid var(--line); padding-top: 12px; }
.order-mini-summary h3 { margin: 0 0 8px; font-size: 14px; }
.order-mini-summary ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.order-mini-summary li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.payment-badge.invoice_pending { background: #fff0d2; color: #82540d; }

.production-config-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.production-config-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; }
.production-config-card.inactive { opacity: .62; }
.production-config-card header, .production-config-card footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.production-config-card header span:first-child { color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.production-config-card h3 { margin: 3px 0 0; }
.production-config-metrics { margin: 14px 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.production-config-metrics span { border-radius: 6px; background: #f5f3ee; padding: 9px; color: var(--muted); font-size: 11px; }
.production-config-metrics strong { margin-top: 3px; display: block; color: var(--ink); font-size: 13px; }
.production-config-card p { min-height: 36px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.production-config-card footer { justify-content: flex-end; }
.production-config-card footer button { min-height: 33px; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 0 10px; cursor: pointer; }
.production-links > div { max-height: 310px; overflow: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.production-links label { min-height: 48px; border: 1px solid #e2ded6; border-radius: 6px; padding: 7px 9px; display: grid; grid-template-columns: auto 1fr 84px; gap: 8px; align-items: center; }
.production-links label > span { display: grid; font-size: 12px; font-weight: 750; }
.production-links label small { color: var(--muted); font-size: 10px; font-weight: 500; }
.production-links input[type="number"] { width: 84px; min-height: 34px; }

.laboratory-section { margin-bottom: 18px; }
.laboratory-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.laboratory-card { border: 1px solid var(--line); border-top: 4px solid #2b7658; border-radius: 8px; background: #fff; padding: 16px; }
.laboratory-card.status-attention { border-top-color: #c78d2c; }
.laboratory-card.status-produce { border-top-color: #d56435; }
.laboratory-card.status-exhausted { border-top-color: #a83226; }
.laboratory-card header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.laboratory-card header span { color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.laboratory-card h3 { margin: 3px 0 0; font-size: 20px; }
.laboratory-card header > b { border-radius: 999px; background: #e4f2ea; padding: 5px 9px; color: #246747; font-size: 11px; }
.status-attention header > b { background: #fff0d2; color: #82540d; }
.status-produce header > b, .status-exhausted header > b { background: #f8dfdb; color: #8c3126; }
.production-gauge { position: relative; height: 48px; margin: 14px 0; border-radius: 7px; overflow: hidden; background: #eeeae3; display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.production-gauge i { position: absolute; inset: 0 auto 0 0; width: var(--consumed); background: linear-gradient(90deg,#d96543,#eaa44e); opacity: .48; }
.production-gauge strong, .production-gauge span { position: relative; z-index: 1; }
.production-gauge strong { font-size: 20px; }
.production-gauge span { color: #524d46; font-size: 12px; }
.laboratory-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.laboratory-metrics span { border: 1px solid #ebe7df; border-radius: 6px; padding: 8px; color: var(--muted); font-size: 10px; }
.laboratory-metrics strong { margin-top: 4px; display: block; color: var(--ink); font-size: 13px; }
.laboratory-events { margin: 12px 0; display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.laboratory-events strong { color: var(--ink); font-weight: 650; }
.manual-override-note { border-left: 3px solid #ba572d; background: #fff3e9; padding: 6px 8px; color: #7d3d22; }
.laboratory-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.laboratory-actions button { min-height: 36px; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 0 10px; color: var(--ink); font-size: 11px; font-weight: 750; cursor: pointer; }
.laboratory-actions button:disabled { opacity: .45; cursor: not-allowed; }
.production-alert-strip { margin: 0 0 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.production-alert { min-height: 84px; border: 1px solid #e6c1b9; border-left: 5px solid var(--red); border-radius: 7px; background: #fff4f1; padding: 12px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.production-alert strong, .production-alert span { display: block; }
.production-alert span { margin-top: 3px; color: #7c4f44; font-size: 12px; }
.production-alert button { min-height: 34px; border: 1px solid #d49a43; border-radius: 5px; background: #fff; color: #794d11; padding: 0 10px; font-weight: 800; cursor: pointer; }
.production-alert.quiet { border-color: #d7e5db; border-left-color: var(--green); background: #f5fbf6; }
.production-lanes { margin-top: 4px; }
.production-batch-card { min-height: 148px; }
.settings-subtitle { margin: 4px 0 10px; display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.settings-subtitle strong { color: var(--ink); font-size: 13px; }
.production-history { display: grid; gap: 10px; }
.production-history article { position: relative; padding-left: 22px; display: grid; grid-template-columns: 1fr; }
.production-history article > i { position: absolute; left: 2px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.production-history article > div { display: grid; gap: 3px; }
.production-history span, .production-history p { margin: 0; color: var(--muted); font-size: 11px; }

.activity-item small { color: #948e84; font-size: 10px; word-break: break-all; }
.admin-tabs { max-height: calc(100vh - 96px); overflow-y: auto; }

@media (max-width: 1180px) {
  .settings-choice-grid { grid-template-columns: 1fr; }
  .settings-choice-grid .switch-field { min-height: 84px; }
  .laboratory-metrics { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 920px) {
  .admin-tabs { max-height: none; overflow-y: hidden; }
  .production-config-list, .laboratory-grid { grid-template-columns: 1fr; }
  .production-alert-strip { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar .shared-sync-status { width: 32px; padding: 0; justify-content: center; }
  .topbar .shared-sync-status span { display: none; }
  .form-grid.three-cols { grid-template-columns: 1fr; }
  .existing-customer-picker { grid-template-columns: 1fr; }
  .settings-card { padding: 13px; }
  .settings-subtitle { display: grid; }
  .floor-map { min-height: 470px; }
  .table-detail { min-height: 0; }
  .settings-footer, .invoice-operation-card header, .invoice-operation-card footer { align-items: stretch; flex-direction: column; }
  .settings-footer .primary-button { width: 100%; min-width: 0; }
  .invoice-operation-card footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .invoice-fiscal-line { display: grid; gap: 4px; }
  .production-config-metrics { grid-template-columns: 1fr; }
  .production-links > div { grid-template-columns: 1fr; }
  .laboratory-actions { display: grid; grid-template-columns: repeat(2,1fr); }
  .laboratory-actions button { width: 100%; }
}

@media (max-width: 420px) {
  .laboratory-metrics { grid-template-columns: 1fr 1fr; }
  .invoice-checkout-summary { grid-template-columns: 1fr; }
  .availability-action { min-height: 28px; font-size: 10px; }
}

/* Demo operativa: sessione, amministrazione e form */
select, textarea { font: inherit; color: inherit; }
button:disabled { opacity: .5; cursor: not-allowed !important; transform: none !important; box-shadow: none !important; }
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }

.terminal-identity strong, .terminal-identity span { display: block; white-space: nowrap; }
.terminal-identity strong { font-size: 12px; }
.terminal-identity span { color: #9f9b92; font-size: 11px; }
.topbar .shared-sync-status { margin-left: 0; min-height: 32px; max-width: 230px; border-color: #3a3730; background: #24221d; color: #d5d1c8; font-size: 11px; }
.topbar .shared-sync-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .shared-sync-status[data-tone="error"] { border-color: #6b2a1f; background: #3a1d17; color: #f3b3a6; }
.topbar .connection-chip { width: 34px; min-height: 34px; border-color: #3a3730; background: transparent; padding: 0; justify-content: center; color: #d5d1c8; }
.topbar .connection-chip i { display: none; }
.topbar .connection-chip::before { content: "\21BB"; font-size: 17px; line-height: 1; }
.topbar .connection-chip.offline { border-color: var(--amber); color: #f0c46e; }
.topbar .connection-chip:hover { background: #2a2722; color: white; }
.current-user-button { min-height: 38px; border: 1px solid #3a3730; border-radius: 7px; background: #24221d; color: white; padding: 3px 8px 3px 3px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.current-user-button:hover { background: #2a2722; }
.current-user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.current-user-button small, .current-user-button strong { display: block; }
.current-user-button small { color: #9f9b92; font-size: 10px; }
.current-user-button strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.current-user-button > b { color: #9f9b92; font-size: 14px; }
.view { min-height: calc(100vh - var(--topbar-offset)); }

.product-card .image-art { overflow: hidden; }
.product-card .image-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; display: block; }
.product-card .icon-art { display: grid; place-items: center; background: var(--accent); color: rgba(21,20,17,.68); font-size: 29px; font-weight: 800; }
.product-card:disabled { opacity: .62; filter: grayscale(.25); }
.order-actions { display: flex; gap: 18px; }
.order-context { margin: 0 0 12px; border-radius: 5px; background: #f4f1eb; padding: 9px 10px; display: grid; gap: 5px; }
.order-context span { color: var(--muted); font-size: 12px; }
.order-context b { color: var(--ink); }
.empty-inline, .board-empty { color: var(--muted); font-size: 13px; }
.board-empty { min-height: 118px; border: 1px dashed var(--line); border-radius: 6px; display: grid; place-items: center; }

.admin-header { align-items: center; }
.danger-button { min-height: 40px; border: 1px solid #e0b2a8; border-radius: 5px; background: #fff5f2; color: var(--red-dark); padding: 0 14px; font-weight: 700; cursor: pointer; }
.admin-shell { padding-top: 18px; display: grid; grid-template-columns: 218px minmax(0,1fr); gap: 18px; align-items: start; }
.admin-tabs { position: sticky; top: 76px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 7px; display: grid; gap: 3px; }
.admin-tabs button { min-height: 45px; border: 0; border-left: 3px solid transparent; border-radius: 5px; background: transparent; padding: 0 9px; display: flex; align-items: center; gap: 9px; text-align: left; color: var(--muted); cursor: pointer; font-size: 13px; }
.admin-tabs button span { width: 19px; color: #aaa49b; font-size: 10px; font-weight: 800; }
.admin-tabs button:hover { background: #f4f2ed; color: var(--ink); }
.admin-tabs button.active { border-left-color: var(--red); background: var(--ink); color: white; font-weight: 700; }
.admin-tabs button.active span { color: #ef8b79; }
.admin-panels { min-width: 0; }
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fade-in .18s ease; }
.panel-heading { min-height: 74px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel-heading h2 { margin: 2px 0 0; font-size: 23px; }
.panel-heading p:not(.eyebrow) { max-width: 650px; margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.admin-kpis { margin-top: 0; }
.admin-analytics { margin-bottom: 12px; }
.channel-list.large { padding: 13px 0 20px; gap: 14px; }
.channel-list.large div { font-size: 13px; }
.data-section { border: 1px solid var(--line); border-radius: 7px; background: white; padding: 15px; }
.data-section.flush { padding: 0 10px; }
.empty-state { min-height: 120px; padding: 30px; color: var(--muted); text-align: center; display: grid; place-items: center; font-size: 14px; }
.admin-toolbar { min-height: 64px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 9px; display: flex; align-items: end; gap: 9px; }
.admin-toolbar > label:not(.search-field) { min-width: 150px; display: grid; gap: 4px; }
.admin-toolbar > label > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.admin-toolbar input, .admin-toolbar select { min-height: 40px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 11px; }
.search-field.wide { flex: 1 1 260px; }
.admin-table { min-width: 940px; }
.admin-table th, .admin-table td { padding: 12px 9px; vertical-align: middle; }
.admin-table th { font-size: 11px; }
.admin-table td { font-size: 13px; }
.admin-table .action-column { text-align: right; }
.row-inactive { opacity: .65; }
.table-product { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 9px; min-width: 190px; }
.table-product > span { width: 36px; height: 36px; border-radius: 5px; background: var(--tile); display: grid; place-items: center; font-weight: 800; }
.table-status.off { color: #69645b; background: #e9e6df; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions button, .entity-card footer button, .entity-actions button, .role-pill button, .permission-matrix th button { min-height: 34px; border: 1px solid var(--line); border-radius: 4px; background: white; padding: 0 9px; cursor: pointer; font-size: 12px; }
.row-actions button + button, .entity-card footer button + button { margin-left: 5px; }
.payment-badge { border-radius: 3px; padding: 4px 7px; background: #e9e6df; font-size: 11px; font-weight: 700; }
.payment-badge.card { background: #e0edf2; color: #205f78; }
.payment-badge.cash { background: var(--green-soft); color: var(--green); }

.info-callout { margin-bottom: 13px; border: 1px solid #d6d0c5; border-left: 4px solid var(--blue); border-radius: 6px; background: #f7fbfc; padding: 11px 13px; display: flex; align-items: baseline; gap: 10px; }
.info-callout.strong { border-left-color: var(--red); background: #fff8f6; }
.info-callout strong { font-size: 13px; }
.info-callout span { color: var(--muted); font-size: 12px; }
.entity-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.entity-card { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 14px; }
.entity-card.inactive, .group-admin-card.inactive, .role-pill.inactive { opacity: .68; }
.entity-card header { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.entity-card h3, .group-admin-card h3 { margin: 0; font-size: 15px; }
.entity-card p, .group-admin-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.category-swatch { width: 40px; height: 40px; border-radius: 5px; background: var(--swatch); }
.avatar-card { width: 40px; height: 40px; border-radius: 50%; background: var(--avatar); color: white; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.entity-meta { min-height: 44px; margin-top: 12px; border-top: 1px solid #ece9e2; border-bottom: 1px solid #ece9e2; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.entity-meta strong { color: var(--ink); font-size: 14px; }
.entity-card footer { padding-top: 11px; display: flex; justify-content: flex-end; }
.danger-text { border-color: transparent !important; background: transparent !important; color: var(--red-dark) !important; }
.permission-chip-list { min-height: 48px; margin-top: 12px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; }
.permission-chip-list span { border-radius: 3px; background: #f0ede7; padding: 4px 6px; color: var(--muted); font-size: 10px; }

.group-admin-list { display: grid; gap: 10px; }
.group-admin-card { border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }
.group-admin-card > header { min-height: 72px; padding: 11px 13px; display: grid; grid-template-columns: auto minmax(150px,1fr) auto auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.group-order, .order-buttons { display: flex; gap: 4px; }
.group-order button, .order-buttons button { width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 4px; background: white; cursor: pointer; }
.entity-actions { display: flex; gap: 5px; }
.group-products { padding: 10px 13px 13px; }
.group-products-title { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.group-products ol { margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; list-style: none; }
.group-products li { min-height: 48px; border: 1px solid #ebe8e1; border-radius: 5px; background: #faf9f6; padding: 5px 6px; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 7px; }
.group-products li.unavailable { opacity: .58; }
.group-products li strong, .group-products li small { display: block; }
.group-products li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.group-products li small { color: var(--muted); font-size: 10px; }
.mini-product-color { width: 30px; height: 30px; border-radius: 4px; background: var(--tile); display: grid; place-items: center; font-size: 12px; font-weight: 800; }

.role-summary { margin-bottom: 10px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.role-pill { min-height: 65px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 8px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 5px; }
.role-pill strong, .role-pill span { display: block; }
.role-pill strong { font-size: 13px; }
.role-pill span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.permission-table-wrap { max-height: 620px; }
.permission-matrix { min-width: 850px; }
.permission-matrix thead { position: sticky; top: 0; z-index: 2; background: white; }
.permission-matrix th:not(:first-child), .permission-matrix td:not(:first-child) { text-align: center; }
.permission-matrix th button { font-weight: 800; }
.permission-matrix td:first-child { min-width: 250px; }
.permission-matrix td:first-child strong, .permission-matrix td:first-child small { display: block; }
.permission-matrix td:first-child strong { font-size: 12px; }
.permission-matrix td:first-child small { color: var(--muted); font-size: 10px; }
.permission-cell span { width: 25px; height: 25px; margin: auto; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.permission-cell .granted { background: var(--green-soft); color: var(--green); }
.permission-cell .denied { background: #efede8; color: #aaa59b; }
.inactive-column { opacity: .48; }

.record-count { border-radius: 4px; background: white; padding: 6px 9px; color: var(--muted); font-size: 12px; }
.activity-list { border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }
.activity-item { min-height: 66px; border-bottom: 1px solid #ebe8e1; padding: 9px 12px; display: grid; grid-template-columns: 36px minmax(0,1fr) 170px; align-items: center; gap: 10px; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 34px; height: 34px; border-radius: 5px; background: #edeae4; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.activity-icon.sale { background: var(--green-soft); color: var(--green); }
.activity-icon.payment { background: #dfeef4; color: var(--blue); }
.activity-icon.config { background: #f3e6e1; color: var(--red-dark); }
.activity-item > div:nth-child(2) strong, .activity-item > div:nth-child(2) span, .activity-item > div:last-child strong, .activity-item time { display: block; }
.activity-item > div:nth-child(2) strong { font-size: 13px; }
.activity-item > div:nth-child(2) span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.activity-item > div:last-child { text-align: right; }
.activity-item > div:last-child strong { font-size: 11px; }
.activity-item time { margin-top: 2px; color: var(--muted); font-size: 10px; }

.editor-modal { width: min(760px,100%); }
.editor-body { margin-top: 18px; display: grid; gap: 15px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two-cols { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-field { min-width: 0; display: grid; gap: 5px; }
.form-field > span, .checkbox-group legend { color: #4d4942; font-size: 12px; font-weight: 700; }
.form-field input:not([type="checkbox"]), .form-field select, .form-field textarea { width: 100%; min-height: 43px; border: 1px solid #cfcac0; border-radius: 5px; background: white; padding: 9px 10px; }
.form-field input[type="color"] { height: 43px; padding: 4px; }
.form-field textarea { resize: vertical; line-height: 1.4; }
.field-hint { color: var(--muted); font-size: 10px; }
.form-field.field-invalid input, .form-field.field-invalid select, .form-field.field-invalid textarea, [aria-invalid="true"] { border-color: var(--red) !important; background: #fff7f5 !important; }
.checkbox-group { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 6px; padding: 11px; }
.checkbox-group legend { padding: 0 5px; }
.check-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.check-grid label { min-height: 40px; border: 1px solid #e5e1da; border-radius: 4px; padding: 6px 8px; display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.check-grid label > span { width: 9px; height: 25px; border-radius: 2px; background: var(--check-color); }
.switch-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.switch-field { min-height: 62px; border: 1px solid var(--line); border-radius: 6px; padding: 9px; display: grid; grid-template-columns: 39px minmax(0,1fr); align-items: center; gap: 9px; cursor: pointer; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control { width: 38px; height: 22px; border-radius: 12px; background: #c9c4ba; position: relative; transition: .15s; }
.switch-control::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .15s; }
.switch-field input:checked + .switch-control { background: var(--green); }
.switch-field input:checked + .switch-control::after { transform: translateX(16px); }
.switch-field strong, .switch-field small { display: block; }
.switch-field strong { font-size: 12px; }
.switch-field small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.product-preview-wrap { border-radius: 7px; background: #edeae4; padding: 11px; display: grid; grid-template-columns: minmax(0,1fr) 180px; align-items: center; gap: 14px; }
.product-preview-wrap > div:first-child span, .product-preview-wrap > div:first-child small { display: block; }
.product-preview-wrap > div:first-child span { font-size: 13px; font-weight: 700; }
.product-preview-wrap > div:first-child small { margin-top: 3px; color: var(--muted); }
.preview-card { width: 180px; min-height: 145px; pointer-events: none; }
.form-error { margin-top: 13px; border-left: 4px solid var(--red); border-radius: 4px; background: #fff2ef; padding: 10px 12px; color: #862717; font-size: 12px; }
.form-error strong { display: block; }
.form-error ul { margin: 5px 0 0; padding-left: 18px; }

.assignment-list { max-height: 330px; margin-top: 8px; overflow-y: auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.product-assignment > p { margin: 0; color: var(--muted); font-size: 11px; }
.assignment-product { min-height: 53px; border: 1px solid #e7e3dc; border-radius: 5px; padding: 5px 7px; display: grid; grid-template-columns: auto 30px minmax(0,1fr) auto; align-items: center; gap: 7px; cursor: pointer; }
.assignment-product > span:nth-of-type(2) strong, .assignment-product > span:nth-of-type(2) small { display: block; }
.assignment-product > span:nth-of-type(2) strong { font-size: 11px; }
.assignment-product > span:nth-of-type(2) small { color: var(--muted); font-size: 9px; }
.assignment-product i { font-style: normal; }
.role-choice-list { display: grid; gap: 6px; }
.role-choice { min-height: 57px; border: 1px solid #e4e0d8; border-radius: 5px; padding: 7px 9px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; cursor: pointer; }
.role-choice.inactive { opacity: .55; }
.role-choice strong, .role-choice small { display: block; }
.role-choice strong { font-size: 12px; }
.role-choice small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.role-choice i { color: var(--muted); font-size: 10px; font-style: normal; }
.permission-editor-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.permission-group { border: 1px solid #e6e2da; border-radius: 5px; padding: 8px; }
.permission-group h3 { margin: 0 0 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.permission-group label { min-height: 42px; border-top: 1px solid #eeeae4; padding: 5px 2px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; cursor: pointer; }
.permission-group label:first-of-type { border-top: 0; }
.permission-group strong, .permission-group small { display: block; }
.permission-group strong { font-size: 11px; }
.permission-group small { color: var(--muted); font-size: 9px; }
.plan-form { display: grid; gap: 8px; }
.plan-form fieldset { border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.plan-form legend { font-size: 12px; font-weight: 800; }

.user-switcher-modal { width: min(680px,100%); }
.modal-intro { margin: 8px 0 15px; color: var(--muted); font-size: 13px; }
.user-picker-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.user-pick-card { min-height: 128px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.user-pick-card:hover, .user-pick-card.selected { border-color: var(--ink); box-shadow: 0 7px 18px rgba(21,20,17,.08); }
.user-pick-card > span, .pin-user > span { width: 46px; height: 46px; border-radius: 50%; background: var(--avatar); color: white; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.user-pick-card strong { margin-top: 9px; font-size: 13px; }
.user-pick-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.pin-panel { max-width: 320px; margin: 0 auto; }
.pin-user { margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 9px; }
.pin-user strong, .pin-user small { display: block; }
.pin-user strong { font-size: 14px; }
.pin-user small { color: var(--muted); font-size: 10px; }
.pin-dots { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.pin-dots i { width: 12px; height: 12px; border: 2px solid #aaa49a; border-radius: 50%; }
.pin-dots i.filled { border-color: var(--ink); background: var(--ink); }
.pin-error { margin-bottom: 8px; color: var(--red-dark); text-align: center; font-size: 12px; }
.pin-keypad { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.pin-keypad button { min-height: 54px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 19px; font-weight: 700; cursor: pointer; }
.pin-keypad button:active { background: #eae6df; }
.pin-submit { width: 100%; margin-top: 8px; }
.pin-change { width: 100%; padding-block: 9px; text-align: center; }
.switcher-footer { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 11px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.switcher-footer button { min-height: 34px; border: 0; cursor: pointer; }
.switcher-footer details { color: var(--muted); text-align: right; font-size: 11px; }
.switcher-footer summary { cursor: pointer; font-weight: 700; }
.switcher-footer p { margin: 4px 0 0; }
.toast[data-tone="error"] { background: #8e2d20; }

@media (max-width: 1180px) {
  .admin-shell { grid-template-columns: 185px minmax(0,1fr); gap: 12px; }
  .entity-grid { grid-template-columns: 1fr; }
  .role-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .group-admin-card > header { grid-template-columns: auto minmax(150px,1fr) auto; }
  .group-admin-card .entity-actions { grid-column: 2 / -1; justify-content: flex-end; }
}
@media (max-width: 920px) {
  .admin-shell { display: block; }
  .admin-tabs { position: sticky; top: var(--topbar-offset); z-index: 15; margin-bottom: 14px; display: flex; overflow-x: auto; scrollbar-width: none; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs button { flex: 0 0 auto; min-height: 42px; border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
  .admin-tabs button.active { border-bottom-color: var(--red); }
  .admin-analytics { grid-template-columns: 1fr; }
  .group-products ol { grid-template-columns: 1fr; }
  .activity-item { grid-template-columns: 36px minmax(0,1fr) 140px; }
}
@media (max-width: 620px) {
  .brand-mark { width: 28px; height: 28px; font-size: 16px; }
  .current-user-button > span:nth-child(2) { min-width: 0; }
  .current-user-button small { display: none; }
  .current-user-button strong { max-width: 110px; }
  .admin-header { display: block; }
  .admin-header .header-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; }
  .panel-heading { display: block; }
  .panel-heading > button, .panel-heading > .segmented { width: 100%; margin-top: 12px; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar > label:not(.search-field) { min-width: 0; }
  .info-callout { align-items: flex-start; flex-direction: column; gap: 3px; }
  .role-summary { grid-template-columns: 1fr; }
  .group-admin-card > header { grid-template-columns: auto minmax(0,1fr) auto; }
  .group-admin-card .entity-actions { grid-column: 1 / -1; justify-content: stretch; }
  .group-admin-card .entity-actions button { flex: 1; }
  .activity-item { grid-template-columns: 34px minmax(0,1fr); }
  .activity-item > div:last-child { grid-column: 2; text-align: left; display: flex; gap: 8px; }
  .form-grid.two-cols, .switch-grid, .permission-editor-grid, .assignment-list { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .product-preview-wrap { grid-template-columns: 1fr; }
  .preview-card { width: 100%; }
  .user-picker-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .user-pick-card { min-height: 116px; }
  .editor-modal, .user-switcher-modal { max-height: calc(100vh - 20px); }
  .plan-form fieldset { grid-template-columns: 1fr; }
  .switcher-footer { align-items: stretch; flex-direction: column; }
  .switcher-footer details { text-align: left; }
  #view-architecture { overflow-x: clip; }
  #view-architecture .decision-table-wrap { width: 100%; max-width: calc(100vw - 22px); min-width: 0; contain: inline-size; }
}
@media (max-width: 420px) {
  .admin-header .header-actions { grid-template-columns: 1fr; }
  .entity-card header { grid-template-columns: 40px minmax(0,1fr); }
  .entity-card header .table-status { grid-column: 2; justify-self: start; }
  .entity-meta { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 7px; }
  .check-grid, .user-picker-grid { grid-template-columns: 1fr; }
  .user-pick-card { min-height: 96px; display: grid; grid-template-columns: 46px minmax(0,1fr); grid-template-rows: auto auto; text-align: left; column-gap: 10px; }
  .user-pick-card > span { grid-row: 1 / 3; }
  .user-pick-card strong { margin-top: 0; }
  .user-pick-card small { margin-top: 0; }
  .activity-item > div:nth-child(2) span { word-break: break-word; }
}

/* App nativa (Capacitor) e PWA a schermo intero: rispetta notch e barre di sistema. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
.topbar { padding-top: env(safe-area-inset-top, 0px); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.workspace { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
@media (max-width: 920px) {
  .topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
}

/* Filiera: ricette e magazzino */
@media (max-width: 1440px) { .topbar .terminal-identity { display: none; } }
@media (max-width: 1320px) { .topbar .shared-sync-status { max-width: 150px; } }
.editor-modal.wide { width: min(1080px, 100%); }
.supply-tabs { margin: 14px 0 12px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.supply-tabs::-webkit-scrollbar { display: none; }
.supply-tabs button { flex: 0 0 auto; min-height: 44px; border: 0; border-bottom: 3px solid transparent; background: none; padding: 0 12px; color: var(--muted); font-weight: 700; cursor: pointer; }
.supply-tabs button.active { border-bottom-color: var(--red); color: var(--ink); }
.supply-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
#recipesRoot, .supply-layout.nested { padding-top: 14px; grid-template-columns: 290px minmax(0, 1fr); align-items: start; }
.supply-list-panel { position: sticky; top: calc(var(--topbar-offset) + 12px); max-height: calc(100vh - var(--topbar-offset) - 26px); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }
.supply-list { overflow-y: auto; }
.supply-list-item { width: 100%; min-height: 54px; border: 0; border-bottom: 1px solid #efece6; border-left: 3px solid transparent; background: white; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.supply-list-item strong, .supply-list-item small { display: block; }
.supply-list-item strong { font-size: 14px; }
.supply-list-item small { color: var(--muted); font-size: 11px; }
.supply-list-item:hover { background: #faf8f4; }
.supply-list-item.active { border-left-color: var(--red); background: #f6f3ed; }
.supply-list-item.inactive { opacity: .6; }
.supply-toolbar { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.supply-toolbar.stacked { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; flex-direction: column; align-items: stretch; }
.supply-toolbar.stacked .search-field { flex: 0 0 auto; }
.supply-toolbar .search-field { flex: 1 1 240px; }
.supply-toolbar select { min-height: 40px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 10px; }
.toolbar-note { margin: 4px; color: var(--muted); font-size: 13px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.supply-detail { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 18px; }
.supply-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.supply-detail-head h2 { margin: 2px 0 6px; font-size: 24px; }
.header-actions.wrap { flex-wrap: wrap; justify-content: flex-end; max-width: 560px; }
.supply-description { margin: 6px 0; color: var(--muted); font-size: 13px; }
.muted-inline { color: var(--muted); font-size: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; }
.supply-chip { border-radius: 999px; background: #efece6; padding: 3px 8px; color: var(--ink-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
.supply-chip.vegan { background: var(--green-soft); color: var(--green); }
.supply-chip.allergen { background: #fbeee0; color: #8a4b12; }
.supply-chip.muted { background: #ece9e3; color: var(--muted); }
button.supply-chip { min-height: 30px; border: 1px solid transparent; cursor: pointer; }
.supply-chip.action { border-color: #c7dbe4; background: #eef6f9; color: var(--blue); }
.supply-chip.create { border-color: #e7c2b9; background: #fff4f1; color: var(--red-dark); }
.supply-kpis { margin: 14px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.supply-kpis.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.supply-kpis article { min-height: 86px; border: 1px solid var(--line); border-radius: 7px; background: white; padding: 12px; }
.supply-kpis article.warning { border-color: #e6cf98; background: #fffaf0; }
.supply-kpis article.danger { border-color: #e6b6ac; background: #fff4f1; }
.supply-kpis small, .supply-kpis span { display: block; color: var(--muted); font-size: 12px; }
.supply-kpis strong { display: block; margin: 5px 0 3px; font-size: 21px; line-height: 1.1; }
.supply-table td small { display: block; color: var(--muted); font-size: 11px; }
.supply-table tr.low td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.supply-table tr.out td:first-child, .compact-table tr.out td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.supply-table tr.inactive { opacity: .55; }
.admin-table td.numeric, .admin-table th.numeric, .recipe-table .numeric { text-align: right; white-space: nowrap; }
.compact-table { min-width: 640px; }
.compact-table th, .compact-table td { padding: 8px 7px; font-size: 12px; }
.compact-table td small { display: block; color: var(--muted); }
.compact-table .group-row th { background: #f6f3ed; text-align: left; font-size: 11px; text-transform: uppercase; }
.negative { color: var(--red-dark) !important; }
.positive { color: var(--green) !important; }
.stock-badge { display: inline-block; margin: 1px 4px 1px 0; border-radius: 3px; padding: 3px 6px; font-size: 10px; font-weight: 800; }
.stock-badge.ok { background: var(--green-soft); color: var(--green); }
.stock-badge.low { background: #f6e7c4; color: #7b5810; }
.stock-badge.out { background: #f8dcd5; color: #8e2d20; }
.stock-badge.untracked { background: #ece9e3; color: var(--muted); }
.stock-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #b8b3a8; }
.stock-dot.ok { background: #53b77f; }
.stock-dot.short { background: var(--red); }
.link-button { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; text-align: left; text-decoration: underline; text-decoration-color: #cfc9be; text-underline-offset: 3px; cursor: pointer; }
.link-button:hover { color: var(--red); }
.recipe-link, .supply-detail a, .laboratory-card a, .production-config-recipe a { color: var(--blue); font-weight: 700; }
.recipe-scale { margin: 6px 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.recipe-scale input { width: 90px; min-height: 36px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; }
.recipe-scale button { min-height: 36px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 10px; cursor: pointer; }
.recipe-scale button.active { border-color: var(--ink); background: var(--ink); color: white; }
.recipe-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.recipe-phase { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; }
.recipe-phase.alternative { border-style: dashed; background: #fcfbf8; }
.recipe-phase header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recipe-phase h3, .recipe-procedure h3, .recipe-links h3 { margin: 0 0 6px; font-size: 15px; }
.recipe-table { width: 100%; border-collapse: collapse; }
.recipe-table th { color: var(--muted); font-size: 11px; text-align: left; padding: 4px 10px 4px 0; }
.recipe-table td { border-top: 1px solid #efece6; padding: 7px 10px 7px 0; font-size: 13px; vertical-align: top; }
.recipe-table td small { display: block; color: var(--muted); font-size: 11px; }
.phase-instructions, .recipe-procedure p { margin: 8px 0 0; color: var(--ink-soft); font-size: 13px; white-space: pre-line; }
.recipe-procedure, .recipe-links { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.recipe-links p { margin: 4px 0; font-size: 13px; }
.recipe-editor-phases { display: grid; gap: 10px; }
.recipe-editor-phase { border: 1px solid var(--line); border-radius: 7px; background: #fcfbf8; padding: 10px; }
.phase-head { margin-bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) 200px 38px; gap: 6px; }
.phase-head input, .phase-head select, .recipe-line input, .recipe-line select, .phase-instructions-input, .receipt-line input, .count-input, .rl-ingredient select { min-height: 38px; border: 1px solid var(--line); border-radius: 5px; background: white; padding: 0 8px; font: inherit; font-size: 13px; }
.phase-name { font-weight: 700; }
.phase-lines { display: grid; gap: 6px; }
.recipe-line { display: grid; grid-template-columns: minmax(180px, 1fr) 96px 70px 60px minmax(90px, .6fr) 34px; align-items: center; gap: 6px; }
.recipe-line .line-help, .rl-ingredient { grid-column: 1 / -1; }
.line-qb { display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; }
.line-help { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.line-help.error { color: var(--red-dark); }
.phase-instructions-input { width: 100%; min-height: 50px; margin-top: 8px; padding: 8px; resize: vertical; }
.icon-button.small { width: 34px; height: 34px; font-size: 18px; }
.recipe-editor-toolbar { margin: 10px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.inline-ingredient { margin: 10px 0; border: 1px solid #e7c2b9; border-radius: 7px; background: #fff8f6; padding: 12px; }
.inline-actions { display: flex; justify-content: flex-end; gap: 8px; }
.receipt-lines-head, .receipt-line { display: grid; grid-template-columns: minmax(200px, 1fr) 76px 96px 120px 140px 34px; gap: 6px; align-items: center; }
.receipt-lines-head { margin-top: 12px; color: var(--muted); font-size: 11px; font-weight: 700; }
#receiptLines { display: grid; gap: 8px; }
.rl-ingredient { min-height: 18px; color: var(--muted); font-size: 12px; }
.rl-ingredient .unlinked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #7b5810; }
.receipt-total { margin: 8px 0; font-weight: 800; text-align: right; }
.acceptance-checks { margin: 6px 0; }
.inventory-count-table { max-height: 52vh; overflow-y: auto; }
.count-input { width: 110px; text-align: right; }
.score-bar { width: 90px; height: 6px; border-radius: 3px; background: #ece9e3; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: var(--green); }
.modal-section-title { margin: 16px 0 6px; font-size: 14px; }
.section-heading { margin: 18px 0 8px; font-size: 18px; }
.plain-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.import-errors { margin: 0 0 10px; padding-left: 18px; color: var(--red-dark); font-size: 12px; }
.info-callout .secondary-button { margin-left: auto; }
.info-callout.warning { border-left-color: var(--amber); background: #fffaf0; }
.stock-preview-list { margin: 0 0 12px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; font-size: 12px; }
.stock-preview-list li { display: flex; gap: 6px; justify-content: space-between; border-bottom: 1px dashed #e6e2da; padding: 3px 0; }
.stock-preview-list li small { color: var(--red-dark); }
.stock-preview-list li.short { color: var(--red-dark); }
.recipe-link-fieldset p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.production-config-recipe { font-size: 12px; }
@media (max-width: 1180px) {
  #recipesRoot, .supply-layout.nested { grid-template-columns: 240px minmax(0, 1fr); }
  .supply-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  #recipesRoot, .supply-layout.nested { grid-template-columns: 1fr; }
  .supply-list-panel { position: static; max-height: 300px; }
  .supply-detail-head { flex-direction: column; }
  .header-actions.wrap { justify-content: flex-start; max-width: none; }
  .recipe-line { grid-template-columns: minmax(0, 1fr) 80px 64px; }
  .receipt-lines-head { display: none; }
  .receipt-line { grid-template-columns: minmax(0, 1fr) 70px 90px; }
}
@media (max-width: 620px) {
  .supply-kpis, .supply-kpis.compact { grid-template-columns: 1fr 1fr; }
  .supply-detail { padding: 12px; }
  .recipe-phases { grid-template-columns: 1fr; }
  .phase-head { grid-template-columns: minmax(0, 1fr) 38px; }
  .phase-head select { grid-column: 1 / -1; grid-row: 2; }
}
.supply-detail-head.stacked { flex-direction: column; }
.supply-detail-head.stacked .header-actions.wrap { justify-content: flex-start; max-width: none; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.option-grid label { min-height: 40px; border: 1px solid #e5e1da; border-radius: 4px; padding: 6px 8px; display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.option-grid.acceptance-checks { margin: 6px 0; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 620px) {
  #view-recipes .workspace-header, #view-warehouse .workspace-header { flex-direction: column; align-items: stretch; }
  #view-recipes .header-actions, #view-warehouse .header-actions { flex-wrap: wrap; }
  #view-recipes .header-actions button, #view-warehouse .header-actions button { flex: 1 1 140px; }
}

/* Allineamento dei form. Nelle griglie a colonne etichetta, campo e descrizione
   di ogni campo condividono le stesse righe (subgrid): gli input restano sulla
   stessa linea anche se un'etichetta va a capo o solo alcuni campi hanno una
   descrizione, e nessun campo viene stirato all'altezza del vicino. */
.form-grid { align-items: start; }
.form-field { align-content: start; }
.form-field > span { align-self: end; line-height: 1.3; }
.field-hint { font-size: 11px; line-height: 1.35; }
@supports (grid-template-rows: subgrid) {
  .form-grid.two-cols > .form-field, .form-grid.three-cols > .form-field { grid-row: span 3; grid-template-rows: subgrid; row-gap: 5px; }
}
.form-field input:not([type="checkbox"]), .form-field select { height: 43px; }
.form-field input:disabled, .form-field select:disabled { background: #f3f1ec; color: var(--muted); }
.fieldset-hint { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.recipe-link-fieldset { display: grid; gap: 12px; }
.recipe-link-fieldset .fieldset-hint { margin: 0; }
.recipe-link-summary { border-radius: 6px; background: #f4f1eb; padding: 10px 12px; display: grid; gap: 3px; font-size: 13px; }
.recipe-link-summary span { color: var(--muted); font-size: 12px; }
.header-actions { flex-wrap: wrap; }
.header-actions > button, .row-actions button { white-space: nowrap; }
.row-actions button { vertical-align: middle; }
.supply-toolbar .search-field input, .supply-toolbar select { height: 40px; }
.admin-table td { vertical-align: middle; }
.supply-table { min-width: 0; }
.supply-table th { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.recipe-line input, .recipe-line select, .receipt-line input, .phase-head input, .phase-head select { height: 40px; }

/* Ordini ai fornitori: bozze per fornitore, consegne programmate, storico. */
.supply-tabs .tab-count { min-width: 20px; margin-left: 4px; border-radius: 999px; background: var(--red); padding: 1px 6px; color: white; font-size: 11px; display: inline-block; text-align: center; }
.supply-list-group { margin: 0; border-bottom: 1px solid #efece6; background: #f6f3ed; padding: 7px 12px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.supply-list-empty { margin: 0; border-bottom: 1px solid #efece6; padding: 10px 12px; color: var(--muted); font-size: 12px; }
.supply-list-item .stock-badge, .supply-list-item .table-status { flex: 0 0 auto; }
.supply-chip.order { margin-top: 4px; display: inline-block; background: #eef6f9; color: var(--blue); }
.order-delivery { margin: 2px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.order-delivery .stock-badge { margin: 0; }
.order-lines tfoot td { border-bottom: 0; background: #faf8f4; font-size: 13px; }
.order-lines tfoot td small { font-size: 11px; }
.order-lines .row-actions .icon-button.small { display: inline-grid; }
a.secondary-button { color: var(--ink); display: inline-flex; align-items: center; font-size: 14px; text-decoration: none; }
.row-actions .order-button:not(:disabled) { border-color: var(--ink); background: var(--ink); color: white; font-weight: 700; }
.order-shortcut { border-color: #c7dbe4 !important; background: #eef6f9 !important; color: var(--blue); }
.qty-stepper { justify-self: start; display: inline-flex; align-items: stretch; border: 1px solid #cfcac0; border-radius: 5px; background: white; overflow: hidden; }
.qty-stepper button { width: 38px; min-height: 40px; border: 0; background: #f6f3ed; font-size: 18px; font-weight: 700; cursor: pointer; }
.qty-stepper button:disabled { color: #bdb8ae; cursor: default; }
.qty-stepper input { width: 64px; min-height: 40px; border: 0; border-left: 1px solid #e5e1da; border-right: 1px solid #e5e1da; padding: 0 6px; font: inherit; font-weight: 700; text-align: center; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.qty-stepper input:disabled { background: #f3f1ec; color: var(--muted); }
.qty-stepper.large button { width: 48px; min-height: 48px; font-size: 22px; }
.qty-stepper.large input { width: 90px; min-height: 48px; font-size: 20px; }
.order-item-facts { margin: 10px 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.order-item-facts article { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px; }
.order-item-facts article.warning { border-color: #e6cf98; background: #fffaf0; }
.order-item-facts small, .order-item-facts span { display: block; color: var(--muted); font-size: 12px; }
.order-item-facts strong { display: block; margin: 3px 0; font-size: 17px; }
.order-qty-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }
.order-estimate { min-height: 86px; border-radius: 7px; background: #f4f1eb; padding: 10px 14px; }
.order-estimate small, .order-estimate span { display: block; color: var(--muted); font-size: 12px; }
.order-estimate strong { display: block; margin: 2px 0; font-size: 24px; }
.catalog-toolbar { margin: 12px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.catalog-toolbar .search-field { flex: 1 1 240px; }
.catalog-table { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; }
.catalog-table thead th { position: sticky; top: 0; z-index: 1; background: white; }
.catalog-qty { width: 76px; min-height: 38px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; font: inherit; font-weight: 700; text-align: right; }
.receipt-order-hint .info-callout { margin: 8px 0 12px; flex-wrap: wrap; }
.receipt-order-hint .info-callout span { display: flex; flex-wrap: wrap; gap: 6px; }
.rl-ordered { margin-right: 8px; border-radius: 3px; background: #eef6f9; padding: 2px 6px; color: var(--blue); font-weight: 700; }
.rl-ordered.differs { background: #f6e7c4; color: #7b5810; }
.order-text { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 10px; font: inherit; font-size: 13px; }
@media (max-width: 620px) {
  .order-qty-row { grid-template-columns: 1fr; }
  .order-lines { min-width: 720px; }
}
.supply-table td small.in-draft { color: var(--blue); }
.order-supplier-choice { margin: 0 0 10px; border: 0; padding: 0; display: grid; gap: 6px; }
.order-supplier-choice legend { margin-bottom: 6px; color: #4d4942; font-size: 12px; font-weight: 700; }
.order-supplier-choice label { min-height: 48px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.order-supplier-choice label.active { border-color: var(--ink); background: #f6f3ed; }
.order-supplier-choice .choice-text { flex: 1 1 auto; }
.order-supplier-choice strong, .order-supplier-choice small { display: block; }
.order-supplier-choice small { color: var(--muted); font-size: 12px; }
/* Righe DDT su tablet e telefono: articolo su una riga, poi colli, prezzo,
   lotto e scadenza con spazio sufficiente per la data. */
.receipt-line .rl-item { grid-area: item; } .receipt-line .rl-packages { grid-area: packages; } .receipt-line .rl-price { grid-area: price; }
.receipt-line .rl-lot { grid-area: lot; } .receipt-line .rl-expiry { grid-area: expiry; } .receipt-line [data-remove-receipt-line] { grid-area: remove; } .receipt-line .rl-ingredient { grid-area: ing; }
.receipt-line { grid-template-areas: "item packages price lot expiry remove" "ing ing ing ing ing ing"; }
@media (max-width: 920px) {
  .receipt-line { grid-template-columns: 72px 96px minmax(0, 1fr) 150px 34px; grid-template-areas: "item item item item item" "packages price lot expiry remove" "ing ing ing ing ing"; }
}
@media (max-width: 620px) {
  .receipt-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "item item remove" "packages price price" "lot expiry expiry" "ing ing ing"; }
}
/* Ordini: a sinistra solo gli ordini aperti, in due riquadri distinti; lo
   storico ha una vista a parte con ricerca, filtro per fornitore e pagine. */
.order-sidebar { position: sticky; top: calc(var(--topbar-offset) + 12px); max-height: calc(100vh - var(--topbar-offset) - 26px); min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.order-groups { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 16px; }
.order-group, .order-history-panel { border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }
.order-group-head { margin: 0; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.order-group-head span { min-width: 22px; border-radius: 999px; padding: 1px 7px; color: white; font-size: 11px; text-align: center; }
.order-group.to-send { border-color: #e6cf98; }
.order-group.to-send .order-group-head { border-bottom: 1px solid #efdcae; background: #fbefd2; color: #7b5810; }
.order-group.to-send .order-group-head span { background: var(--amber); }
.order-group.in-delivery { border-color: #b9d6e3; }
.order-group.in-delivery .order-group-head { border-bottom: 1px solid #cfe3ec; background: #e4f0f6; color: #1f6485; }
.order-group.in-delivery .order-group-head span { background: var(--blue); }
.order-group .supply-list-item:last-child, .order-group .supply-list-empty:last-child { border-bottom: 0; }
.order-history-button { width: 100%; min-height: 46px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; }
.order-history-count { border-radius: 999px; background: #efece6; padding: 1px 8px; color: var(--muted); font-size: 12px; }
.order-history-count:empty { display: none; }
.order-history-panel { min-height: 0; display: flex; flex-direction: column; }
.order-history-head { border-bottom: 1px solid var(--line); padding: 8px; display: flex; align-items: center; gap: 10px; }
.order-history-head .secondary-button { min-height: 36px; padding: 0 10px; font-size: 13px; }
.order-history-panel .supply-list { min-height: 0; flex: 1 1 auto; }
.order-history-more { width: 100%; min-height: 44px; border: 0; background: #faf8f4; color: var(--blue); font-weight: 700; cursor: pointer; }
@media (max-width: 920px) {
  .order-sidebar { position: static; max-height: none; }
  .order-groups { max-height: 460px; }
  .order-history-panel .supply-list { max-height: 360px; }
}
