:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #f5f7fb; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f5f7fb; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 248px; flex-direction: column; padding: 28px 16px; color: #dbeafe; background: #101827; }
.sidebar-brand { padding: 0 14px 32px; color: #fff; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.sidebar nav { display: grid; gap: 6px; }
.nav-link { display: block; width: 100%; border: 0; border-radius: 10px; padding: 12px 14px; color: #aab8cf; background: transparent; text-align: left; cursor: pointer; }
.nav-link:hover, .nav-link.is-active { color: #fff; background: #243552; }
.sidebar-footer { margin-top: auto; }
.sidebar-overlay { display: none; }
.mobile-header { display: none; }
.main-content { min-height: 100vh; margin-left: 248px; padding: 42px clamp(20px, 5vw, 64px); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: #55709b; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.04em; }
h2 { margin-bottom: 12px; font-size: 1.15rem; }
.status-badge { border-radius: 999px; padding: 8px 12px; color: #166534; background: #dcfce7; font-size: .85rem; font-weight: 700; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.summary-card, .panel-card { border: 1px solid #e5eaf2; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(16, 24, 39, .04); }
.summary-card { display: grid; gap: 8px; padding: 22px; }
.summary-card span, .summary-card small { color: #66758f; }
.summary-card strong { color: #172033; font-size: 2rem; }
.summary-card small { font-size: .8rem; }
.panel-card { padding: 24px; }
.panel-card p { margin-bottom: 0; color: #66758f; line-height: 1.6; }
.two-column-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 18px; }
.stack-form { display: grid; gap: 10px; }
.stack-form label { margin-top: 4px; color: #475569; font-size: .9rem; font-weight: 700; }
.stack-form input, .stack-form select { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: #fff; }
.data-list { display: grid; gap: 8px; }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #eef2f7; padding: 12px 0; }
.data-row:last-child { border-bottom: 0; }
.data-row strong, .data-row small { display: block; }
.data-row small { margin-top: 4px; color: #66758f; }
.text-button { border: 0; color: #2563eb; background: transparent; cursor: pointer; font-weight: 700; }
.text-button.danger-text { color: #b42318; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.product-delete-card { width: min(100%, 520px); }
.product-delete-heading { display: flex; align-items: center; gap: 12px; }
.product-delete-heading h2 { margin: 0; }
.product-delete-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; color: #b42318; background: #fee2e2; font-size: 1.35rem; font-weight: 900; }
.product-delete-card > p { margin: 18px 0 22px; color: #64748b; line-height: 1.6; }
.product-delete-actions { display: flex; justify-content: flex-end; gap: 10px; }
.danger-button { color: #fff; background: #b42318; }
.danger-button:hover, .danger-button:focus-visible { background: #991b1b; }
.filter-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.filter-grid input, .filter-grid select { min-width: 0; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { border-bottom: 1px solid #eef2f7; padding: 12px 10px; text-align: left; white-space: nowrap; }
th { color: #66758f; font-size: .8rem; text-transform: uppercase; }
.detail-heading, .detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.detail-meta { flex-wrap: wrap; margin: 18px 0; color: #66758f; font-size: .9rem; }
.detail-total { margin-top: 18px; text-align: right; font-size: 1.15rem; font-weight: 800; }
.waiter-toolbar { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto minmax(180px, 1fr); align-items: center; gap: 10px; margin-bottom: 18px; }
.waiter-toolbar label { color: #475569; font-weight: 700; }
.waiter-toolbar select, .waiter-toolbar input { border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: #fff; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.table-card { display: grid; min-height: 130px; align-content: space-between; gap: 8px; border: 2px solid #dbeafe; border-radius: 16px; padding: 18px; background: #fff; box-shadow: 0 8px 20px rgba(16,24,39,.05); }
.table-card strong { font-size: 1.2rem; }
.table-card small, .table-area { color: #66758f; }
.table-area { font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.table-status-occupied { border-color: #fca5a5; background: #fff7f7; }
.table-status-reserved { border-color: #fcd34d; background: #fffbeb; }
.table-status-available { border-color: #86efac; background: #f0fdf4; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 18px; align-items: start; }
.product-panel, .cart-panel { border: 1px solid #e5eaf2; border-radius: 16px; padding: 18px; background: #fff; }
.order-search input { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 12px; }
.category-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0; padding-bottom: 4px; }
.category-tab { border: 0; border-radius: 999px; padding: 9px 14px; color: #475569; background: #eef2f7; cursor: pointer; white-space: nowrap; }
.category-tab.is-active { color: #fff; background: #2563eb; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.product-card { display: grid; gap: 12px; border: 1px solid #e5eaf2; border-radius: 12px; padding: 14px; }
.product-card strong, .product-card small { display: block; }
.product-card small { margin-top: 5px; color: #66758f; line-height: 1.4; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.add-product { min-height: 44px; border: 0; border-radius: 8px; padding: 8px 12px; color: #fff; background: #2563eb; cursor: pointer; font-weight: 700; }
.modifier-select { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px; background: #fff; }
.cart-panel { position: sticky; top: 18px; }
.cart-items { display: grid; gap: 8px; min-height: 80px; margin: 14px 0; }
.empty-cart { color: #66758f; font-size: .9rem; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eef2f7; padding: 10px 0; }
.cart-row strong, .cart-row small { display: block; }
.cart-row small { max-width: 150px; margin-top: 4px; color: #66758f; font-size: .78rem; }
.cart-controls { display: flex; align-items: center; gap: 6px; }
.cart-controls button, .primary-button, .secondary-button { min-height: 44px; }
.cart-controls button { border: 1px solid #cbd5e1; border-radius: 6px; padding: 3px 7px; background: #fff; cursor: pointer; }
.cart-totals { display: grid; gap: 8px; border-top: 1px solid #eef2f7; padding-top: 14px; }
.cart-totals div { display: flex; justify-content: space-between; color: #66758f; }
.cart-totals .cart-total { color: #172033; font-size: 1.15rem; font-weight: 800; }
.cart-panel label { display: block; margin-top: 18px; margin-bottom: 6px; color: #475569; font-weight: 700; }
.cart-panel textarea { width: 100%; resize: vertical; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; font: inherit; }
.send-order { width: 100%; margin-top: 14px; }
.existing-order { margin-bottom: 18px; border-bottom: 1px solid #eef2f7; padding-bottom: 14px; }
.existing-order h2 { font-size: 1rem; }
.existing-order p { margin: 10px 0 0; color: #66758f; font-size: .8rem; }
.existing-item { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: .85rem; }
.existing-item small { color: #66758f; }
.kitchen-actions { display: flex; align-items: center; gap: 10px; }
.secondary-button { border: 1px solid #cbd5e1; border-radius: 8px; padding: 9px 12px; color: #334155; background: #fff; cursor: pointer; font-weight: 700; }
.kitchen-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.kitchen-card { border: 1px solid #e5eaf2; border-radius: 16px; padding: 18px; background: #fff; box-shadow: 0 8px 24px rgba(16,24,39,.05); }
.kitchen-card-header { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #eef2f7; padding-bottom: 12px; }
.kitchen-card h2 { margin: 2px 0 4px; }
.kitchen-card small { display: block; color: #66758f; }
.new-badge { border-radius: 999px; padding: 6px 8px; color: #92400e; background: #fef3c7; font-size: .72rem; font-weight: 800; }
.kitchen-items { display: grid; gap: 10px; margin-top: 14px; }
.kitchen-item { display: flex; justify-content: space-between; gap: 10px; border-left: 4px solid #cbd5e1; padding: 10px; background: #f8fafc; }
.kitchen-item.status-preparing { border-left-color: #f59e0b; }
.kitchen-item.status-ready { border-left-color: #22c55e; }
.kitchen-item strong, .kitchen-item small { display: block; }
.kitchen-item small { margin-top: 4px; font-size: .8rem; }
.payment-item { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #eef2f7; padding: 12px 0; }
.payment-item span { flex: 1; }
.kitchen-buttons { display: flex; align-items: center; }
.stack-form textarea { width: 100%; resize: vertical; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; font: inherit; }
.loading-indicator { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: #55709b; font-size: .9rem; }
.loading-indicator span { width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: #2563eb; border-radius: 50%; animation: spin .7s linear infinite; }
.error-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.error-card { width: min(100%, 520px); padding: 32px; border: 1px solid #e5eaf2; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(16, 24, 39, .06); }
.error-card p:not(.eyebrow) { color: #66758f; line-height: 1.6; }
.primary-link { display: inline-block; margin-top: 10px; border-radius: 9px; padding: 10px 14px; color: #fff; background: #2563eb; font-weight: 700; }
.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: #101827; }
.auth-card { width: min(100%, 420px); padding: 32px; border-radius: 18px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.24); }
.auth-card h1 { margin-bottom: 24px; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { margin-top: 8px; color: #475569; font-size: .9rem; font-weight: 700; }
.auth-card input { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 12px; color: #172033; background: #fff; }
.auth-card input:focus { outline: 3px solid #bfdbfe; border-color: #2563eb; }
.primary-button { margin-top: 14px; border: 0; border-radius: 9px; padding: 12px 16px; color: #fff; background: #2563eb; cursor: pointer; font-weight: 700; }
.primary-button.is-loading { display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: wait; opacity: .86; }
.button-spinner { width: 15px; height: 15px; flex: 0 0 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.alert { margin-bottom: 16px; border-radius: 9px; padding: 12px; font-size: .9rem; }
.alert-error { color: #991b1b; background: #fee2e2; }
.restaurant-orphan-warning { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; border: 1px solid #fecaca; }
.restaurant-orphan-warning strong { margin-right: 4px; }
.restaurant-orphan-warning span { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #7f1d1d; background: rgba(255,255,255,.65); font-size: .8rem; font-weight: 700; }
.restaurant-panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.restaurant-area-filter { display: inline-flex; align-items: center; gap: 7px; color: #64748b; font-size: .75rem; font-weight: 800; }
.restaurant-area-filter select { min-width: 190px; min-height: 52px; border: 1px solid #b9cbe5; border-radius: 11px; padding: 12px 36px 12px 14px; color: #172033; background: #fff; font: inherit; font-size: .95rem; font-weight: 800; cursor: pointer; }
.alert-success { color: #166534; background: #dcfce7; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-button { border: 0; border-radius: 8px; color: inherit; background: transparent; cursor: pointer; font-size: 1.35rem; line-height: 1; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px; }
.toast { min-width: 260px; max-width: min(420px, calc(100vw - 40px)); padding: 14px 16px; border-radius: 10px; color: #fff; background: #172033; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.is-error { background: #b42318; }
.modal[hidden] { display: none; }
.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .5); }
.modal-card { width: min(100%, 480px); padding: 24px; border-radius: 16px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.admin-order-detail-modal { z-index: 75; align-items: start; overflow-y: auto; padding: clamp(18px, 5vh, 52px) 18px; }
.admin-order-detail-card { width: min(760px, 100%); max-height: min(88vh, 820px); overflow-y: auto; padding: clamp(20px, 4vw, 32px); }
.admin-order-detail-card .modal-header h2 { margin: 0; }
.admin-order-detail-card .icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #dbe3ef; border-radius: 10px; color: #475569; background: #f8fafc; font-size: 1.5rem; }
.admin-order-detail-card .icon-button:hover, .admin-order-detail-card .icon-button:focus-visible { color: #1d4ed8; border-color: #93c5fd; background: #eff6ff; outline: 3px solid #dbeafe; }
.admin-order-detail-card .detail-meta { margin: 20px 0; border: 1px solid #e5eaf2; border-radius: 12px; padding: 13px; background: #f8fafc; }
.admin-order-detail-section { margin-top: 22px; }
.admin-order-detail-section h3 { margin: 0 0 8px; color: #334155; font-size: .9rem; }
.admin-order-empty { margin: 0; color: #64748b; font-size: .9rem; }
.admin-order-payments { display: grid; gap: 8px; }
.admin-order-payments > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e5eaf2; border-radius: 10px; padding: 11px 13px; background: #f8fafc; }
.admin-order-payments small { display: block; margin-top: 4px; color: #64748b; }
.admin-order-detail-card .detail-total { display: flex; justify-content: space-between; border-top: 2px solid #dbe3ef; padding-top: 16px; }
.orders-filter-heading, .orders-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.orders-filter-heading h2, .orders-list-heading h2 { margin-bottom: 4px; }
.orders-filter-heading small, .orders-list-heading small { color: #64748b; }
.admin-order-payment-summary { display: flex; justify-content: flex-end; gap: 18px; margin-top: 10px; color: #64748b; font-size: .85rem; }
.admin-order-payment-summary strong { color: #172033; }
.orders-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 20px; }
.orders-pagination a { display: inline-grid; min-width: 38px; height: 38px; place-items: center; border: 1px solid #dbe3ef; border-radius: 9px; color: #475569; background: #fff; font-weight: 800; }
.orders-pagination a:hover, .orders-pagination a:focus-visible, .orders-pagination a.is-current { border-color: #2563eb; color: #fff; background: #2563eb; outline: none; }
@media (max-width: 600px) {
  .orders-filter-heading, .orders-list-heading { align-items: flex-start; flex-direction: column; }
  .orders-filter-heading .secondary-button { width: 100%; text-align: center; }
  .admin-order-payment-summary { justify-content: space-between; }
}

/* Sunmi M2 / Android 7 WebView: keep the terminal usable at 720px CSS width. */
@media (max-width: 760px) {
    body.terminal-body { min-width: 0; overflow-x: hidden; }
    body.terminal-body .terminal-main { width: 100%; max-width: 100%; min-width: 0; padding: 18px 10px 72px; }
    body.terminal-body .terminal-index-heading { gap: 10px; margin-bottom: 14px; }
    body.terminal-body .terminal-index-heading-copy h1 { font-size: 1.55rem; }
    body.terminal-body .terminal-index-lead { font-size: .78rem; }
    body.terminal-body .terminal-toolbar { margin-bottom: 12px; padding: 12px; }
    body.terminal-body .terminal-area-heading { gap: 8px; }
    body.terminal-body .terminal-area-tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    body.terminal-body .terminal-area-tabs::-webkit-scrollbar { display: none; }
    body.terminal-body .terminal-area-tab { min-height: 44px; padding: 9px 13px; white-space: nowrap; }
    body.terminal-body .terminal-toolbar > input,
    body.terminal-body #table-search { min-height: 46px; width: 100%; font-size: .95rem; }
    body.terminal-body .terminal-index-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
    body.terminal-body .terminal-stat { min-height: 62px; padding: 9px; }
    body.terminal-body .terminal-stat strong { font-size: 1.15rem; }
    body.terminal-body .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    body.terminal-body .terminal-table-card { min-height: 126px; padding: 11px; border-radius: 13px; }
    body.terminal-body .table-card-number { margin: 12px 0 7px; }
    body.terminal-body .table-card-number strong { font-size: 1.2rem; }
    body.terminal-body .table-card-bottom small { font-size: .62rem; }
}

@media (max-width: 390px) {
    body.terminal-body .terminal-main { padding-inline: 7px; }
    body.terminal-body .table-grid { gap: 6px; }
    body.terminal-body .terminal-table-card { min-height: 116px; padding: 9px; }
    body.terminal-body .table-card-area { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.product-admin-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.product-admin-summary article { display: flex; align-items: center; gap: 12px; border: 1px solid #e5eaf2; border-radius: 15px; padding: 16px; background: #fff; box-shadow: 0 8px 24px rgba(16,24,39,.04); }
.product-summary-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: #2563eb; background: #dbeafe; font-size: 1.2rem; font-weight: 900; }
.product-summary-icon.is-active { color: #16804a; background: #dcfce7; }
.product-summary-icon.is-category { color: #a16207; background: #fef3c7; }
.product-summary-icon.is-warning, .product-admin-icon.is-warning { color: #b45309; background: #fef3c7; }
.product-admin-summary small { display: block; color: #64748b; font-size: .75rem; }
.product-admin-summary strong { display: block; margin-top: 2px; font-size: 1.35rem; }
.area-admin-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.product-admin-layout { align-items: start; }
.product-form-card { position: sticky; top: 18px; overflow: hidden; }
.recipe-quantity-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, .55fr); gap: 10px; }
.recipe-definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.recipe-definition-grid .panel-card { min-width: 0; margin: 0; }
.recipe-quantity-row > div { display: grid; gap: 10px; }
.recipe-unit-help { color: #64748b; font-size: .78rem; line-height: 1.45; }
.inventory-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 20px 0; padding: 22px 24px; border: 1px solid #dbe5f2; border-radius: 18px; background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%); box-shadow: 0 10px 28px rgba(15,23,42,.06); }
.inventory-action-bar h2 { margin: 4px 0 4px; font-size: 1.15rem; }
.inventory-action-bar span { color: #64748b; font-size: .88rem; }
.inventory-action-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.inventory-page .primary-button, .inventory-page .secondary-button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 44px; line-height: 1.2; }
.inventory-page .primary-button { margin-top: 0; }
.inventory-page .stack-form .primary-button { margin-top: 8px; }
.inventory-page .text-button { min-height: 36px; padding: 8px 10px; line-height: 1.2; }
.inventory-supplier-modal-card { width: min(100%, 720px); }
.inventory-supplier-modal-card .inline-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 10px; }
.inventory-supplier-modal-card .inline-form input { box-sizing: border-box; min-width: 0; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: #fff; }
.inventory-supplier-modal-card .inline-form .primary-button { white-space: nowrap; }
.inventory-form-layer[aria-hidden="true"] { display: none; }
.inventory-form-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; }
.inventory-form-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.56); backdrop-filter: blur(3px); }
.inventory-modal-card { position: relative; z-index: 1; width: min(100%, 540px); max-height: min(90vh, 760px); overflow-y: auto; margin: 0; box-shadow: 0 28px 80px rgba(15,23,42,.28); animation: inventory-modal-in .2s ease-out; }
.inventory-modal-card[hidden] { display: none; }
.inventory-modal-card .icon-button { flex: 0 0 auto; width: 36px; height: 36px; font-size: 1.4rem; }
@keyframes inventory-modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 680px) { .inventory-action-bar { align-items: stretch; flex-direction: column; padding: 18px; } .inventory-action-buttons { display: grid; grid-template-columns: 1fr; } .inventory-action-buttons button { min-height: 48px; } .inventory-form-layer { padding: 12px; } .inventory-modal-card { max-height: 94vh; } .inventory-supplier-modal-card .inline-form { grid-template-columns: 1fr; } .inventory-supplier-modal-card .inline-form .primary-button { width: 100%; } }
.product-mode-banner { display: flex; align-items: center; gap: 11px; margin: -24px -24px 20px; padding: 13px 18px; color: #1d4ed8; background: #eff6ff; border-bottom: 1px solid #dbeafe; }
.product-form-card.is-editing .product-mode-banner { color: #7c3aed; background: #f5f3ff; border-bottom-color: #ddd6fe; }
.product-mode-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 10px; color: #fff; background: #2563eb; font-size: 1.2rem; font-weight: 800; }
.is-editing .product-mode-icon { background: #7c3aed; }
.product-mode-banner strong, .product-mode-banner small { display: block; }
.product-mode-banner strong { font-size: .82rem; }
.product-mode-banner small { margin-top: 2px; color: #64748b; font-size: .72rem; }
.product-form-heading, .product-list-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.product-form-heading h2, .product-list-heading h2 { margin-bottom: 0; }
.product-editing-name { display: inline-block; margin-top: 6px; color: #7c3aed; font-size: .8rem; font-weight: 800; }
.product-form-lead { margin: -2px 0 16px; color: #64748b; font-size: .86rem; line-height: 1.5; }
.product-form-submit { width: 100%; margin-top: 18px; }
.product-list-count { border-radius: 999px; padding: 7px 10px; color: #2563eb; background: #eff6ff; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.product-list-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 170px 130px; gap: 8px; margin: 16px 0 12px; }
.product-search-field { display: flex; align-items: center; gap: 8px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 0 11px; color: #64748b; background: #fff; }
.product-search-field:focus-within { border-color: #2563eb; outline: 3px solid #dbeafe; }
.product-search-field input { width: 100%; min-height: 42px; border: 0; outline: 0; background: transparent; }
.product-list-toolbar select { min-width: 0; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px; background: #fff; }
.category-list-toolbar { grid-template-columns: minmax(0, 1fr) 160px; }
.modifier-list-toolbar { grid-template-columns: minmax(0, 1fr) 160px; }
.area-list-toolbar { grid-template-columns: minmax(0, 1fr) 160px; }
.modifier-price { color: #16804a !important; white-space: nowrap; }
.modifier-price.is-discount { color: #b42318 !important; }
.modifier-parent-warning { margin: 0 0 16px; font-size: .8rem; line-height: 1.45; }
.product-admin-list { display: grid; gap: 8px; }
.product-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #e7edf5; border-radius: 13px; padding: 13px; background: #fbfcfe; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.product-admin-row:hover { border-color: #b8cbea; box-shadow: 0 8px 18px rgba(37,99,235,.07); transform: translateY(-1px); }
.product-admin-row[hidden] { display: none; }
.product-admin-main { display: flex; min-width: 0; align-items: flex-start; gap: 11px; }
.product-admin-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; color: #1d4ed8; background: #dbeafe; font-weight: 900; }
.product-admin-icon.is-inactive { color: #64748b; background: #e2e8f0; }
.table-admin-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.staff-admin-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.station-admin-summary, .printer-admin-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .station-admin-summary, .printer-admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .staff-admin-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.product-admin-main strong, .product-admin-main small, .product-admin-main p { display: block; }
.product-admin-main strong { color: #172033; }
.product-admin-main small { margin-top: 4px; color: #64748b; font-size: .76rem; }
.product-admin-main p { max-width: 380px; margin: 5px 0 0; overflow: hidden; color: #94a3b8; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.product-admin-meta { display: flex; align-items: center; gap: 10px; }
.product-admin-meta > strong { min-width: 82px; color: #172033; text-align: right; }
.product-vat-label { display: block; margin-top: 3px; color: #94a3b8; font-size: .65rem; font-weight: 700; white-space: nowrap; }
.product-status { border-radius: 999px; padding: 5px 8px; color: #16804a; background: #dcfce7; font-size: .68rem; font-weight: 800; }
.product-status.is-inactive { color: #64748b; background: #e2e8f0; }
.product-list-empty { margin: 12px 0 0; padding: 20px; border: 1px dashed #cbd5e1; border-radius: 11px; color: #64748b; text-align: center; }
@media (max-width: 980px) { .product-form-card { position: static; } .product-list-toolbar { grid-template-columns: 1fr 1fr; } .product-search-field { grid-column: 1 / -1; } }
@media (max-width: 900px) { .recipe-definition-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .recipe-quantity-row { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .area-admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .product-admin-summary { grid-template-columns: 1fr; } .product-admin-row { align-items: flex-start; flex-direction: column; } .product-admin-meta { width: 100%; flex-wrap: wrap; justify-content: space-between; } .product-admin-meta > strong { min-width: 0; text-align: left; } .product-list-toolbar { grid-template-columns: 1fr; } .product-search-field { grid-column: auto; } .product-form-heading .secondary-button { white-space: nowrap; } .product-mode-banner { margin: -18px -18px 18px; } .product-form-heading { align-items: stretch; flex-direction: column; } .product-form-heading .secondary-button { width: 100%; text-align: center; } }

/* Admin navigation: grouped, icon-led and touch friendly. */
.order-item-modifiers { display: block; margin-top: 3px; color: #7c3aed; font-size: .74rem; font-weight: 700; }
.sidebar { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #334968 transparent; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding-bottom: 26px; }
.sidebar-brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(191,219,254,.24); border-radius: 12px; color: #fff; background: linear-gradient(145deg, #2563eb, #1d4ed8); font-size: 1.15rem; font-weight: 900; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { line-height: 1.1; }
.sidebar-brand small { margin-top: 4px; color: #8295b3; font-size: .68rem; font-weight: 600; letter-spacing: .04em; }
.sidebar nav { display: grid; gap: 18px; }
.sidebar-group { display: grid; gap: 4px; }
.sidebar-group-title { margin: 0 12px 4px; color: #7084a4; font-size: .66rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-link { display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 10px 12px; color: #aab8cf; }
.nav-link-icon { display: inline-grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; color: #8295b3; }
.nav-link-icon svg { display: block; width: 19px; height: 19px; }
.nav-link-label { min-width: 0; flex: 1; }
.nav-notification-badge { display: inline-grid; min-width: 22px; height: 22px; place-items: center; border: 2px solid #101827; border-radius: 999px; padding: 0 5px; color: #fff; background: #dc2626; font-size: .68rem; font-weight: 900; line-height: 1; box-shadow: 0 0 0 2px rgba(248,113,113,.18); }
.nav-link:hover .nav-notification-badge, .nav-link.is-active .nav-notification-badge { border-color: #243552; }
.nav-link:hover .nav-link-icon, .nav-link.is-active .nav-link-icon { color: #bfdbfe; }
.nav-link.is-active { box-shadow: inset 3px 0 0 #60a5fa, 0 8px 18px rgba(0,0,0,.12); }
.nav-button { color: #aab8cf; }
.sidebar-footer { padding-top: 18px; }
@media (max-width: 760px) {
  .mobile-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; color: #fff; background: #101827; }
  .brand-name { font-weight: 800; }
  .mobile-user { color: #aab8cf; font-size: .8rem; }
  body.sidebar-open { overflow: hidden; }
  .sidebar { z-index: 60; transform: translate3d(-105%, 0, 0); visibility: hidden; transition: transform .26s cubic-bezier(.22,1,.36,1), visibility 0s linear .26s; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar.is-open { visibility: visible; transition-delay: 0s; }
  .sidebar { width: min(294px, 88vw); padding: 22px 14px; box-shadow: 18px 0 40px rgba(15,23,42,.24); }
  .sidebar-overlay.is-visible { position: fixed; inset: 0; z-index: 50; display: block; background: rgba(15, 23, 42, .52); animation: sidebar-overlay-in .2s ease both; }
  .main-content { margin-left: 0; padding: 28px 18px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .two-column-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .waiter-toolbar { grid-template-columns: 1fr; }
  .order-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
  .kitchen-actions { align-items: flex-start; flex-direction: column; }
  .page-heading { align-items: flex-start; flex-direction: column; }
}
@keyframes sidebar-overlay-in { from { opacity: 0; } to { opacity: 1; } }
.connection-status {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: .6rem 1rem;
    text-align: center;
    color: #fff;
    background: #9f2f2f;
    font-weight: 700;
}
.terminal-main { max-width: 1400px; margin-left: 0; margin-right: auto; }
.terminal-main .table-card { min-height: 150px; padding: 22px; }
.terminal-main .add-product, .terminal-main .category-tab, .terminal-main .send-order { min-height: 48px; }
.terminal-category-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }.terminal-category-heading h2 { margin: 0; }.terminal-category-heading .eyebrow { margin-bottom: 5px; }.terminal-category-heading > span { color: #94a3b8; font-size: .75rem; font-weight: 700; }
.terminal-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-bottom: 22px; }
.terminal-category-card { display: flex; min-height: 116px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #e4e9f1; border-radius: 14px; padding: 12px 8px; color: #334155; background: #f8fafc; cursor: pointer; flex-direction: column; text-align: center; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.terminal-category-card:hover, .terminal-category-card:focus-visible { transform: translateY(-2px); border-color: #9bb8ed; background: #f2f6ff; box-shadow: 0 8px 18px rgba(37,99,235,.1); }.terminal-category-card.is-active { border-color: #2563eb; color: #fff; background: #2563eb; box-shadow: 0 8px 18px rgba(37,99,235,.18); }.terminal-category-card.is-active small { color: #dbeafe; }.terminal-category-card:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.terminal-category-symbol { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #fff; font-size: 1.35rem; }.terminal-category-card.is-active .terminal-category-symbol { background: rgba(255,255,255,.18); }.terminal-category-card strong { max-width: 100%; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }.terminal-category-card small { color: #94a3b8; font-size: .67rem; }
.terminal-product-search { margin-bottom: 16px; }.terminal-main .product-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }.terminal-main .product-card { min-height: 138px; padding: 16px; }.terminal-main .add-product { padding: 9px 14px; }
.modifier-options { display: grid; gap: 5px; margin: 12px 0 0; padding: 8px; border: 1px solid #dbe3ef; border-radius: 10px; background: #f8fafc; }.modifier-options legend { padding: 0 4px; color: #64748b; font-size: .68rem; font-weight: 800; }.modifier-options label { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 6px; color: #334155; font-size: .72rem; cursor: pointer; }.modifier-options input { margin: 0; accent-color: #7c3aed; }.modifier-options small { color: #7c3aed; font-size: .67rem; font-weight: 800; }
.modifier-total { display: block; margin-top: 8px; color: #7c3aed; font-size: .72rem; font-weight: 800; }
.terminal-request-card { width: min(100%, 540px); }.terminal-request-card h2 { margin: 0; }.terminal-request-product { margin: 18px 0 12px; padding: 12px 14px; border-radius: 10px; color: #1d4ed8; background: #eff6ff; font-weight: 800; }.terminal-request-card label { display: block; margin-bottom: 7px; color: #475569; font-size: .85rem; font-weight: 800; }.terminal-request-card textarea { width: 100%; resize: vertical; border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px; font: inherit; }.terminal-request-card textarea:focus { outline: 3px solid #bfdbfe; border-color: #2563eb; }.terminal-request-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; margin-top: 16px; }.terminal-request-actions button { margin-top: 0; min-height: 46px; }.terminal-request-actions .secondary-button { white-space: nowrap; }
@media (max-width: 600px) { .terminal-category-heading { align-items: flex-start; flex-direction: column; gap: 5px; }.terminal-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }.terminal-category-card { min-height: 104px; }.terminal-category-symbol { width: 36px; height: 36px; font-size: 1.15rem; }.terminal-category-card strong { font-size: .74rem; }.terminal-category-card small { font-size: .62rem; }.terminal-main .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }.terminal-main .product-card { padding: 12px; }.terminal-main .product-card-footer { align-items: stretch; flex-direction: column; }.terminal-main .add-product { width: 100%; } }
@media (max-width: 600px) { .terminal-request-actions { grid-template-columns: 1fr; }.terminal-request-actions button { width: 100%; } }
.terminal-main { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.terminal-main .order-search input, .terminal-main #product-search { min-height: 54px; padding: 14px 16px; font-size: 1rem; }
.terminal-main .terminal-category-grid { gap: 12px; }
.terminal-main .terminal-category-card { min-height: 132px; padding: 14px 10px; border-width: 2px; }
.terminal-main .terminal-category-symbol { width: 50px; height: 50px; font-size: 1.55rem; }
.terminal-main .terminal-category-card strong { font-size: .9rem; }
.terminal-main .terminal-category-card small { font-size: .72rem; }
.terminal-main .product-grid { gap: 14px; }
.terminal-main .product-card { min-height: 178px; gap: 16px; padding: 18px; border-width: 2px; }
.terminal-main .product-card strong { font-size: 1.05rem; line-height: 1.3; }
.terminal-main .product-card-footer { gap: 12px; }
.terminal-main .product-card-footer > span { font-size: 1rem; }
.terminal-main .add-product { min-width: 94px; min-height: 54px; border-radius: 12px; padding: 12px 16px; font-size: 1rem; }
.terminal-main .modifier-select { min-height: 52px; padding: 12px; font-size: .95rem; }
.terminal-main .cart-row { gap: 14px; padding: 14px 0; }
.terminal-main .cart-row strong { font-size: .98rem; }
.terminal-main .cart-row small { max-width: 190px; font-size: .85rem; line-height: 1.35; }
.terminal-main .cart-controls { gap: 6px; }
.terminal-main .cart-controls button { display: grid; width: 48px; height: 48px; min-width: 48px; min-height: 48px; place-items: center; border-width: 2px; border-radius: 11px; padding: 0; font-size: 1.2rem; font-weight: 800; }
.terminal-main .cart-controls span { min-width: 28px; text-align: center; font-size: 1.1rem; font-weight: 800; }
.terminal-main .cart-panel textarea { min-height: 104px; padding: 14px; font-size: 1rem; }
.terminal-main .send-order { min-height: 58px; border-radius: 12px; font-size: 1rem; }
.terminal-main .terminal-request-card textarea { min-height: 120px; padding: 15px; font-size: 1rem; }
.terminal-main .terminal-request-actions button { min-height: 54px; border-radius: 11px; font-size: .95rem; }
.manager-cancel-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: #94a3b8; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.manager-cancel-divider::before, .manager-cancel-divider::after { height: 1px; flex: 1; background: #e2e8f0; content: ''; }
.manager-cancel-fields { display: grid; gap: 9px; border: 1px solid #dbe4f0; border-radius: 12px; padding: 13px; background: #f8fafc; }
.manager-cancel-fields .eyebrow { margin-bottom: 1px; color: #64748b; font-size: .68rem; }
.manager-cancel-fields input { width: 100%; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 9px; padding: 10px 12px; background: #fff; font: inherit; }
.manager-cancel-fields input:focus { border-color: #2563eb; outline: 3px solid #dbeafe; }
.manager-cancel-fields .secondary-button { min-height: 46px; color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.restaurant-payment-confirm-card { width: min(100%, 460px); }
.restaurant-payment-confirm-card > p { margin: 16px 0 0; color: #475569; line-height: 1.55; }
.restaurant-payment-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.restaurant-payment-confirm-actions button { width: 100%; min-height: 48px; margin-top: 0; }
.restaurant-transfer-card { width: min(100%, 500px); }
.restaurant-transfer-card > p { margin: 16px 0; color: #475569; line-height: 1.55; }
.restaurant-transfer-card > label { display: block; margin: 12px 0 7px; color: #475569; font-size: .8rem; font-weight: 800; }
.restaurant-transfer-card > select, .restaurant-transfer-card > textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: #fff; font: inherit; }
.restaurant-transfer-card > select:focus, .restaurant-transfer-card > textarea:focus { border-color: #2563eb; outline: 3px solid #dbeafe; }
.restaurant-table-transfer { color: #1d4ed8 !important; background: #eff6ff !important; }
@media (max-width: 430px) { .restaurant-payment-confirm-actions { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .terminal-main .terminal-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .terminal-main .terminal-category-card { min-height: 126px; }
    .terminal-main .product-grid { grid-template-columns: 1fr; gap: 10px; }
    .terminal-main .product-card { min-height: 154px; }
    .terminal-main .product-card-footer { align-items: center; flex-direction: row; }
    .terminal-main .add-product { width: auto; }
    .terminal-main .cart-controls button { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
}

.restaurant-main { max-width: 1500px; margin-left: 0; margin-right: auto; }
.restaurant-main, .restaurant-main .restaurant-layout, .restaurant-main .restaurant-panel, .restaurant-main .restaurant-orders { touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.restaurant-main .restaurant-orders { -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.restaurant-main button, .restaurant-main a, .restaurant-main article, .restaurant-main summary { user-select: none; -webkit-user-select: none; }
.restaurant-main input, .restaurant-main textarea, .restaurant-main select { touch-action: manipulation; user-select: text; -webkit-user-select: text; }
.restaurant-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.restaurant-topbar h1 { margin-bottom: 8px; }
.restaurant-back { display: inline-block; margin-bottom: 20px; color: #2563eb; font-size: .85rem; font-weight: 800; }
.restaurant-lead { margin: 0; color: #748096; }
.restaurant-user { display: flex; align-items: center; gap: 10px; color: #475569; font-size: .84rem; font-weight: 700; }
.restaurant-user a { margin-left: 10px; color: #64748b; }
.restaurant-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.restaurant-summary article { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid #e5eaf2; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(16,24,39,.04); }
.restaurant-summary small, .restaurant-summary strong { display: block; }.restaurant-summary small { color: #748096; font-size: .78rem; }.restaurant-summary strong { margin-top: 4px; font-size: 1.45rem; }
.restaurant-summary-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; font-weight: 900; }.restaurant-summary-icon.blue { color: #2563eb; background: #e7efff; }.restaurant-summary-icon.amber { color: #b56a00; background: #fff4d7; }.restaurant-summary-icon.green { color: #16804a; background: #dcfce7; }
.restaurant-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr); gap: 20px; align-items: start; }
.restaurant-panel { padding: 22px; border: 1px solid #e5eaf2; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(16,24,39,.04); }
.restaurant-panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }.restaurant-panel-heading h2 { margin: 0; }.restaurant-panel-heading .eyebrow { margin-bottom: 5px; }.restaurant-refresh { color: #94a3b8; font-size: .75rem; }.restaurant-order-count { display: grid; min-width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #2563eb; background: #e7efff; font-size: .8rem; font-weight: 800; }
.restaurant-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }.restaurant-table-card { display: grid; gap: 8px; min-height: 116px; padding: 16px; border: 1px solid #d8e1ef; border-radius: 14px; background: #f8fafc; }.restaurant-table-card[hidden], .restaurant-order-card[hidden] { display: none !important; }.restaurant-table-card.is-occupied { border-color: #f7c978; background: #fffaf0; }.restaurant-table-card strong { font-size: 1.05rem; }.restaurant-table-heading { display: flex; align-items: center; justify-content: space-between; }.restaurant-table-area { overflow: hidden; color: #748096; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.restaurant-table-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }.is-occupied .restaurant-table-dot { background: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.restaurant-orders { display: grid; gap: 12px; max-height: 680px; overflow-y: auto; padding-right: 4px; }.restaurant-order-card { padding: 16px; border: 1px solid #e5eaf2; border-radius: 14px; background: #fbfcfe; }.restaurant-order-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }.restaurant-order-heading strong, .restaurant-order-heading small { display: block; }.restaurant-order-heading small { margin-top: 5px; color: #748096; font-size: .78rem; }.order-status { border-radius: 999px; padding: 5px 8px; color: #2563eb; background: #e7efff; font-size: .7rem; font-weight: 800; white-space: nowrap; }.order-status-preparing { color: #b56a00; background: #fff4d7; }.order-status-ready, .order-status-served { color: #16804a; background: #dcfce7; }.restaurant-order-items { display: grid; gap: 6px; margin: 14px 0; padding: 12px 0; border-top: 1px solid #eef2f7; border-bottom: 1px solid #eef2f7; }.restaurant-order-items div, .restaurant-order-total { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; }.restaurant-order-items strong { font-weight: 700; }.restaurant-order-total { margin-bottom: 14px; color: #64748b; }.restaurant-order-total strong { color: #182033; font-size: 1rem; }.restaurant-payment label { display: block; margin-bottom: 7px; color: #475569; font-size: .8rem; font-weight: 800; }.restaurant-payment label small { color: #94a3b8; font-weight: 600; }.restaurant-payment-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; }.restaurant-payment-row input, .restaurant-payment-row select { min-width: 0; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; background: #fff; }.restaurant-payment-row .primary-button { margin-top: 0; padding: 9px 12px; white-space: nowrap; }.restaurant-remaining { margin: 8px 0 0; color: #748096; font-size: .78rem; }.restaurant-empty { display: grid; place-items: center; gap: 8px; min-height: 220px; color: #748096; text-align: center; }.restaurant-empty span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: #16804a; background: #dcfce7; font-size: 1.3rem; }.restaurant-empty strong { color: #334155; }.restaurant-empty small { font-size: .8rem; }
@media (max-width: 980px) { .restaurant-layout { grid-template-columns: 1fr; } .restaurant-orders { max-height: none; } }
@media (max-width: 640px) { .restaurant-main { padding: 24px 16px; }.restaurant-topbar { flex-direction: column; }.restaurant-user { align-self: flex-start; }.restaurant-summary { grid-template-columns: 1fr; gap: 10px; }.restaurant-panel { padding: 16px; }.restaurant-panel-heading { align-items: flex-start; flex-direction: column; }.restaurant-panel-heading-actions { width: 100%; align-items: stretch; flex-direction: column; }.restaurant-area-filter { justify-content: space-between; }.restaurant-area-filter select { flex: 1; }.restaurant-payment-row { grid-template-columns: 1fr 1fr; }.restaurant-payment-row .primary-button { grid-column: 1 / -1; width: 100%; } }

.restaurant-table-card.is-reserved { border-color: #c4b5fd; background: #f7f3ff; }
.is-reserved .restaurant-table-dot { background: #8b5cf6; box-shadow: 0 0 0 4px #ede9fe; }
.restaurant-table-action { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; margin-top: 4px; padding: 8px 10px; border-radius: 9px; color: #2563eb; background: #e7efff; font-size: .75rem; font-weight: 800; text-align: center; }
.restaurant-table-action:hover { background: #dbe7ff; }
.restaurant-manual-refresh { margin: 0; padding: 8px 12px; }
.restaurant-order-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 9px; cursor: pointer; }
.restaurant-order-item input { width: 18px; height: 18px; margin-top: 2px; accent-color: #2563eb; }
.restaurant-order-item > span { min-width: 0; }
.restaurant-order-item > span strong, .restaurant-order-item > span small { display: block; }
.restaurant-order-item > span small { margin-top: 3px; color: #94a3b8; font-size: .72rem; }
.restaurant-order-item.is-paid { opacity: .55; }
.restaurant-payment-history { margin-top: 1rem; border-top: 1px solid var(--line, #e5e7eb); padding-top: .75rem; }
.restaurant-payment-history summary { cursor: pointer; color: var(--muted, #64748b); font-size: .9rem; }
.restaurant-payment-history > div { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--line, #e5e7eb); }
.restaurant-payment-history strong { text-align: right; }
.restaurant-payment-history small { grid-column: 1 / -1; color: var(--muted, #64748b); }
@media print {
    body * { visibility: hidden !important; }
    .restaurant-order-card.is-printing, .restaurant-order-card.is-printing * { visibility: visible !important; }
    .restaurant-order-card.is-printing { position: absolute; inset: 0; width: 100%; box-shadow: none; border: 0; }
    .restaurant-order-card.is-printing .restaurant-payment,
    .restaurant-order-card.is-printing .restaurant-order-links,
    .restaurant-order-card.is-printing .restaurant-payment-history summary { display: none !important; }
}
.restaurant-table-card { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.restaurant-table-card:hover, .restaurant-table-card:focus-visible { border-color: #93b4f7; box-shadow: 0 8px 20px rgba(37,99,235,.1); transform: translateY(-1px); outline: none; }
.restaurant-table-card.is-selected { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.16); }
.restaurant-table-card.is-occupied.is-selected { border-color: #2563eb; }
.restaurant-order-heading .restaurant-order-note { color: #b56a00; font-weight: 700; }
.restaurant-order-links { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.restaurant-order-links span { color: #94a3b8; font-size: .7rem; text-align: right; }
.restaurant-payment-row input, .restaurant-payment-row select, .restaurant-payment-row button { min-height: 44px; }
.restaurant-payment-row input, .restaurant-payment-row select { min-height: 50px; padding: 11px 12px; font-size: .95rem; }
@media (max-width: 640px) { .restaurant-order-links { align-items: flex-start; flex-direction: column; }.restaurant-order-links span { text-align: left; } }

/* Merkez / Hub */
.hub-page { min-height: 100vh; color: #182033; background: #f7f8fc; }
.hub-shell { width: min(1180px, calc(100% - 40px)); min-height: 100vh; margin: 0 auto; padding: 28px 0 24px; }
.hub-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hub-brand { display: inline-flex; align-items: center; gap: 12px; }
.hub-brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #fff; background: #182033; font-size: 1.25rem; font-weight: 900; box-shadow: 0 8px 18px rgba(24,32,51,.18); }
.hub-brand strong, .hub-brand small { display: block; }
.hub-brand strong { letter-spacing: -.03em; }
.hub-brand small { margin-top: 2px; color: #8791a6; font-size: .72rem; }
.hub-user-area { display: flex; align-items: center; gap: 18px; }
.hub-user { display: flex; align-items: center; gap: 8px; color: #334155; font-size: .85rem; font-weight: 700; }
.hub-user small { color: #94a3b8; font-size: .72rem; font-weight: 600; }
.hub-user-dot, .hub-online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
.hub-logout { color: #64748b; font-size: .82rem; font-weight: 700; }
.hub-logout:hover { color: #2563eb; }
.hub-hero { position: relative; display: flex; min-height: 265px; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; margin-top: 42px; padding: 42px 58px; border-radius: 28px; color: #fff; background: linear-gradient(118deg, #121a2d 0%, #1c2e50 64%, #2d4a76 100%); box-shadow: 0 22px 45px rgba(24,32,51,.15); }
.hub-hero::after { position: absolute; right: -80px; bottom: -150px; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.035), 0 0 0 68px rgba(255,255,255,.025); content: ""; }
.hub-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: #6b7da5; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hub-hero .hub-kicker { color: #9eb5df; }
.hub-kicker span { display: inline-block; width: 22px; height: 2px; background: currentColor; }
.hub-hero h1 { position: relative; z-index: 1; margin: 0; color: #fff; font-size: clamp(2.2rem, 5vw, 4.3rem); line-height: .98; letter-spacing: -.07em; }
.hub-hero h1 em { color: #f7bd59; font-style: normal; }
.hub-lead { max-width: 430px; margin: 22px 0 0; color: #b9c7df; font-size: .96rem; line-height: 1.6; }
.hub-hero-art { position: relative; z-index: 1; display: grid; width: 210px; height: 210px; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; color: #f7bd59; background: rgba(255,255,255,.04); font-size: 2.4rem; font-weight: 900; letter-spacing: -.08em; }
.hub-hero-art::before { position: absolute; inset: 22px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; content: ""; }
.hub-hero-art i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #f7bd59; }
.hub-hero-art i:nth-of-type(1) { top: 20px; right: 58px; }.hub-hero-art i:nth-of-type(2) { right: 16px; bottom: 58px; background: #8bb6ff; }.hub-hero-art i:nth-of-type(3) { bottom: 33px; left: 55px; background: #f88c8c; }
.hub-section { margin-top: 38px; }
.hub-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.hub-section-heading .hub-kicker { margin-bottom: 5px; }.hub-section-heading h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.05em; }.hub-section-heading > span { color: #94a3b8; font-size: .8rem; font-weight: 700; }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hub-card { position: relative; display: flex; min-height: 208px; flex-direction: column; justify-content: space-between; gap: 20px; padding: 22px; border: 1px solid #e9edf4; border-radius: 20px; background: #fff; box-shadow: 0 10px 26px rgba(24,32,51,.045); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.hub-card:hover, .hub-card:focus-visible { transform: translateY(-4px); border-color: #cbd8ed; box-shadow: 0 16px 34px rgba(24,32,51,.1); }
.hub-card:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.hub-card-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; }
.hub-card-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.hub-tone-amber { color: #b56a00; background: #fff4d7; }.hub-tone-blue { color: #2563eb; background: #e7efff; }.hub-tone-rose { color: #d6496b; background: #ffebf0; }.hub-tone-orange { color: #d15b13; background: #ffeddc; }.hub-tone-violet { color: #7655d8; background: #f0eaff; }.hub-tone-green { color: #16804a; background: #dcfce7; }
.hub-card-content strong, .hub-card-content small { display: block; }.hub-card-content strong { margin-bottom: 7px; font-size: 1.08rem; letter-spacing: -.025em; }.hub-card-content small { color: #748096; line-height: 1.45; }
.hub-card-action { display: flex; align-items: center; justify-content: space-between; color: #2563eb; font-size: .8rem; font-weight: 800; }.hub-card-action span { font-size: 1.1rem; }
.hub-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 44px; padding-top: 18px; border-top: 1px solid #e5eaf2; color: #9aa5b8; font-size: .75rem; }.hub-footer > span:first-child { display: flex; align-items: center; gap: 9px; color: #64748b; font-weight: 700; }
@media (max-width: 860px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hub-hero { padding: 38px; } .hub-hero-art { width: 170px; height: 170px; } }
@media (max-width: 600px) { .hub-shell { width: min(100% - 28px, 520px); padding-top: 18px; }.hub-header { align-items: flex-start; }.hub-user-area { gap: 10px; flex-direction: column; align-items: flex-end; }.hub-user { font-size: .78rem; }.hub-hero { min-height: 0; margin-top: 28px; padding: 30px 24px; border-radius: 22px; }.hub-hero-art { position: absolute; right: -42px; bottom: -38px; width: 160px; height: 160px; opacity: .65; }.hub-hero h1 { font-size: 2.65rem; }.hub-lead { max-width: 245px; font-size: .86rem; }.hub-grid { grid-template-columns: 1fr; gap: 12px; }.hub-card { min-height: 172px; padding: 20px; }.hub-section { margin-top: 30px; }.hub-section-heading h2 { font-size: 1.45rem; }.hub-footer { align-items: flex-start; flex-direction: column; margin-top: 30px; } }
.terminal-hub-link { margin-bottom: 14px; }
.terminal-toolbar { display: grid; gap: 14px; }
.terminal-toolbar > label { margin-top: 4px; }
.terminal-toolbar > input { min-height: 52px; }
.terminal-area-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.terminal-area-heading-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.terminal-area-heading strong { display: block; color: #1e293b; font-size: 1.05rem; }
.terminal-home-button { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid #cbdaf0; border-radius: 10px; color: #2563eb; background: #eff6ff; }
.terminal-home-button svg { width: 19px; height: 19px; fill: currentColor; }
.terminal-home-button:hover, .terminal-home-button:focus-visible { border-color: #93b4f7; color: #1d4ed8; background: #dbeafe; outline: 3px solid #dbeafe; }
.terminal-area-heading > span { color: #64748b; font-size: .85rem; font-weight: 800; white-space: nowrap; }
.terminal-area-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 5px; scrollbar-width: thin; }
.terminal-area-tab { min-height: 50px; flex: 0 0 auto; border: 1px solid #dbe3ef; border-radius: 13px; padding: 11px 17px; color: #475569; background: #f8fafc; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 800; white-space: nowrap; transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease; }
.terminal-area-tab:hover, .terminal-area-tab:focus-visible { border-color: #93b4f7; background: #eff6ff; outline: none; transform: translateY(-1px); }
.terminal-area-tab.is-active { border-color: #2563eb; color: #fff; background: #2563eb; box-shadow: 0 7px 16px rgba(37,99,235,.18); }
.terminal-empty-state { margin: 20px 0; border: 1px dashed #b8c7dc; border-radius: 14px; padding: 28px; color: #64748b; background: #f8fafc; text-align: center; font-weight: 700; }
.terminal-existing-order { position: sticky; top: 10px; z-index: 5; max-height: min(32vh, 300px); margin: -2px 0 18px; overflow-y: auto; border: 2px solid #bfdbfe; border-radius: 15px; padding: 14px 16px; background: rgba(239,246,255,.97); box-shadow: 0 8px 22px rgba(30,64,175,.12); backdrop-filter: blur(8px); }
.terminal-existing-accordion { padding: 0; overflow: hidden; }
.terminal-existing-accordion > summary { list-style: none; cursor: pointer; }
.terminal-existing-accordion > summary::-webkit-details-marker { display: none; }
.terminal-existing-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.terminal-existing-summary .eyebrow { margin-bottom: 3px; }
.terminal-existing-summary h2 { margin: 0; color: #1e3a8a; font-size: 1rem; }
.terminal-existing-count { display: inline-flex; align-items: center; gap: 8px; color: #1d4ed8; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.terminal-existing-count b { display: inline-block; font-size: 1rem; transition: transform .18s ease; }
.terminal-existing-accordion[open] .terminal-existing-count b { transform: rotate(180deg); }
.terminal-existing-content { border-top: 1px solid rgba(147,197,253,.55); padding: 0 16px 14px; }
.terminal-existing-content > p { margin: 9px 0 0; color: #64748b; font-size: .75rem; }
.terminal-existing-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.terminal-existing-heading h2 { margin: 0; color: #1e3a8a; font-size: 1rem; }
.terminal-existing-heading > span { color: #1d4ed8; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.terminal-existing-items { display: grid; gap: 4px; }
.terminal-existing-order .existing-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(147,197,253,.45); padding: 7px 0; }
.terminal-existing-order .existing-item span { color: #1e293b; font-size: .9rem; font-weight: 800; }
.terminal-existing-order .existing-item small { color: #64748b; font-size: .72rem; }
.terminal-existing-order > p { margin: 9px 0 0; color: #64748b; font-size: .75rem; }
@media (max-width: 600px) { .terminal-existing-order { top: 6px; max-height: 28vh; margin-bottom: 14px; padding: 12px; } .terminal-existing-order .existing-item span { font-size: .82rem; } }
.terminal-cart-fab { position: fixed; right: 24px; bottom: 24px; z-index: 55; display: none; min-width: 72px; min-height: 72px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 999px; padding: 0 22px; color: #fff; background: #2563eb; box-shadow: 0 12px 28px rgba(37,99,235,.35); cursor: pointer; font: inherit; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease; }
.terminal-cart-fab:hover, .terminal-cart-fab:focus-visible { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(37,99,235,.42); outline: 3px solid #bfdbfe; outline-offset: 3px; }
.terminal-cart-fab svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.terminal-cart-backdrop { position: fixed; inset: 0; z-index: 58; background: rgba(15,23,42,.52); backdrop-filter: blur(3px); }
.terminal-cart-dialog { position: fixed !important; top: 5vh; right: 5vw; bottom: 5vh; z-index: 60; display: flex; width: min(560px, 90vw); max-height: 90vh; flex-direction: column; overflow-y: auto; margin: 0; border: 2px solid #bfdbfe; box-shadow: 0 24px 70px rgba(15,23,42,.28); opacity: 0; pointer-events: none; transform: translateY(42px) scale(.97); transition: opacity .24s ease, transform .24s cubic-bezier(.22,1,.36,1); }
.terminal-cart-dialog.is-open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.terminal-cart-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.terminal-main .terminal-cart-dialog-header .icon-button { display: none; }
.terminal-request-modal { z-index: 80; }
.terminal-cart-dialog-header h2 { margin: 0; }
.terminal-cart-dialog .cart-items { min-height: 80px; max-height: 42vh; overflow-y: auto; }
.terminal-cart-dialog .send-order { margin-top: 12px; }
body.terminal-cart-open { overflow: hidden; }
@media (max-width: 760px) { .terminal-cart-fab { display: inline-flex; right: 16px; bottom: 16px; min-width: 64px; min-height: 64px; padding: 0 17px; }.terminal-cart-fab span { display: none; }.terminal-main .terminal-cart-dialog-header .icon-button { display: grid; }.terminal-cart-dialog { top: 3vh; right: 3vw; bottom: 3vh; width: 94vw; max-height: 94vh; padding: 16px; }.terminal-cart-dialog .cart-items { max-height: 38vh; } }
body.terminal-body .mobile-header { display: none !important; }
.terminal-main .terminal-category-grid { display: flex; flex-wrap: nowrap; gap: 10px; margin-bottom: 18px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.terminal-main .terminal-category-card { flex: 0 0 112px; min-height: 78px; padding: 9px 8px; border-width: 1px; }
.terminal-main .terminal-category-symbol { width: 38px; height: 38px; font-size: 1.2rem; }
.terminal-main .terminal-category-card strong { font-size: .95rem; }
.terminal-main .terminal-category-card small { font-size: .68rem; }
.restaurant-table-history { border: 1px solid #bfdbfe; border-radius: 9px; padding: 7px 9px; color: #2563eb; background: #eff6ff; cursor: pointer; font-size: .72rem; font-weight: 800; }
.restaurant-table-history:hover, .restaurant-table-history:focus-visible { background: #dbeafe; outline: 2px solid #93c5fd; outline-offset: 2px; }
.restaurant-history-modal { z-index: 70; }
.restaurant-history-card { width: min(720px, 94vw); max-height: 88vh; overflow-y: auto; }
.restaurant-history-loading { padding: 24px 0; color: #64748b; text-align: center; }
.restaurant-history-order { margin-top: 12px; border: 1px solid #e2e8f0; border-radius: 13px; padding: 14px; background: #f8fafc; }
.restaurant-history-order-heading, .restaurant-history-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.restaurant-history-order-heading small { display: block; margin-top: 4px; color: #64748b; }
.restaurant-history-items { margin: 12px 0; border-top: 1px solid #e2e8f0; }
.restaurant-history-items > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e2e8f0; padding: 8px 0; font-size: .88rem; }
.restaurant-history-order > p { margin: 8px 0; color: #64748b; font-size: .8rem; }
.restaurant-history-total { border-top: 2px solid #cbd5e1; padding-top: 10px; font-weight: 800; }
.terminal-main .product-panel { min-width: 0; }
.terminal-main .terminal-category-grid { width: 100%; max-width: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; touch-action: pan-x pan-y; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.terminal-main .terminal-category-card { width: 112px; min-width: 112px; flex: 0 0 112px; scroll-snap-align: start; }
.terminal-cancel-order { margin-bottom: 12px; color: #b91c1c; border-color: #fecaca; background: #fff1f2; }
.terminal-cancel-order:hover, .terminal-cancel-order:focus-visible { border-color: #fca5a5; background: #ffe4e6; }
.restaurant-table-account { border: 1px solid #fed7aa; border-radius: 9px; padding: 7px 9px; color: #c2410c; background: #fff7ed; cursor: pointer; font-size: .72rem; font-weight: 800; }
.restaurant-table-account:hover, .restaurant-table-account:focus-visible { background: #ffedd5; outline: 2px solid #fdba74; outline-offset: 2px; }
.action-dropdown { position: relative; display: inline-flex; }
.action-dropdown-toggle { min-height: 42px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 12px; color: #334155; background: #fff; cursor: pointer; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.action-dropdown-toggle:hover, .action-dropdown-toggle:focus-visible { border-color: #93b4f7; background: #eff6ff; outline: 2px solid #bfdbfe; outline-offset: 2px; }
.action-dropdown-menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 25; display: grid; min-width: 190px; gap: 5px; border: 1px solid #dbe3ef; border-radius: 12px; padding: 7px; background: #fff; box-shadow: 0 14px 30px rgba(15,23,42,.16); }
.action-dropdown-menu[hidden] { display: none !important; visibility: hidden; }
.action-dropdown-item, .action-dropdown-menu .restaurant-print-receipt, .action-dropdown-menu .terminal-cancel-order { display: block; width: 100%; border: 0; border-radius: 8px; padding: 11px 12px; color: #334155; background: transparent; cursor: pointer; text-align: left; font: inherit; font-size: .8rem; font-weight: 800; }
.action-dropdown-item:hover, .action-dropdown-item:focus-visible, .action-dropdown-menu button:hover, .action-dropdown-menu button:focus-visible { background: #eff6ff; outline: none; }
.action-dropdown-menu .terminal-cancel-order { color: #b91c1c; background: #fff1f2; }
.restaurant-table-actions { width: 100%; margin-top: 2px; }
.restaurant-table-actions .action-dropdown-toggle { width: 100%; }
.restaurant-order-actions { margin-left: 4px; }
@media (max-width: 600px) { .action-dropdown-menu { position: fixed; right: 16px; bottom: 16px; min-width: min(260px, calc(100vw - 32px)); } .restaurant-order-actions { margin: 0; } }
.terminal-order-actions { position: relative; z-index: 30; display: flex; justify-content: flex-end; margin: -4px 0 12px; }
.terminal-order-actions .action-dropdown-toggle { min-height: 46px; border: 1px solid #c7d6ee; border-radius: 12px; padding: 10px 15px; color: #1d4ed8; background: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.08); font-size: .84rem; }
.terminal-order-actions .action-dropdown-toggle span { display: inline-block; margin-left: 7px; color: #64748b; font-size: .95rem; transition: transform .18s ease; }
.terminal-order-actions .action-dropdown-toggle[aria-expanded="true"] { border-color: #2563eb; color: #fff; background: #2563eb; box-shadow: 0 8px 18px rgba(37,99,235,.22); }
.terminal-order-actions .action-dropdown-toggle[aria-expanded="true"] span { color: #dbeafe; transform: rotate(180deg); }
.terminal-order-actions .action-dropdown-menu { top: 0; right: auto; left: calc(100% + 8px); bottom: auto; min-width: 245px; border: 1px solid #d6e2f3; border-radius: 14px; padding: 8px; box-shadow: 0 18px 36px rgba(15,23,42,.18); }
.terminal-order-actions .terminal-cancel-order { border-radius: 10px; padding: 13px 14px; font-size: .82rem; }
.terminal-order-actions .terminal-print-receipt { color: #1d4ed8; background: #eff6ff; }
.terminal-order-actions .terminal-print-receipt:hover, .terminal-order-actions .terminal-print-receipt:focus-visible { background: #dbeafe; }
.terminal-order-actions .terminal-print-receipt:disabled { cursor: wait; opacity: .65; }
.terminal-order-actions .terminal-finish-table { border-radius: 10px; padding: 13px 14px; color: #1d4ed8; background: #eff6ff; font-size: .82rem; text-decoration: none; }
.terminal-order-actions .terminal-finish-table:hover, .terminal-order-actions .terminal-finish-table:focus-visible { background: #dbeafe; outline: none; }
.terminal-order-actions.is-open { z-index: 100; }
.terminal-order-actions .action-dropdown-menu { position: absolute !important; z-index: 110; }
.terminal-order-actions.is-open .action-dropdown-menu:not([hidden]) { animation: action-menu-in .16s ease-out both; transform-origin: top right; }
.terminal-main .page-heading > .terminal-back-link { margin-left: auto; align-self: flex-start; white-space: nowrap; }

/* Terminal workbench: touch-first visual hierarchy and accessible focus states. */
.terminal-main { max-width: 1360px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 42px) 128px; background: #f5f7fb; }
.terminal-main :focus-visible { outline: 3px solid #f59e0b; outline-offset: 3px; }
.terminal-page-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-direction: row; margin-bottom: 22px; }
.terminal-heading-copy { display: grid; gap: 5px; }
.terminal-table-heading-row { display: flex; align-items: center; gap: 11px; }
.terminal-detail-home { display: inline-grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid #cbdaf0; border-radius: 10px; color: #2563eb; background: #eff6ff; }
.terminal-detail-home svg { width: 19px; height: 19px; fill: currentColor; }
.terminal-detail-home:hover, .terminal-detail-home:focus-visible { border-color: #93b4f7; color: #1d4ed8; background: #dbeafe; outline: 3px solid #dbeafe; }
.terminal-heading-copy .eyebrow { margin: 0; color: #526b94; letter-spacing: .14em; }
.terminal-heading-copy h1 { margin: 0; color: #0f172a; font-size: clamp(1.9rem, 3vw, 2.55rem); letter-spacing: -.045em; }
.terminal-table-status { display: inline-flex; width: fit-content; align-items: center; gap: 7px; margin-top: 4px; color: #64748b; font-size: .76rem; font-weight: 800; }
.terminal-table-status::before { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; content: ''; }
.terminal-table-status.table-status-occupied::before { background: #2563eb; box-shadow: 0 0 0 4px #dbeafe; }
.terminal-table-status.table-status-reserved::before { background: #f59e0b; box-shadow: 0 0 0 4px #fef3c7; }
.terminal-heading-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 10px; margin-left: auto; justify-self: end; }
.terminal-heading-actions .terminal-back-link { order: -1; margin: 0; padding: 9px 0; color: #1d4ed8; font-size: .85rem; }
.terminal-heading-actions .terminal-back-link:hover { color: #1e40af; }
.terminal-heading-actions .terminal-order-actions { margin: 0; }
.terminal-heading-actions .action-dropdown-toggle { min-width: 178px; justify-content: center; }
.terminal-main .order-layout { grid-template-columns: minmax(0, 1fr) minmax(330px, 380px); gap: 20px; align-items: start; }
.terminal-main .product-panel, .terminal-main .cart-panel { border: 1px solid #dce5f2; border-radius: 20px; background: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .06); }
.terminal-main .product-panel { min-width: 0; padding: clamp(16px, 2.4vw, 26px); }
.terminal-main .cart-panel { border-color: #cbdaf0; padding: 20px; }
.terminal-category-heading { align-items: end; margin: 0 0 12px; }
.terminal-category-heading h2 { color: #0f172a; font-size: 1.35rem; letter-spacing: -.025em; }
.terminal-category-heading > span { color: #64748b; font-size: .76rem; font-weight: 700; }
.terminal-main .terminal-category-grid { gap: 10px; margin: 0 -2px 18px; padding: 3px 2px 10px; }
.terminal-main .terminal-category-card { flex-basis: 112px; min-height: 78px; border: 1px solid #dbe4f0; border-radius: 15px; color: #334155; background: #f8fafc; box-shadow: 0 2px 8px rgba(15, 23, 42, .03); transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease; }
.terminal-main .terminal-category-card:hover, .terminal-main .terminal-category-card:focus-visible { border-color: #93b4f7; background: #eff6ff; box-shadow: 0 7px 18px rgba(37, 99, 235, .12); transform: translateY(-2px); }
.terminal-main .terminal-category-card.is-active { border-color: #2563eb; color: #fff; background: linear-gradient(145deg, #2563eb, #1d4ed8); box-shadow: 0 10px 22px rgba(37, 99, 235, .22); }
.terminal-main .terminal-category-card.is-active small { color: #dbeafe; }
.terminal-main .terminal-category-card[aria-pressed="true"] .terminal-category-symbol { background: rgba(255,255,255,.2); }
.terminal-main .terminal-category-symbol { margin-bottom: 4px; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.terminal-main .terminal-product-search { margin-bottom: 16px; }
.terminal-main .terminal-product-search input { border-color: #cbd8ea; border-radius: 13px; background: #fbfdff; box-shadow: inset 0 1px 2px rgba(15,23,42,.025); }
.terminal-main .terminal-product-search input:focus { border-color: #2563eb; box-shadow: 0 0 0 4px #dbeafe; }
.terminal-main .product-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.terminal-main .product-card { min-height: 166px; border: 1px solid #dce5f2; border-radius: 16px; padding: 17px; box-shadow: 0 4px 14px rgba(15,23,42,.035); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.terminal-main .product-card:hover { border-color: #9db9e8; box-shadow: 0 10px 22px rgba(37,99,235,.1); transform: translateY(-2px); }
.terminal-main .product-card[hidden] { display: none !important; }
.terminal-main .product-card strong { color: #172033; font-size: .98rem; }
.terminal-main .quick-quantity-control { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; margin-top: -5px; border: 1px solid #bfdbfe; border-radius: 10px; padding: 4px; background: #eff6ff; }
.terminal-main .quick-quantity-control span { min-width: 24px; color: #1e3a8a; text-align: center; font-size: .88rem; font-weight: 900; }
.terminal-main .product-card-footer { margin-top: auto; align-items: end; }
.terminal-main .product-card-footer > span { color: #172033; font-size: 1rem; font-weight: 900; }
.terminal-main .add-product { min-width: 86px; min-height: 48px; border-radius: 11px; box-shadow: 0 6px 12px rgba(37,99,235,.16); }
.terminal-main .modifier-select { margin-top: 8px; border-radius: 10px; border-color: #cbd8ea; background-color: #fbfdff; }
.terminal-main .product-empty-state { margin: 10px 0 0; }
.terminal-main .terminal-existing-accordion { margin-bottom: 18px; border-color: #c8dbf7; background: #f7fbff; box-shadow: none; }
.terminal-main .terminal-existing-summary { min-height: 64px; padding: 12px 15px; }
.terminal-main .terminal-existing-content { background: rgba(255,255,255,.52); }
.terminal-main .cart-panel h2 { color: #0f172a; font-size: 1.18rem; }
.terminal-main .cart-panel .cart-total { border-top-color: #dce5f2; }
.terminal-main .cart-panel .send-order { min-height: 54px; box-shadow: 0 8px 16px rgba(37,99,235,.18); }
.terminal-main .terminal-cart-fab { min-height: 64px; min-width: 64px; padding: 0 20px; border: 4px solid #fff; box-shadow: 0 14px 30px rgba(37,99,235,.3); }
.terminal-main .terminal-cart-fab:focus-visible { outline-offset: 4px; }
@media (max-width: 760px) {
    .terminal-main { padding: 20px 12px 116px; }
    .terminal-page-heading { align-items: flex-start; gap: 10px; margin-bottom: 16px; }
    .terminal-heading-copy h1 { font-size: 1.85rem; }
    .terminal-heading-actions { gap: 5px; }
    .terminal-heading-actions .terminal-back-link { padding: 5px 0; }
    .terminal-heading-actions .action-dropdown-toggle { min-width: 154px; padding: 10px 11px; font-size: .78rem; }
    .terminal-main .order-layout { display: block; }
    .terminal-main .product-panel { padding: 15px; }
    .terminal-main .terminal-category-heading { align-items: start; flex-direction: column; gap: 3px; }
    .terminal-main .terminal-category-heading > span { align-self: flex-end; }
    .terminal-main .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .terminal-main .product-card { min-height: 148px; padding: 14px 12px; }
    .terminal-main .product-card-footer { align-items: end; flex-direction: column; gap: 8px; }
    .terminal-main .add-product { width: 100%; min-height: 46px; }
    .terminal-main .terminal-cart-fab { right: 14px; bottom: 14px; }
}
@media (max-width: 430px) {
    .terminal-main .terminal-category-card { flex-basis: 102px; min-height: 78px; }
    .terminal-main .product-card strong { font-size: .9rem; }
    .terminal-main .product-card-footer > span { align-self: flex-start; font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
    .terminal-main *, .terminal-main *::before, .terminal-main *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* SUNMI M2 compact profile: 5in 1280x720 hardware, usually a very narrow CSS viewport. */
@media (max-width: 380px) and (max-height: 700px), (max-width: 700px) and (max-height: 430px) {
    body.terminal-body { min-width: 0; overflow-x: hidden; }
    .terminal-main { width: 100%; max-width: 100%; min-width: 0; padding: 12px 8px 88px; }
    .terminal-main .terminal-page-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 12px; }
    .terminal-main .terminal-heading-copy h1 { max-width: 100%; font-size: 1.45rem; letter-spacing: -.035em; }
    .terminal-main .terminal-heading-copy .eyebrow { margin-bottom: 4px; font-size: .62rem; }
    .terminal-main .terminal-table-status { font-size: .68rem; }
    .terminal-main .terminal-heading-actions { min-width: 0; gap: 4px; }
    .terminal-main .terminal-heading-actions .terminal-back-link { max-width: 100%; overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
    .terminal-main .terminal-heading-actions .action-dropdown-toggle { min-width: 0; width: 100%; padding: 8px 7px; font-size: .68rem; white-space: nowrap; }
    .terminal-main .terminal-order-actions .action-dropdown-menu { top: calc(100% + 8px); right: 0; left: auto; min-width: min(230px, calc(100vw - 24px)); }
    .terminal-main .terminal-toolbar { margin-bottom: 10px; padding: 12px; border-radius: 13px; }
    .terminal-main .terminal-area-heading strong { font-size: .86rem; }
    .terminal-main .terminal-area-heading > span { font-size: .68rem; }
    .terminal-main .terminal-area-tabs { gap: 6px; padding-bottom: 4px; }
    .terminal-main .terminal-area-tab { min-height: 42px; padding: 8px 11px; border-radius: 10px; font-size: .72rem; }
    .terminal-main .terminal-index-summary { gap: 6px; margin: 10px 0 12px; }
    .terminal-main .terminal-stat { min-height: 58px; padding: 8px; border-radius: 11px; }
    .terminal-main .terminal-stat small { font-size: .62rem; }
    .terminal-main .terminal-stat strong { font-size: 1.1rem; }
    .terminal-main .terminal-stat-icon { width: 25px; height: 25px; font-size: .82rem; }
    .terminal-main .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .terminal-main .terminal-table-card { min-height: 116px; padding: 10px; border-radius: 12px; }
    .terminal-main .table-card-area, .terminal-main .table-area { max-width: 70px; overflow: hidden; font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
    .terminal-main .table-card-number { margin: 10px 0 5px; font-size: .7rem; }
    .terminal-main .table-card-number strong { font-size: 1.15rem; }
    .terminal-main .table-card-bottom small { font-size: .58rem; }
    .terminal-main .table-card-arrow { width: 24px; height: 24px; font-size: .85rem; }
    .terminal-main .order-layout { display: block; }
    .terminal-main .product-panel { width: 100%; padding: 10px; border-radius: 14px; }
    .terminal-main .terminal-existing-order { max-height: 30vh; margin-bottom: 10px; padding: 8px; border-radius: 11px; }
    .terminal-main .terminal-existing-summary { min-height: 48px; padding: 8px 9px; }
    .terminal-main .terminal-existing-summary h2, .terminal-main .terminal-existing-heading h2 { font-size: .82rem; }
    .terminal-main .terminal-existing-count { font-size: .66rem; }
    .terminal-main .terminal-category-heading { margin-bottom: 8px; }
    .terminal-main .terminal-category-heading h2 { font-size: 1rem; }
    .terminal-main .terminal-category-heading > span { font-size: .62rem; }
    .terminal-main .terminal-category-grid { gap: 6px; margin: 0 -2px 10px; padding: 2px 2px 6px; }
    .terminal-main .terminal-category-card { width: 86px; min-width: 86px; flex-basis: 86px; min-height: 78px; padding: 7px 5px; border-radius: 10px; }
    .terminal-main .terminal-category-symbol { width: 28px; height: 28px; margin-bottom: 1px; border-radius: 8px; font-size: .92rem; }
    .terminal-main .terminal-category-card strong { font-size: .9rem; }
    .terminal-main .terminal-category-card small { font-size: .62rem; }
    .terminal-main .terminal-product-search { margin-bottom: 10px; }
    .terminal-main .terminal-product-search input, .terminal-main #product-search { min-height: 44px; padding: 10px 12px; border-radius: 10px; font-size: .85rem; }
    .terminal-main .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .terminal-main .product-card { min-height: 128px; gap: 7px; padding: 10px 8px; border-radius: 11px; }
    .terminal-main .product-card strong { display: -webkit-box; overflow: hidden; font-size: .78rem; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .terminal-main .product-card small { max-height: 28px; overflow: hidden; font-size: .62rem; line-height: 1.25; }
    .terminal-main .modifier-options { margin: 4px 0 0; padding: 5px; font-size: .62rem; }
    .terminal-main .modifier-options label { gap: 4px; padding: 3px 0; }
    .terminal-main .modifier-options small { font-size: .57rem; }
    .terminal-main .product-card-footer { align-items: center; flex-direction: row; gap: 5px; }
    .terminal-main .product-card-footer > span { min-width: 0; font-size: .72rem; }
    .terminal-main .add-product { min-width: 0; width: auto; min-height: 38px; padding: 8px 9px; border-radius: 8px; font-size: .7rem; }
    .terminal-main .quick-quantity-control span { min-width: 18px; font-size: .72rem; }
    .terminal-main .cart-panel { position: static; width: 100%; margin-top: 10px; padding: 12px; border-radius: 14px; }
    .terminal-main .terminal-cart-dialog { position: fixed !important; margin: 0; }
    .terminal-main .cart-panel h2 { font-size: .98rem; }
    .terminal-main .cart-row { gap: 7px; padding: 9px 0; }
    .terminal-main .cart-row small { max-width: 145px; font-size: .68rem; }
    .terminal-main .cart-controls button { width: 38px; height: 38px; min-width: 38px; min-height: 38px; border-radius: 8px; font-size: 1rem; }
    .terminal-main .cart-controls span { min-width: 20px; font-size: .85rem; }
    .terminal-main .cart-panel textarea { min-height: 72px; padding: 9px; font-size: .8rem; }
    .terminal-main .send-order { min-height: 46px; border-radius: 9px; font-size: .82rem; }
    .terminal-main .terminal-request-card { width: min(100%, calc(100vw - 20px)); padding: 14px; border-radius: 13px; }
    .terminal-main .terminal-request-card h2 { font-size: 1rem; }
    .terminal-main .terminal-request-actions button { min-height: 44px; font-size: .78rem; }
}

/* Terminal landing page: clear status hierarchy and quick table selection. */
.terminal-main.terminal-main { max-width: 1440px; padding-top: clamp(28px, 5vw, 64px); padding-bottom: 72px; }
.terminal-index-heading { align-items: flex-end; margin-bottom: 28px; }
.terminal-index-heading-copy { display: grid; gap: 6px; }
.terminal-index-heading-copy .terminal-hub-link { width: fit-content; margin-bottom: 8px; color: #2563eb; font-size: .85rem; font-weight: 800; }
.terminal-index-heading-copy .terminal-hub-link:hover { color: #1d4ed8; }
.terminal-index-heading-copy h1 { color: #0f172a; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.055em; }
.terminal-index-lead { margin: 3px 0 0; color: #64748b; font-size: 1rem; }
.terminal-index-heading > .status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; box-shadow: 0 5px 12px rgba(22,101,52,.08); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.terminal-main .terminal-toolbar { border-color: #d7e2f1; padding: clamp(17px, 2.5vw, 24px); box-shadow: 0 10px 28px rgba(15,23,42,.05); }
.terminal-main .terminal-toolbar .terminal-area-heading { margin-bottom: 1px; }
.terminal-main .terminal-toolbar > label { color: #334155; font-size: .84rem; }
.terminal-main .terminal-toolbar > input { border-color: #cbd8ea; background: #fbfdff; box-shadow: inset 0 1px 2px rgba(15,23,42,.025); }
.terminal-main .terminal-toolbar > input:focus { border-color: #2563eb; outline: 3px solid #dbeafe; }
.terminal-index-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 22px; }
.terminal-stat { display: flex; align-items: center; gap: 12px; min-height: 78px; border: 1px solid #e2e8f0; border-radius: 15px; padding: 14px 16px; background: #fff; box-shadow: 0 5px 16px rgba(15,23,42,.035); }
.terminal-stat > span:last-child { display: grid; gap: 3px; }
.terminal-stat small { color: #64748b; font-size: .74rem; font-weight: 700; }
.terminal-stat strong { color: #0f172a; font-size: 1.45rem; line-height: 1; }
.terminal-stat-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #2563eb; background: #eff6ff; font-weight: 900; }
.terminal-stat-available .terminal-stat-icon { color: #15803d; background: #dcfce7; }
.terminal-stat-occupied .terminal-stat-icon { color: #1d4ed8; background: #dbeafe; }
.terminal-stat-reserved .terminal-stat-icon { color: #b45309; background: #fef3c7; }
.terminal-main .terminal-table-card { min-height: 152px; gap: 0; border: 1px solid #dbe4f0; border-radius: 17px; padding: 17px; box-shadow: 0 7px 18px rgba(15,23,42,.045); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.terminal-main .terminal-table-card:hover, .terminal-main .terminal-table-card:focus-visible { border-color: #8fb1ec; box-shadow: 0 13px 26px rgba(37,99,235,.13); transform: translateY(-3px); }
.terminal-main .terminal-table-card:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.table-card-top, .table-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.table-status-label { border-radius: 999px; padding: 5px 8px; color: #166534; background: #dcfce7; font-size: .66rem; font-weight: 800; }
.table-status-occupied .table-status-label { color: #1d4ed8; background: #dbeafe; }
.table-status-reserved .table-status-label { color: #92400e; background: #fef3c7; }
.table-card-number { margin: 18px 0 10px; color: #64748b; font-size: .86rem; }
.table-card-number strong { display: inline-block; margin-left: 4px; color: #0f172a; font-size: 1.55rem; letter-spacing: -.04em; }
.table-card-bottom small { color: #64748b; font-size: .76rem; }
.table-card-arrow { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #2563eb; background: #eff6ff; font-size: 1.1rem; font-weight: 900; transition: transform .16s ease; }
.terminal-table-card:hover .table-card-arrow { transform: translateX(3px); }
.terminal-main .terminal-table-card.table-status-occupied { border: 2px solid #60a5fa !important; background: linear-gradient(145deg, #eff6ff, #dbeafe); box-shadow: 0 8px 20px rgba(37,99,235,.14); }
.terminal-main .terminal-table-card.table-status-occupied .table-status-label { color: #1e40af; background: #bfdbfe; }
.terminal-main .terminal-table-card.table-status-occupied .table-card-number strong { color: #1e3a8a; }
.terminal-main .terminal-table-card.table-status-occupied .table-card-arrow { color: #fff; background: #2563eb; }
.table-status-reserved { border-color: #fde68a !important; background: linear-gradient(145deg, #fff, #fffdf5); }
.table-status-available { border-color: #bbf7d0 !important; background: linear-gradient(145deg, #fff, #fbfffc); }
@media (max-width: 760px) {
    .terminal-main.terminal-main { padding-top: 24px; }
    .terminal-index-heading { align-items: flex-start; gap: 16px; }
    .terminal-index-heading > .status-badge { align-self: flex-start; }
    .terminal-index-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
    .terminal-index-summary { gap: 8px; }
    .terminal-stat { min-height: 70px; padding: 11px; }
    .terminal-stat-icon { width: 30px; height: 30px; }
    .terminal-stat strong { font-size: 1.25rem; }
    .terminal-stat small { font-size: .68rem; }
}

/* Order heading actions: keep navigation and table actions on one deliberate row. */
.terminal-page-heading .terminal-heading-actions { flex-direction: row; align-items: center; gap: 12px; }
.terminal-page-heading .terminal-heading-actions .terminal-back-link { display: inline-flex; min-height: 46px; align-items: center; margin: 0; border: 1px solid transparent; border-radius: 11px; padding: 10px 13px; color: #1d4ed8; background: transparent; font-size: .84rem; font-weight: 800; }
.terminal-page-heading .terminal-heading-actions .terminal-back-link:hover, .terminal-page-heading .terminal-heading-actions .terminal-back-link:focus-visible { border-color: #c7d6ee; background: #eff6ff; outline: none; }
.terminal-page-heading .terminal-heading-actions .terminal-order-actions { margin: 0; }
.terminal-page-heading .terminal-heading-actions .action-dropdown-toggle { min-width: 178px; min-height: 46px; border-radius: 11px; padding: 10px 14px; font-weight: 800; }
@media (max-width: 760px) {
    .terminal-page-heading .terminal-heading-actions { width: 100%; justify-content: space-between; }
    .terminal-page-heading .terminal-heading-actions .terminal-back-link { padding-inline: 4px; }
    .terminal-page-heading .terminal-heading-actions .action-dropdown-toggle { min-width: 0; padding-inline: 13px; }
}
@media (max-width: 360px) {
    .terminal-page-heading .terminal-heading-actions { gap: 6px; }
    .terminal-page-heading .terminal-heading-actions .terminal-back-link { font-size: .78rem; }
    .terminal-page-heading .terminal-heading-actions .action-dropdown-toggle { padding-inline: 10px; font-size: .76rem; }
}
.restaurant-table-actions .action-dropdown-menu, .restaurant-order-actions .action-dropdown-menu { top: calc(100% + 8px); bottom: auto; }
.restaurant-table-actions .action-dropdown-toggle, .restaurant-order-actions .action-dropdown-toggle { box-shadow: 0 4px 12px rgba(15,23,42,.06); }
.action-dropdown.is-open { z-index: 40; }
.action-dropdown.is-open .action-dropdown-menu:not([hidden]) { animation: action-menu-in .16s ease-out both; transform-origin: top right; }
.action-dropdown-menu::before { position: absolute; top: -6px; right: 18px; width: 10px; height: 10px; border-top: 1px solid #d6e2f3; border-left: 1px solid #d6e2f3; background: #fff; content: ''; transform: rotate(45deg); }
@keyframes action-menu-in { from { opacity: 0; transform: translateY(-5px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.terminal-order-actions .action-dropdown-menu::before { right: 18px; }

/* Audit activity: make errors immediately distinguishable from normal actions. */
.audit-page-heading { align-items: flex-start; }
.audit-page-lead { max-width: 680px; margin: 8px 0 0; color: #64748b; }
.audit-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: -8px 0 22px; }
.audit-summary-card { display: flex; align-items: center; gap: 13px; min-height: 86px; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px 18px; background: #fff; box-shadow: 0 7px 20px rgba(15,23,42,.045); }
.audit-summary-card > div { display: grid; gap: 4px; }
.audit-summary-card small { color: #64748b; font-size: .76rem; font-weight: 700; }
.audit-summary-card strong { color: #0f172a; font-size: 1.65rem; line-height: 1; }
.audit-summary-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: #2563eb; background: #eff6ff; font-weight: 900; }
.audit-summary-card-error { border-color: #fecaca; background: linear-gradient(145deg, #fff, #fff7f7); }
.audit-summary-card-error .audit-summary-icon { color: #dc2626; background: #fee2e2; }
.audit-summary-card-error strong { color: #b91c1c; }
.audit-summary-card-action .audit-summary-icon { color: #15803d; background: #dcfce7; }
.audit-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.audit-section-heading h2 { margin-bottom: 0; }
.audit-filter-card { margin-bottom: 18px; }
.audit-filter-grid { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
.audit-result-count { border-radius: 999px; padding: 7px 11px; color: #526b94; background: #f1f5f9; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.audit-log-card { overflow: hidden; }
.audit-log-card .table-wrap { margin: 0 -24px -24px; }
.audit-log-card table { min-width: 850px; }
.audit-log-card tbody tr { transition: background .15s ease; }
.audit-log-card tbody tr:hover { background: #f8fafc; }
.audit-log-card tbody tr.audit-row-error { background: #fff7f7; box-shadow: inset 4px 0 0 #ef4444; }
.audit-log-card tbody tr.audit-row-error:hover { background: #fef2f2; }
.audit-action-badge { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; border-radius: 999px; padding: 5px 8px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.audit-action-badge span { display: grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; font-size: .65rem; }
.audit-action-badge.is-action { color: #166534; background: #dcfce7; }
.audit-action-badge.is-action span { color: #fff; background: #16a34a; }
.audit-action-badge.is-error { color: #b91c1c; background: #fee2e2; }
.audit-action-badge.is-error span { color: #fff; background: #dc2626; }
.audit-action-name { color: #172033; font-size: .86rem; }
.audit-row-error .audit-action-name { color: #991b1b; }
.audit-detail { display: block; max-width: 390px; overflow-wrap: anywhere; color: #64748b; line-height: 1.45; }
@media (max-width: 760px) {
    .audit-summary-grid { grid-template-columns: 1fr; margin-top: 0; }
    .audit-filter-grid { grid-template-columns: 1fr; }
    .audit-section-heading { align-items: flex-start; flex-direction: column; }
    .audit-log-card .table-wrap { margin-inline: -16px; }
}

/* Settings: compact, typed controls with a clear save action for each value. */
.settings-page-heading { align-items: flex-start; }
.settings-page-lead { max-width: 680px; margin: 8px 0 0; color: #64748b; }
.settings-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 14px; margin: -8px 0 22px; }
.settings-summary-card { display: flex; align-items: center; gap: 13px; min-height: 82px; border: 1px solid #e2e8f0; border-radius: 16px; padding: 15px 18px; background: #fff; box-shadow: 0 7px 20px rgba(15,23,42,.045); }
.settings-summary-card > div { display: grid; gap: 4px; }
.settings-summary-card small { color: #64748b; font-size: .76rem; font-weight: 700; }
.settings-summary-card strong { color: #0f172a; font-size: 1.35rem; line-height: 1; }
.settings-summary-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: #2563eb; background: #eff6ff; font-weight: 900; }
.settings-summary-icon.is-safe { color: #15803d; background: #dcfce7; }
.settings-panel { padding-bottom: 0; }
.settings-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.settings-panel-heading h2 { margin-bottom: 0; }
.settings-hint { color: #64748b; font-size: .78rem; font-weight: 700; }
.settings-list { display: grid; margin: 0 -24px; border-top: 1px solid #e8edf4; }
.settings-row { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(220px, 1.15fr) auto; align-items: center; gap: 18px; padding: 18px 24px; border-bottom: 1px solid #e8edf4; }
.settings-row:hover { background: #fbfdff; }
.settings-row-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.settings-row-info strong, .settings-row-info small { display: block; }
.settings-row-info strong { color: #172033; font-size: .92rem; }
.settings-row-info small { margin-top: 5px; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .72rem; }
.settings-type-badge { flex: 0 0 auto; border-radius: 999px; padding: 5px 8px; color: #526b94; background: #eef4ff; font-size: .66rem; font-weight: 800; }
.settings-row input, .settings-row textarea { width: 100%; min-width: 0; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px; background: #fff; color: #172033; font: inherit; }
.settings-row textarea { resize: vertical; }
.settings-row input:focus, .settings-row textarea:focus { border-color: #2563eb; outline: 3px solid #dbeafe; }
.settings-row-action { display: flex; align-items: center; gap: 12px; }
.settings-row-action small { color: #94a3b8; font-size: .7rem; white-space: nowrap; }
.settings-row-action .secondary-button { min-height: 40px; padding: 8px 13px; white-space: nowrap; }
.settings-switch { display: inline-flex; align-items: center; gap: 9px; color: #475569; font-size: .82rem; font-weight: 800; cursor: pointer; }
.settings-switch input[type="checkbox"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-switch-track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: background .15s ease; }
.settings-switch-track::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.2); content: ''; transition: transform .15s ease; }
.settings-switch input:checked + .settings-switch-track { background: #2563eb; }
.settings-switch input:checked + .settings-switch-track::after { transform: translateX(18px); }
.settings-switch input:focus-visible + .settings-switch-track { outline: 3px solid #bfdbfe; outline-offset: 2px; }
.settings-empty { margin: 0; padding: 28px; color: #64748b; text-align: center; }
@media (max-width: 900px) {
    .settings-row { grid-template-columns: 1fr 1fr; }
    .settings-row-info { grid-column: 1 / -1; }
    .settings-row-action { justify-content: flex-end; }
}

/* Reports: make the selected period and top-selling products the visual focus. */
.report-page-heading { align-items: flex-start; }
.report-page-lead { max-width: 700px; margin: 8px 0 0; color: #64748b; }
.report-live-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.report-live-status { display: inline-flex; align-items: center; gap: 7px; color: #15803d; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.report-live-status i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
.report-live-status.is-refreshing { color: #1d4ed8; }
.report-live-status.is-refreshing i { background: #3b82f6; box-shadow: 0 0 0 4px #dbeafe; }
.report-live-status.is-error { color: #b91c1c; }
.report-live-status.is-error i { background: #ef4444; box-shadow: 0 0 0 4px #fee2e2; }
.report-period-badge { border: 1px solid #bfdbfe; border-radius: 999px; padding: 8px 12px; color: #1d4ed8; background: #eff6ff; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.report-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.report-filter-heading h2 { margin-bottom: 0; }
.report-filter-heading .eyebrow { margin-bottom: 5px; }
.report-filter-heading .secondary-button { min-height: 40px; }
.report-period { margin: 16px 0 0 !important; border-top: 1px solid #eef2f7; padding-top: 13px; color: #64748b; font-size: .8rem; }
.report-period strong { color: #172033; }
.report-section { overflow: hidden; }
.report-section h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: #172033; }
.report-section .table-wrap { margin-inline: -24px; }
.report-section tbody tr:hover { background: #f8fbff; }
.report-section tbody td strong { color: #172033; }
.report-rank { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: #1d4ed8; background: #dbeafe; font-size: .76rem; font-weight: 900; }
@media (max-width: 760px) {
    .report-page-heading { gap: 12px; }
    .report-live-controls { justify-content: flex-start; }
    .report-period-badge { align-self: flex-start; }
    .report-filter-heading { align-items: flex-start; flex-direction: column; }
    .report-section .table-wrap { margin-inline: -16px; }
}

/* Reports layout refinement: consistent spacing, columns and responsive tables. */
.reports-main { max-width: none; }
.report-filter-accordion { border: 0; }
.report-filter-accordion > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.report-filter-accordion > summary::-webkit-details-marker { display: none; }
.report-filter-accordion > summary > span:first-child { display: grid; gap: 5px; }
.report-filter-accordion > summary .eyebrow { margin: 0; }
.report-filter-accordion > summary strong { color: #172033; font-size: 1.08rem; }
.report-filter-summary-action { display: inline-flex; align-items: center; gap: 9px; border: 1px solid #cbd8e8; border-radius: 10px; padding: 9px 12px; color: #1d4ed8; background: #fff; font-size: .78rem; font-weight: 800; }
.report-filter-summary-action b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #eff6ff; font-size: 1rem; line-height: 1; transition: transform .18s ease; }
.report-filter-accordion[open] .report-filter-summary-action b { transform: rotate(180deg); }
.report-filter-accordion[open] > summary { padding-bottom: 18px; border-bottom: 1px solid #e7edf5; }
.report-filter-body { padding-top: 18px; }
.report-filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; color: #64748b; font-size: .8rem; }
.report-filter-toolbar strong { color: #172033; }
.reports-main .reports-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.reports-main .summary-card { min-height: 132px; align-content: center; border-color: #dfe7f2; padding: 20px; }
.reports-main .summary-card span { font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
.reports-main .summary-card strong { font-size: clamp(1.45rem, 2.5vw, 2rem); letter-spacing: -.04em; }
.reports-main .summary-card:nth-child(1) { border-top: 3px solid #2563eb; }
.reports-main .summary-card:nth-child(2) { border-top: 3px solid #16a34a; }
.reports-main .summary-card:nth-child(3) { border-top: 3px solid #8b5cf6; }
.reports-main .summary-card:nth-child(4) { border-top: 3px solid #f59e0b; }
.reports-main .report-filter-panel { margin-bottom: 22px; border-color: #dbe5f2; background: linear-gradient(145deg, #fff, #f8fbff); }
.reports-main .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.reports-main .filter-grid label { display: grid; gap: 7px; color: #475569; font-size: .78rem; font-weight: 800; }
.reports-main .filter-grid input, .reports-main .filter-grid select { width: 100%; min-height: 44px; border-color: #cbd8e8; border-radius: 10px; }
.reports-main .filter-grid .primary-button { align-self: end; min-height: 44px; }
.report-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.report-section { min-width: 0; padding: 22px; }
.report-section-wide { grid-column: 1 / -1; }
.report-section h2 { min-height: 28px; margin-bottom: 14px; font-size: 1.05rem; }
.report-section .table-wrap { margin: 0; }
.report-section table { min-width: 0; }
.report-section th { padding: 11px 10px; color: #71809a; font-size: .68rem; letter-spacing: .07em; }
.report-section td { padding: 12px 10px; color: #334155; font-size: .84rem; }
.report-section td:last-child, .report-section th:last-child { text-align: right; }
.report-section tbody tr:last-child td { border-bottom: 0; }
.report-section-wide table { min-width: 620px; }
@media (max-width: 1050px) {
    .reports-main .reports-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-main .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .settings-summary-grid { grid-template-columns: 1fr; margin-top: 0; }
    .settings-panel-heading { align-items: flex-start; flex-direction: column; }
    .settings-list { margin-inline: -16px; }
    .settings-row { grid-template-columns: 1fr; gap: 11px; padding-inline: 16px; }
    .settings-row-info, .settings-row-action { grid-column: auto; }
    .settings-row-action { align-items: flex-end; flex-direction: column; }
    .reports-main .reports-summary-grid, .reports-main .filter-grid, .report-data-grid { grid-template-columns: 1fr; }
    .reports-main .summary-card { min-height: 100px; }
    .report-section-wide { grid-column: auto; }
    .report-section-wide table { min-width: 620px; }
    .report-filter-accordion > summary { align-items: flex-start; flex-direction: column; }
    .report-filter-summary-action { width: 100%; justify-content: space-between; }
    .report-filter-toolbar { align-items: flex-start; flex-direction: column; }
    .report-filter-toolbar .secondary-button { width: 100%; text-align: center; }
}

/* Final Sunmi M2 overrides: placed after the terminal desktop rules. */
@media (max-width: 760px) {
    body.terminal-body .terminal-main { width: 100%; max-width: 100%; min-width: 0; padding: 18px 10px 72px; }
    body.terminal-body .terminal-index-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    body.terminal-body .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    body.terminal-body .terminal-table-card { min-height: 126px; padding: 11px; }
    body.terminal-body .terminal-area-tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    body.terminal-body .terminal-area-tab { min-height: 44px; white-space: nowrap; }
    body.terminal-body #table-search { width: 100%; min-height: 46px; font-size: .95rem; }
}
@media (max-width: 390px) {
    body.terminal-body .terminal-main { padding-inline: 7px; }
    body.terminal-body .table-grid { gap: 6px; }
    body.terminal-body .terminal-table-card { min-height: 116px; padding: 9px; }
}

/* Some Android 7 WebViews report a 980px layout viewport even on the M2 panel. */
@media (max-width: 1100px) and (pointer: coarse) {
    body.terminal-body { min-width: 0; overflow-x: hidden; }
    body.terminal-body .terminal-main { width: 100%; max-width: 100%; min-width: 0; padding: 18px 10px 72px; }
    body.terminal-body .terminal-index-heading { gap: 10px; margin-bottom: 14px; }
    body.terminal-body .terminal-index-heading-copy h1 { font-size: 1.55rem; }
    body.terminal-body .terminal-toolbar { margin-bottom: 12px; padding: 12px; }
    body.terminal-body .terminal-area-tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    body.terminal-body .terminal-area-tab { min-height: 44px; padding: 9px 13px; white-space: nowrap; }
    body.terminal-body #table-search { width: 100%; min-height: 46px; font-size: .95rem; }
    body.terminal-body .terminal-index-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
    body.terminal-body .terminal-stat { min-height: 62px; padding: 9px; }
    body.terminal-body .terminal-stat > span:last-child { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 6px; }
    body.terminal-body .terminal-stat small { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
    body.terminal-body .terminal-stat strong { font-size: 1.15rem; }
    body.terminal-body .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    body.terminal-body .terminal-table-card { min-height: 126px; padding: 11px; }
    body.terminal-body .table-card-number { margin: 12px 0 7px; }
    body.terminal-body .table-card-number strong { font-size: 1.2rem; }
    body.terminal-body .table-card-bottom small { font-size: .62rem; }
}

/* Server-detected Android terminal fallback. This intentionally does not depend on viewport media queries. */
body.android-terminal { min-width: 0; overflow-x: hidden; }
body.android-terminal .terminal-main { width: 100%; max-width: 100%; min-width: 0; padding: 18px 10px 72px; }
body.android-terminal .terminal-index-heading { gap: 10px; margin-bottom: 14px; }
body.android-terminal .terminal-index-heading-copy h1 { font-size: 1.55rem; }
body.android-terminal .terminal-toolbar { margin-bottom: 12px; padding: 12px; }
body.android-terminal .terminal-area-tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
body.android-terminal .terminal-area-tab { min-height: 44px; padding: 9px 13px; white-space: nowrap; }
body.android-terminal #table-search { width: 100%; min-height: 46px; font-size: .95rem; }
body.android-terminal .terminal-index-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
body.android-terminal .terminal-stat { min-height: 62px; padding: 9px; }
body.android-terminal .terminal-stat > span:last-child { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 6px; }
body.android-terminal .terminal-stat small { overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
body.android-terminal .terminal-stat strong { font-size: 1.15rem; }
body.android-terminal .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.android-terminal .terminal-table-card { min-height: 126px; padding: 11px; }
body.android-terminal .table-card-number { margin: 12px 0 7px; }
body.android-terminal .table-card-number strong { font-size: 1.2rem; }
body.android-terminal .table-card-bottom small { font-size: .62rem; }

/* Chrome 54 fallback: CSS Grid is unavailable, so terminal containers use Flexbox. */
body.android-terminal .terminal-index-summary,
body.android-terminal .table-grid,
body.android-terminal .terminal-category-grid,
body.android-terminal .product-grid { display: flex; flex-wrap: wrap; }
body.android-terminal .terminal-index-summary { margin-left: -4px; margin-right: -4px; }
body.android-terminal .terminal-stat { display: flex; box-sizing: border-box; flex: 0 0 calc(50% - 8px); width: calc(50% - 8px); margin: 0 4px 8px; }
body.android-terminal .terminal-stat-icon,
body.android-terminal .table-card-arrow,
body.android-terminal .terminal-category-symbol { display: flex; align-items: center; justify-content: center; }
body.android-terminal .terminal-stat > span:last-child { display: flex; align-items: baseline; justify-content: space-between; flex: 1 1 auto; }
body.android-terminal .terminal-stat small { margin-right: 6px; }
body.android-terminal .table-grid { margin-left: -4px; margin-right: -4px; }
body.android-terminal .terminal-table-card { box-sizing: border-box; flex: 0 0 calc(50% - 8px); width: calc(50% - 8px); margin: 0 4px 8px; }
body.android-terminal .terminal-area-tabs { display: flex; flex-wrap: nowrap; }
body.android-terminal .terminal-area-tab { flex: 0 0 auto; margin-right: 6px; }
body.android-terminal .terminal-category-card { flex: 0 0 92px; margin-right: 6px; }
body.android-terminal .terminal-page-heading { display: flex; flex-wrap: wrap; }
body.android-terminal .terminal-heading-copy { flex: 1 1 55%; }
body.android-terminal .terminal-heading-actions { display: flex; flex: 0 1 auto; }
body.android-terminal .order-layout { display: block; }
body.android-terminal .product-panel { width: 100%; box-sizing: border-box; }
body.android-terminal .product-grid { margin-left: -4px; margin-right: -4px; }
body.android-terminal .product-card { display: flex; box-sizing: border-box; flex: 0 0 calc(50% - 8px); width: calc(50% - 8px); flex-direction: column; margin: 0 4px 8px; }
body.android-terminal .cart-panel { width: 100%; box-sizing: border-box; margin-top: 12px; }
body.android-terminal .cart-items,
body.android-terminal .cart-totals,
body.android-terminal .modifier-options,
body.android-terminal .terminal-request-actions { display: block; }
body.android-terminal .cart-row,
body.android-terminal .cart-totals > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
body.android-terminal .modifier-options label { display: flex; align-items: center; margin-bottom: 5px; }
body.android-terminal .modifier-options label span { flex: 1 1 auto; margin-left: 6px; }
body.android-terminal .terminal-request-actions button { display: block; width: 100%; margin-top: 8px; }
body.android-terminal .action-dropdown-menu { display: block; }
body.android-terminal .action-dropdown-menu > * { display: block; margin-bottom: 5px; }

/* Chrome 54 modal fallback: avoid inset, min(), grid centering and unsupported viewport sizing. */
body.android-terminal .terminal-cart-dialog {
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    max-height: none;
    padding: 14px;
    overflow-y: auto;
}
body.android-terminal .terminal-request-modal {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 8px;
    overflow-y: auto;
}
body.android-terminal .terminal-request-modal[hidden] { display: none; }
body.android-terminal .terminal-request-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    max-height: calc(100% - 8px);
    margin: 0;
    padding: 14px;
    overflow-y: auto;
}
body.android-terminal .terminal-request-card textarea { box-sizing: border-box; max-height: 110px; }
body.android-terminal .terminal-request-card h2 { font-size: 1.05rem; }

/* Chrome 54 terminal controls: horizontal category rail and visible cart close button. */
body.android-terminal .terminal-category-grid {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 12px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
body.android-terminal .terminal-category-card {
    display: flex;
    box-sizing: border-box;
    flex: 0 0 92px;
    width: 92px;
    min-width: 92px;
    margin-right: 6px;
    flex-direction: column;
}
body.android-terminal .terminal-main .terminal-cart-dialog-header .icon-button {
    display: flex !important;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    font-size: 1.5rem;
    line-height: 1;
}

/* Modern Android Chrome: use the native grid layout again. The android-terminal
   rules above remain as the Chrome 54 fallback and these rules intentionally
   come last so current Chrome wins without affecting the legacy device. */
body.modern-terminal .terminal-index-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-left: 0;
    margin-right: 0;
}
body.modern-terminal .terminal-stat {
    display: flex;
    box-sizing: border-box;
    width: auto;
    flex: initial;
    margin: 0;
}
body.modern-terminal .table-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-left: 0;
    margin-right: 0;
}
body.modern-terminal .terminal-table-card {
    display: grid;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    min-height: 126px;
    flex: initial;
    margin: 0;
}
body.terminal-body .table-card[hidden] {
    display: none !important;
}
body.modern-terminal .order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 16px;
    align-items: start;
}
body.modern-terminal .product-panel,
body.modern-terminal .cart-panel {
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    margin-top: 0;
}
body.modern-terminal .product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-left: 0;
    margin-right: 0;
}
body.modern-terminal .product-card {
    display: flex;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    flex: initial;
    margin: 0;
}
body.modern-terminal .terminal-category-grid {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
body.modern-terminal .terminal-category-card {
    display: flex;
    box-sizing: border-box;
    flex: 0 0 104px;
    width: 104px;
    min-width: 104px;
    margin-right: 8px;
}

@media (max-width: 800px) {
    body.modern-terminal .order-layout {
        display: block;
    }
    body.modern-terminal .cart-panel {
        width: 100%;
        margin-top: 12px;
    }
}

@media (min-width: 1100px) {
    body.modern-terminal .terminal-index-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    body.modern-terminal .table-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    body.modern-terminal .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Installed terminal PWA: use the complete viewport and respect display cutouts. */
body.terminal-body {
    min-height: 100vh;
    min-height: 100dvh;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}
body.terminal-body .app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
}
body.terminal-body .terminal-main {
    min-height: calc(100vh - env(safe-area-inset-top, 0px));
    min-height: calc(100dvh - env(safe-area-inset-top, 0px));
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
}
body.terminal-body .terminal-cart-fab {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

@media (display-mode: fullscreen), (display-mode: standalone) {
    body.terminal-body {
        background: #f5f7fb;
    }
    body.terminal-body .terminal-main {
        padding-top: calc(22px + env(safe-area-inset-top, 0px));
    }
}
