/* Shared layout and account styling for the workbench. */
:root {
  color-scheme: light;
  --bg: #f2f5f6;
  --ink: #182c35;
  --muted: #526773;
  --line: #d9e2e7;
  --teal: #12695f;
  --teal-soft: #e1f0eb;
  --workspace-side: #172e35;
  --workspace-side-text: #e2edf0;
  --workspace-side-muted: #afc0c5;
  --workspace-width: 208px;
  --workspace-focus: #146b96;
  --workspace-head: #f5f8fa;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
}
.sidebar {
  width: var(--workspace-width);
  padding: 20px 14px 18px;
  background: var(--workspace-side);
  border: 0;
  overflow-y: auto;
  color: var(--workspace-side-text);
  scrollbar-width: thin;
  scrollbar-color: #607881 transparent;
}
.sidebar .brand {
  display: grid;
  justify-items: center;
  --brand-gap: 6px;
  gap: var(--brand-gap);
  margin: 0 0 16px;
  padding: 0 4px;
  color: var(--workspace-side-text);
  text-align: center;
}
.brand-logos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  place-items: center;
  gap: 8px;
  width: 100%;
  max-width: 168px;
  padding: 6px 9px;
}
.brand-logos a {
  display: block;
  width: min(100%, 60px);
}
.brand-logos img {
  display: block;
  width: 100%;
  height: 44px;
  object-fit: contain;
}
.brand-logos .brand-logo-voyage {
  object-fit: cover;
}
.brand-home {
  display: grid;
  gap: var(--brand-gap);
  color: inherit;
}
.brand-home:hover { text-decoration: none; }
.brand-names {
  display: grid;
  gap: 1px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.brand-voyage-name {
  color: #d9c5ac;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.11em;
}
.brand-workbench {
  color: #f5fafb;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.sidebar nav { gap: 3px; }
#workspace-system, #workspace-finance { display: grid; gap: inherit; }
#app .panel-head .approval-section-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 22px; line-height: 1.2;
}
.approval-section-count {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 4px 10px; border-radius: 6px; font-size: 13px;
  background: #edf2f2; color: #53676c; font-variant-numeric: tabular-nums;
}
.approval-section-count.has-pending { background: #fff0c8; color: #754900; }
.approval-section-count strong { font-size: 25px; line-height: 1; }
.sidebar .workspace-nav-label {
  color: var(--workspace-side-muted);
  font-size: 11px;
  margin: 12px 8px 3px;
}
.sidebar nav > .workspace-nav-label:first-child { margin-top: 0; }
.sidebar nav a[data-nav] {
  color: var(--workspace-side-text);
  font-size: 13px;
  line-height: 1.4;
  min-height: 36px;
  padding: 7px 9px;
  gap: 8px;
}
.sidebar nav a[data-nav]:hover { background: #29434b; }
.sidebar nav a[data-nav].active { background: #285149; color: #edfff8; box-shadow: inset 3px 0 #8cdcc3; }
.sidebar .approval-nav-counts:not([hidden]) { margin: 3px 4px 4px 9px; gap: 4px; }
.sidebar nav .approval-nav-counts > :is(span, a) { background: #29434b; color: #e1edf1; }
.sidebar nav .approval-nav-counts > .has-pending { background: #544124; color: #ffe1a6; }
.sidebar .side-footer { position: static; color: var(--workspace-side-muted); margin: 12px 8px 0; padding: 12px 0 0; border-top: 1px solid #3c515a; }
.sidebar .status-dot { background: #88d6bd; }
.sidebar .primary { color: #12372f; background: #a7e4d1; border-color: #a7e4d1; margin-top: 15px; }
.sidebar .primary:hover { background: #c1efdf; }
.sidebar .sidebar-planning { background: #203b43; color: var(--workspace-side-text); border-color: #55727d; }
.sidebar .sidebar-planning:hover { background: #31545e; }
.main-shell { min-width: 0; margin-left: var(--workspace-width); }
.main-shell .topbar {
  height: 58px;
  padding-inline: clamp(16px,2.4vw,35px);
  background: #fff;
  border-color: var(--line);
}
.workspace-breadcrumb,.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.workspace-breadcrumb { color: var(--muted); }
#breadcrumb { color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-right { flex-shrink: 0; }
.top-right .local-badge { color: #2f604d; background: #e9f4ed; border-color: #c9ded0; white-space: nowrap; }
.team-test-mode .top-right .local-badge { color: #704317; background: #fff3dd; border-color: #ebd7ad; }
.top-right .actor-button { color: var(--ink); font-weight: 650; }
#app { padding: clamp(16px,2.4vw,34px); }
#app .page-title { margin-bottom: 20px; }
#app .page-title h1 { color: var(--ink); font-size: clamp(22px,2.1vw,32px); font-weight: 720; line-height: 1.25; }
#app .page-title .subtitle { color: var(--muted); margin-block: 6px 0; }
#app .panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 4px #19354708; }
#app .panel-head { padding: 14px 16px; }
#app .panel-head h2 { font-size: 16px; }
#app th { color: #425c69; }
#app :is(th,td) { font-variant-numeric: tabular-nums; }
.account-panel th { background: var(--workspace-head); }
.account-panel table { min-width: 860px; }
.account-panel th, .account-panel td { padding: 13px 14px; }
.account-panel :is(th, td):nth-child(n+4):not(:last-child) { text-align: right; }
.account-panel td:nth-child(6) strong { color: #096c5b; }
.account-result { font-size: 12px; color: var(--muted); }
.account-filters { align-items: end; flex-wrap: wrap; }
.account-filters .field { margin: 0; min-width: 140px; }
.account-filters .field:first-child { min-width: min(220px,100%); }
.account-summary { display: grid; grid-template-columns: minmax(180px,1.5fr) repeat(2,minmax(125px,1fr)); gap: 12px; margin-bottom: 16px; }
.account-stat { display: grid; gap: 7px; padding: 14px 17px; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; }
.account-stat > span,.account-stat > small { color: var(--muted); font-size: 12px; }
.account-stat > strong { font-size: clamp(20px,2.5vw,34px); line-height: 1.14; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.account-balance { background: #1d4645; color: #f0fff9; border-color: #1d4645; }
.account-balance > :is(small,span) { color: #d0e8e3; }
.account-state { display: inline-block; padding: 2px 7px; border-radius: 4px; background: #eef1f4; color: #4b5c69; font-size: 12px; white-space: nowrap; }
.account-state.is-available { background: #e2f1eb; color: #17664d; }
#account-ledger-section:not(:empty) { margin-block: 14px; }
#account-ledger-section .panel-head { flex-wrap: wrap; }
.orders-workspace .orders-panel,.crm-care-table,.report-table { font-variant-numeric: tabular-nums; }
.orders-table .metric-neutral,.page-financial-footer .metric-neutral { color: #1b2023; }
#app .orders-toolbar { flex-wrap: nowrap; gap: 8px; padding: 7px 12px; }
.orders-toolbar h2 { min-width: 0; white-space: nowrap; }
.orders-toolbar-actions { display: flex; flex: none; align-items: center; gap: 6px; }
.orders-toolbar-actions button { padding: 5px 9px; }
.order-filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.order-filter-form .field { margin: 0; min-width: 0; }
.order-filter-form .order-filter-search { grid-column: 1 / -1; }
.order-filter-form :is(input, select) { min-width: 0; }
.orders-pager,.orders-pager .actions { flex-wrap: wrap; gap: 8px; }
.orders-pager label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.orders-pager select { width: auto; padding: 5px 7px; }
@media (max-width: 420px) {
  #app .orders-toolbar { padding-inline: 8px; gap: 5px; }
  #app .orders-toolbar h2 { font-size: 14px; }
  .orders-toolbar-actions { gap: 4px; }
  .orders-toolbar-actions button { padding-inline: 6px; }
}
#app .report-tabs button[aria-pressed="true"] { background: var(--teal); }
:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible { outline: 2px solid var(--workspace-focus); outline-offset: 2px; }
.sidebar :is(a,button):focus-visible { outline-color: #9fdfcf; }
#workspace-nav-toggle { display: none; }

@media (max-width: 1200px) {
  :root { --workspace-width: 180px; }
  .sidebar { padding-inline: 10px; }
}
@media (max-width: 800px) {
  .sidebar { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 11px 15px; }
  .sidebar .brand { width: min(100%, 168px); margin: 0; padding: 0; --brand-gap: 4px; }
  .brand-logos { padding-block: 3px; }
  .brand-logos img { height: 40px; }
  #workspace-nav-toggle { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; background: #213c44; border-color: #627981; color: var(--workspace-side-text); }
  .sidebar #workspace-navigation { display: none; }
  .sidebar.workspace-menu-open #workspace-navigation { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0,1fr); margin: 6px 0 0; overflow: visible; }
  .sidebar #workspace-navigation a[data-nav] { min-height: 44px; }
  .sidebar #workspace-navigation .approval-nav { display: block; }
  .sidebar.workspace-menu-open > :is(#sidebar-new,#sidebar-planning):not([hidden]) { grid-column: 1 / -1; display: block; min-height: 44px; margin: 0; }
  .sidebar:not(.workspace-menu-open) > :is(#sidebar-new,#sidebar-planning),.sidebar .side-footer { display: none; }
  .main-shell { margin: 0; }
  .main-shell .topbar { height: 48px; }
  .workspace-breadcrumb > span { display: none; }
  #app { padding: 14px; }
  #app .panel-head { flex-wrap: wrap; }
  #app .account-filters { width: 100%; }
  #app input:not([type="checkbox"]):not([type="radio"]),#app select { min-height: 40px; }
  .account-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-balance { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .top-right .actor-button { max-width: 112px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .account-filters .field { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.account-filters {
  display: grid;
  grid-template-columns: minmax(190px,240px) minmax(140px,180px);
  gap: 12px;
  width: auto;
}
.account-filters .field,.account-filters .field:first-child { width: 100%; min-width: 0; }
.account-panel td { vertical-align: middle; }
.account-panel td:last-child .actions { gap: 6px; flex-wrap: wrap; }
.balance-basis { margin-top: 3px; font-size: 12px; color: var(--muted); text-align: right; }
.balance-basis summary { cursor: pointer; }
.balance-basis small { display: block; max-width: 24ch; margin-left: auto; }
.native-balance { white-space: nowrap; }
@media (max-width: 800px) {
  #app .account-filters { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); }
  .account-panel .table-wrap { overflow: visible; }
  .account-panel table { display: block; min-width: 0; }
  .account-panel thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
  .account-panel tbody { display: block; }
  .account-panel tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px 12px; border-top: 1px solid var(--line); }
  .account-panel tbody td { display: block; min-width: 0; border: 0; padding: 5px 3px; text-align: left !important; white-space: normal; }
  .account-panel td:not(:first-child):not(:last-child)::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
  .account-panel td:is(:first-child,:last-child) { grid-column: 1 / -1; }
  .account-panel td:first-child strong { font-size: 16px; }
  .account-panel td:last-child button { min-height: 44px; }
  .balance-basis { text-align: left; }
  .balance-basis small { margin-left: 0; }
}

.orders-payment-shortcut { margin: 0 0 12px; }
.orders-payment-shortcut .has-pending { color: #7a4500; background: #fff2d8; border-color: #e9cb90; }
