/* Management layouts use shared colors, controls and dialogs from styles.css. */
.admin-area { font-size: 16px; line-height: 1.55; }
.a-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.a-heading-actions { display: flex; align-items: center; gap: 10px; }
.a-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.a-filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.a-filter { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); min-width: 0; }
.a-filter > span { flex: 0 0 auto; white-space: nowrap; }
.a-filter select, .a-filter input { min-width: 0; max-width: 176px; font-size: 14px; }
.a-search { display: flex; align-items: center; min-width: 0; min-height: 44px; gap: 9px; padding: 0 12px; border: 1px solid var(--input-line); border-radius: 7px; color: var(--muted); background: var(--surface); }
.a-search input { width: 238px; min-width: 0; border: 0; background: transparent; font-size: 14px; padding: 10px 0; outline: 0; }
.a-search:focus-within { outline: 2px solid var(--primary); outline-offset: 3px; }
.a-panel { padding: 24px; }
.a-no-padding { padding: 0; overflow: hidden; }
.a-section-gap { margin-top: 24px; }
.a-section-meta { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.a-panel-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.a-panel-title h2, .a-store-card h2 { font-size: 16px; font-weight: 550; }
.a-panel-title p { margin-top: 6px; font-size: 13px; color: var(--muted); }
.a-mini-label { color: var(--muted); font-size: 12px; }
.a-mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.a-amount { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 550; white-space: nowrap; }
.a-nowrap { white-space: nowrap; }

/* Numbers lead; color is reserved for actions and status. */
.a-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 16px; overflow: hidden; }
.a-stat { padding: 28px 24px; min-width: 0; border-right: 1px solid var(--line); }
.a-stat:last-child { border-right: 0; }
.a-stat > span { font-size: 14px; color: var(--muted); }
.a-stat > strong { display: block; font-size: clamp(26px,2.4vw,36px); line-height: 1.25; font-weight: 550; letter-spacing: -.04em; margin-top: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.a-stat p { font-size: 13px; color: var(--muted); margin-top: 10px; }
.a-stats-three { grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 28px; }
.a-metric-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 8px 0 24px; gap: 24px; margin-bottom: 12px; }
.a-metric-strip > div { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-width: 0; padding: 0 4px; }
.a-metric-strip span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.a-metric-strip strong { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.a-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 24px; }
.a-chart { display: flex; align-items: end; justify-content: space-around; gap: 10px; height: 230px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top,transparent 0,transparent 49px,#eef1ee 50px,transparent 51px); }
.a-chart-column { display: flex; flex-direction: column; align-items: center; justify-content: end; min-width: 0; flex: 1; max-width: 64px; height: 100%; }
.a-chart-track { height: 170px; display: flex; align-items: end; width: 50%; min-width: 12px; }
.a-chart-bar { width: 100%; min-height: 2px; background: #aabdae; border-radius: 4px 4px 0 0; }
.a-chart-column:last-child .a-chart-bar { background: var(--primary); }
.a-chart-value { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.a-chart-label { font-size: 12px; color: var(--muted); margin: 10px 0; white-space: nowrap; }
.a-rank { display: flex; flex-direction: column; gap: 23px; }
.a-rank-row { display: grid; grid-template-columns: 18px minmax(0,1fr) 38px; align-items: center; gap: 10px; }
.a-rank-number { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.a-rank-row > div > strong { display: block; font-size: 14px; font-weight: 400; margin-bottom: 8px; overflow-wrap: anywhere; }
.a-rank-track { height: 3px; background: var(--nav); }
.a-rank-track i { display: block; height: 100%; background: #aabdae; }
.a-rank-row > b { font-size: 16px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.a-rank-row small { font-size: 12px; color: var(--muted); margin-left: 4px; font-weight: 400; }

/* Tables preserve relationships while scrolling inside their own region. */
.a-table-wrap { max-width: 100%; overflow: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
th { padding: 15px 20px; background: var(--nav); color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbf9; }
td > strong { font-size: 14px; font-weight: 500; }
td small { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; line-height: 1.6; }
.a-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 112px; }
.a-actions .a-btn { padding-inline: 10px; }
.a-order-table { min-width: 820px; }
.a-order-items { display: block; min-width: 120px; font-size: 14px; line-height: 1.7; }
.a-audit-detail { min-width: 220px; max-width: 560px; overflow-wrap: anywhere; color: var(--muted); line-height: 1.7; }
.a-empty > svg { margin-bottom: 16px; }
.a-empty > strong { display: block; font-size: 16px; font-weight: 500; color: var(--text); }
.a-empty p { margin-top: 8px; font-size: 14px; }

/* Order flow */
.a-order-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 28px; }
.a-order-summary-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); text-align: left; color: var(--text); }
.a-order-summary-item > span { color: var(--muted); font-size: 14px; }
.a-order-summary-item > strong { font-size: 28px; font-weight: 550; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.a-order-summary-item.selected { background: var(--primary-soft); border-color: #a4bbaa; }
.a-advanced-filters { margin: -8px 0 24px; }
.a-advanced-filters > summary { width: fit-content; cursor: pointer; color: var(--muted); font-size: 13px; min-height: 44px; padding: 12px 0; }
.a-order-date-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 0 0; }
.a-prep-summary { border: 1px solid var(--line); border-radius: 10px; background: white; margin-bottom: 24px; padding: 0 24px; }
.a-prep-summary > summary { cursor: pointer; padding: 18px 0; min-height: 60px; color: var(--text); }
.a-prep-summary > summary > strong { font-size: 14px; font-weight: 500; }
.a-prep-summary > summary > span { margin-left: 14px; font-size: 13px; color: var(--muted); }
.a-prep-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; border-top: 1px solid var(--line); padding: 22px 0; }
.a-prep-columns h3 { font-size: 13px; font-weight: 400; color: var(--muted); margin-bottom: 12px; }
.a-prep-columns section > div { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; font-size: 14px; }
.a-prep-columns strong { font-weight: 400; }
.a-prep-columns section > div > span { white-space: nowrap; color: var(--muted); }
.a-print-note { display: flex; align-items: center; justify-content: end; gap: 20px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.a-check { display: inline-flex; align-items: center; min-height: 44px; gap: 9px; font-size: 14px; cursor: pointer; }

/* Management cards */
.a-dish-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.a-dish-card { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: white; overflow: hidden; }
.a-dish-image { position: relative; background: var(--nav); aspect-ratio: 1.7; }
.a-dish-image > img { width: 100%; height: 100%; object-fit: cover; }
.a-dish-flags { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.a-dish-info { padding: 20px; }
.a-dish-info > h2 { font-size: 17px; margin: 6px 0; font-weight: 550; }
.a-dish-info > p { font-size: 14px; color: var(--muted); min-height: 44px; }
.a-dish-spice { margin: 12px 0; color: var(--muted); font-size: 12px; }
.a-dish-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.a-dish-bottom > strong { font-size: 23px; font-weight: 550; letter-spacing: -.025em; }
.a-dish-bottom del { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.a-dish-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.a-dish-actions > .a-btn { flex: 1; }
.a-dish-placeholder { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; height: 100%; font-size: 13px; color: var(--muted); }
.a-store-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.a-store-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.a-store-icon { color: var(--primary); }
.a-store-card > p { margin-top: 10px; min-height: 44px; color: var(--muted); font-size: 14px; }
.a-store-info { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 13px 16px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; font-size: 14px; }
.a-store-info > span { color: var(--muted); }
.a-store-info > strong { font-weight: 400; overflow-wrap: anywhere; }
.a-store-buttons { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }

/* Forms and details */
.a-modal { max-width: 540px; }
.a-modal.wide { max-width: 720px; }
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.a-field > small { font-size: 12px; color: var(--muted); font-weight: 400; }
.a-fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.a-fieldset legend { font-size: 14px; margin-bottom: 10px; }
.a-week-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.a-form-checks { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; }
.a-note { padding: 14px 16px; background: var(--nav); border-radius: 7px; margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.a-note.danger { color: var(--danger); background: var(--danger-soft); }
.a-note > p { margin-top: 5px; }
.a-detail-header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.a-detail-header h3 { margin: 8px 0; font-size: 20px; font-weight: 550; }
.a-detail-header p, .a-detail-header > span { font-size: 13px; color: var(--muted); }
.a-eyebrow { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.a-detail-items { padding: 18px 0; border-bottom: 1px solid var(--line); }
.a-detail-items > div { display: grid; grid-template-columns: 1fr 40px 90px; gap: 16px; align-items: center; padding: 12px 0; font-size: 14px; }
.a-detail-items small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.a-detail-items strong { text-align: right; font-weight: 500; }
.a-finance-breakdown { padding: 12px 0 24px; }
.a-finance-breakdown > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0; font-size: 14px; color: var(--muted); }
.a-finance-breakdown b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.a-finance-breakdown .total { padding-top: 18px; margin-top: 12px; border-top: 1px solid var(--line); color: var(--text); }
.a-finance-breakdown .total > b { font-size: 24px; }
.a-detail-actions { display: flex; justify-content: end; gap: 12px; }
.a-detail-list { margin: 0; }
.a-detail-list > div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.a-detail-list > div:last-child { border-bottom: 0; }
.a-detail-list dt { color: var(--muted); }
.a-detail-list dd { margin: 0; overflow-wrap: anywhere; }
.a-qr-area { text-align: center; margin-bottom: 28px; }
.a-qr-code { width: 244px; height: 244px; max-width: 100%; margin: 0 auto 20px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.a-qr-code img, .a-qr-code canvas { max-width: 100%; }
.a-qr-area h3 { margin: 16px 0 10px; }
.a-qr-area p { font-size: 14px; color: var(--muted); }

@media (max-width: 1250px) {
  .a-dish-grid, .a-store-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .a-stat { padding: 24px 20px; }
  .a-toolbar { align-items: start; }
  .a-filter-group { gap: 10px; }
  .a-filter { gap: 7px; }
  .a-filter input, .a-filter select { max-width: 156px; }
}
@media (max-width: 1024px) {
  .a-dashboard-grid { grid-template-columns: 1fr; }
  .a-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .a-stat:nth-child(2) { border-right: 0; }
  .a-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .a-stats-three { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .a-stats-three .a-stat { border-bottom: 0; border-right: 1px solid var(--line); }
  .a-stats-three .a-stat:last-child { border-right: 0; }
  .a-metric-strip { grid-template-columns: 1fr 1fr; grid-auto-flow: row; gap: 16px 24px; }
}
@media (max-width: 768px) {
  .a-page-heading { margin-bottom: 28px; align-items: start; gap: 16px; flex-wrap: wrap; }
  .a-heading-actions { gap: 8px; flex-wrap: wrap; }
  .a-page-heading .a-btn { padding-inline: 12px; }
  .a-toolbar { align-items: start; gap: 12px; }
  .a-filter-group { flex: 1; min-width: 0; }
  .a-toolbar > .a-search { flex: 1; }
  .a-search { width: 100%; }
  .a-search input { flex: 1; width: 100%; font-size: 16px; }
  .a-filter { flex: 1 1 140px; }
  .a-filter input, .a-filter select { width: 100%; max-width: none; font-size: 16px; }
  .a-filter-group > .a-filter:has(input[type=date]) { flex: 1 1 220px; }
  .a-panel { padding: 20px; }
  .a-no-padding { padding: 0; }
  .a-stats { grid-template-columns: 1fr 1fr; }
  .a-stat { padding: 24px 18px; }
  .a-stat > strong { font-size: 28px; margin-top: 12px; }
  .a-stats-three { grid-template-columns: 1fr; }
  .a-stats-three .a-stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .a-stats-three .a-stat:last-child { border-bottom: 0; }
  .a-metric-strip { gap: 16px 24px; padding-bottom: 20px; }
  .a-metric-strip > div { display: block; }
  .a-metric-strip strong { display: block; margin-top: 6px; }
  .a-dashboard-grid { gap: 20px; }
  .a-chart { gap: 6px; }
  .a-chart-label, .a-chart-value { font-size: 12px; }
  .a-chart-track { width: 52%; }
  .a-panel-title { margin-bottom: 24px; }
  .a-panel-title > .a-btn { padding-inline: 10px; }
  .a-order-summary { gap: 8px; margin-bottom: 24px; }
  .a-order-summary-item { padding: 16px 12px; display: block; }
  .a-order-summary-item > span { font-size: 13px; }
  .a-order-summary-item > strong { display: block; margin-top: 8px; font-size: 26px; }
  .a-order-date-filters { gap: 12px; }
  .a-prep-summary { padding: 0 18px; }
  .a-prep-columns { grid-template-columns: 1fr; gap: 24px; }
  .a-print-note { justify-content: start; }
  .a-section-meta { font-size: 12px; }
  .a-dish-grid, .a-store-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .a-dish-image { aspect-ratio: 2; }
  .a-form-grid { grid-template-columns: 1fr; }
  .a-detail-header { flex-direction: column; gap: 10px; }
  .a-detail-items > div { grid-template-columns: minmax(0,1fr) 25px 75px; gap: 10px; }
  .a-detail-list > div { grid-template-columns: 95px minmax(0,1fr); gap: 16px; }
  td, th { padding-inline: 16px; }
  .a-actions { gap: 4px; }
  .a-store-buttons { gap: 8px; }
}

/* On phones, a complete order and its actions stay together without a wide table. */
@media (max-width: 768px) {
  .a-order-table { min-width: 0; display: block; }
  .a-order-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .a-order-table tbody { display: block; }
  .a-order-table tr { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'person state' 'number number' 'items items' 'amount actions'; gap: 14px 12px; padding: 20px 18px; border-bottom: 1px solid var(--line); }
  .a-order-table tr:last-child { border-bottom: 0; }
  .a-order-table td { min-width: 0; padding: 0; border: 0; }
  .a-order-table td:nth-child(1) { grid-area: number; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; color: var(--muted); }
  .a-order-table td:nth-child(1) strong { font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
  .a-order-table td:nth-child(1) small { margin-top: 0; }
  .a-order-table td:nth-child(2) { grid-area: person; }
  .a-order-table td:nth-child(2) strong { font-size: 16px; }
  .a-order-table td:nth-child(2) small { margin-top: 3px; }
  .a-order-table td:nth-child(3) { grid-area: items; }
  .a-order-table td:nth-child(4) { grid-area: amount; align-self: end; }
  .a-order-table td:nth-child(4) strong { display: block; font-size: 21px; }
  .a-order-table td:nth-child(4) small { max-width: 150px; }
  .a-order-table td:nth-child(5) { grid-area: state; justify-self: end; }
  .a-order-table td:nth-child(6) { grid-area: actions; align-self: end; }
  .a-order-table .a-actions { min-width: 0; max-width: 160px; justify-content: end; gap: 4px; }
}
.a-order-table td { overflow-wrap: anywhere; }

/* Operating views use the same typography, spacing and controls as ordering. */
.a-view-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin: -8px 0 24px; }
.a-view-tabs .selected { color: var(--primary); background: var(--primary-soft); }
.a-inline-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--line); }
.a-inline-title h2, .a-small-title { font-size: 16px; font-weight: 550; }
.a-inline-title > span { color: var(--muted); font-size: 13px; }
.a-list-footer { display: flex; justify-content: center; padding: 24px; font-size: 13px; color: var(--muted); }
.a-positive { color: var(--primary); }
.a-device-grid, .a-integration-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.a-device-info { margin: 0 0 24px; font-size: 14px; }
.a-device-info > div { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 16px; padding-block: 6px; }
.a-device-info dt { color: var(--muted); }
.a-device-info dd { margin: 0; overflow-wrap: anywhere; }
.a-integration-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 0 26px; color: var(--muted); font-size: 14px; }
.a-integration-status strong { color: var(--text); font-weight: 550; }
.a-spacer { flex: 1; }
.a-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); }
.a-status-dot.ready { background: var(--primary); }
.a-integration-copy { color: var(--muted); margin-bottom: 28px; font-size: 14px; line-height: 1.8; }
.a-capabilities { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0; font-size: 14px; margin: 0 0 24px; }
.a-setup-details { border-top: 1px solid var(--line); padding-top: 20px; font-size: 14px; }
.a-setup-details summary { cursor: pointer; }
.a-setup-details ol { padding-left: 22px; margin-block: 20px; }
.a-setup-details li { padding-bottom: 10px; }
.a-setup-details p { color: var(--muted); margin-top: 16px; }
.a-job-timeline { padding-left: 20px; }
.a-job-timeline li { padding: 0 0 22px 8px; }
.a-job-timeline strong { display: block; font-size: 14px; font-weight: 500; }
.a-job-timeline small { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.a-error-text { max-width: 260px; white-space: normal; }
@media (max-width: 768px) {
  .a-device-grid, .a-integration-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .a-inline-title { flex-wrap: wrap; padding: 20px 18px; }
  .a-device-info > div { grid-template-columns: 100px minmax(0,1fr); }
  .a-capabilities { grid-template-columns: minmax(0,1fr); }
}
.a-finance-toolbar .a-filter-group { width: 100%; }
.a-finance-toolbar [data-action="finance-export"] { margin-left: auto; }
@media (max-width: 768px) {
  .a-finance-toolbar .a-filter-group { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px 12px; }
  .a-finance-toolbar .a-filter { flex-direction: column; align-items: stretch; gap: 6px; }
  .a-finance-toolbar .a-filter:first-child { grid-column: 1 / -1; }
  .a-finance-toolbar .a-filter input, .a-finance-toolbar .a-filter select { width: 100%; max-width: none; }
  .a-finance-toolbar [data-action="finance-export"] { margin-left: 0; }
  .a-record-table, .a-record-table tbody { display: block; min-width: 0; width: 100%; }
  .a-record-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .a-record-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px 14px; padding: 20px 18px; border-bottom: 1px solid var(--line); }
  .a-record-table tr:last-child { border-bottom: 0; }
  .a-record-table td { display: flex; flex-direction: column; align-items: start; min-width: 0; padding: 0; border: 0; font-size: 14px; overflow-wrap: anywhere; white-space: normal; }
  .a-record-table td:first-child { grid-column: 1 / -1; }
  .a-record-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-bottom: 6px; }
  .a-record-table td small { margin-top: 4px; }
  .a-record-table .a-actions { flex-wrap: wrap; }
}
@media (max-width: 768px) {
  .a-record-table.a-finance-orders tr { grid-template-areas: 'order order' 'person status' 'subsidy personal'; gap: 14px; }
  .a-finance-orders td:nth-child(1) { grid-area: order; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .a-finance-orders td:nth-child(1) small { margin-top: 0; }
  .a-finance-orders td:nth-child(2) { grid-area: person; }
  .a-finance-orders td:nth-child(3) { grid-area: subsidy; }
  .a-finance-orders td:nth-child(4) { grid-area: personal; }
  .a-finance-orders td:nth-child(5) { grid-area: status; justify-self: end; }
  .a-finance-orders td:nth-child(1)::before, .a-finance-orders td:nth-child(2)::before, .a-finance-orders td:nth-child(5)::before { display: none; }
}
.a-setup-details summary { min-height: 44px; padding-block: 8px; line-height: 26px; }
.a-integration-grid { align-items: start; }
.a-settlement-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin: -4px 0 24px; font-size: 14px; color: var(--muted); }
.a-settlement-summary strong { color: var(--text); font-weight: 500; }
@media (max-width: 768px) {
  .a-company-table td:last-child { grid-column: 1 / -1; }
  .a-company-table td:first-child { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: 'name status' 'store store'; gap: 4px 12px; align-items: center; }
  .a-company-table td:first-child::before { display: none; }
  .a-company-table td:first-child > strong { grid-area: name; font-size: 16px; }
  .a-company-table td:first-child > small { grid-area: store; }
  .a-company-table td:first-child > .a-badge { grid-area: status; }
}
.a-order-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.a-live-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 768px) { .a-order-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } .a-heading-actions { flex-wrap: wrap; gap: 6px 12px; } }
/* New orders and their primary action stay above preparation totals. */
.app-shell[data-route="orders"] .page-content > * { animation: none; }
.a-order-table + .a-prep-summary, .a-panel + .a-prep-summary { margin-top: 24px; }
@media (max-width: 768px) {
  .a-order-summary { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
  .a-order-summary-item { padding: 12px 8px; }
  .a-order-summary-item > span { font-size: 12px; }
  .a-order-summary-item > strong { font-size: 24px; margin-top: 6px; }
}

.a-integration-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.a-field input[type="file"] { width: 100%; min-width: 0; overflow: hidden; }

.a-platform-scope[hidden] { display: none; }

.a-mini-code { display: block; max-width: 100%; width: 320px; margin: 0 auto 20px; }
.a-link-select { max-width: 100%; min-width: 180px; min-height: 44px; }
