/* Operational screens. Load after the shared beta visual base. */
.operations-page { min-width: 0; }
.operations-page .section-heading { align-items: stretch; gap: 1rem; margin-bottom: 1.5rem; }
.operations-page .section-heading h2 { margin: 0 0 .375rem; font-size: 1.375rem; color: var(--navy); }
.operations-page .section-heading p { margin: 0; font-size: .875rem; line-height: 1.5; }
.operations-page .section-heading > .primary-button { align-self: stretch; }
.operations-order-toolbar, .operations-table-toolbar { padding: 1rem; gap: 1rem; margin-bottom: 1.25rem; background: white; border: 1px solid var(--line); border-radius: 1rem; }
.operations-order-toolbar label, .operations-table-toolbar label { display: grid; gap: .375rem; width: 100%; color: var(--navy); font-size: .75rem; font-weight: 700; }
.operations-order-toolbar input, .operations-table-toolbar input { min-width: 0; width: 100%; }
.operations-board-caption { color: var(--muted); font-size: .75rem; }
.order-status-tabs { display: flex; gap: .375rem; overflow-x: auto; padding: .25rem .125rem .75rem; margin-bottom: .5rem; overscroll-behavior-x: contain; }
.order-status-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; flex: 0 0 auto; border: 1px solid var(--line); border-radius: .625rem; background: white; color: var(--muted); padding: .625rem .875rem; font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.order-status-tabs button[aria-selected="true"] { background: var(--navy); color: white; border-color: var(--navy); }
.order-status-tabs button span, .order-stage-heading > span { display: inline-grid; place-items: center; min-width: 1.5rem; min-height: 1.5rem; border-radius: .375rem; background: rgb(127 145 172 / 12%); font-size: .75rem; font-variant-numeric: tabular-nums; }
.order-board-scroll { width: 100%; max-width: 100%; min-width: 0; }
.order-stage { display: none; min-width: 0; }
.order-stage.is-current { display: block; }
.order-stage-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .875rem; padding: .5rem .125rem; }
.order-stage-heading h3 { display: flex; align-items: center; gap: .5rem; font-size: .875rem; margin: 0; color: var(--navy); }
.order-stage-heading h3::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--stage-color); flex: 0 0 auto; }
.stage-open { --stage-color: var(--blue); }
.stage-preparing { --stage-color: var(--amber); }
.stage-ready { --stage-color: var(--green); }
.stage-closing { --stage-color: var(--violet); }
.stage-cancelled { --stage-color: var(--subtle); }
.operations-order-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: .75rem; align-items: stretch; }
.operation-order-card.panel { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: .375rem; width: 100%; min-width: 0; min-height: 11.25rem; height: 100%; margin: 0; padding: .75rem; background: white; border: 1px solid var(--line); border-top: 3px solid var(--stage-color); border-radius: .875rem; text-align: left; color: var(--ink); box-shadow: var(--shadow-card); }
.operation-order-card:hover { border-color: var(--stage-color); box-shadow: 0 4px 14px rgb(16 24 40 / 8%); }
.operation-order-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem; }
.operation-order-label { color: var(--muted); font-size: .6875rem; font-weight: 600; }
.operation-order-top .badge { padding: .1875rem .375rem; max-width: 100%; white-space: normal; font-size: .625rem; line-height: 1.35; }
.operation-order-top .badge.violet, .operation-detail-meta .badge.violet { background: #f4f0ff; color: #6941c6; }
.operation-order-card strong.operation-order-number { display: block; font-size: 1.125rem; font-family: var(--font-heading); font-weight: 800; color: var(--navy); line-height: 1.3; overflow-wrap: anywhere; }
.operation-order-place { font-size: .8125rem; font-weight: 650; overflow-wrap: anywhere; }
.operation-order-customer { font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.operation-order-meta, .operation-order-items, .operation-order-action { display: none; }
.operation-order-footer { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--line); }
.operation-order-footer > span:first-child { display: grid; gap: .125rem; min-width: 0; }
.operation-order-footer small { font-size: .625rem; color: var(--muted); }
.operation-order-footer b { font-size: .9375rem; color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.operations-empty { padding: 1.5rem 1rem; border: 1px dashed #d3dae5; border-radius: .875rem; text-align: center; color: var(--muted); font-size: .8125rem; }
.operations-empty strong { display: block; color: var(--navy); }
.operations-empty p { margin: .375rem 0 0; }
.operations-metrics.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.75rem; }
.operations-metrics .metric-card { padding: 1rem; min-height: 9rem; background: white; border: 1px solid var(--line); }
.operations-metrics .metric-card > div { display: flex; flex-direction: column; height: 100%; gap: .5rem; }
.operations-metrics .metric-card p { margin: 0; color: var(--muted); font-size: .75rem; font-weight: 650; }
.operations-metrics .metric-card strong { color: var(--navy); font: 800 1.75rem/1.1 var(--font-heading); }
.operations-metrics .metric-card small { margin-top: auto; color: var(--muted); font-size: .6875rem; line-height: 1.4; }
.operations-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.operations-section-title h3 { margin: 0 0 .375rem; font-size: 1rem; color: var(--navy); }
.operations-section-title p { margin: 0; color: var(--muted); font-size: .8125rem; }
.operations-section-title > .badge { flex-shrink: 0; }
.operations-table-legend { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .75rem; }
.operations-table-legend > span { display: inline-flex; gap: .375rem; align-items: center; }
.operations-table-legend i { width: .5rem; height: .5rem; border-radius: 50%; }
.operations-table-legend .occupied { background: var(--blue); }
.operations-table-legend .free { background: var(--green); }
.operations-tables-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .625rem; align-items: stretch; }
.operations-tables-grid .restaurant-table { display: flex; flex-direction: column; align-items: stretch; gap: .375rem; height: 100%; min-height: 9.25rem; margin: 0; padding: .75rem .5rem; border-radius: .875rem; text-align: center; }
.operations-tables-grid .restaurant-table.occupied { background: #eff5ff; border-color: #b2ccff; color: var(--navy); }
.operations-tables-grid .restaurant-table.free { background: white; border-color: #d4e9e0; }
.operations-tables-grid .operation-table-number { font: 800 1.375rem/1.2 var(--font-heading); color: var(--navy); overflow-wrap: anywhere; }
.operations-tables-grid .operation-table-status { font-size: .6875rem; color: #067647; }
.operations-tables-grid .occupied .operation-table-status { color: #175cd3; }
.operation-table-order { color: var(--muted); font-size: .625rem; overflow-wrap: anywhere; }
.operation-table-footer { display: block; margin-top: auto; padding-top: .5rem; border-top: 1px solid rgb(127 145 172 / 18%); font-size: .625rem; color: var(--muted); overflow-wrap: anywhere; }
.operations-tables-grid .operation-table-footer b { color: var(--navy); font-size: .75rem; font-variant-numeric: tabular-nums; }
.operation-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; font-size: .875rem; }
.operation-detail-meta > small { color: var(--muted); }
.operation-detail-items { min-width: 0; }
.operation-items-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.operation-items-table th { color: var(--muted); font-size: .6875rem; font-weight: 650; background: var(--canvas); }
.operation-items-table td, .operation-items-table th { padding: .75rem .5rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.operation-items-table th:nth-child(2), .operation-items-table td:nth-child(2) { width: 2.75rem; text-align: center; }
.operation-items-table th:last-child, .operation-items-table td:last-child { width: 6.25rem; text-align: right; }
.operation-items-table td { font-size: .8125rem; font-variant-numeric: tabular-nums; }
.operation-items-table td strong { display: block; font-size: .8125rem; overflow-wrap: anywhere; }
.operation-items-table td small { display: block; margin-top: .25rem; color: var(--muted); font-size: .6875rem; }
.operation-detail .drawer-total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-block: 1rem; border-top: 1px solid var(--line); }
.operation-detail .drawer-total strong { font: 800 1.5rem/1.3 var(--font-heading); color: var(--navy); }
.operation-detail .form-actions { display: flex; flex-wrap: wrap; }
.operation-detail .form-actions button { flex: 1 1 10rem; }
@media (min-width: 48rem) {
  .operations-page .section-heading { align-items: center; }
  .operations-page .section-heading > .primary-button { align-self: center; }
  .operations-page .section-heading h2 { font-size: 1.5rem; }
  .operations-order-toolbar, .operations-table-toolbar { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .operations-order-toolbar label, .operations-table-toolbar label { width: min(100%, 24rem); }
  .operations-order-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .operation-order-card.panel { padding: 1rem; min-height: 16rem; }
  .operation-order-label, .operation-order-top .badge { font-size: .6875rem; }
  .operation-order-card strong.operation-order-number { font-size: 1.375rem; }
  .operation-order-meta { display: block; color: var(--muted); font-size: .6875rem; }
  .operation-order-items { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--muted); font-size: .75rem; line-height: 1.5; margin: .375rem 0 .625rem; overflow-wrap: anywhere; }
  .operation-order-action { display: inline-flex; align-items: center; gap: .25rem; color: var(--blue); font-size: .6875rem; font-weight: 700; }
  .operations-metrics .metric-card { padding: 1.25rem; }
  .operations-metrics .metric-card strong { font-size: 2rem; }
  .operations-tables-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .875rem; }
  .operations-tables-grid .restaurant-table { padding: 1rem .625rem; min-height: 10rem; }
  .operation-table-order { font-size: .6875rem; }
  .operation-items-table td, .operation-items-table th { padding: 1rem .75rem; }
  .operation-items-table th:last-child, .operation-items-table td:last-child { width: 8rem; }
}
@media (min-width: 64rem) {
  .operations-metrics.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .operations-order-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .order-status-tabs { display: none; }
  .order-board-scroll { overflow-x: auto; padding: .25rem .125rem 1rem; overscroll-behavior-x: contain; }
  .order-board { display: grid; grid-template-columns: repeat(5, minmax(12.5rem, 1fr)); gap: .875rem; align-items: start; }
  .order-stage, .order-stage.is-current { display: block; padding: .75rem; border: 1px solid var(--line); border-radius: 1rem; background: #f0f3f8; }
  .order-stage-heading { min-height: 2.5rem; padding: 0; }
  .order-stage .operations-order-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: .75rem; }
  .order-stage .operation-order-card.panel { min-height: 16rem; padding: .875rem; }
  .order-stage .operations-empty { padding: 1.5rem .5rem; font-size: .75rem; background: rgb(255 255 255 / 45%); }
}
@media (min-width: 80rem) {
  .operations-tables-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (min-width: 100rem) {
  .operations-dashboard .operations-order-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .operations-tables-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (min-width: 120rem) {
  .operations-dashboard .operations-order-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
