/* Superwagen Intel · shared visual system, September 2026.
   This presentation layer follows the existing data and navigation contracts. */
:root {
  --bg: #f4f6f8;
  --surface: #fff;
  --surface-2: #f5f7f9;
  --text: #1b2236;
  --muted: #596579;
  --line: #dce2e9;
  --line-strong: #bdc7d3;
  --accent: #234a74;
  --accent-bright: #234a74;
  --accent-soft: #eaf1f8;
  --good: #087f69;
  --good-soft: #eaf6f1;
  --bad: #b23f4c;
  --bad-soft: #fbedef;
  --warning: #996114;
  --warning-soft: #fbf4e7;
  --shadow: 0 2px 8px rgb(16 27 45 / 3%);
  --sidebar-width: 248px;
  --navy: #101b2d;
  --radius: 12px;
  color-scheme: light;
}

html { scroll-behavior: auto; scroll-padding-top: 108px; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
::selection { background: #cfe3f5; color: #101b2d; }
*, *::before, *::after { box-sizing: border-box; }
.hidden, [hidden] { display: none !important; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #1686b3;
  outline-offset: 3px;
}
:where(input, select, textarea):focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(35 74 116 / 12%); }

.app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.app-shell > .sidebar {
  background: var(--navy); padding: 24px 14px 16px; gap: 18px;
  border-right: 1px solid #243247; box-shadow: none;
}
.brand-block { padding: 0 8px 20px; gap: 15px; border-color: #344156; }
.sidebar-group-lockup { width: 180px; max-width: 100%; height: auto; }
.brand-subtitle { display: flex; align-items: center; justify-content: center; gap: 9px; color: #fff; font-size: 16px; font-weight: 700; }
.brand-subtitle span { padding-left: 9px; border-left: 1px solid #526075; color: #bac6d7; font-size: 11px; font-weight: 400; }
.sidebar .nav { gap: 4px; padding-right: 2px; }
.sidebar .nav-section-label { color: #a7b6ca; font-size: 11px; font-weight: 400; letter-spacing: .09em; padding: 0 12px; margin: 2px 0 7px; }
.sidebar .nav-link { min-height: 44px; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #d8e1ed; font-size: 14px; line-height: 1.35; font-weight: 400; }
.sidebar .nav-link i { color: #aabdd3; font-size: 17px; }
.sidebar .nav-link:hover { background: #243247; color: #fff; }
.sidebar .nav-link.active { background: #e9f0f7; color: #152d4c; box-shadow: none; }
.sidebar .nav-link.active i { color: #234a74; }
.sidebar .nav-assistant-link { border: 0; background: transparent; }
.sidebar .nav-assistant-link:hover { background: #243247; }
.sidebar .nav-assistant-link.active { background: #e9f0f7; color: #152d4c; }
.sidebar .nav-assistant-link small { background: #283a50; border: 0; color: #cedce9; border-radius: 4px; font-size: 10px; text-transform: none; padding: 4px 5px; font-weight: 400; }
.sidebar .nav-group { gap: 4px; margin: 0; }
.sidebar .nav-group-toggle { min-height: 44px; padding: 9px 12px; gap: 10px; border-radius: 8px; color: #d8e1ed; }
.sidebar .nav-group-title strong { font-size: 13px; line-height: 1.4; font-weight: 400; overflow-wrap: normal; }
.sidebar .nav-group-icon { color: #aabdd3; font-size: 17px; }
.sidebar .nav-group-chevron { color: #aabdd3; font-size: 11px; }
.sidebar .nav-group.active > .nav-group-toggle { background: #203147; border-color: #354860; }
.sidebar .nav-group.active > .nav-group-toggle .nav-group-icon { color: #d0e3f4; }
.sidebar .nav-group-toggle:hover { background: #243247; border-color: transparent; }
.sidebar .nav-group-links { margin: 0 0 8px 21px; padding: 0 0 0 10px; border-color: #3b4c63; gap: 3px; }
.sidebar .nav-group-links .nav-link { padding: 9px 8px; min-height: 40px; font-size: 12px; gap: 7px; }
.sidebar .nav-group-links .nav-link span { overflow-wrap: normal; }
.sidebar .nav-group-links .nav-link i { font-size: 14px; }
.sidebar-footer { padding: 14px 4px 0; border-color: #344156; }
.logout-button { min-height: 40px; border: 1px solid #46556b; border-radius: 8px; color: #d8e1ed; font-size: 12px; font-weight: 400; }
.sidebar :where(a, button):focus-visible { outline-color: #89c9ef; }

.main { width: 100%; max-width: 1850px; padding: 28px 32px 64px; }
.main > .topbar { min-height: 90px; margin: -28px -32px 28px; padding: 20px 32px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; backdrop-filter: none; gap: 20px; align-items: center; }
.topbar-title-group { gap: 14px; }
.topbar-view-icon { width: 40px; height: 40px; flex-basis: 40px; border: 0; border-radius: 10px; background: #edf2f7; color: var(--accent); font-size: 19px; }
.main .topbar h1 { color: var(--text); font-size: 25px; font-weight: 700; line-height: 1.16; letter-spacing: -.025em; }
.main .topbar p { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
#pageTitle:focus { outline: none; }
.topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.topbar .refresh-status { max-width: 285px; font-size: 12px; line-height: 1.45; }
.view { gap: 24px; animation: none; }
.view > * { min-width: 0; }
.panel { border-color: var(--line); border-radius: var(--radius); padding: 24px; background: var(--surface); box-shadow: var(--shadow); }
.panel-header { align-items: center; min-height: 48px; padding-bottom: 16px; margin-bottom: 18px; border-color: #e8ecf0; gap: 16px; }
.panel-header h2 { color: var(--text); font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.015em; }
.panel-header > span, .panel-header > div > span:not(.section-eyebrow) { font-size: 12px; color: var(--muted); line-height: 1.4; }
.section-eyebrow { color: var(--accent); font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: .07em; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 700; line-height: 1.3; text-decoration: none; transition: background-color 130ms ease, border-color 130ms ease; }
.primary-button { border: 1px solid transparent; background: var(--accent); color: #fff; box-shadow: none; }
.primary-button:hover:not(:disabled) { background: #183858; }
.secondary-button { background: #fff; color: var(--accent); border: 1px solid #c7d2de; box-shadow: none; }
.secondary-button:hover:not(:disabled) { background: #edf3f8; border-color: #92a7bf; }
button:disabled { cursor: not-allowed; }
.secondary-button:disabled { color: #6b7584; background: #eef1f4; }
.compact.secondary-button { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.icon-button { border-radius: 8px; min-width: 40px; min-height: 40px; }
.login-form label, .filters label, .financial-sector-controls label, label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; line-height: 1.45; }
input, select, textarea { min-width: 0; min-height: 42px; font-size: 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); }
textarea { padding: 12px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #717c8d; opacity: 1; }
input[type="checkbox"], input[type="radio"] { min-height: 18px; width: 18px; accent-color: var(--accent); }
.filters { gap: 14px; }
.controls-panel { top: 90px; border-radius: var(--radius); padding: 18px; }
.kpi-grid, .access-kpi-grid, .sector-kpi-grid { border-color: var(--line); border-radius: var(--radius); }
.kpi { padding: 22px; min-height: 124px; border-color: var(--line); }
.kpi-label { font-size: 12px; font-weight: 400; text-transform: none; color: var(--muted); }
.kpi-value { margin-top: 10px; color: var(--text); font-size: 32px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-note { font-size: 12px; line-height: 1.5; color: var(--muted); }
.table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; overscroll-behavior-x: contain; }
table { width: 100%; color: var(--text); font-size: 13px; line-height: 1.45; }
thead { background: #f3f6f9; }
th { color: #4b596d; font-size: 11px; line-height: 1.4; font-weight: 700; text-transform: none; letter-spacing: 0; }
th, td { padding: 13px 14px; }
td { border-color: #e8edf2; }
tbody tr:hover { background: #f2f6fa; }
.numeric, td.numeric, th.numeric { font-variant-numeric: tabular-nums; }
.empty-state { border-radius: 10px; border-color: var(--line); color: var(--muted); background: #f7f9fb; padding: 28px; font-size: 14px; line-height: 1.6; }
.view-loading-notice { border-radius: 10px; border-color: #cbdce9; box-shadow: var(--shadow); }
.view-loading-copy strong { font-size: 14px; }
.view-loading-copy small { font-size: 12px; }
dialog { max-width: calc(100vw - 32px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 90px rgb(16 27 45 / 22%); }
dialog::backdrop { background: rgb(16 27 45 / 55%); backdrop-filter: blur(3px); }
.login-screen { background: var(--navy); }
.login-screen::before, .login-panel::before { content: none; }
.login-panel { border-radius: 18px; padding: 40px; box-shadow: 0 20px 70px rgb(0 0 0 / 18%); }
.login-panel h1 { font-size: 30px; color: var(--text); }
.login-panel > p { font-size: 15px; color: var(--muted); line-height: 1.6; }
.login-form { gap: 18px; }
.skip-to-content { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 18px; border: 0; border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.skip-to-content:focus { top: 12px; outline: 3px solid #1686b3; }
.home-section-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 0; }
.home-section-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid #d2dde8; border-radius: 7px; color: var(--accent); background: #fff; font-size: 12px; font-weight: 700; text-decoration: none; }
.home-section-nav a:hover { background: var(--accent-soft); border-color: #93abc3; }
.home-section-nav a:first-child { color: #fff; background: var(--accent); border-color: var(--accent); }
.home-section-nav a:first-child:hover { background: #183858; }
#dashboardView .review-theme-evidence-panel { padding: 0; }
#salesManagementWorkbenchView .smw-controls { grid-template-columns: minmax(190px, .8fr) minmax(220px, 1fr) minmax(300px, 2fr) minmax(190px, 1fr); }
.view .commercial-delivery-scope-selector > span { color: var(--muted); font-size: 12px; text-transform: none; }
.view .commercial-delivery-scope-selector select { background: #fff; color: var(--text); border-color: var(--line-strong); font-size: 14px; }
#commercialSimulationRoot { display: grid; gap: 24px; min-width: 0; }
@media (min-width: 761px) and (max-width: 1599px) {
  .view :is(.sales-kpi-grid, .inventory-kpi-grid, .logistics-kpi-grid, .commercial-kpi-grid, .commercial-simulation-kpi-grid):has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  #salesManagementWorkbenchView .smw-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #salesManagementWorkbenchView .smw-controls { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1600px) {
  #dashboardView .review-theme-evidence-panel { grid-template-columns: minmax(0, 1fr); }
  #dashboardView .review-theme-evidence-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); }
  #dashboardView .review-theme-summary-legend { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  #dashboardView .review-theme-evidence-columns { display: none; }
  #dashboardView .review-theme-evidence-row { grid-template-columns: minmax(0, 1fr) auto 22px; gap: 10px; }
  #dashboardView .review-theme-evidence-topic { grid-column: 1; }
  #dashboardView .review-theme-evidence-metrics { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 0 0; border-top: 1px solid var(--line); }
  #dashboardView .review-theme-evidence-metrics small { display: block; }
  #dashboardView .review-theme-status { grid-column: 2; max-width: 110px; }
  #dashboardView .review-theme-chevron { grid-column: 3; }
}
@media (max-width: 600px) {
  #dashboardView .review-theme-evidence-summary { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1280px) and (min-width: 1081px) {
  :root { --sidebar-width: 224px; }
  .main { padding: 24px; }
  .main > .topbar { margin: -24px -24px 24px; padding: 18px 24px; }
  .sidebar .nav-link { font-size: 13px; }
  .sidebar .nav-group-title strong { font-size: 12px; }
  .brand-subtitle { gap: 6px; }
  .brand-subtitle span { padding-left: 6px; font-size: 10px; }
}
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-shell > .sidebar { width: 286px; max-width: calc(100vw - 48px); visibility: hidden; transition: transform 180ms ease; }
  .sidebar-open .app-shell > .sidebar { visibility: visible; transform: translateX(0); }
  .sidebar-overlay { background: rgb(16 27 45 / 55%); backdrop-filter: blur(3px); }
  body.sidebar-open { overflow: hidden; }
  .main { padding: 24px; }
  .main > .topbar { margin: -24px -24px 24px; padding: 18px 24px; }
  .mobile-nav-button { min-height: 44px; min-width: 44px; border-radius: 8px; color: var(--accent); background: #f1f5f8; border-color: var(--line); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 120px; }
  .main { padding: 18px 16px 40px; }
  .main > .topbar { min-height: 82px; margin: -18px -16px 20px; padding: 16px; gap: 12px; flex-direction: column; align-items: stretch; }
  .main .topbar h1 { font-size: 22px; line-height: 1.2; }
  .main .topbar p { max-width: none; font-size: 12px; white-space: normal; overflow: visible; }
  .topbar-title-group { gap: 12px; }
  .topbar-actions { padding-left: 0; justify-content: flex-start; }
  .topbar .refresh-status { display: block; max-width: none; width: 100%; text-align: left; font-size: 11px; }
  .topbar-actions .primary-button, .topbar-actions .secondary-button { min-height: 40px; font-size: 12px; white-space: normal; }
  .view { gap: 20px; }
  .panel { padding: 18px; }
  .panel-header { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .panel-header h2 { font-size: 18px; }
  .panel-header > span { font-size: 12px; }
  .controls-panel { position: static; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  .kpi { padding: 18px; }
  .kpi-value { font-size: 28px; }
  th, td { padding: 12px; }
  .primary-button, .secondary-button { min-height: 44px; white-space: normal; }
  .login-panel { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
