/* Shared top navigation for every platform workspace. */
body:has(.app-container > .sidebar) .app-container {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
}
body:has(.app-container > .sidebar) .sidebar {
  position: sticky !important;
  top: 0;
  z-index: 100;
  align-self: stretch !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 13px clamp(16px,3vw,38px) 10px !important;
  border-right: 0 !important;
  border-bottom: 1px solid #e3eaf0 !important;
  box-shadow: 0 5px 18px #1027460b !important;
}
body:has(.app-container > .sidebar) .sidebar .logo {
  margin: 0 0 9px !important;
  padding: 0 8px !important;
}
body:has(.app-container > .sidebar) .sidebar .nav-menu {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px !important;
  white-space: nowrap;
  padding-bottom: 2px;
}
body:has(.app-container > .sidebar) .sidebar .nav-item {
  flex: 0 0 auto;
}
body:has(.app-container > .sidebar) .sidebar .sub-menu {
  order: 2;
  flex: 1 0 100%;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  overflow-x: auto;
  gap: 3px !important;
  padding: 9px 0 0 !important;
  margin: 4px 0 0 !important;
  border-left: 0 !important;
  border-top: 1px solid #e3eaf0 !important;
}
body:has(.app-container > .sidebar) .sidebar [data-auth-logout] {
  width: auto !important;
  margin-top: 0 !important;
}
body:has(.app-container > .sidebar) .main-content {
  width: 100%;
  min-width: 0;
  max-width: none !important;
  margin-left: 0 !important;
}
.sidebar .nav-coming-label {
  padding: 4px 6px;
  border: 1px solid #e2eaf0;
  border-radius: 999px;
  background: #f6f8fa;
  color: #8191a1;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}
#scannerOpen[hidden], body:has(#tab-income:not(.active)) #scannerOpen {
  display: none !important;
}
/* Settings already have a top header; keep their section links above the form too. */
.settings-layout {
  display: flex !important;
  flex-direction: column;
  gap: 20px;
}
.settings-index {
  position: static !important;
  width: 100%;
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  padding: 9px;
  gap: 4px;
}
.settings-index > span { display: none; }
.settings-index a { flex: 0 0 auto; padding: 10px 12px; }
.settings-sections { width: 100%; }
/* Headings must remain readable on the calculator's light cards. */
.calc-card h2, .calc-results h2 { color: #102746 !important; }
@media (min-width: 1151px) {
  .app-container > .main-content .calc-results { top: 120px; }
}
@media (max-width: 760px) {
  .settings-index { flex-wrap: nowrap; overflow-x: auto; }
  .settings-index a { padding: 9px 10px; }
}
