:root {
  --bg: #f4f3f0;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #1c1c1c;
  --muted: #777772;
  --line: #e8e7e2;
  --dark: #171717;
  --accent: #f09a00;
  --accent-2: #ffc24b;
  --success-bg: #dff3a1;
  --success: #3d5700;
  --warning-bg: #ffe7b8;
  --warning: #7a4a00;
  --danger-bg: #ffdada;
  --danger: #8a1f1f;
  --neutral-bg: #ededea;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 36px rgba(0,0,0,.035);
}

* { box-sizing: border-box; }
html { font-family: "Golos Text", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 12px; transition: .2s; }
.skip-link:focus { top: 16px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 22px 16px 16px; background: var(--dark); color: #fff; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 22px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 15px; color: var(--dark); background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-size: 22px; font-weight: 900; }
.brand strong { display: block; font-size: 19px; letter-spacing: .08em; }
.brand small { display: block; color: #aaa; font-size: 12px; margin-top: 2px; }
.workspace { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; background: #242424; border: 1px solid #333; border-radius: 16px; padding: 11px; margin-bottom: 18px; }
.workspace-avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: #343434; font-weight: 800; }
.workspace small, .workspace b { display: block; }
.workspace small { color: #9b9b9b; font-size: 11px; }
.workspace b { font-size: 13px; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace button { background: transparent; border: 0; color: #aaa; cursor: pointer; }
.nav-section { margin: 9px 0 14px; }
.nav-title { display: block; color: #777; font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 0 12px 8px; }
.nav-button { width: 100%; min-height: 43px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; border: 0; background: transparent; color: #bbb; border-radius: 14px; padding: 10px 12px; text-align: left; cursor: pointer; transition: .16s ease; }
.nav-button:hover { background: #242424; color: #fff; }
.nav-button.active { color: #171717; background: linear-gradient(135deg, var(--accent), var(--accent-2)); font-weight: 750; }
.nav-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { min-width: 24px; padding: 3px 7px; border-radius: 999px; background: #333; color: #ddd; text-align: center; font-size: 11px; font-style: normal; }
.nav-button.active .nav-badge { background: rgba(255,255,255,.5); color: #171717; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid #2d2d2d; }
.user-card { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding: 8px 10px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #3a3a3a; color: #fff; font-size: 12px; font-weight: 800; }
.user-card b, .user-card small { display: block; }
.user-card b { font-size: 13px; }
.user-card small { font-size: 11px; color: #888; margin-top: 3px; }

.app-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; height: 68px; display: flex; align-items: center; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(244,243,240,.94); backdrop-filter: blur(12px); }
.menu-toggle { display: none; }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.breadcrumbs b { color: #bbb; }
.breadcrumbs strong { color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-search { margin-left: auto; position: relative; width: min(300px, 28vw); }
.top-search input { width: 100%; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 16px 0 40px; outline: none; }
.top-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,154,0,.14); }
.top-search span { position: absolute; left: 15px; top: 10px; color: #888; }
.top-icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; position: relative; }
.top-icon::after { content: ""; position: absolute; right: 7px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid white; }
.role-select { height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 36px 0 14px; max-width: 220px; }

.page { padding: 30px; max-width: 1680px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 3vw, 40px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 19px; letter-spacing: -.015em; }
h3 { margin-bottom: 5px; font-size: 15px; }
.page-head p, .section-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn { min-height: 42px; border-radius: 999px; border: 1px solid var(--line); padding: 0 18px; background: #fff; font-weight: 700; font-size: 14px; cursor: pointer; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); border-color: #d6d5cf; }
.btn-primary { border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #171717; box-shadow: 0 7px 20px rgba(240,154,0,.2); }
.btn-dark { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn-ghost { background: transparent; }
.btn-small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 13px; }

.module-hero { background: var(--dark); color: #fff; border-radius: 26px; padding: 28px; display: grid; grid-template-columns: 1.4fr .8fr; gap: 30px; position: relative; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 20px; }
.module-hero::after { content: "А"; position: absolute; right: -10px; bottom: -72px; font-size: 250px; font-weight: 950; color: rgba(255,255,255,.035); }
.module-hero h1 { max-width: 760px; }
.module-hero p { max-width: 720px; color: #b8b8b8; line-height: 1.55; }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-self: end; z-index: 1; }
.hero-stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 16px; }
.hero-stat b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; }
.hero-stat span { display: block; color: #aaa; font-size: 12px; margin-top: 4px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.kpi { background: var(--surface); border: 1px solid rgba(0,0,0,.025); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-height: 140px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; font-size: clamp(28px, 3vw, 40px); line-height: 1; margin: 18px 0 9px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid rgba(0,0,0,.025); box-shadow: var(--shadow); padding: 22px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.section-head .actions { flex-shrink: 0; }
.dashboard-grid { grid-template-columns: 1.2fr .8fr; margin-top: 16px; }
.module-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.module-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 20px; text-align: left; cursor: pointer; min-height: 190px; display: flex; flex-direction: column; transition: .18s ease; }
.module-card:hover { transform: translateY(-3px); box-shadow: 0 14px 38px rgba(0,0,0,.07); border-color: #dad9d4; }
.module-card .module-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--neutral-bg); font-weight: 900; margin-bottom: 24px; }
.module-card.active-module .module-icon { background: var(--warning-bg); color: var(--warning); }
.module-card b { font-size: 17px; }
.module-card p { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 8px 0 18px; }
.module-card em { margin-top: auto; font-style: normal; font-weight: 800; font-size: 13px; }
.activity { display: grid; gap: 14px; }
.activity-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-dot { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-weight: 900; color: var(--accent); }
.activity-item b, .activity-item small { display: block; }
.activity-item b { font-size: 13px; }
.activity-item small { color: var(--muted); margin-top: 4px; line-height: 1.4; }
.activity-item time { color: #aaa; font-size: 11px; }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.search-field { position: relative; min-width: 260px; flex: 1; }
.search-field input { width: 100%; height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 0 14px 0 40px; outline: none; }
.search-field span { position: absolute; left: 15px; top: 10px; color: #888; }
.select { height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 0 38px 0 14px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 3px 0 14px; scrollbar-width: thin; }
.tab { white-space: nowrap; min-height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 15px; cursor: pointer; font-weight: 650; font-size: 13px; }
.tab.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.tab span { display: inline-block; margin-left: 7px; padding: 2px 7px; border-radius: 999px; background: var(--neutral-bg); color: var(--muted); font-size: 11px; }
.tab.active span { background: #353535; color: #ddd; }

.table-card { padding: 0; overflow: hidden; }
.table-card .section-head { padding: 22px 22px 0; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th { padding: 13px 18px; text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); background: #fbfaf8; }
td { padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tbody tr { transition: .12s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #fff9eb; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.status { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--neutral-bg); color: #575752; font-weight: 800; font-size: 11px; white-space: nowrap; }
.status.success { background: var(--success-bg); color: var(--success); }
.status.warning { background: var(--warning-bg); color: var(--warning); }
.status.danger { background: var(--danger-bg); color: var(--danger); }
.status.dark { background: var(--dark); color: #fff; }
.progress { width: 120px; height: 7px; border-radius: 999px; background: #ecebe7; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.progress-label { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.empty { padding: 42px; text-align: center; color: var(--muted); }

.passport-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 18px; }
.school-mark { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 24px; background: var(--dark); color: #fff; font-weight: 900; font-size: 17px; text-align: center; line-height: 1.05; }
.school-mark span { color: var(--accent-2); }
.passport-title h1 { font-size: clamp(24px, 2.6vw, 34px); margin: 7px 0; }
.passport-title p { color: var(--muted); margin: 0; }
.passport-score { min-width: 180px; padding: 15px 18px; border-radius: 16px; background: var(--surface-2); }
.passport-score div { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.passport-score strong { font-size: 26px; }
.passport-score small { color: var(--muted); }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.info { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; }
.info small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.info b { display: block; font-size: 14px; margin-top: 7px; line-height: 1.4; }
.readiness-list { display: grid; gap: 15px; }
.readiness-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 8px; }
.readiness-row .progress { width: 100%; }
.org-chart { overflow-x: auto; padding: 8px 0 4px; }
.org-root { width: 320px; margin: 0 auto 32px; }
.org-level { display: grid; grid-template-columns: repeat(3, minmax(240px,1fr)); gap: 16px; min-width: 800px; position: relative; }
.org-level::before { content: ""; position: absolute; top: -17px; left: 16.5%; right: 16.5%; height: 1px; background: #ccc; }
.org-node { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; position: relative; }
.org-level .org-node::before { content: ""; position: absolute; width: 1px; height: 17px; top: -17px; left: 50%; background: #ccc; }
.org-node.root { background: var(--dark); color: #fff; border-color: var(--dark); }
.org-node small, .org-node b, .org-node span { display: block; }
.org-node small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.org-node.root small { color: #aaa; }
.org-node b { margin: 9px 0 5px; }
.org-node span { color: var(--muted); font-size: 12px; }
.org-node.root span { color: #bbb; }
.leadership-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,290px),1fr)); gap: 20px; }
.leadership-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.leadership-portrait { position: relative; height: 250px; background: linear-gradient(135deg,#f3f0e9,#e6e9ed); display: grid; place-items: center; }
.leadership-initials { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: #fff9; color: var(--dark); font-size: 34px; font-weight: 700; }
.leadership-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.leadership-photo[hidden] { display: none; }
.leadership-details { padding: 22px; }
.leadership-position { color: #916000; font-size: 12px; font-weight: 700; margin: 0 0 10px; }
.leadership-details h3 { margin: 0; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.leadership-responsibilities { color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; margin: 14px 0 0; }
.leadership-photo-note { display: block; color: var(--muted); margin-top: 14px; }
.structure-tree-scroll { overflow: auto; padding: 24px 12px; }
.structure-tree { width: max-content; min-width: 100%; }
.structure-tree ul { display: flex; justify-content: center; position: relative; list-style: none; margin: 0; padding: 28px 0 0; }
.structure-tree li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 28px 14px 0; }
.structure-tree li::before, .structure-tree li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 28px; border-top: 2px solid #a1a8b3; }
.structure-tree li::after { right: auto; left: 50%; border-left: 2px solid #a1a8b3; }
.structure-tree li:only-child { padding-top: 0; }
.structure-tree li:only-child::before, .structure-tree li:only-child::after, .structure-tree li:first-child::before, .structure-tree li:last-child::after { display: none; }
.structure-tree li:last-child::before { border-right: 2px solid #a1a8b3; }
.structure-tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 28px; border-left: 2px solid #a1a8b3; }
.structure-tree > ul { padding-top: 0; }
.structure-node { width: 230px; flex-shrink: 0; text-align: center; overflow-wrap: anywhere; }
.structure-node span { white-space: pre-wrap; }

.route { display: grid; gap: 0; }
.route-node { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding-bottom: 24px; position: relative; }
.route-node:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.route-index { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: #fff; font-size: 11px; font-weight: 900; z-index: 1; }
.route-node.done .route-index { background: var(--success-bg); color: var(--success); }
.route-node.current .route-index { background: var(--accent); color: var(--dark); }
.route-node b, .route-node small { display: block; }
.route-node b { font-size: 13px; }
.route-node small { color: var(--muted); margin-top: 4px; line-height: 1.4; }
.route-node time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(320px,.65fr); gap: 16px; }
.detail-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-meta div { padding: 14px; background: var(--surface-2); border-radius: 14px; }
.detail-meta dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.detail-meta dd { margin: 6px 0 0; font-size: 13px; line-height: 1.4; font-weight: 650; }
.description { font-size: 14px; line-height: 1.65; color: #444; }
.source-link { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 14px; cursor: pointer; text-align: left; }
.source-link:hover { border-color: var(--accent); }
.source-link b, .source-link small { display: block; }
.source-link small { color: var(--muted); margin-top: 3px; }

.doc-number { color: var(--muted); font-variant-numeric: tabular-nums; }
.direction { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; background: var(--neutral-bg); font-weight: 900; }
.direction.in { background: #e2edf9; color: #285b91; }
.direction.out { background: var(--warning-bg); color: var(--warning); }
.direction.internal { background: #e8e3f8; color: #5f469c; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(15,15,15,.38); z-index: 80; display: flex; justify-content: flex-end; animation: fade .16s ease; }
.drawer { width: min(560px, 100%); height: 100%; overflow-y: auto; background: #fff; padding: 26px; box-shadow: -18px 0 70px rgba(0,0,0,.16); animation: slide .22s ease; }
.drawer-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.drawer-head h2 { font-size: 24px; }
.close { border: 0; background: var(--surface-2); width: 38px; height: 38px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.drawer-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.drawer-section h3 { margin-bottom: 12px; }
.drawer-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.drawer-actions .btn { flex: 1; }
.modal-backdrop { justify-content: center; align-items: center; padding: 20px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 24px; padding: 24px; box-shadow: 0 24px 90px rgba(0,0,0,.22); animation: pop .18s ease; }
.modal-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.modal-head p { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); padding: 11px 12px; outline: none; }
.field input, .field select { height: 44px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,154,0,.13); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.hint { margin-top: 12px; padding: 13px 14px; background: #fff7e4; border-radius: 13px; color: #65420b; font-size: 12px; line-height: 1.5; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 120; max-width: 420px; display: flex; gap: 10px; align-items: center; background: var(--dark); color: #fff; padding: 14px 17px; border-radius: 14px; box-shadow: 0 18px 45px rgba(0,0,0,.22); animation: pop .2s ease; font-size: 13px; }
.toast span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #171717; font-weight: 900; }
.connection-badge { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #4c4b47; font-size: 12px; font-weight: 800; white-space: nowrap; }
.connection-badge i { width: 8px; height: 8px; border-radius: 50%; background: #9a9890; box-shadow: 0 0 0 4px #efeee9; }
.connection-badge.live i { background: var(--success); box-shadow: 0 0 0 4px var(--success-bg); }
.connection-badge.demo i { background: var(--accent); box-shadow: 0 0 0 4px var(--warning-bg); }
.admin-context { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px; margin: -8px 0 18px; border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 17px; }
.admin-context div { display: grid; grid-template-columns: auto auto; gap: 2px 12px; align-items: center; }
.admin-context small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.admin-context b { font-size: 13px; }
.admin-context span { color: var(--muted); font-size: 12px; }
.type-chip { display: inline-flex; padding: 6px 9px; border-radius: 9px; background: var(--surface-2); font-size: 12px; font-weight: 750; white-space: nowrap; }
.setup-layout { display: grid; grid-template-columns: minmax(280px,.7fr) minmax(0,1.3fr); gap: 16px; align-items: start; }
.setup-explainer { position: sticky; top: 88px; overflow: hidden; background: var(--dark); color: #fff; }
.setup-explainer::after { content: "А"; position: absolute; right: -18px; bottom: -58px; color: rgba(255,255,255,.035); font-size: 220px; font-weight: 950; line-height: 1; }
.setup-explainer h2 { margin: 14px 0 10px; font-size: 24px; }
.setup-explainer > p { color: #bbb; line-height: 1.65; font-size: 14px; }
.setup-number { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: #181818; font-weight: 950; }
.mini-route { margin-top: 26px; position: relative; z-index: 1; }
.mini-route .route-node:not(:last-child)::before { background: #3a3a3a; }
.mini-route .route-node small { color: #aaa; }
.admin-form { padding: 26px; }
.form-section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 24px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section-title:first-of-type { margin-top: 8px; }
.form-section-title span { font-size: 14px; font-weight: 900; }
.form-section-title small { color: var(--muted); font-size: 12px; }
.login-wrap { min-height: 560px; display: grid; place-items: center; }
.login-card { width: min(430px,100%); padding: 34px; }
.login-card h2 { margin: 18px 0 8px; font-size: 26px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.login-card .field { margin-top: 14px; }
.login-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg,#ffbe35,var(--accent)); color: #171717; font-size: 24px; font-weight: 950; }
.btn-wide { width: 100%; margin-top: 22px; }
.template-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.template-card { padding: 0; overflow: hidden; }
.template-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 20px; border-bottom: 1px solid var(--line); background: #fcfbf8; }
.template-head small { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.template-head h2 { margin-top: 2px; font-size: 18px; }
.template-head > b { font-size: 26px; }
.template-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--dark); color: var(--accent); font-weight: 950; }
.template-sections { display: grid; }
.template-sections > div { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; min-height: 46px; padding: 8px 20px; border-bottom: 1px solid #efeee9; }
.template-sections > div:last-child { border-bottom: 0; }
.template-sections span { color: var(--muted); font-size: 11px; font-weight: 850; }
.template-sections b { font-size: 13px; }
.template-sections i { color: var(--muted); font-size: 11px; font-style: normal; }
.loading-card { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.modal-wide { width: min(900px,100%); }
.wizard-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 8px; }
.wizard-steps span { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; }
.wizard-steps i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: #fff; font-style: normal; }
.wizard-steps .active { background: var(--warning-bg); color: #5c3b00; }
.wizard-steps .active i { background: var(--accent); color: #1b1b1b; }
.passport-preview { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; margin-top: 18px; padding: 15px; border: 1px solid #efd18a; border-radius: 15px; background: #fffaf0; }
.passport-preview b,.passport-preview small { display: block; }
.passport-preview small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.passport-preview > strong { color: #7b5100; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.mobile-overlay { display: none; }
.passport-editor-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:20px 0; }
.passport-editor-tabs .btn { height:auto; text-align:left; white-space:normal; }
.passport-editor-tabs small { display:block; font-size:11px; margin-top:4px; font-weight:400; }
.passport-section-form { padding:24px; }
.passport-record { min-width:0; border:1px solid var(--line); border-radius:14px; margin:20px 0; padding:18px; }
.passport-record legend { font-weight:600; padding:0 8px; }
.passport-record > .btn { margin-top:14px; }
.passport-record input,.passport-record textarea,.passport-record select { width:100%; }
.passport-record :disabled { opacity:.85; color:var(--text); background:#f4f3f0; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .module-cards { grid-template-columns: 1fr; }
  .dashboard-grid, .detail-layout { grid-template-columns: 1fr; }
  .module-hero { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .setup-layout { grid-template-columns: 1fr; }
  .setup-explainer { position: relative; top: auto; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; width: 268px; transition: left .2s ease; }
  .app-shell.menu-open .sidebar { left: 0; }
  .mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 19; }
  .app-shell.menu-open .mobile-overlay { display: block; }
  .menu-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line); background: #fff; }
  .topbar { padding: 0 16px; }
  .breadcrumbs { display: none; }
  .top-search { width: auto; flex: 1; margin-left: 0; }
  .role-select { width: 46px; max-width: 46px; padding-left: 12px; color: transparent; }
  .page { padding: 20px 16px 30px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; }
  .passport-head { grid-template-columns: auto 1fr; }
  .passport-score { grid-column: 1 / -1; }
  .grid-3 { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .wizard-steps { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 560px) {
  .grid-4, .grid-2, .info-grid, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .module-hero { padding: 22px; border-radius: 20px; }
  .page-head .actions, .page-head .btn { width: 100%; }
  .passport-head { grid-template-columns: 1fr; }
  .school-mark { width: 62px; height: 62px; border-radius: 19px; }
  .detail-meta { grid-template-columns: 1fr; }
  .drawer { padding: 20px; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
  .admin-context { align-items: flex-start; }
  .admin-context div { grid-template-columns: 1fr; }
  .wizard-steps { grid-template-columns: 1fr; }
  .template-sections > div { grid-template-columns: 28px 1fr; }
  .template-sections i { display: none; }
  .passport-preview { grid-template-columns: auto 1fr; }
  .passport-preview > strong { grid-column: 2; }
}
.passport-field-group { min-width: 0; margin: 20px 0; }
.passport-field-group h3 { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line, #e5e2dc); font-size: 15px; }
.passport-field-group .info b { white-space: pre-wrap; overflow-wrap: anywhere; }
.passport-field-group .form-grid { min-width: 0; }
.timetable-classes { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:14px; }
.timetable-class { display:flex; flex-direction:column; gap:12px; padding:20px; text-align:left; border:1px solid var(--line); border-radius:14px; background:var(--surface); color:var(--ink); cursor:pointer; }
.timetable-class:hover,.timetable-class:focus-visible { border-color:var(--accent); background:var(--surface-2); }
.timetable-class strong { font-size:22px; }
.timetable-class span { color:var(--muted); font-size:12px; }
.timetable-calendar .section-head { flex-wrap:wrap; gap:16px; }
.timetable-calendar h2 { margin:14px 0 6px; }
.timetable-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.timetable-controls label { display:flex; align-items:center; gap:8px; font-size:12px; }
.timetable-controls input { width:auto; }
.timetable-grid { width:100%; min-width:1000px; table-layout:fixed; }
.timetable-grid th:first-child { width:82px; }
.timetable-grid th small { display:block; margin-top:6px; font-weight:400; }
.timetable-grid td { height:100px; padding:8px; vertical-align:top; border-right:1px solid var(--line); }
.timetable-grid .timetable-today { background:var(--warning-bg); color:var(--ink); }
.timetable-lesson { display:flex; flex-direction:column; gap:8px; padding:12px; border-left:3px solid var(--accent); border-radius:8px; background:var(--surface-2); overflow-wrap:anywhere; }
.timetable-lesson strong { font-size:13px; }
.timetable-lesson span,.timetable-lesson small { font-size:11px; color:var(--muted); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.leadership-contacts { display: grid; gap: 12px; margin: 16px 0 0; }
.leadership-contacts dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.leadership-contacts dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }

.staff-category-label { margin: 10px 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* Keep all twelve kindergarten sections directly visible. */
.tabs.kindergarten-tabs { flex-wrap: wrap; overflow: visible; gap: 4px 12px; }
.tabs.kindergarten-tabs .tab { white-space: normal; text-align: left; }
