/* ==========================================================================
   Malvern POS type pages (October 2026): Tables, Kitchen / Barista queue,
   Online orders, Reservations, Staff time, Purchase orders, Stock counts,
   Waste & expiry, News rounds and Services. One grammar everywhere:
   the list or board on the left, one side panel on the right, a filter row,
   whole-row targets of 48 px or more, and status as text plus a chip.
   Uses only semantic tokens, so every brand palette and interface style applies.
   ========================================================================== */
.workflow-view.fit-view .tw-split { grid-template-columns: minmax(0, 1fr) minmax(330px, 392px); gap: 12px; }
.workflow-view.fit-view .rd-rounds.tw-split, .workflow-view.fit-view .rd-services { grid-template-columns: minmax(0, 1fr) minmax(330px, 392px); }
.rd-services > .workflow-split-sidebar { order: 2; }
.tw-main { gap: 10px; padding: 14px 16px; }
.tw-main-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; margin: 0; }
.tw-head h2 { white-space: nowrap; display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.tw-head-actions, .tw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tw-head-actions .button, .tw-actions .button { min-height: 44px; padding: 0 14px; }
.tw-actions { margin: 4px 0 2px; }
.tw-actions .button.primary { min-height: 52px; padding: 0 20px; }
.tw-filter { flex: none; align-self: flex-start; max-width: 100%; overflow: hidden; }
.tw-filter button { min-height: 40px; }
.tw-sub { margin: 12px 0 6px; color: var(--color-text-muted); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tw-note, .tw-empty { margin: 0; color: var(--color-text-muted); font-size: 13px; }
.tw-empty { padding: 14px 4px; text-align: center; }
.tw-danger, .button.tw-danger, .mini-button.tw-danger { color: var(--color-danger) !important; border-color: var(--color-danger) !important; }
.tw-mono, .tw-money, .tw-qty, .tw-ticket-no, .tw-age, .tw-total strong, .tw-row-time strong, .tw-table-total { font-family: "Geist Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.tw-money.bad, .tw-dl .bad { color: var(--color-danger); }

/* Side panel */
.tw-side { gap: 10px; }
.workflow-view.fit-view .tw-side { overflow: hidden; padding: 12px; }
.tw-panel-tabs { flex: none; }
.tw-panel-tabs button { min-height: 44px; }
.tw-wrap { flex-wrap: wrap; }
.tw-wrap > * { flex: 1 1 auto; }
.tw-pane { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 2px 2px 8px; }
.tw-retrieval { display: flex; flex: none; align-items: center; gap: 8px; }
.tw-retrieval > .field:first-child { flex: 1; min-width: 0; }
.tw-retrieval > .field:nth-child(2) { width: 80px; }
.tw-retrieval [role="status"] { font-size: 12px; color: var(--color-text-muted); }
.tw-lines.fit-list { min-height: 0; overflow: hidden; }
.round-forms > [data-work-form], .round-forms > .tw-mini-list, .round-forms > .tw-result { flex: none; }
.round-forms { overflow: hidden !important; min-height: 0; }
.tw-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tw-detail-head h2 { margin: 2px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.tw-detail-head .eyebrow { margin: 0; }
.tw-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tw-facts > span { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border-radius: 999px; background: var(--color-surface-subtle); font-size: 12.5px; }
.tw-lines { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--color-border); }
.tw-lines li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; min-height: 44px; padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 14px; }
.tw-lines li small { display: block; color: var(--color-text-muted); font-size: 12px; }
.tw-qty { font-weight: 700; }
.tw-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; padding: 4px 0; font-weight: 600; }
.tw-total strong { font-size: 24px; letter-spacing: -.02em; }
.tw-more { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.tw-more > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; font-weight: 650; cursor: pointer; list-style: none; }
.tw-more > summary::-webkit-details-marker { display: none; }
.tw-more > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform 140ms cubic-bezier(.2, 0, 0, 1); }
.tw-more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.tw-more > form { padding: 0 14px 14px; }
.tw-more .workflow-form h2 { display: none; }
.tw-check { display: flex; align-items: center; gap: 10px; min-height: 44px; grid-column: 1 / -1; font-size: 14px; }
.tw-check input { width: 22px; height: 22px; }
.tw-result { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--color-info); border-radius: 12px; background: var(--color-info-bg); }
.tw-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tw-result p { margin: 0; font-size: 14px; }
.tw-mini-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--color-border); }
.tw-mini-list li { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.tw-mini-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tw-mini-list small { color: var(--color-text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.tw-dl dd { margin: 0; text-align: right; font-family: "Geist Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.tw-small-table { width: 100%; font-size: 13px; }
.tw-small-table td small { display: block; color: var(--color-text-muted); }
.tw-ticket-text { margin: 0; padding: 10px; overflow: auto; max-height: 220px; border-radius: 8px; background: var(--color-surface); font: 12px/1.45 "Geist Mono", ui-monospace, monospace; white-space: pre-wrap; }
.tw-days { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.tw-days legend { width: 100%; margin-bottom: 4px; font-size: 12px; font-weight: 600; }
.tw-day { position: relative; }
.tw-day input { position: absolute; opacity: 0; }
.tw-day span { display: inline-grid; place-items: center; min-width: 48px; min-height: 44px; border: 1px solid var(--color-control-border); border-radius: 10px; font-weight: 600; font-size: 13px; }
.tw-day input:checked + span { background: var(--color-brand); color: #FFFFFF; border-color: var(--color-brand); }
.tw-day input:focus-visible + span { outline: 3px solid var(--brand-accent, #2D4BFF); outline-offset: 2px; }
.tw-sheet { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.tw-sheet li small { display: block; color: var(--color-text-muted); }
.tw-sheet li span { display: block; font-weight: 600; }

/* Rows (orders, bookings, purchase orders, counts, waste) */
.tw-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--color-border); }
.tw-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px; border-bottom: 1px solid var(--color-border); cursor: pointer; }
.tw-row:not(:has(.tw-row-time)) { grid-template-columns: minmax(0, 1fr) auto auto; }
.tw-row:has(.tw-row-actions), .tw-row:has(details) { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.tw-row:not(:has(.tw-row-time)):has(details) { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.tw-reservations .tw-row { grid-template-columns: 76px minmax(0, 1fr) auto auto; }
.tw-row:hover { background: var(--color-surface-subtle); }
.tw-row.is-selected, .rd-row.is-selected td { background: var(--color-selected); box-shadow: inset 4px 0 0 var(--brand-primary, var(--color-brand)); }
.tw-row.inactive { opacity: .62; }
.tw-row-time { display: flex; flex-direction: column; min-width: 64px; }
.tw-row-time strong { font-size: 16px; }
.tw-row-time small, .tw-row-main small { color: var(--color-text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-row-main { display: flex; flex-direction: column; min-width: 0; }
.tw-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.tw-row-actions { display: flex; gap: 6px; }
.tw-row .tw-money { font-weight: 600; }
.tw-accept { background: var(--color-brand) !important; color: #FFFFFF !important; border-color: var(--color-brand) !important; }
.tw-drafts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text-muted); }

/* Kitchen / barista board */
.tw-board { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tw-column { display: flex; flex-direction: column; min-height: 0; border-radius: 14px; background: var(--color-surface-subtle); }
.tw-column-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; }
.tw-column-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tw-column-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; }
.tw-ticket { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--color-border); border-left: 5px solid var(--color-border); border-radius: 12px; background: var(--color-surface); cursor: pointer; }
.tw-ticket.is-selected { outline: 3px solid var(--brand-accent, #2D4BFF); outline-offset: 1px; }
.tw-ticket header { position: static; inset: auto; display: flex; align-items: center; gap: 8px; height: auto; min-height: 24px; padding: 0; background: transparent; color: inherit; border: 0; z-index: auto; }
.tw-ticket-no { font-size: 16px; font-weight: 700; }
.tw-ticket-type { display: block; margin-top: 1px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-muted); }
.tw-age { margin-left: auto; font-size: 13px; font-weight: 700; }
.tw-age-slow { border-left-color: var(--color-warning); }
.tw-age-slow .tw-age { color: var(--color-warning); }
.tw-age-late { border-left-color: var(--color-danger); }
.tw-age-late .tw-age { color: var(--color-danger); }
.tw-ticket-who { margin: 0; font-weight: 650; font-size: 14px; }
.tw-ticket ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.tw-ticket li b { display: inline-block; min-width: 20px; font-family: "Geist Mono", ui-monospace, monospace; }
.tw-ticket li small { display: block; padding-left: 24px; color: var(--color-text-muted); font-size: 12px; }
.tw-more-items { color: var(--color-text-muted); }
.tw-advance { min-height: 48px !important; width: 100%; margin-top: 2px; }

/* Restaurant floor */
.tw-floor-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.tw-area + .tw-area { margin-top: 6px; }
.tw-floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.tw-table { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 108px; padding: 12px; border: 1.5px solid var(--color-border); border-radius: 14px; background: var(--color-surface); color: var(--color-text); text-align: left; cursor: pointer; font: inherit; }
.tw-table:hover { border-color: var(--color-text); }
.tw-table[aria-pressed="true"] { outline: 3px solid var(--brand-accent, #2D4BFF); outline-offset: 2px; }
.tw-shape-round { border-radius: 54px; padding-left: 18px; }
.tw-shape-booth { border-left-width: 6px; }
.tw-table-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.tw-table-meta { color: var(--color-text-muted); font-size: 12.5px; }
.tw-table-state { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.tw-table-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tw-table-total { font-size: 16px; font-weight: 700; }
.tw-table-free .tw-table-state { color: var(--color-success); }
.tw-table-busy { background: var(--color-brand); border-color: var(--color-brand); color: #FFFFFF; }
.tw-table-busy .tw-table-meta, .tw-table-busy .tw-table-state { color: #FFFFFF; }
.tw-table-bill { border-color: var(--color-warning); background: var(--color-warning-bg); }
.tw-table-bill .tw-table-state { color: var(--color-warning); }
.tw-table-booked { border-color: var(--color-info); }
.tw-table-booked .tw-table-state { color: var(--color-info); }
.tw-table-off { border-style: dashed; opacity: .6; }

/* Staff time */
.tw-clock { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface-subtle); }
.tw-clock.is-on { border-color: var(--color-success); background: var(--color-success-bg); }
.tw-clock h2 { margin: 2px 0; font-size: 20px; font-weight: 650; }
.tw-clock .help { margin: 0; }
.tw-clock-btn { min-height: 56px !important; min-width: 168px; font-size: 16px !important; }
.tw-on-now { display: flex; flex-wrap: wrap; gap: 6px; }
.tw-person { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 12px 3px 3px; border: 1px solid var(--color-border); border-radius: 999px; font-size: 13px; font-weight: 600; }
.tw-person .avatar { width: 30px; height: 30px; font-size: 11px; }
.tw-table-wrap { flex: 1 1 auto; min-height: 0; }
.tw-shift-table td { cursor: pointer; }

@media (max-width: 1180px) {
  .workflow-view.fit-view .tw-split, .workflow-view.fit-view .rd-rounds.tw-split, .workflow-view.fit-view .rd-services { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); }
  .tw-floor { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
  .tw-table { min-height: 96px; }
  .tw-row-time { min-width: 52px; }
}
@media (prefers-reduced-motion: reduce) { .tw-more > summary::after { transition: none; } }
body.osk-bottom .workflow-view.fit-view .tw-split { grid-template-columns: minmax(0, 1fr); }
body.osk-bottom .workflow-view.fit-view .tw-main { display: none; }

/* Checkout order bar (takeaway, restaurant and coffee): name for the order, order type, more details */
.order-bar { display: flex; align-items: center; gap: 8px; flex: none; }
.order-bar[hidden] { display: none !important; }
.order-name-field { flex: 1 1 auto; min-width: 0; }
.order-name-field input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--color-control-border); border-radius: var(--radius-control, 12px); background: var(--color-surface); font: inherit; font-size: 14px; }
.order-name-field input:focus { outline: none; border-color: var(--color-action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-action) 30%, transparent); }
.order-type-seg { flex: none; }
.order-type-seg button { min-height: 44px; padding: 0 10px; font-size: 13px; }
.order-more { flex: none; min-height: 44px !important; padding: 0 12px !important; }
.order-type-field:has(#orderType) { display: none !important; }
.tw-split .empty-state, .rd-rounds .empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--color-text-muted); }
.tw-split .empty-state strong { color: var(--color-text); font-size: 15px; }
.tw-split .count-badge { white-space: nowrap; }
#servicesView .rd-services.tw-split { grid-template-columns: minmax(0, 1fr) minmax(330px, 392px); }
#servicesView .rd-services > .workflow-split-sidebar { order: initial; }

/* Weighed item: read the scale beside the gross weight */
.weight-read { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.weight-read .button { min-height: 52px; }
/* End of day drawer: close-out and card terminal totals */
.drawer-extra { margin-top: 10px; border: 1px solid var(--color-border); border-radius: 12px; }
.drawer-extra > summary { display: flex; align-items: center; min-height: 48px; padding: 0 14px; font-weight: 650; cursor: pointer; }
.drawer-extra > form, .drawer-extra > div { display: grid; gap: 8px; padding: 0 14px 14px; }
.drawer-extra .help { margin: 0; }
.drawer-intent { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 13px; }
.drawer-reconcile { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.drawer-reconcile.good { background: var(--color-success-bg); color: var(--color-success); }
.drawer-reconcile.bad { background: var(--color-danger-bg); color: var(--color-danger); }
.drawer-reconcile strong { margin-right: 6px; }

/* Dense boards share the same table and action rhythm as the management screens. */
@media(min-width:980px){.tw-board{gap:8px}.tw-column{border:1px solid var(--color-border);border-radius:10px}.tw-column-head{min-height:40px;flex:none;padding:0 10px;border-bottom:1px solid var(--color-border)}.tw-column-body{padding:8px;gap:8px}.tw-ticket{padding:8px 10px;gap:4px;border-radius:8px}.tw-ticket ul{font-size:12.5px}.tw-ticket-no{font-size:15px}.tw-advance{min-height:44px!important}.tw-ticket-who{font-size:13px}.tw-ticket li small{font-size:11px}}
.tw-salon-filter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-bottom: 12px; }
.tw-salon-filter .field { min-width: 0; margin: 0; }
.tw-salon-filter input, .tw-salon-filter select { width: 100%; min-width: 0; }
.tw-salon-filter button { align-self: end; min-height: 44px; }
@media (max-width: 1100px) { .tw-salon-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tw-salon-filter { grid-template-columns: minmax(0, 1fr); } }
