.oa-orders-workspace {
  --orders-ink: #18253b;
  --orders-muted: #52617a;
  --orders-rule: #dce4ef;
  --orders-surface: #fff;
  --orders-soft: #f5f8fc;
  --orders-selected: #e9f2fb;
  --orders-blue: #103e69;
  display: grid;
  gap: 18px;
  max-width: 1560px;
  margin-inline: auto;
  color: var(--orders-ink);
}
.dark .oa-orders-workspace {
  --orders-ink: #eef3fb;
  --orders-muted: #aebcd0;
  --orders-rule: #344257;
  --orders-surface: #152235;
  --orders-soft: #101c2e;
  --orders-selected: #203b56;
  --orders-blue: #b4d8ff;
}
.oa-orders-workspace :is(button,input,select):focus-visible {
  outline: 2px solid var(--orders-blue);
  outline-offset: 2px;
}
.oa-orders-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px }
.oa-orders-header h1 { margin: 0; font-size: clamp(1.65rem, 2.6vw, 2.25rem); font-weight: 800; letter-spacing: -.035em }
.oa-orders-header p { margin-top: 3px; font-size: .925rem; color: var(--orders-muted) }
.oa-orders-export, .oa-orders-clear, .oa-orders-back {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--orders-rule); border-radius: 9px;
  color: var(--orders-blue); background: var(--orders-surface); font-size: .83rem; font-weight: 700;
}
.oa-orders-export:disabled { opacity: .55; cursor: default }
.oa-orders-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px }
.oa-orders-metric {
  min-width: 0; padding: 15px 17px; min-height: 105px; border: 1px solid var(--orders-rule);
  border-radius: 12px; background: var(--orders-surface);
}
.oa-orders-metric p { color: var(--orders-muted); font-size: .82rem; font-weight: 650 }
.oa-orders-metric strong { display: block; margin: 2px 0; font-size: 1.75rem; line-height: 1.2; font-variant-numeric: tabular-nums }
.oa-orders-metric span { display: block; color: var(--orders-muted); font-size: .76rem }
.oa-orders-metric[data-tone="attention"] strong { color: #94470d }
.oa-orders-metric[data-tone="complete"] strong { color: #126758 }
.dark .oa-orders-metric[data-tone="attention"] strong { color: #ffca91 }
.dark .oa-orders-metric[data-tone="complete"] strong { color: #7ee0c8 }
.oa-orders-controls { border: 1px solid var(--orders-rule); border-radius: 12px; background: var(--orders-surface) }
.oa-orders-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--orders-rule) }
.oa-orders-tabs button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px;
  padding: 6px 10px; border-radius: 8px; color: var(--orders-muted); font-weight: 650; font-size: .82rem;
}
.oa-orders-tabs button[aria-pressed="true"] { background: var(--orders-selected); color: var(--orders-blue) }
.oa-orders-tabs button span { font-weight: 500; font-variant-numeric: tabular-nums }
.oa-orders-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 13px }
.oa-orders-filters label { display: grid; gap: 4px; color: var(--orders-muted); font-size: .76rem; font-weight: 700; min-width: 0 }
.oa-orders-filters select, .oa-orders-filters input {
  min-height: 44px; padding: 7px 10px; border: 1px solid var(--orders-rule); border-radius: 8px;
  background: var(--orders-surface); color: var(--orders-ink); font-weight: 500; font-size: .86rem;
}
.oa-orders-filters .oa-orders-search { flex: 1 1 220px }
.oa-orders-search span { display: block; position: relative }
.oa-orders-search svg { width: 16px; height: 16px; position: absolute; top: 14px; left: 12px; color: var(--orders-muted); pointer-events: none }
.oa-orders-search input { width: 100%; padding-left: 35px }
.oa-orders-layout { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start }
.oa-orders-queue { min-width: 0; border: 1px solid var(--orders-rule); border-radius: 12px; background: var(--orders-surface) }
.oa-orders-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 15px }
.oa-orders-list-heading h2 { font-size: .96rem; font-weight: 750 }
.oa-orders-list-heading span { color: var(--orders-muted); font-size: .76rem; font-variant-numeric: tabular-nums }
.oa-orders-list { max-height: min(64vh, 720px); overflow: auto; overscroll-behavior: contain; }
.oa-orders-table { width: 100%; border-collapse: collapse; text-align: left; }
.oa-orders-table th {
  padding: 12px 15px; font-size: .75rem; font-weight: 700; color: var(--orders-muted);
  background: var(--orders-soft); border-block: 1px solid var(--orders-rule); white-space: nowrap;
}
.oa-orders-table td { padding: 8px 15px; font-size: .83rem; border-top: 1px solid var(--orders-rule); vertical-align: middle; }
.oa-orders-table :is(th,td):last-child { text-align: right; font-variant-numeric: tabular-nums; }
.oa-orders-table tr[data-selected="true"] { background: var(--orders-selected); box-shadow: inset 3px 0 var(--orders-blue); }
.oa-orders-table tbody tr:hover { background: var(--orders-soft); }
.oa-orders-table tbody tr[data-selected="true"]:hover { background: var(--orders-selected); }
.oa-orders-table-amount { font-weight: 750; white-space: nowrap; }
.oa-orders-row-action { display: grid; gap: 3px; text-align: left; min-height: 44px; align-content: center; color: var(--orders-blue); }
.oa-orders-row-badge { display: inline-block; border-radius: 20px; padding: 3px 7px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.oa-orders-row-caption, .oa-orders-table-note { display: block; color: var(--orders-muted); font-size: .75rem; overflow-wrap: anywhere; }
.oa-orders-table-note { margin-top: 4px; }
.oa-orders-pagination { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:11px 15px; border-top:1px solid var(--orders-rule); }
.oa-orders-pagination span { color:var(--orders-muted); font-size:.83rem; font-variant-numeric:tabular-nums; }
.oa-orders-pagination button:disabled { opacity:.5; cursor:default; }
.oa-orders-advanced { border-top:1px solid var(--orders-rule); }
.oa-orders-lookup-note { padding:0 13px 13px; color:var(--orders-muted); font-size:.82rem }
@media(min-width:1100px) {
  .oa-orders-layout[data-detail-open="true"] { grid-template-columns:minmax(470px,55%) minmax(0,1fr); }
}
.oa-orders-detail, .oa-orders-detail-empty { min-width: 0 }
.oa-orders-detail > div { background: var(--orders-surface) }
.oa-orders-detail [tabindex="-1"]:focus-visible { outline: 2px solid var(--orders-blue); outline-offset: 4px }
.oa-orders-empty, .oa-orders-detail-empty { padding: 24px 15px; color: var(--orders-muted); font-size: .87rem }
.oa-orders-detail-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding-block: 44px; border: 1px dashed var(--orders-rule); border-radius: 12px }
.oa-orders-detail-empty svg { width: 22px; height: 22px; color: var(--orders-blue) }
.oa-orders-alert { border: 1px solid #dfb3aa; border-radius: 9px; padding: 12px; color: #963226; background: #fff4f2 }
@media(max-width: 1099px) {
  .oa-orders-layout { grid-template-columns: minmax(0,1fr) }
  .oa-orders-layout[data-detail-open="true"] .oa-orders-queue, .oa-orders-detail-empty { display: none }
  .oa-orders-list { max-height: none }
  .oa-orders-workspace:has(.oa-orders-layout[data-detail-open="true"]) > :is(.oa-orders-summary,.oa-orders-controls) { display: none }
}
@media(max-width: 560px) {
  .oa-orders-summary { grid-template-columns: minmax(0,1fr); gap: 6px }
  .oa-orders-metric { min-height: 0; display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: center; padding: 9px 12px }
  .oa-orders-metric strong { grid-row: span 2; font-size: 1.4rem }
  .oa-orders-metric span { grid-column: 1 }
  .oa-orders-filters label { flex: 1 1 120px }
  .oa-orders-tabs { gap: 1px }
  .oa-orders-tabs button { padding-inline: 7px }
  .oa-orders-table thead { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); }
  .oa-orders-table tbody tr { display:grid; grid-template-columns:1fr 1fr; padding:7px 10px; border-top:1px solid var(--orders-rule); }
  .oa-orders-table tbody td { display:block; border:0; padding:4px 6px; min-width:0; }
  .oa-orders-table td:first-child { grid-column:1 / -1; }
  .oa-orders-table td[data-label]::before { content:attr(data-label); display:block; color:var(--orders-muted); font-size:.72rem; }
  .oa-orders-table td:last-child { text-align:left; }
}

.oa-cancellation-card { padding: 14px; border: 1px solid var(--orders-rule); border-left: 3px solid #a35a1b; border-radius: 10px; background: var(--orders-soft); }
.oa-cancellation-card h3 { display: flex; align-items: center; gap: 7px; font-size: .92rem; font-weight: 750; }
.oa-cancellation-card h3 svg { width: 17px; height: 17px; color: #a35a1b; }
.oa-cancellation-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 10px 0; }
.oa-cancellation-facts dt, .oa-cancellation-verify label { color: var(--orders-muted); font-size: .78rem; font-weight: 650; }
.oa-cancellation-facts dd { margin-top: 2px; font-size: .88rem; font-weight: 700; }
.oa-cancellation-actions { display: grid; justify-items: start; gap: 10px; }
.oa-cancellation-primary { min-height: 44px; padding: 8px 12px; border-radius: 8px; color: #fff; background: #9a2634; font-size: .83rem; font-weight: 750; }
.oa-cancellation-primary:disabled, .oa-cancellation-verify .oa-orders-export:disabled { opacity: .55; }
.oa-cancellation-verify { display: flex; flex-wrap: wrap; align-items: end; gap: 7px; width: 100%; padding-top: 9px; border-top: 1px solid var(--orders-rule); }
.oa-cancellation-verify label { display: grid; gap: 4px; flex: 1 1 160px; }
.oa-cancellation-verify input { min-height: 44px; width: 100%; }

.oa-commerce-surface, .oa-commerce-filters {
  padding: clamp(12px, 2vw, 22px);
  background: var(--orders-surface);
  border: 1px solid var(--orders-rule);
  border-radius: 14px;
  min-width: 0;
}
.oa-commerce-surface h2 { font-size: 1.15rem; font-weight: 750; margin: 0 0 12px }
.oa-commerce-surface p { margin-block: 10px; color: var(--orders-muted) }
.oa-commerce-filters, .oa-commerce-categories, .oa-commerce-pagination, .oa-orders-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end }
.oa-commerce-filters label { display: grid; gap: 6px; font-size: .82rem; font-weight: 650 }
.oa-commerce-filters input { min-height: 44px; padding: 7px 10px; border: 1px solid var(--orders-rule); border-radius: 9px; background: var(--orders-surface) }
.oa-commerce-categories button[aria-pressed="true"] { background: var(--orders-selected); border-color: var(--orders-blue) }
.oa-commerce-table { overflow: auto; border: 1px solid var(--orders-rule); border-radius: 10px }
.oa-commerce-table table { width: 100%; min-width: 660px; border-collapse: collapse; text-align: left; font-size: .875rem }
.oa-commerce-table th, .oa-commerce-table td { border-bottom: 1px solid var(--orders-rule); padding: 12px; vertical-align: top }
.oa-commerce-table th { background: var(--orders-soft); white-space: nowrap }
.oa-commerce-table tbody tr:last-child td { border-bottom: 0 }
.oa-commerce-table summary { cursor: pointer; color: var(--orders-blue); font-weight: 700 }
.oa-commerce-table dl { margin-top: 8px }
.oa-commerce-table dt, .oa-commerce-table small { display: block; color: var(--orders-muted); font-size: .75rem; margin-top: 4px }
.oa-commerce-status { text-transform: capitalize }
.oa-commerce-pagination { justify-content: flex-end; align-items: center; margin-top: 12px }
.oa-commerce-pagination button:disabled { opacity: .55; cursor: default }
.oa-commerce-loading { min-height: 100px; display: grid; place-items: center; color: var(--orders-muted) }
.oa-commerce-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 8px }
.oa-commerce-usage div { background: var(--orders-soft); border-radius: 8px; padding: 12px }
.oa-commerce-usage dd { font-size: 1.15rem; font-weight: 750; margin: 4px 0 0 }

/* Orders uses the same logo, muted navigation and gold selection marker as Business Intelligence. */
.oa-order-shell {
  --shell-ink:#172b43; --shell-muted:#566983; --shell-line:#e0e8f1;
  --shell-background:#f4f7fa; --shell-card:#fff; --shell-current:#eaf1f9;
  --shell-accent:#073763; --shell-gold:#edb900;
  display:grid; grid-template-columns:224px minmax(0,1fr); min-height:100dvh;
  background:var(--shell-background); color:var(--shell-ink);
  font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.oa-order-sidebar { position:sticky; top:0; height:100dvh; overflow:auto; overscroll-behavior:contain;
  scrollbar-width:thin; background:var(--shell-card); border-inline-end:1px solid var(--shell-line) }
.oa-order-brand { display:flex; align-items:center; min-height:83px; padding:15px 23px; border-bottom:1px solid var(--shell-line) }
.oa-order-brand img { display:block; max-width:100%; width:164px; height:auto }
.oa-order-sidebar nav { display:grid; gap:22px; padding:20px 11px }
.oa-order-nav-group { display:grid; gap:3px }
.oa-order-nav-group > span { padding:0 12px 7px; color:var(--shell-muted); font-size:.7rem; font-weight:750; letter-spacing:.12em; text-transform:uppercase }
.oa-order-nav-group a { display:grid; grid-template-columns:20px minmax(0,1fr) auto; align-items:center; gap:8px;
  min-height:42px; padding:6px 9px; border-inline-start:3px solid transparent; border-radius:8px;
  color:var(--shell-muted); text-decoration:none; font-size:.875rem; font-weight:650 }
.oa-order-nav-group a:is(:hover,[aria-current=page]) { background:var(--shell-current); color:var(--shell-accent) }
.oa-order-nav-group a[aria-current=page] { border-inline-start-color:var(--shell-gold); font-weight:750 }
.oa-order-nav-external { opacity:.65 }
.oa-order-sidebar a:focus-visible,.oa-order-mobile-bar button:focus-visible { outline:2px solid var(--shell-accent); outline-offset:-2px }
.oa-order-main { min-width:0 }
.oa-order-main .portal-admin-shell { padding-top:0 }
.oa-order-main .portal-toolbar { position:sticky; left:auto; right:auto; top:0; min-height:57px;
  padding:5px clamp(12px, 2.25vw, 34px); background:var(--shell-card); color:var(--shell-muted);
  border-bottom:1px solid var(--shell-line); box-shadow:none }
.oa-order-main .portal-toolbar button { background:var(--shell-card); border-color:var(--shell-line); color:var(--shell-accent) }
.oa-order-main .portal-toolbar button:hover { background:var(--shell-current) }
.oa-order-main .portal-toolbar-note { color:var(--shell-muted) }
.oa-order-main .portal-divider { background:var(--shell-line) }
.oa-order-main .oa-orders-workspace { max-width:none; padding:clamp(14px, 2.25vw, 34px); gap:13px }
.oa-order-main .oa-orders-header h1 { line-height:1.18 }
.oa-order-main .oa-orders-header p { margin:4px 0 0 }
.oa-order-main .oa-commerce-table table { min-width:850px }
.oa-order-main .oa-commerce-surface { padding:14px }
.oa-order-main .oa-commerce-surface h2 { margin:0 0 10px }
.oa-order-main .oa-commerce-table th,.oa-order-main .oa-commerce-table td { padding:10px 11px }
.oa-order-main .oa-commerce-table tbody tr:hover { background:var(--orders-soft) }
.oa-order-customer { font-weight:700; color:var(--orders-blue); text-decoration:underline; text-underline-offset:3px }
.oa-commerce-table td small { overflow-wrap:anywhere }
.oa-order-tools { display:flex; align-items:center; justify-content:space-between; gap:8px }
.oa-order-period { color:var(--orders-muted); font-size:.8rem; font-variant-numeric:tabular-nums }
.oa-order-tools button { margin-inline-start:auto }
.oa-commerce-filters[hidden] { display:none }
.oa-commerce-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; align-items:end; padding:12px }
.oa-commerce-filters :is(select,input) { box-sizing:border-box; width:100%; min-width:0; height:42px;
  color:var(--orders-ink); font:inherit; padding:7px 8px; border:1px solid var(--orders-rule); border-radius:8px; background:var(--orders-surface) }
.oa-commerce-filters .oa-orders-export { background:var(--orders-blue); color:var(--orders-surface); }
.oa-commerce-filters .oa-order-filter-note { color:var(--orders-muted); font-size:.75rem; margin:0; grid-column:1/-1 }
.oa-order-shell .oa-commerce-categories { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:4px;
  padding:4px; border:1px solid var(--orders-rule); border-radius:10px; background:var(--orders-surface); scrollbar-width:thin }
.oa-order-shell .oa-commerce-categories button { flex:none; white-space:nowrap; min-height:38px; border-color:transparent; padding:6px 9px }
.oa-order-shell .oa-commerce-categories button[aria-pressed=true] { background:var(--orders-selected); border-color:transparent }
.oa-order-pager { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px 15px;
  color:var(--orders-muted); font-size:.8rem; padding:12px 0 0 }
.oa-order-pager :is(label,.oa-order-pager-actions) { display:flex; gap:7px; align-items:center }
.oa-order-pager :is(button,select) { color:var(--orders-blue); background:var(--orders-surface); font:inherit;
  min-height:36px; border:1px solid var(--orders-rule); border-radius:8px; padding:4px 7px }
.oa-order-pager button { display:grid; place-items:center; min-width:36px }
.oa-order-pager button:hover:not(:disabled) { background:var(--orders-selected) }
.oa-order-pager :disabled { opacity:.5; cursor:default }
.oa-order-mobile-bar { display:none }
.dark .oa-order-shell {
  --shell-ink:#eef3fb; --shell-muted:#b1c0d3; --shell-line:#344257;
  --shell-background:#101c2e; --shell-card:#152235; --shell-current:#203b56; --shell-accent:#c9e6ff;
}
@media(max-width:760px) {
  .oa-order-shell { display:block }
  .oa-order-mobile-bar { display:block; background:var(--shell-card); border-bottom:1px solid var(--shell-line); padding:6px 12px }
  .oa-order-mobile-bar button { display:flex; align-items:center; gap:8px; min-height:38px; color:var(--shell-accent);
    font:inherit; font-weight:700; border:0; background:none }
  .oa-order-sidebar { display:none; position:static; height:auto; border-inline:0 }
  .oa-order-nav-open .oa-order-sidebar { display:block }
  .oa-order-main .portal-toolbar { overflow:auto }
  .oa-order-main .portal-toolbar-note { display:none }
}
.oa-commerce-surface > .oa-order-pager { padding:0 0 10px }

.oa-ai-token-report { display:grid; gap:12px }
.oa-ai-token-report h3 { font-size:.95rem; margin:0 0 8px }
.oa-ai-group-grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)) }
.oa-ai-groups .oa-commerce-table table,.oa-order-main .oa-ai-groups .oa-commerce-table table { min-width:0 }
