/* Both navigation levels use the viewport centre, independently of side controls. */
:root, :root[data-theme] {
  --text:#252a30; --secondary:#555d66; --muted:#68746b;
  --line:#e7e9e7; --accent:#3068d8; --accent-text:#fff;
}
html, body, .main-pane.glass {background:#f7f8f6;}
.site-header {
  display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  grid-template-areas:"brand navigation account";
  column-gap:24px; padding:0 32px; background:#fff; border-color:#edf0ec;
}
.site-header .brand {grid-area:brand; justify-self:start;}
.top-nav {grid-area:navigation; justify-self:center; justify-content:center; gap:6px;}
.header-tools {grid-area:account; justify-self:end; margin-left:0; max-width:100%;}
.header-tools .profile-button {min-width:0; background:#f5f6f4; padding:6px 10px;}
.header-tools .avatar {background:#e8edf5; color:#46618a;}
.site-header .brand-mark {background:#3068d8;}
.top-nav-item {min-height:40px; font-size:14px; padding:10px 16px; font-weight:550;}
.top-nav-item.current {background:#edf3ff; color:#245bbd;}
.top-nav-item.expanded, .top-nav-item:hover {background:#f0f3f7;}
.section-bar {display:flex; align-items:center; justify-content:center; min-height:62px; padding:8px 24px; gap:0; background:#fff; border-color:#e9ece7;}
#current-group {display:none;}
.section-nav {flex:0 1 auto; justify-content:center; gap:14px; margin:0; padding:0; overflow:visible;}
.section-nav .navigation-link {padding:11px 8px 10px; min-height:40px; border:0; border-bottom:2px solid transparent; border-radius:0; font-size:13px; font-weight:500; color:#6a737d; background:none;}
.section-nav .navigation-link.active {background:none; color:#285db9; border-bottom:2px solid #3975dc; font-weight:600;}
.section-nav .navigation-link:hover {background:none; color:#285db9;}
.navigation-panel {background:#fff;}
.navigation-open .site-header {background:#fff;}
.navigation-panel-inner {max-width:1320px;}
.content, #finance-content {
  padding:32px max(28px,calc((100% - 1240px) / 2)) 28px;
  scrollbar-gutter:stable both-edges;
}
.page-heading {align-items:center; gap:24px; margin-bottom:26px;}
h1, .finance-content h1 {font-size:30px; font-weight:600; letter-spacing:-.7px; color:#252a30;}
.page-heading p {font-size:14px; line-height:1.55; color:#737c86; margin-top:8px; max-width:660px;}
.heading-actions {flex-shrink:0; gap:10px;}
.button {min-height:40px; padding:10px 16px; font-size:13px; font-weight:500;}
.button.primary {background:#3068d8; border-color:#3068d8; box-shadow:0 3px 7px #3068d81a !important;}
.button.primary:hover {background:#245bc4;}
.button.secondary {background:#fff; border-color:#e2e7df; color:#475363;}
.surface, .inventory-panel, .storage-panel, .activity-panel, .f-card, .f-metric, .f-panel, .f-table-panel {
  border-color:#e7ebe4; box-shadow:0 3px 12px #253a2404 !important;
}
.summary {display:flex; gap:0; margin-bottom:28px; padding:0 4px;}
.summary-card {flex:1; min-width:0; padding:0 24px; border:0; border-right:1px solid #e1e7df; border-radius:0; background:none; gap:14px; box-shadow:none !important;}
.summary-card:first-child {padding-left:0;}
.summary-card:last-child {border-right:0;}
.summary-icon {width:38px; height:38px; border-radius:12px; background:#eaf1fe; color:#3e6cac;}
.summary-label {font-size:12px; font-weight:400; color:#738078; margin-bottom:5px;}
.summary-value {font-size:25px; line-height:1.15; font-weight:600; letter-spacing:-.5px;}
.summary-value small {display:none;}
#quick-actions {display:none;}
.workspace-grid {grid-template-columns:minmax(0,1fr); gap:24px;}
.context-panels {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px;}
.inventory-panel {padding:24px 28px 16px;}
.panel-heading {margin-bottom:22px; gap:16px; align-items:center;}
.panel-heading h2, .context-title h2 {font-size:17px; font-weight:550; letter-spacing:-.2px; color:#404a55;}
.panel-tools {gap:7px;}
.filter-bar, .catalog-view .filter-bar {display:flex; flex-direction:column; align-items:stretch; gap:16px; margin-bottom:18px;}
.filter-topline {display:flex; align-items:center; gap:18px; justify-content:space-between; min-width:0;}
.filter-topline .filter-row {display:flex; align-items:center; gap:12px; width:auto; flex-wrap:wrap;}
.search-slot {min-width:0; flex:1 1 280px; max-width:340px;}
#global-search {height:40px; width:100%; min-width:0; padding:0 13px; border:1px solid #e4e8e1; border-radius:11px; background:#fafbf9;}
#global-search input {font-size:14px;}
#global-search input::placeholder {color:#8a938c;}
#global-search kbd {background:none; font-size:10px; color:#929b94;}
.segments {gap:7px; flex-wrap:wrap;}
.segment {min-height:32px; padding:6px 12px; border-color:transparent; background:#f4f6f1; color:#677361; font-size:12px;}
.segment.active {background:#edf3ff; border-color:transparent; color:#3164b6;}
.location-select {height:38px; padding:0 10px; background:#fff; border:1px solid #e5e9e1;}
.location-select select {font-size:13px; color:#566050;}
.filter-button {min-height:38px; padding:8px 12px; border:1px solid #e5e9e1; background:#fff; font-size:12px; color:#687164;}
.filter-button .icon {width:16px; height:16px;}
.stock-table th, .doc-list th {font-size:12px; font-weight:500; color:#8a938c; padding-top:14px; padding-bottom:14px; border-color:#edf0e9;}
.stock-table td, .doc-list td {font-size:14px; padding-top:17px; padding-bottom:17px; border-color:#edf0e9;}
.stock-table .item-name, .doc-list .item-name {font-size:14px; font-weight:500; color:#35404d;}
.stock-table .item-sku, .doc-list .item-sku {font-size:11px; color:#929b95; margin-top:4px;}
.stock-table .qty {font-size:15px; font-weight:550; color:#3a4859;}
.product-icon {width:36px; height:40px; border-radius:12px; border:0;}
.product-icon.raw {background:#edf4ec; color:#5a7e5d;}
.product-icon.pack {background:#f7f1e7; color:#9a7b4f;}
.product-icon.finished {background:#edf2fc; color:#5a78b2;}
.product-icon .icon {width:21px; height:21px;}
.content-footer {padding-top:18px; color:#939c94; font-size:11px;}
.storage-panel, .activity-panel {padding:22px 26px;}
.storage-place, .activity-row {padding:13px 10px;}
.storage-place strong, .activity-row strong {font-weight:500;}
.context-note {color:#879286;}
.statusbar {font-size:10px; color:#939d93; padding-top:22px;}
.empty-state {min-height:340px; padding:44px 20px; gap:12px;}
.empty-state>.icon {width:60px; height:60px; padding:16px; border-radius:19px; background:#edf4ff; color:#688abd; margin-bottom:4px;}
.empty-state h3 {font-size:24px; font-weight:550; letter-spacing:-.5px; max-width:none; color:#364350;}
.empty-state p {font-size:14px; line-height:1.65; max-width:420px; color:#849083; margin-bottom:4px;}
.empty-state .button {margin-top:4px;}
.empty-warehouse .context-panels {display:none;}
.empty-warehouse #filter-bar {display:none;}
.empty-warehouse .panel-heading {margin-bottom:0;}
.empty-warehouse .panel-tools {visibility:hidden;}
.f-filter {display:flex; align-items:center; gap:16px; margin-bottom:24px; flex-wrap:wrap;}
.f-filter .search-slot {flex:1 1 280px; margin-right:auto;}
.f-filter>label:not(.f-check) {display:flex; align-items:center; gap:10px; font-size:12px; color:#7c877d; white-space:nowrap;}
.f-filter select {min-width:180px; max-width:260px; background:#fff; font-size:13px; padding:10px 12px;}
.f-card {padding:26px; border-radius:20px;}
.f-card h2 {font-size:20px; font-weight:550; letter-spacing:-.35px;}
.f-kicker {color:#8b958c;}
.f-card-foot {border-color:#edf0e9;}
.f-empty {min-height:320px; padding:40px 24px; border:1px solid #e7ebe4; border-radius:20px; background:#fff; gap:18px;}
.f-empty>.icon {width:52px; height:52px; padding:12px; background:#eef4ff; color:#7394c5; border-radius:16px;}
.f-empty h2 {font-size:22px; font-weight:500; color:#58665c;}
.f-table th {font-size:12px; text-transform:none; letter-spacing:0; color:#8b958b; font-weight:500; border-color:#edf0e9;}
.f-table td {font-size:14px; border-color:#edf0e9;}
.f-check {color:#7c877d;}
.f-note {color:#829080;}
/* Keep secondary labels readable on the quiet, pale surfaces. */
.page-heading p,.summary-label,.stock-table th,.doc-list th,.stock-table .item-sku,.doc-list .item-sku,.content-footer,.context-note,.statusbar,.f-kicker,.f-filter>label:not(.f-check),.f-check,.f-note,.f-table th,.empty-state p {color:#68746b;}
#global-search input::placeholder {color:#68746b;}
@media(min-width:768px) and (max-width:1199px) {
  .site-header {padding:0 20px; column-gap:18px;}
  .top-nav {gap:3px;}
  .top-nav-item {font-size:13px; padding:10px 12px;}
  .section-nav {flex:0 1 auto; gap:10px;}
  .section-bar {flex-wrap:nowrap; padding:8px 18px;}
  .content,#finance-content {padding:28px 24px;}
  .f-filter {gap:12px;}
}
@media(max-width:767px) {
  .site-header {grid-template-areas:"menu brand account"; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); column-gap:12px; padding:0 16px;}
  .site-header .brand {justify-self:center;}
  #menu-toggle {grid-area:menu; justify-self:start;}
  .top-nav {display:none;}
  .section-bar {padding:8px 12px; min-height:54px; flex-wrap:nowrap;}
  .section-nav {flex:0 1 auto; width:auto; flex-wrap:wrap; justify-content:center; gap:2px 12px; margin:0;}
  .section-nav .navigation-link {padding:9px 5px 8px; min-height:36px; font-size:12px; border-bottom:2px solid transparent;}
  .section-nav .navigation-link.active {border-bottom:2px solid #3975dc;}
  .content,#finance-content {padding:24px 16px; scrollbar-gutter:auto;}
  .page-heading {gap:16px; margin-bottom:22px; align-items:flex-start;}
  h1,.finance-content h1 {font-size:27px;}
  .page-heading p {font-size:13px; line-height:1.5; margin-top:7px;}
  .heading-actions {width:100%;}
  .button,.finance-content .button {font-size:13px; padding:11px 14px;}
  .summary {gap:0; margin-bottom:24px; padding:0;}
  .summary-card {padding:0 13px; display:block;}
  .summary-icon {display:none;}
  .summary-label {font-size:11px; min-height:30px; margin-bottom:5px;}
  .summary-value {font-size:24px;}
  .inventory-panel {padding:19px 16px 14px; border-radius:18px;}
  .panel-heading {margin-bottom:18px; gap:10px;}
  .panel-heading h2 {font-size:16px;}
  .panel-tools {gap:2px;}
  .filter-topline {align-items:stretch; flex-direction:column; gap:12px;}
  .search-slot {flex:none; max-width:none; width:100%;}
  #global-search {height:42px;}
  #global-search input {font-size:16px;}
  #global-search kbd {display:none;}
  .filter-topline .filter-row {width:100%; gap:8px; flex-wrap:nowrap;}
  .location-select {min-width:0; flex:1; height:40px;}
  .location-select select {font-size:16px; width:100%; min-width:0;}
  .filter-button {min-height:40px; padding:8px 10px;}
  .filter-button span {display:none;}
  .segments {gap:6px;}
  .segment {font-size:11px; padding:7px 9px;}
  .stock-table td,.doc-list td {padding-top:16px; padding-bottom:16px;}
  .stock-table .item-name,.doc-list .item-name {font-size:13px;}
  .stock-table .qty {font-size:13px;}
  .stock-table .product-icon {width:30px; height:34px;}
  .context-panels {grid-template-columns:minmax(0,1fr); gap:16px;}
  .storage-panel,.activity-panel {padding:20px;}
  .empty-state {min-height:310px; padding:32px 8px;}
  .empty-state h3 {font-size:22px;}
  .empty-state p {font-size:13px;}
  .f-filter .search-slot {flex-basis:100%; margin:0;}
  .f-filter>label:not(.f-check) {flex:1 1 100%; flex-direction:column; align-items:flex-start; gap:7px; white-space:normal;}
  .f-filter select {max-width:none; width:100%; font-size:16px;}
  .f-card {padding:22px; border-radius:18px;}
  .f-empty {padding:30px 18px; min-height:300px; border-radius:18px;}
  .f-empty h2 {font-size:21px;}
}
