/* Safety navigation: deep navy, restrained blue light, static technical grid.
 * Visual-only redesign: menu names, routes, accordion, keyboard controls and employee data logic are preserved. */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: var(--font-body);
  --color-workspace: #fff;
  --color-transparent: transparent;
  --sidebar-width: 252px;
  --rail-width: 64px;
  --brand-height: 88px;
  --footer-height: 50px;
  --control-height: 38px;
  --group-height: 34px;
  --text-brand: 16px;
  --text-module: 13px;
  --radius-control: 8px;
  --color-sidebar: #0b2b4f;
}

/* Scoped navigation tokens keep the business workspace in its existing light theme. */
.sidebar {
  --nav-surface-deep: #082747;
  --nav-surface-hover: rgb(133 180 229 / 11%);
  --nav-surface-pressed: rgb(55 137 255 / 26%);
  --nav-ink: #eaf4ff;
  --nav-ink-secondary: #c1d8ef;
  --nav-muted: #7fa5cc;
  --nav-rule: rgb(169 208 244 / 17%);
  --nav-line: rgb(166 208 244 / 25%);
  --nav-blue: #2183f0;
  --nav-focus: #91c6ff;
  --nav-selected: #1879ea;
  --nav-selected-end: #2787ed;
  --nav-selected-ink: #fff;
  --nav-grid: transparent;
  --nav-glow: rgb(40 135 239 / 20%);
  --nav-edge: rgb(125 191 255 / 44%);
}

html, body { width: 100%; height: 100%; overflow-x: clip; }
body { font-synthesis: none; }
button, a, summary { -webkit-tap-highlight-color: var(--color-transparent); touch-action: manipulation; }
button { border: 0; cursor: pointer; }
a { text-decoration: none; }
button, a, summary { outline-offset: -2px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--color-focus); }
button:disabled, button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
button[aria-busy="true"] { cursor: progress; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: clip; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; top: var(--space-xs); left: calc(var(--sidebar-width) + var(--space-md)); z-index: var(--z-tooltip);
  padding: var(--space-xs) var(--space-md); color: var(--color-accent); background: var(--color-paper);
  border: 1px solid var(--color-focus); border-radius: var(--radius-control); transform: translateY(-180%);
}
.skip-link:focus-visible { transform: translateY(0); }
.app { display: flex; width: 100%; height: 100dvh; }
.sidebar {
  width: var(--sidebar-width); flex: 0 0 var(--sidebar-width); display: flex; flex-direction: column; min-height: 0;
  color: var(--nav-ink); border-right: 1px solid var(--nav-rule);
  background-color: var(--color-sidebar);
  background-image: linear-gradient(180deg, #0b294a 0%, #0d3159 48%, #0b2b4f 100%);
  box-shadow: inset -1px 0 0 rgb(179 216 253 / 9%);
}
.sidebar :is(button, a, summary):focus-visible {
  outline-color: var(--nav-focus); outline-offset: -2px;
}
.brand {
  height: var(--brand-height); flex: 0 0 var(--brand-height); display: flex; align-items: center;
  gap: 9px; padding: 16px 15px; border-bottom: 0;
  background: transparent; position: relative;
}
.brand::after { content: ""; position: absolute; width: 120px; height: 120px; top: -70px; left: -65px; border-radius: 50%; background: rgb(33 131 240 / 12%); filter: blur(18px); pointer-events: none; }
.brand-mark { display: flex; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--nav-selected-ink); background: linear-gradient(145deg, #2c91fb, #1262bd); border: 1px solid rgb(141 203 255 / 27%); border-radius: 11px; box-shadow: 0 7px 18px rgb(4 20 43 / 24%), inset 0 1px 0 rgb(255 255 255 / 17%); }
.brand-mark svg { width: 23px; height: 26px; }
.brand-shield { fill: none; stroke: currentColor; stroke-width: 1.8; }
.brand-check { stroke: currentColor; }
.brand-copy { display: flex; flex-direction: column; gap: var(--space-3xs); min-width: 0; }
.brand-name { margin: 0; color: var(--nav-selected-ink); font-size: var(--text-brand); line-height: 21px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.brand-subtitle { margin: 0; color: #a8c5e1; font-size: 11px; line-height: 16px; white-space: nowrap; }
.navigation {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: clip; padding: 14px 10px 16px;
  scrollbar-width: thin; scrollbar-color: var(--nav-line) var(--color-sidebar);
  scroll-padding-block: var(--space-sm); overscroll-behavior: contain;
}
.navigation ul { list-style: none; margin: 0; padding: 0; }
.menu-group + .menu-group { margin-top: 8px; }
.group-toggle {
  position: relative; display: flex; align-items: center; gap: 9px; width: 100%; min-height: var(--group-height);
  padding: 4px 10px; border-radius: 7px; text-align: left; background: var(--color-transparent);
  color: var(--nav-muted); font-size: var(--text-module); font-weight: 550; line-height: 18px; white-space: nowrap;
  transition: color var(--dur-micro) ease, background-color var(--dur-micro) ease;
}
.group-toggle > .nav-icon { width: 16px; height: 16px; color: var(--nav-muted); opacity: .82; }
.group-toggle[aria-expanded="true"] > .nav-icon,
.group-toggle.has-selection > .nav-icon,
.fallback-menu details[open] > summary > .nav-icon { color: var(--nav-blue); }
.group-toggle.has-selection, .group-toggle[aria-expanded="true"], .fallback-menu details[open] > summary { color: #aac9e7; }
.group-toggle.has-selection > .nav-icon { filter: none; }
.nav-icon { flex: 0 0 20px; width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.menu-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.menu-label { min-width: 0; font-size: 13px; line-height: 18px; white-space: normal; overflow-wrap: break-word; letter-spacing: 0; }
.chevron { flex: 0 0 16px; width: 16px; height: 16px; color: var(--nav-muted); transition: transform var(--dur-micro) var(--ease-out); }
[aria-expanded="true"] > .chevron { transform: rotate(90deg); }
.submenu { position: relative; padding: 1px 0 2px !important; }
.submenu::before { display: none; }
.submenu-row { position: relative; display: flex; align-items: stretch; border-radius: 8px; }
.submenu-row + .submenu-row { margin-top: 2px; }
.menu-link {
  position: relative; display: flex; align-items: center; min-width: 0; min-height: var(--control-height); flex: 1;
  gap: 7px; padding: 7px 10px 7px 36px; color: var(--nav-ink-secondary); font-size: 13px; font-weight: 430;
  line-height: 18px; border-radius: 8px; white-space: normal; overflow-wrap: break-word;
  transition: color var(--dur-micro) ease, background-color var(--dur-micro) ease;
}
.submenu-row.is-active { background: linear-gradient(100deg, var(--nav-selected), var(--nav-selected-end)); box-shadow: 0 10px 22px rgb(5 26 58 / 20%), inset 0 1px 0 rgb(255 255 255 / 11%); }
.submenu-row.is-active > .menu-link { color: var(--nav-selected-ink); font-weight: 600; }
.submenu-row.is-active::before { content: ""; position: absolute; left: 14px; top: 50%; width: 6px; height: 6px; border-radius: 50%; transform: translateY(-50%); background: #dceeff; box-shadow: 0 0 0 3px rgb(220 238 255 / 18%); }
.nested-toggle { display: flex; width: var(--control-height); flex: 0 0 var(--control-height); align-items: center; justify-content: center; padding: 0; color: var(--nav-ink-secondary); background: var(--color-transparent); border-radius: 4px; }
.third-level { padding-left: var(--space-md) !important; }
.third-level .menu-link { font-size: var(--text-sm); }
.sidebar-footer { flex: 0 0 var(--footer-height); display: flex; align-items: center; padding: 0 12px; border-top: 1px solid var(--nav-rule); background: rgb(7 34 62 / 26%); }
.collapse-button {
  display: flex; width: 100%; min-height: var(--control-height); gap: var(--space-sm); align-items: center;
  padding: 8px 10px; color: var(--nav-muted); font-size: 12px; line-height: 20px;
  white-space: nowrap; background: var(--color-transparent); border-radius: 8px;
}
.collapse-button::after { content: ""; width: 24px; height: 3px; margin-left: auto; background: repeating-linear-gradient(90deg, var(--nav-line) 0 4px, transparent 4px 7px); }
.workspace { flex: 1; min-width: 0; height: 100%; background: var(--color-workspace); }
.workspace:focus-visible { outline-offset: -4px; }
.group-toggle:active, .menu-link:active, .nested-toggle:active, .collapse-button:active { background: var(--nav-surface-pressed); }
.menu-link[aria-current="page"]:active { background: var(--nav-selected); }
@media (hover: hover) {
  .group-toggle:hover, .submenu-row:not(.is-active):hover, .nested-toggle:hover, .collapse-button:hover { background: var(--nav-surface-hover); color: var(--nav-selected-ink); }
}
.app.is-collapsed .sidebar { width: var(--rail-width); flex-basis: var(--rail-width); }
.app.is-collapsed .brand { justify-content: center; padding-inline: var(--space-xs); }
.app.is-collapsed .brand-copy, .app.is-collapsed .menu-copy, .app.is-collapsed .group-toggle > .chevron, .app.is-collapsed .submenu, .app.is-collapsed .collapse-label, .app.is-collapsed .collapse-button::after { display: none; }
.app.is-collapsed .brand::after { left: 16px; width: 30px; }
.app.is-collapsed .navigation { padding-inline: var(--space-sm); padding-top: var(--space-sm); }
.app.is-collapsed .group-toggle { padding-inline: var(--space-sm); justify-content: center; }
.app.is-collapsed .group-toggle.has-selection { color: var(--nav-selected-ink); background: linear-gradient(125deg, var(--nav-selected), var(--nav-selected-end)); box-shadow: inset 0 0 0 1px var(--nav-edge); }
.app.is-collapsed .sidebar-footer { padding-inline: var(--space-sm); }
.app.is-collapsed .collapse-button { padding-inline: var(--space-sm); justify-content: center; }
.app.is-collapsed .collapse-button .nav-icon { transform: rotate(180deg); }
html:not(.js) .sidebar-footer { display: none; }
.fallback-menu summary { list-style: none; cursor: pointer; }
.fallback-menu summary::-webkit-details-marker { display: none; }
.fallback-menu details[open] > summary > .chevron { transform: rotate(90deg); }
@media (max-width: 60rem) {
  .skip-link { left: var(--space-md); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
