:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: #1b2733;
  background: #edf1f4;
  font-synthesis: none;
  --nav: #15202b;
  --nav-2: #1d2a36;
  --border: #d7dfe5;
  --muted: #647381;
  --blue: #2877a8;
  --amber: #c48520;
  --green: #27815c;
  --red: #b74c45;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #edf1f4; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 242px;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  color: #dbe5ec;
  background: var(--nav);
  border-right: 1px solid #0e171f;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 8px 18px; border-bottom: 1px solid #2a3945; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; background: #d79b36; color: #14202b; border: 1px solid #edba61; border-radius: 5px; font-size: 20px; font-weight: 900; }
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-copy strong { color: #fff; font-size: 15px; letter-spacing: .16em; }
.brand-copy small { color: #91a2af; font-size: 10px; letter-spacing: .04em; }
.nav-label { margin: 24px 10px 8px; color: #748694; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.management-label { margin-top: 30px; }
.sidebar-nav { display: grid; gap: 3px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-left: 3px solid transparent; color: #afbdc7; border-radius: 4px; font-size: 13px; font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item:hover { color: #fff; background: #1d2b37; }
.nav-item.active { color: #fff; background: #223240; border-left-color: #d79b36; }
.sidebar-state { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 11px 4px; border-top: 1px solid #2a3945; }
.state-light { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #4ec589; box-shadow: 0 0 0 4px rgba(78,197,137,.12); }
.status-copy { display: grid; gap: 2px; }
.status-copy strong { color: #dce6ed; font-size: 11px; }
.status-copy small { color: #788b98; font-size: 9px; }

.application { min-height: 100vh; margin-left: 242px; }
.topbar { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: #84919b; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.breadcrumb b { color: #c1c9cf; font-weight: 400; }
.breadcrumb strong { color: #384652; }
.topbar-meta { display: flex; align-items: center; gap: 18px; color: #667580; font-size: 11px; }
.topbar-meta time { font-variant-numeric: tabular-nums; }
.system-state { display: flex; align-items: center; gap: 7px; padding-left: 18px; border-left: 1px solid var(--border); color: #3d5b4e; font-weight: 700; }
.system-state i { width: 7px; height: 7px; border-radius: 50%; background: #3eaf77; }

.dashboard { max-width: 1510px; margin: 0 auto; padding: 30px 32px 45px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 19px; }
.section-code { margin: 0 0 5px; color: #778793; font-size: 9px; font-weight: 850; letter-spacing: .17em; }
.page-heading h1 { margin: 0; color: #192632; font-size: 27px; line-height: 1.15; letter-spacing: -.025em; }
.page-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.refresh-button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px; color: #40515e; background: #fff; border: 1px solid #cbd5dc; border-radius: 5px; cursor: pointer; font-size: 11px; font-weight: 750; }
.refresh-button:hover { border-color: #8093a0; background: #f8fafb; }
.refresh-button svg { width: 15px; height: 15px; }
.refresh-button.busy svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.environment-banner { min-height: 40px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 8px 13px; color: #6d5123; background: #fff7e6; border: 1px solid #e9d4a9; border-left: 4px solid #c98a23; font-size: 11px; }
.environment-banner .env-tag { padding: 3px 6px; color: #fff; background: #9d6818; border-radius: 3px; font-size: 8px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.environment-banner strong { color: #513a17; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { min-height: 116px; padding: 16px 17px; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 1px 2px rgba(24,39,51,.03); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: #586875; font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.metric-label i { width: 7px; height: 7px; border-radius: 50%; }
.metric-label .blue { background: var(--blue); }
.metric-label .amber { background: var(--amber); }
.metric-label .green { background: var(--green); }
.metric-label .red { background: var(--red); }
.metric > strong { display: block; margin: 9px 0 1px; color: #1c2a35; font-size: 29px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric > small { color: #89959e; font-size: 10px; }

.control-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .78fr); align-items: start; gap: 16px; }
.right-column { display: grid; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 1px 2px rgba(24,39,51,.03); }
.panel-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 17px; border-bottom: 1px solid #e0e6ea; }
.panel-heading.compact { min-height: 62px; }
.panel-heading h2 { margin: 0; color: #24323e; font-size: 15px; }
.panel-count { padding: 4px 7px; color: #287553; background: #e8f4ee; border: 1px solid #c5e1d3; border-radius: 3px; font-size: 8px; font-weight: 850; letter-spacing: .08em; }

.module-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 15px; min-height: 142px; padding: 18px 17px; border-bottom: 1px solid #e4e9ed; }
.module-row:last-child { border-bottom: 0; }
.module-code { width: 44px; height: 44px; display: grid; place-items: center; align-self: start; color: #fff; border-radius: 5px; font-size: 11px; font-weight: 900; letter-spacing: .04em; }
.cve-code { background: #326f93; }
.traffic-code { background: #aa741d; }
.inactive-code { color: #7d8b94; background: #edf1f3; border: 1px dashed #aeb9c1; font-size: 21px; font-weight: 400; }
.module-details { min-width: 0; }
.module-title-line { display: flex; align-items: center; gap: 10px; }
.module-title-line h3 { margin: 0; color: #1f2d38; font-size: 14px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 6px; border-radius: 3px; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.status-badge i { width: 5px; height: 5px; border-radius: 50%; }
.status-badge.operational { color: #236846; background: #e9f5ef; border: 1px solid #c8e5d6; }
.status-badge.operational i { background: #2a9a67; }
.status-badge.inactive { color: #687681; background: #f0f3f5; border: 1px solid #dce2e6; }
.module-details > p { max-width: 660px; margin: 7px 0 11px; color: #667580; font-size: 11px; line-height: 1.5; }
.module-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: #87939c; font-size: 9px; }
.module-meta span::before { content: "✓"; margin-right: 5px; color: #568069; font-weight: 850; }
.module-actions { display: grid; justify-items: stretch; gap: 8px; min-width: 126px; }
.primary-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 0 10px; color: #fff; background: #263e50; border: 1px solid #263e50; border-radius: 4px; font-size: 10px; font-weight: 750; }
.primary-action:hover { background: #172d3d; }
.primary-action span { font-size: 15px; }
.text-action { color: #426377; font-size: 9px; font-weight: 750; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.inactive-row { min-height: 93px; background: #fafbfc; }

.quick-actions { display: grid; }
.quick-actions a { min-height: 67px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 15px; border-bottom: 1px solid #e4e9ed; }
.quick-actions a:last-child { border-bottom: 0; }
.quick-actions a:hover { background: #f6f8f9; }
.action-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 4px; font-size: 8px; font-weight: 900; }
.amber-icon { color: #86590f; background: #f7eddc; }
.blue-icon { color: #286483; background: #e7f0f5; }
.gray-icon { color: #536671; background: #e9eef1; }
.quick-actions a > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.quick-actions strong { color: #2c3b46; font-size: 10px; }
.quick-actions small { overflow: hidden; color: #7e8b95; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quick-actions b { color: #8997a1; font-size: 14px; }

.status-list { margin: 0; padding: 6px 16px; }
.status-list > div { min-height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf0f2; }
.status-list > div:last-child { border-bottom: 0; }
.status-list dt { color: #73818b; font-size: 9px; }
.status-list dd { margin: 0; color: #30424f; font-size: 9px; font-weight: 750; text-align: right; }
.last-updated { margin: 0; padding: 10px 16px; color: #8a969e; background: #fafbfc; border-top: 1px solid #e7ebee; font-size: 8px; }

@media (max-width: 1120px) {
  .control-grid { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .topbar { height: 54px; padding: 0 17px; }
  .topbar-meta time, .system-state span { display: none; }
  .system-state { padding-left: 0; border-left: 0; }
  .dashboard { padding: 23px 17px 36px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 23px; }
  .refresh-button { width: 36px; padding: 0; justify-content: center; }
  .refresh-button span { display: none; }
  .environment-banner { align-items: flex-start; flex-wrap: wrap; }
  .environment-banner > span:last-child { flex-basis: 100%; }
  .right-column { grid-template-columns: 1fr; }
  .module-row { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
  .module-code { width: 40px; height: 40px; }
  .module-actions { grid-column: 2; width: 100%; grid-template-columns: minmax(115px, .6fr) minmax(90px, .4fr); align-items: center; }
  .module-title-line { align-items: flex-start; flex-direction: column; gap: 5px; }
  .inactive-row { min-height: 112px; }
}

@media (max-width: 480px) {
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .breadcrumb span, .breadcrumb b { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 105px; padding: 14px 12px; }
  .metric-label { font-size: 8px; }
  .metric > strong { font-size: 25px; }
  .metric > small { font-size: 8px; }
  .panel-heading { padding-inline: 13px; }
  .module-row { padding-inline: 13px; }
}
/* Labeled navigation, shared by phone/tablet drawer and desktop sidebar. */
:root { --navigation-touch: 48px; --navigation-focus: #2877a8; --scroll-thumb: #647381; --scroll-track: #edf1f4; }
html { scrollbar-gutter: stable; scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-width: auto; }
* { scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
:focus-visible { outline: 3px solid var(--navigation-focus); outline-offset: 3px; }
#open-navigation, #close-navigation { min-height: var(--navigation-touch); padding: 10px 16px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: #1b2733; cursor: pointer; font-size: 16px; font-weight: 700; }
#open-navigation { display: none; align-items: center; gap: 10px; flex-shrink: 0; }
#open-navigation svg { width: 22px; height: 22px; }
#open-navigation:hover, #close-navigation:hover { background: #edf1f4; }
#open-navigation:active, #close-navigation:active { background: #d7dfe5; }
#navigation-drawer { padding: 0; margin: 0; border: 0; width: min(360px, calc(100vw - 24px)); max-width: none; height: 100dvh; max-height: 100dvh; background: var(--nav); color: #fff; overflow: auto; }
#navigation-drawer::backdrop { background: rgb(15 23 31 / 55%); }
.drawer-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: max(16px, env(safe-area-inset-top)) 16px 12px; }
.drawer-heading h2 { margin: 0; font-size: 18px; }
#navigation-drawer .sidebar { position: static; width: 100%; height: auto; min-height: 0; border: 0; padding: 8px 14px max(24px, env(safe-area-inset-bottom)); }
#navigation-drawer .brand { display: none; }
#navigation-drawer .nav-item { min-height: var(--navigation-touch); font-size: 16px; }
#navigation-drawer .nav-item span { display: block; }
#navigation-drawer .nav-label { font-size: 12px; color: #afbdc7; letter-spacing: .04em; }
#navigation-drawer .sidebar-state { margin-top: 28px; }
.compact-navigation .application { margin-left: 0; }
.compact-navigation #open-navigation { display: inline-flex; }
.compact-navigation .topbar { height: auto; min-height: 70px; gap: 16px; padding: 10px 16px; position: sticky; top: 0; z-index: 8; }
.compact-navigation .breadcrumb { font-size: 13px; text-transform: none; letter-spacing: 0; flex: 1; }
.compact-navigation .topbar-meta time { display: none; }
@media(max-width: 480px) { .compact-navigation .topbar-meta { display: none; } }
@media(prefers-reduced-motion: reduce) { #navigation-drawer, #open-navigation { transition: none; animation: none; } }
@media(forced-colors: active) { * { scrollbar-color: auto; } }
@media print { #open-navigation, #navigation-drawer, .sidebar { display: none !important; } .application { margin-left: 0; } }

/* Task-first home: readable controls before supporting metrics. */
.task-start{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:20px 0 24px;background:#fff;border:1px solid var(--border);border-radius:10px;overflow:hidden}
.task-start a{display:grid;align-content:center;gap:8px;min-height:120px;padding:22px;border-right:1px solid var(--border)}
.task-start a:last-child{border-right:0}.task-start a:hover{background:#e7f0f5}.task-start strong{font-size:20px;color:#173d50}.task-start span{font-size:15px;line-height:1.5;color:#52616e}.task-start a:focus-visible{outline-offset:-4px}
.page-heading>div>p:last-child{font-size:16px}.refresh-button{min-height:48px;font-size:14px}.metric{min-height:90px;padding:14px}.metric-label{font-size:12px}.metric>strong{font-size:24px}.metric>small{font-size:12px;color:#536471}
.panel-heading h2{font-size:18px}.module-title-line h3{font-size:17px}.module-details>p{font-size:14px}.module-meta{font-size:12px;color:#52616e}.primary-action,.text-action{min-height:48px;font-size:14px;display:flex;align-items:center;justify-content:center}.module-title-line{flex-wrap:wrap}.status-badge{font-size:11px}.quick-actions strong{font-size:15px}.quick-actions small{font-size:13px;white-space:normal;color:#52616e}.nav-label,.status-copy small{color:#afbdc7}.nav-item{min-height:48px}.status-panel>summary{padding:18px;font-weight:700;cursor:pointer;min-height:56px}.status-list dt,.status-list dd,.last-updated{font-size:13px;color:#52616e}.environment-banner{font-size:13px;line-height:1.5;border-left-width:1px}.nav-item.active{border-left-color:transparent}.nav-item:focus-visible{outline-color:#8ed1ee}.refresh-button:disabled{cursor:wait;opacity:.7}.system-state[data-state="offline"] i{background:var(--red)}.system-state[data-state="checking"] i{background:var(--amber)}
#dashboard-feedback:empty{display:none}#dashboard-feedback{font-size:14px;color:#873c2b}.dashboard .panel{box-shadow:none}::selection{background:#c8e5ee;color:#15202b}
@media(max-width:1100px){.control-grid{grid-template-columns:1fr}.module-row{grid-template-columns:44px minmax(0,1fr)}.module-actions{grid-column:2;display:flex;flex-wrap:wrap}.module-actions a{padding:10px 18px}}
@media(max-width:700px){.task-start{grid-template-columns:1fr}.task-start a{min-height:92px;padding:16px;border-right:0;border-bottom:1px solid var(--border)}.task-start a:last-child{border-bottom:0}.task-start strong{font-size:19px}.page-heading{flex-wrap:wrap;gap:12px}.refresh-button{width:auto;padding:0 12px}.refresh-button span{display:inline}.metrics{gap:8px}.metric-label,.metric>small{font-size:12px}.module-actions{grid-column:1/-1}.module-actions a{flex:1}.right-column{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.refresh-button.busy svg{animation:none}}

.control-grid{grid-template-columns:1fr}.right-column{grid-template-columns:1fr;align-items:start}.additional-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--border);padding:12px 0;gap:4px 24px}.additional-tools a{display:flex;align-items:center;min-height:48px;font-size:16px;color:#23546c;text-decoration:underline;text-underline-offset:4px}.status-panel{max-width:100%}@media(max-width:480px){.additional-tools{grid-template-columns:1fr}}

.sidebar-sign-out{margin-top:auto;width:100%;min-height:48px;cursor:pointer;text-align:left;background:transparent;border:1px solid #526575;font:inherit;color:inherit}.sidebar-sign-out + .sidebar-state{margin-top:12px}
