:root {
  color-scheme: light;
  --ink: #172541;
  --muted: #556782;
  --line: #dce5f1;
  --navy: #14243e;
  --blue: #2350c5;
  --canvas: #f3f6fc;
  font: 14px/1.55 Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid #6c95ea; outline-offset: 3px; }
.app { min-height: 100dvh; display: grid; grid-template: "side top" auto "side main" 1fr / 280px minmax(0, 1fr); }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.topbar { grid-area: top; min-height: 54px; display: flex; align-items: center; gap: 11px; padding: 9px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.top-label { color: #415675; font-weight: 500; font-size: 13px; }
.mobile-menu { display: none; }
.sidebar { grid-area: side; padding: 21px 13px; color: #fff; background: linear-gradient(165deg,#14243d,#1d3559); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 9px 25px; }
.brand img { object-fit: contain; border-radius: 7px; padding: 3px; background: #fff; }
.brand strong { display: block; font-size: 15px; line-height: 1.2; font-weight: 600; }
.brand span { color: #b8cce9; font-size: 12px; }
.nav-parent, .submenu :is(a,button) { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 7px 9px; border: 0; border-radius: 7px; color: #e5edf9; background: transparent; text-align: left; text-decoration: none; white-space: nowrap; font-size: 13px; font-weight: 450; }
.nav-parent { justify-content: space-between; color: #f2f6ff; font-weight: 550; }
.nav-parent:hover, .submenu a:not([aria-current="page"]):hover { background: #ffffff12; }
.chevron { flex: none; width: 7px; height: 7px; border-right: 1px solid #a8c0e3; border-bottom: 1px solid #a8c0e3; transform: rotate(-45deg); margin-right: 4px; }
.nav-parent[aria-expanded="true"] .chevron { transform: rotate(45deg); margin-bottom: 4px; }
.submenu { display: grid; gap: 2px; margin: 5px 0 0; padding: 0 0 0 8px; list-style: none; }
.submenu [aria-current="page"] { background: #3553a7; color: #fff; box-shadow: inset 0 0 0 1px #ffffff22; }
.submenu button:disabled { color: #9eafcc; cursor: default; }
.submenu svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
main { grid-area: main; width: 100%; max-width: 1110px; min-width: 0; margin: 0 auto; padding: 28px; }
.heading { margin-bottom: 15px; }
h1 { font-size: clamp(20px,2vw,24px); line-height: 1.25; font-weight: 600; letter-spacing: -.025em; }
.section-path { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 2px 7px #23426b09; }
.panel-header { padding: 14px 18px; border-bottom: 1px solid var(--line); }
h2 { font-size: 15px; font-weight: 550; }
h3 { font-size: 14px; font-weight: 550; margin-bottom: 8px; }
.panel-body { padding: 16px 18px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: #3b5276; }
input, select { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid #ced9eb; border-radius: 7px; background: #fff; color: var(--ink); }
input::placeholder { color: #667790; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.primary, .secondary { min-height: 37px; padding: 7px 11px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 550; }
.primary { color: #fff; background: var(--blue); }
.primary:hover { background: #1b3fa3; }
.secondary { color: #344f7f; border-color: var(--line); background: #fff; }
.secondary:hover { background: #edf3ff; }
.storage-note { color: var(--muted); margin-top: 10px; font-size: 12px; }
.feedback { color: #185c47; font-size: 13px; margin-top: 6px; }
.feedback[data-error="true"] { color: #952d39; }
.unit-form { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 13px; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 12px; padding-left: 14px; border-left: 1px solid #bacce5; }
.org-tree li { position: relative; padding-block: 4px; }
.org-tree ul li::before { content: ''; position: absolute; left: -14px; top: 19px; width: 14px; border-top: 1px solid #bacce5; }
.org-unit { display: inline-block; padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; color: #314b79; background: #f5f8fe; overflow-wrap: anywhere; }
#org-tree, #position-tree, #catalog-content { overflow: auto; }
button.org-unit:hover { border-color: #8ca9e3; background: #ebf2ff; }
.empty { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 8px 9px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: #465f82; background: #f5f8fd; font-weight: 550; }
@media (max-width: 740px) {
  .app { grid-template: "top" auto "side" auto "main" 1fr / minmax(0,1fr); }
  .topbar, main { padding-inline: 14px; }
  .sidebar { display: none; padding: 9px 14px; }
  .sidebar.open { display: block; }
  .sidebar .brand { display: none; }
  .mobile-menu { display: inline-block; padding: 5px 8px; min-height: 35px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; font-size: 13px; font-weight: 550; }
}
@media (max-width: 480px) {
  .fields { grid-template-columns: minmax(0,1fr); }
}
