/* Shared workspace chrome and dense order operations; semantic states stay constant. */
:root {
  --bg: #f3f5f8; --surface: #fff; --subtle: #f6f8fb;
  --ink: #243247; --muted: #5e6e83; --line: #dce3ed;
  --primary: #2563eb; --primary-hover: #1d4ed8; --primary-soft: #edf3ff;
  --nav: #172b46; --nav-text: #d2ddef; --nav-muted: #a5b7cd; --nav-active: #284a77;
  --success: #236448; --success-soft: #eaf5ee;
  --blue: #235ea8; --blue-soft: #edf3fc;
  --amber: #875113; --amber-soft: #fff4df;
  --danger: #a13831; --danger-soft: #fceeed;
  --radius: 6px; --sidebar-size: 184px; --topbar-size: 44px;
  --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
:root[data-theme='graphite'] {
  --primary: #475569; --primary-hover: #334155; --primary-soft: #eef1f5;
  --nav: #222b38; --nav-text: #d7dfe9; --nav-muted: #aebccd; --nav-active: #3c4b61;
}
:root[data-theme='forest'] {
  --primary: #216548; --primary-hover: #194f38; --primary-soft: #eaf4ee;
  --nav: #192c25; --nav-text: #d4e4da; --nav-muted: #a3bcad; --nav-active: #315844;
}
:root[data-theme='indigo'] {
  --primary: #5b4bc4; --primary-hover: #4938ad; --primary-soft: #f1eefe;
  --nav: #262541; --nav-text: #e0def2; --nav-muted: #b8b4d4; --nav-active: #45416c;
}
:root[data-theme='amber'] {
  --primary: #a34b14; --primary-hover: #843b10; --primary-soft: #fff1e6;
  --nav: #352b25; --nav-text: #eaddd2; --nav-muted: #c5b3a4; --nav-active: #624530;
}
:root[data-sidebar='collapsed'] { --sidebar-size: 60px; }
body { line-height: 1.5; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 3px;
}
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sidebar { width: var(--sidebar-size); padding: 0 8px; overflow: visible; }
.brand { height: var(--topbar-size); padding: 0 9px; gap: 9px; font-size: 20px; letter-spacing: .04em; flex: none; border-bottom: 1px solid #ffffff16; }
.brandmark { width: 29px; height: 29px; font-size: 18px; border-radius: 6px; color: #fff; background: #ffffff0d; }
.brand small { font-size: 7px; margin-top: 1px; }
.workspace { padding: 10px 8px; margin: 13px 0 10px; border-radius: 5px; gap: 8px; font-size: 12px; }
.workspace small { font-size: 11px; }
.warehouse-icon { padding: 3px; }
.nav-label { padding: 8px 10px 4px; font-size: 11px; }
.nav-item { position: relative; gap: 9px; min-height: 39px; margin: 3px 0; padding: 8px 10px; border-radius: 4px; font-size: 13px; }
.nav-item:hover { background: #ffffff0c; }
.nav-item.active { background: var(--nav-active); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; background: #fff; border-radius: 0 2px 2px 0; }
.nav-item .nav-symbol, .future-nav .nav-symbol { width: 18px; height: 18px; flex: none; }
.nav-text { white-space: nowrap; }
.space-top { margin-top: 20px; }
.future-nav { position: relative; align-items: center; justify-content: flex-start; min-height: 38px; padding: 8px 10px; gap: 9px; font-size: 12px; }
.future-nav .future-badge { margin-left: auto; padding: 1px 3px; font-size: 10px; border: 1px solid #ffffff2a; border-radius: 3px; }
.future-nav .nav-text { border: 0; padding: 0; font-size: 12px; border-radius: 0; }
.sidebar-bottom { padding: 14px 7px; font-size: 11px; border-top: 1px solid #ffffff17; }
.sidebar-bottom small { font-size: 10px; line-height: 1.6; }
.app { margin-left: var(--sidebar-size); min-width: 0; }
.topbar { height: var(--topbar-size); min-height: var(--topbar-size); padding: 0 14px 0 10px; gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.breadcrumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .breadcrumb b { margin: 0 8px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 4px; flex: none; }
.icon-button:hover { color: var(--primary); background: var(--primary-soft); border-color: var(--line); }
.sidebar-toggle .icon { width: 19px; height: 19px; }
:root[data-sidebar='collapsed'] .sidebar-toggle .icon { transform: rotate(180deg); }
.userbar { gap: 9px; min-width: 0; }
.environment { color: var(--muted); background: var(--subtle); border-color: var(--line); font-size: 10px; padding: 2px 6px; }
.avatar { width: 25px; height: 25px; background: var(--primary-soft); }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 18px; }
.page-heading { margin-bottom: 16px; }
.button { border-radius: 4px; gap: 7px; }
.button:hover { background: var(--subtle); border-color: #b8c7dc; }
.pill.green { color: var(--success); background: var(--success-soft); }
.pill.neutral { background: #eef1f5; }
.heading-count, .tabs a b { background: #edf1f6; }
.product-thumb { background: var(--subtle); border-color: var(--line); color: #506178; }
.product small .mono { font-size: 11px; }
input, select { border-color: var(--line); }
tbody tr:hover { background: var(--subtle); }
td { border-bottom-color: var(--line); }
footer { min-height: 28px; padding: 6px 16px; gap: 12px; font-size: 11px; line-height: 1.4; }
.appearance { position: relative; }
.appearance-trigger { list-style: none; display: flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 7px; border: 1px solid transparent; border-radius: 4px; color: var(--muted); cursor: pointer; user-select: none; }
.appearance-trigger::-webkit-details-marker { display: none; }
.appearance[open] .appearance-trigger, .appearance-trigger:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--line); }
.appearance-panel { position: absolute; z-index: 60; width: 300px; max-width: calc(100vw - 24px); right: 0; top: calc(100% + 9px); padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 36px #14243b24; color: var(--ink); }
.appearance-panel h2 { font-size: 14px; }
.appearance-description { margin: 4px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-option { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); text-align: left; font-size: 12px; }
.theme-option:hover { background: var(--subtle); }
.theme-option[aria-pressed='true'] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.theme-swatch { width: 23px; height: 23px; border-radius: 4px; background: var(--swatch); box-shadow: inset 0 0 0 1px #0000000b; flex: none; }
.swatch-blue { --swatch: #2563eb; } .swatch-graphite { --swatch: #475569; } .swatch-forest { --swatch: #216548; } .swatch-indigo { --swatch: #5b4bc4; } .swatch-amber { --swatch: #a34b14; }
.theme-check { display: none; width: 14px; height: 14px; margin-left: auto; }
.theme-option[aria-pressed='true'] .theme-check { display: block; }
.appearance-status { margin: 12px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.appearance-reset { width: 100%; }
:root[data-sidebar='collapsed'] .brand { padding: 0; justify-content: center; }
:root[data-sidebar='collapsed'] .brand-copy,
:root[data-sidebar='collapsed'] .workspace,
:root[data-sidebar='collapsed'] .nav-label,
:root[data-sidebar='collapsed'] .sidebar-bottom .sidebar-copy,
:root[data-sidebar='collapsed'] .sidebar-bottom small,
:root[data-sidebar='collapsed'] .future-badge { display: none; }
:root[data-sidebar='collapsed'] .sidebar nav { margin-top: 15px; }
:root[data-sidebar='collapsed'] .nav-item,
:root[data-sidebar='collapsed'] .future-nav { justify-content: center; padding: 10px 0; min-height: 40px; }
:root[data-sidebar='collapsed'] .nav-item .nav-text,
:root[data-sidebar='collapsed'] .future-nav .nav-text { display: none; }
:root[data-sidebar='collapsed'] .nav-item:hover .nav-text,
:root[data-sidebar='collapsed'] .nav-item:focus-visible .nav-text {
  display: block; position: absolute; top: 0; left: calc(100% + 10px); padding: 10px 12px;
  background: var(--nav); color: #fff; border-radius: 4px; box-shadow: 0 3px 12px #14243b22; z-index: 80;
}
:root[data-sidebar='collapsed'] .sidebar-bottom { display: flex; justify-content: center; padding: 17px 0; }
:root[data-sidebar='collapsed'] .sidebar-bottom .dot { margin: 0; }
.sidebar-menu { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #ffffff30 transparent; overscroll-behavior: contain; }
.sidebar>.brand, .sidebar>.workspace, .sidebar>.sidebar-bottom { flex-shrink: 0; }
.sidebar-menu .space-top { margin-top: 14px; }
.sidebar-menu .nav-label { padding-top: 7px; }
:root[data-sidebar='collapsed'] .sidebar-menu nav { margin-top: 7px; }
:root[data-sidebar='collapsed'] .sidebar-menu .nav-item:hover .nav-text,
:root[data-sidebar='collapsed'] .sidebar-menu .nav-item:focus-visible .nav-text { position: fixed; top: auto; left: calc(var(--sidebar-size) + 6px); }
/* The orders workspace fills the screen, with scrolling confined to the data grid. */
.orders-page .app { height: 100dvh; min-height: 0; }
.orders-page .main-orders { flex: 1; min-height: 0; padding: 12px; display: flex; flex-direction: column; }
.orders-page .message { flex: none; margin-bottom: 8px; padding: 8px 12px; }
.order-workbench { display: flex; flex: 1; flex-direction: column; min-height: 0; border-radius: 5px; }
.workbench-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; min-height: 45px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.workbench-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.workbench-title h1 { font-size: 17px; font-weight: 650; letter-spacing: 0; line-height: 1.4; white-space: nowrap; }
.workbench-title .muted { font-size: 12px; padding-left: 11px; border-left: 1px solid var(--line); }
.workbench-heading .heading-actions { gap: 7px; }
.workbench-heading .button { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.order-workbench .tabs { flex: none; min-height: 39px; gap: 24px; padding: 0 14px; }
.order-workbench .tabs a { min-height: 39px; font-size: 12px; gap: 6px; }
.order-workbench .tabs a b { font-size: 11px; padding: 1px 5px; }
.order-filters { flex: none; align-items: center; gap: 12px; padding: 9px 14px; min-height: 52px; }
.order-filters label { display: flex; align-items: center; gap: 8px; font-size: 12px; flex: none; }
.order-filters label>span { margin: 0; white-space: nowrap; }
.order-filters .search-label { width: 310px; }
.order-filters .search-label input { width: 260px; min-width: 0; }
.order-filters input, .order-filters select { height: 32px; min-height: 32px; padding: 5px 9px; font-size: 12px; }
.order-filters select { min-width: 180px; max-width: 230px; }
.order-filters .button { min-height: 32px; padding: 4px 12px; }
.order-filters .filter-info { display: block; margin-left: auto; white-space: nowrap; font-size: 11px; }
.order-toolbar { flex: none; align-items: center; min-height: 37px; padding: 5px 14px; border-bottom: 1px solid var(--line); background: #fbfcfe; font-size: 12px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.toolbar-note { font-size: 11px; color: var(--muted); }
.density-switch { display: inline-flex; padding: 2px; gap: 2px; background: #edf1f6; border-radius: 4px; }
.density-switch button { min-width: 40px; min-height: 25px; padding: 2px 7px; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font-size: 11px; }
.density-switch button[aria-pressed='true'] { color: var(--primary); background: var(--surface); box-shadow: 0 1px 3px #14243b12; }
.density-switch button:hover { color: var(--primary); }
.order-workbench .table-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; scrollbar-color: #c5cfdd transparent; scrollbar-width: thin; }
.order-table { table-layout: fixed; min-width: 1080px; border-collapse: separate; border-spacing: 0; }
.order-table .col-order { width: 24%; } .order-table .col-product { width: 26%; }
.order-table .col-quantity { width: 5%; } .order-table .col-destination { width: 8%; }
.order-table .col-declaration { width: 10%; } .order-table .col-status { width: 11%; }
.order-table .col-time { width: 9%; } .order-table .col-actions { width: 7%; }
.order-table th { position: sticky; top: 0; z-index: 3; height: 34px; padding: 7px 12px; font-size: 12px; background: #edf2f8; color: #52647c; line-height: 1.5; }
.order-table td { padding: 6px 12px; font-size: 13px; vertical-align: top; white-space: normal; background: var(--surface); line-height: 1.5; }
.order-table tbody tr:nth-child(even) td { background: #fafbfd; }
.order-table tbody tr:hover td { background: var(--primary-soft); }
.order-table .order-number { display: block; max-width: 100%; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; letter-spacing: -.02em; }
.order-table .secondary { font-size: 12px; line-height: 16px; margin-top: 2px; }
.order-table .order-source { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: normal; }
.order-table .brand-tag { margin: 0; overflow-wrap: anywhere; }
.source-code { color: var(--muted); font: 11px var(--mono); overflow-wrap: anywhere; }
.order-table .micro { font-size: 11px; line-height: 14px; margin-top: 1px; }
.order-table .product { gap: 8px; min-width: 0; max-width: none; align-items: flex-start; }
.order-table .product+.product { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--line); }
.order-table .product-copy { flex: 1; min-width: 0; }
.order-table .product strong { font-size: 13px; font-weight: 500; line-height: 19px; overflow-wrap: anywhere; }
.order-table .product small { font-size: 12px; line-height: 17px; overflow-wrap: anywhere; }
.order-table .product small .mono { display: block; margin: 0; font-size: 11px; line-height: 16px; }
.order-table .pack-unit { font-size: 11px; color: var(--muted); margin-left: 5px; }
.order-table .product-thumb { width: 30px; height: 30px; margin-top: 2px; border-radius: 4px; }
.order-table .product-thumb svg { width: 24px; height: 24px; }
.order-table .line-quantity { font-size: 12px; padding-top: 1px; color: var(--ink); white-space: nowrap; }
.order-table .country { font-size: 12px; }
.order-table .destination-name { display: block; font-size: 12px; color: var(--muted); line-height: 18px; }
.order-table .pill { padding: 1px 5px; min-height: 21px; border-radius: 3px; font-size: 11px; line-height: 19px; }
.order-table .declaration-currency { margin-left: 5px; font-size: 11px; color: var(--muted); }
.order-table .time { font-size: 12px; white-space: nowrap; }
.order-table .time .secondary { font-size: 11px; }
.order-table .row-action { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; font-size: 12px; white-space: nowrap; }
.order-table .row-action .icon { width: 13px; height: 13px; }
.order-table th:last-child, .order-table td:last-child { position: sticky; right: 0; border-left: 1px solid var(--line); }
.order-table th:last-child { z-index: 4; }
.order-table td:last-child { z-index: 1; }
.order-workbench .pagination { flex: none; min-height: 38px; padding: 5px 14px; font-size: 12px; background: var(--surface); }
.order-workbench .pagination .button { min-height: 27px; padding: 2px 9px; }
.pagination-summary { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.empty-cell { height: 240px; }
.empty .empty-symbol svg { width: 36px; height: 36px; }
:root[data-density='standard'] .order-table td { padding-top: 14px; padding-bottom: 14px; }
:root[data-density='standard'] .order-table .secondary { margin-top: 5px; }
:root[data-density='standard'] .order-table .micro { margin-top: 4px; }
:root[data-density='standard'] .order-table .product-thumb { width: 36px; height: 36px; }
.login-body { background: var(--bg); }
.login-intro { background: var(--nav); color: var(--nav-text); }
.login-intro .brand { height: auto; border: 0; }
.login-intro .eyebrow, .login-intro>small { color: var(--nav-muted); }
@media (min-width: 1500px) {
  .order-table .product small .mono { display: inline; margin-left: 6px; }
}
@media (max-width: 1150px) {
  .sidebar { width: var(--sidebar-size); }
  .app { margin-left: var(--sidebar-size); }
  main { padding: 16px; }
  .order-filters .search-label { width: 250px; }
  .order-filters { flex-wrap: wrap; }
  .order-filters .search-label input { width: 200px; }
  .order-filters .filter-info { display: none; }
  .toolbar-note { display: none; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-size); padding: 0 8px; }
  .sidebar .brand { height: var(--topbar-size); padding: 0 9px; font-size: 20px; }
  :root[data-sidebar='collapsed'] .sidebar .brand { padding: 0; }
  .sidebar .nav-label, .sidebar .workspace, .sidebar .future-nav, .sidebar-bottom { display: flex; }
  .sidebar .nav-label { display: block; }
  :root[data-sidebar='collapsed'] .sidebar .workspace,
  :root[data-sidebar='collapsed'] .sidebar .nav-label { display: none; }
  .sidebar nav { display: block; overflow: visible; }
  .nav-item { min-height: 44px; gap: 9px; padding: 10px; }
  .sidebar .nav-symbol { display: block; }
  .app { margin-left: var(--sidebar-size); }
  .topbar { padding: 0 8px 0 5px; height: var(--topbar-size); }
  .topbar-left { gap: 4px; }
  .breadcrumb { font-size: 12px; }
  .breadcrumb .breadcrumb-root, .breadcrumb b { display: none; }
  .userbar { gap: 4px; margin-left: 0; }
  .user-name, .avatar { display: none; }
  .userbar .text-button { min-height: 32px; padding: 4px; }
  .icon-button { width: 32px; }
  .appearance-trigger { min-height: 32px; padding: 4px; }
  .appearance-panel { position: fixed; top: 49px; right: 10px; }
  .orders-page .app { height: auto; min-height: 100dvh; }
  .orders-page .main-orders { padding: 8px; }
  .order-workbench { min-height: 520px; }
  .workbench-heading { align-items: flex-start; gap: 8px; padding: 10px; flex-wrap: wrap; }
  .workbench-title h1 { font-size: 16px; }
  .workbench-title .muted { display: none; }
  .workbench-heading .button { min-height: 36px; }
  .order-workbench .tabs { gap: 18px; padding: 0 10px; }
  .order-workbench .tabs a { min-height: 44px; }
  .order-filters { padding: 10px; gap: 10px; flex-wrap: wrap; }
  .order-filters .search-label { width: 100%; }
  .order-filters label { gap: 6px; width: 100%; }
  .order-filters .search-label input { width: auto; flex: 1; }
  .order-filters select { min-width: 0; width: auto; flex: 1; max-width: none; }
  .order-filters input, .order-filters select { min-height: 40px; height: 40px; font-size: 16px; }
  .order-filters .button { min-height: 40px; }
  .order-toolbar { padding: 6px 10px; flex-wrap: wrap; gap: 5px; }
  .toolbar-right { margin-left: auto; }
  .density-label { display: none; }
  .density-switch button { min-height: 32px; }
  .order-workbench .table-scroll { height: min(55dvh, 480px); min-height: 240px; flex: none; }
  .order-table { min-width: 990px; }
  .order-workbench .pagination { padding: 8px 10px; gap: 8px; }
  .pagination-summary { flex-wrap: wrap; gap: 4px 10px; }
  .order-workbench .pagination .button { min-height: 36px; }
  footer { padding: 8px 12px; flex-direction: column; font-size: 10px; }
}
@media (max-width: 460px) {
  .appearance-trigger>span, .environment { display: none; }
  .workbench-heading .heading-actions { flex-wrap: wrap; }
  .order-filters label { flex-wrap: wrap; }
  .order-filters label>span { min-width: 36px; }
}
@media (prefers-reduced-motion: no-preference) {
  .theme-option, .icon-button, .appearance-trigger { transition: background-color 140ms, border-color 140ms; }
}
@media print {
  .sidebar, .topbar, .appearance, footer, .density-switch { display: none !important; }
  .app { margin-left: 0; }
  .orders-page .app, .order-workbench { height: auto; }
  .orders-page .table-scroll { overflow: visible; }
}
