:root {
  --canvas: #f5f5f7;
  --surface: #fff;
  --ink: #1d1d1f;
  --muted: #424245;
  --faint: #6e6e73;
  --line: #d2d2d7;
  --accent: #0066cc;
  --ok: #1d7a3a;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(0,0,0,.035);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; font-size: 15px; line-height: 1.5; }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.25; }
p { text-wrap: pretty; }
h1 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
h3 { font-size: 16px; font-weight: 600; }
input, textarea, select {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink); padding: 10px 13px; outline: none;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,102,204,.12); }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--accent); }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: #d9eaff; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 25px; height: 25px; }
.btn {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid transparent; padding: 9px 17px; font-weight: 600;
  background: transparent; transition: transform .18s, background .18s, box-shadow .18s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #343436; }
.btn-secondary { background: var(--surface); border-color: var(--line); }
.btn-secondary:hover { background: #fafafa; box-shadow: var(--shadow); }
.btn-ghost { color: var(--muted); padding-inline: 12px; }
.btn-ghost:hover { background: #ececee; color: var(--ink); }
.btn-danger { color: var(--danger); background: #fff; border-color: #ecc5c1; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn-icon { width: 42px; padding: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.meta { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.danger { color: var(--danger); }
.success { color: var(--ok); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stack { display: grid; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.clamp-1, .clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 3px 9px; border-radius: 999px; background: #f0f0f2; color: var(--muted); font-size: 12px; white-space: nowrap; }
.badge.ok { background: #eaf5ed; color: var(--ok); }
.badge.error { background: #fbecea; color: var(--danger); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #e9e9ed; color: var(--muted); font-weight: 600; flex: 0 0 auto; }
.avatar-lg { width: 68px; height: 68px; font-size: 21px; }
.empty { padding: 28px 18px; color: var(--faint); text-align: center; }
.page-loading { min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--faint); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.login-intro { padding: 48px; background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: space-between; min-height: 490px; }
.login-intro .meta { color: #c7c7cc; }
.login-intro h1 { font-size: 34px; margin: 20px 0 14px; }
.login-intro p { color: #d2d2d7; max-width: 320px; }
.login-form { padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.login-form form { display: grid; gap: 16px; }
.login-logo, .brand-logo { display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 600; }
.login-logo { width: max-content; min-height: 38px; padding: 0 14px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; letter-spacing: .02em; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-wrap button { position: absolute; right: 3px; top: 1px; border: 0; background: transparent; color: var(--faint); width: 42px; height: 42px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; }

.app-shell { min-height: 100dvh; }
.header { height: 64px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; padding: 0 24px; background: var(--canvas); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 220px; color: var(--ink); }
.brand-logo { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }
.brand-name { display: block; font-weight: 600; line-height: 1.2; }
.brand-company { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.search-trigger { min-width: 116px; justify-content: flex-start; color: var(--faint); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 7px 4px 10px; margin-left: 4px; border-left: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.user-chip:hover .user-name { color: var(--accent); }
.user-chip .avatar { width: 34px; height: 34px; font-size: 12px; }
.user-name { width: 180px; max-width: 180px; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
.page { max-width: 1440px; margin: 0 auto; padding: 28px 24px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 7px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); margin-bottom: 18px; min-height: 36px; }

.home { height: calc(100dvh - 64px); max-width: 1600px; margin: 0 auto; padding: 18px 24px 20px; display: flex; flex-direction: column; overflow: hidden; }
.home-greeting { flex: 0 0 auto; margin-bottom: 17px; }
.home-greeting .date { color: var(--faint); font-size: 13px; text-transform: capitalize; margin-bottom: 4px; }
.home-columns { flex: 1; min-height: 0; display: grid; grid-template-columns: .95fr 1.05fr; gap: 18px; }
.home-left { min-height: 0; display: flex; flex-direction: column; gap: 16px; }
.home-card { padding: 18px; min-height: 0; display: flex; flex-direction: column; }
.home-card.news-card { flex: 1.1; }
.home-card.tasks-card { flex: .9; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; flex: 0 0 auto; }
.section-head h2 { font-size: 17px; }
.section-link { color: var(--faint); font-size: 12px; min-height: 32px; display: inline-flex; align-items: center; gap: 3px; }
.news-list, .task-list { min-height: 0; overflow: auto; }
.news-item { display: block; padding: 11px 0; border-top: 1px solid #ececee; color: var(--ink); }
.news-item:first-child { border-top: 0; padding-top: 7px; }
.news-item:hover h3 { color: var(--accent); }
.news-item .meta { display: flex; gap: 8px; margin-bottom: 4px; }
.news-item h3 { font-size: 14px; font-weight: 600; line-height: 1.35; transition: color .18s; }
.task-item { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid #ececee; cursor: pointer; }
.task-item:first-child { border-top: 0; }
.task-check { width: 20px; height: 20px; border: 1.5px solid #aeaeb2; border-radius: 50%; display: grid; place-items: center; color: transparent; flex: 0 0 auto; }
.task-item.completed .task-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-item.completed .task-title { text-decoration: line-through; color: var(--faint); }
.task-title { font-size: 14px; }
.task-date { margin-left: auto; font-size: 11px; color: var(--faint); white-space: nowrap; }
.add-task { display: flex; gap: 7px; margin-top: 7px; }
.add-task input { min-height: 38px; font-size: 13px; background: var(--canvas); border-color: transparent; }
.add-task .btn { min-height: 38px; width: 38px; padding: 0; }
.module-grid { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(4, minmax(0,1fr)); gap: 14px; }
.module-card { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 18px; color: var(--ink); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.module-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.075); }
.module-card:active { transform: scale(.99); }
.module-icon { width: 42px; height: 42px; display: grid; place-items: center; background: #f2f2f4; border-radius: 12px; }
.module-card h3 { font-size: 15px; margin-bottom: 4px; }
.module-card p { color: var(--faint); font-size: 12px; line-height: 1.4; }
.module-external { position: absolute; right: 14px; top: 14px; color: var(--faint); }
.module-external .icon { width: 16px; height: 16px; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.filter-bar .search-field { position: relative; flex: 1; }
.search-field .icon { position: absolute; left: 13px; top: 12px; color: var(--faint); }
.search-field input { padding-left: 42px; }
.filter-bar select { width: min(300px, 40%); }
.contacts-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.people-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.person-row { width: 100%; min-height: 174px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 18px; text-align: left; transition: border-color .18s, box-shadow .18s, transform .18s; }
.person-row:hover { border-color: #aeaeb2; box-shadow: 0 7px 20px rgba(0,0,0,.06); transform: translateY(-1px); }
.person-row.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,102,204,.1); }
.person-row > .icon { color: var(--faint); margin-top: 13px; }
.person-row-main { min-width: 0; display: grid; gap: 5px; line-height: 1.35; }
.person-row-title { color: var(--muted); font-size: 13px; }
.person-row-department { grid-column: 1 / -1; color: var(--muted); font-size: 12px; padding-top: 10px; border-top: 1px solid #ececee; }
.person-row-contacts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--faint); font-size: 11px; }
.person-row-contacts > span { min-width: 0; display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.person-card { padding: 24px; position: sticky; top: 20px; }
.person-card-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--faint); }
.person-card-empty h3 { color: var(--ink); margin: 14px 0 7px; }
.person-card-empty p { max-width: 240px; font-size: 13px; }
.person-profile-head { display: flex; align-items: center; gap: 16px; }
.person-profile-head .avatar { flex: 0 0 auto; }
.person-profile-head h2 { font-size: 21px; line-height: 1.3; }
.person-profile-head p { color: var(--muted); margin-top: 5px; }
.person-department-badge { margin-top: 18px; max-width: 100%; white-space: normal; height: auto; }
.person-contact-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 22px 0; }
.person-contact-actions:has(> :only-child) { grid-template-columns: 1fr; }
.person-contact-actions:empty { display: none; }
.person-meta-grid { display: grid; gap: 0; margin: 0; }
.person-meta-grid > div { padding: 13px 0; border-top: 1px solid #ececee; }
.person-meta-grid dt { color: var(--faint); font-size: 11px; margin-bottom: 4px; }
.person-meta-grid dd { margin: 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }

.page.page-org { width: 100%; max-width: none; height: calc(100dvh - 64px); padding: 0; }
.page-org .org-chart-panel { height: 100%; display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 0; box-shadow: none; }
.org-chart-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.org-chart-toolbar > div:first-child { display: grid; gap: 3px; }
.org-zoom-controls { display: flex; align-items: center; gap: 7px; }
.org-zoom-controls .btn-icon { width: 36px; min-height: 36px; }
#org-zoom-label { min-width: 48px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.org-chart-viewport { position: relative; height: min(68dvh, 760px); min-height: 500px; overflow: auto; background-color: #eef2f6; background-image: radial-gradient(#c6d0dc .8px, transparent .8px); background-size: 20px 20px; }
.page-org .org-chart-viewport { flex: 1; height: auto; min-height: 0; }
.page-org .org-chart-hint { flex: 0 0 auto; }
.org-chart-world { position: relative; transform-origin: 0 0; transition: transform .18s ease-out; }
.org-chart-edges { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.org-chart-edges g { fill: none; stroke-linecap: square; stroke-linejoin: miter; }
.org-chart-edges path { fill: none; stroke: inherit; stroke-width: 2.4; }
.org-node { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 3px 12px rgba(0,0,0,.07); }
.org-node.company { background: #12141f; color: #fff; border-color: #12141f; }
.org-node.division { background: #173b57; color: #fff; border-color: #173b57; }
.org-node.branch-admin:not(.division):not(.company) { background: #fff3d6; border-color: #d6bc7e; color: #63460c; }
.org-node.branch-finance:not(.division):not(.company) { background: #eaf2ff; border-color: #a5bce0; color: #233e66; }
.org-node.branch-operations:not(.division):not(.company) { background: #fbe9f0; border-color: #d6a5b8; color: #6b3048; }
.org-node.branch-territory:not(.division):not(.company) { background: #e7f4f3; border-color: #9fc5c1; color: #234d4a; }
.org-node.branch-personnel:not(.division):not(.company) { background: #eaf5ef; border-color: #a8c7b6; color: #24513a; }
.org-node-main { width: 100%; height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 13px 15px; border: 0; border-radius: inherit; background: transparent; color: inherit; text-align: left; }
.org-node-main:disabled { opacity: 1; cursor: default; }
.org-node-kicker { color: inherit; opacity: .68; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.org-node-main strong { max-width: 100%; font-size: 14px; line-height: 1.25; }
.org-node-head { width: 100%; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: inherit; opacity: .8; font-size: 12px; line-height: 1.25; }
.org-node-title { max-width: 100%; color: inherit; opacity: .65; font-size: 10px; }
.org-node-main .badge { margin-top: auto; min-height: 20px; padding: 1px 7px; background: rgba(255,255,255,.55); color: inherit; font-size: 10px; }
.org-node.division .org-node-main .badge, .company .org-node-main .badge { background: rgba(255,255,255,.15); color: #fff; }
.org-node-toggle { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); }
.org-chart-hint { padding: 11px 18px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); }
.org-member-list { display: grid; gap: 8px; }
.org-member { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #e7e7ea; border-radius: 13px; }
.org-member .grow { min-width: 0; display: grid; gap: 3px; }
.org-member .grow > span:not(.badge) { color: var(--faint); font-size: 12px; }
.org-member .badge { justify-self: start; }
.org-member-actions { display: flex; gap: 5px; }

.office-tabs, .tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab { min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); padding: 8px 15px; }
.tab.active { background: var(--ink); color: #fff; }
.office-panel { display: grid; grid-template-columns: .85fr 1.15fr; gap: 20px; }
.office-info { padding: 26px; }
.office-info h2 { font-size: 23px; margin: 18px 0 8px; }
.rooms-panel { padding: 22px; }
.room-row { display: flex; align-items: center; gap: 12px; border-top: 1px solid #ececee; padding: 13px 0; }
.room-row:first-of-type { border-top: 0; }
.page.page-offices { width: 100%; max-width: none; padding: 0; }
.page-offices .locations-map-panel { height: calc(100dvh - 64px); display: flex; flex-direction: column; border: 0; border-radius: 0; box-shadow: none; }
.locations-map-panel { overflow: hidden; }
.locations-map-toolbar { position: relative; z-index: 2; min-height: 68px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.locations-map-heading { display: grid; gap: 3px; margin-right: auto; }
.map-kind-switch { flex: 0 0 auto; display: flex; gap: 5px; padding: 4px; border-radius: 13px; background: var(--canvas); }
.map-kind-switch button { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 7px 13px; background: transparent; color: var(--muted); font-weight: 600; }
.map-kind-switch button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.1); }
.map-kind-switch .badge { min-height: 21px; padding: 1px 7px; font-size: 11px; }
.map-legend { position: relative; flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.map-legend summary { min-height: 38px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.map-legend-items { position: absolute; right: 0; top: 46px; width: min(340px, calc(100vw - 64px)); max-height: 360px; overflow: auto; display: grid; gap: 9px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 10px 35px rgba(0,0,0,.14); }
.map-legend-items span { display: flex; align-items: center; gap: 8px; }
.map-legend-items i { width: 11px; height: 11px; flex: 0 0 auto; border: 2px solid #fff; border-radius: 50%; background: var(--marker-color); box-shadow: 0 0 0 1px var(--line); }
.locations-map { z-index: 0; height: 560px; background: #e8edf1; }
.page-offices .locations-map { flex: 1; height: auto; min-height: 0; }
.locations-map-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; padding: 10px 16px; color: var(--faint); font-size: 11px; border-top: 1px solid var(--line); }
.map-popup { display: grid; gap: 8px; }
.map-popup strong { line-height: 1.35; }
.map-popup > span:not(.meta) { color: var(--muted); }
.map-popup small { color: var(--faint); line-height: 1.4; }
.map-popup-fact { display: grid; gap: 2px; }
.map-popup-fact strong { font-size: 13px; }
.leaflet-popup-content { margin: 16px; line-height: 1.45; }
.office-directory { max-width: 1440px; margin: 0 auto; padding: 28px 24px 48px; }

.course-grid, .test-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.course-card, .test-card { padding: 22px; display: flex; flex-direction: column; gap: 15px; min-height: 230px; }
.course-card .btn, .test-card .btn { margin-top: auto; align-self: flex-start; }
.progress-track { height: 6px; border-radius: 999px; background: #e8e8eb; overflow: hidden; }
.progress-value { height: 100%; background: var(--accent); border-radius: inherit; }
.lesson-list { display: grid; gap: 10px; }
.lesson { padding: 20px; }
.lesson-head { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.lesson-content { color: var(--muted); margin: 15px 0 0 34px; white-space: pre-line; }
.question { padding: 22px; margin-bottom: 14px; }
.question h3 { margin-bottom: 16px; }
.option { display: flex; grid-template: none; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; cursor: pointer; color: var(--ink); }
.option:has(input:checked) { border-color: var(--accent); background: #f2f8fe; }
.option.correct { border-color: var(--ok); background: #f1f8f3; }
.option.wrong { border-color: var(--danger); background: #fdf3f2; }
.result-card { padding: 36px; text-align: center; margin-bottom: 20px; }
.result-score { font-size: 48px; font-weight: 600; letter-spacing: -.04em; margin: 10px 0; font-variant-numeric: tabular-nums; }
.article { max-width: 680px; margin: 0 auto; }
.article-head { margin-bottom: 28px; }
.article-head h1 { font-size: 32px; margin: 10px 0; }
.article-body { padding: 28px; white-space: pre-line; color: var(--muted); font-size: 16px; line-height: 1.65; }

.admin-page { max-width: 1500px; }
.admin-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 22px; align-items: start; }
.admin-nav { display: grid; gap: 4px; position: sticky; top: 20px; }
.admin-nav button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 13px; border: 0; border-radius: 11px; background: transparent; text-align: left; color: var(--muted); }
.admin-nav button.active { background: var(--ink); color: #fff; }
.admin-content { min-width: 0; }
.admin-panel { padding: 22px; }
.admin-panel + .admin-panel { margin-top: 16px; }
.admin-panel h2 { margin-bottom: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { padding: 18px; }
.stat-value { font-size: 28px; font-weight: 600; margin-top: 5px; font-variant-numeric: tabular-nums; }
.module-settings { display: grid; gap: 8px; }
.module-setting { display: grid; grid-template-columns: 30px 1.2fr 1.5fr 1.4fr; gap: 10px; align-items: center; padding: 10px; border: 1px solid #e6e6e9; border-radius: 13px; }
.module-setting input { min-height: 38px; padding: 7px 10px; font-size: 13px; }
.admin-list { overflow: hidden; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #ececee; }
.admin-row:first-child { border-top: 0; }
.admin-row-title { font-weight: 600; }
.admin-row-actions { display: flex; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--faint); text-align: left; font-weight: 400; }
th, td { padding: 11px 10px; border-bottom: 1px solid #ececee; vertical-align: middle; }
.sync-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.sync-log { margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.repeater { display: grid; gap: 12px; margin-top: 12px; }
.repeater-item { border: 1px solid #e5e5e8; border-radius: 13px; padding: 14px; }
.repeater-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(29,29,31,.38); display: grid; place-items: center; padding: 20px; animation: fade .18s ease-out; }
.modal { width: min(620px, 100%); max-height: min(86dvh, 900px); overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.2); padding: 24px; animation: rise .2s ease-out; }
.modal-wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { font-size: 22px; }
.modal-head p { color: var(--faint); margin-top: 5px; }
.modal-close { border: 0; background: #f2f2f4; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.search-modal { align-self: start; margin-top: 8dvh; }
.global-search-input { position: relative; }
.global-search-input .icon { position: absolute; left: 14px; top: 14px; color: var(--faint); }
.global-search-input input { padding-left: 46px; font-size: 16px; }
.search-results { margin-top: 15px; }
.search-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 16px 6px 5px; }
.search-result { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 11px; color: var(--ink); width: 100%; border: 0; background: transparent; text-align: left; }
.search-result:hover { background: #f2f2f4; }
.tour-modal { width: min(520px, 100%); text-align: center; padding: 34px; }
.tour-icon { width: 64px; height: 64px; border-radius: 19px; background: #f0f0f2; display: grid; place-items: center; margin: 0 auto 22px; }
.tour-icon .icon { width: 30px; height: 30px; }
.tour-modal h2 { font-size: 25px; margin-bottom: 10px; }
.tour-modal p { color: var(--muted); min-height: 48px; }
.tour-dots { display: flex; justify-content: center; gap: 7px; margin: 24px 0; }
.tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dot.active { background: var(--ink); width: 20px; border-radius: 9px; }
.tour-actions { display: flex; justify-content: center; gap: 8px; }
.toast-root { position: fixed; z-index: 200; bottom: 24px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(430px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 20px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.2); animation: rise .2s; }
.toast.error { background: var(--danger); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.avatar { position: relative; overflow: hidden; }
.avatar-initials { display: grid; place-items: center; width: 100%; height: 100%; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.greeting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.work-toggle { flex: 0 0 auto; background: var(--ink); color: #fff; }
.work-toggle:hover { background: #343436; }
.work-toggle.working { background: #eaf5ed; border-color: #b9ddc4; color: var(--ok); }
.work-status { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 11px; white-space: nowrap; }
.work-status > span { width: 7px; height: 7px; border-radius: 50%; background: #aeaeb2; }
.work-status.working { color: var(--ok); }
.work-status.working > span { background: #2b9b4d; box-shadow: 0 0 0 3px #e6f4e9; }
.person-status-line { margin-top: 16px; }
.person-row-status { grid-column: 1 / -1; }
.person-photo-action { margin: -10px 0 12px; }
.person-manager-link { display: inline-flex; align-items: center; gap: 3px; }
.back-button { border: 0; background: transparent; padding: 0; }
.pre-line { white-space: pre-line; }
.unit-breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: -6px 0 22px; color: var(--faint); font-size: 12px; }
.unit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.unit-sidebar { display: grid; gap: 16px; position: sticky; top: 20px; }
.unit-profile { padding: 18px; }
.unit-head { display: flex; align-items: center; gap: 13px; color: var(--ink); }
.unit-head > span:not(.avatar) { min-width: 0; flex: 1; display: grid; gap: 3px; }
.unit-head strong { line-height: 1.35; }
.unit-head > span:not(.avatar) > span:last-child { color: var(--faint); font-size: 12px; }
.unit-head-empty { color: var(--faint); font-size: 13px; }
.unit-info { padding: 8px 22px; }
.unit-info dl { margin: 0; }
.unit-info dl > div { padding: 15px 0; border-top: 1px solid #ececee; }
.unit-info dl > div:first-child { border-top: 0; }
.unit-info dt { color: var(--faint); font-size: 11px; margin-bottom: 6px; }
.unit-info dd { margin: 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.unit-children { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.unit-child { padding: 18px; }
.unit-child a { color: var(--ink); }
.unit-child .meta { display: block; margin-bottom: 4px; }
.unit-child-head { display: grid; gap: 4px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #ececee; font-size: 13px; }
.unit-child-head a { color: var(--accent); }
.unit-members { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.unit-member { display: flex; align-items: center; gap: 12px; padding: 15px; color: var(--ink); }
.unit-member .grow { display: grid; gap: 4px; }
.unit-member .grow > span:not(.work-status) { color: var(--faint); font-size: 12px; }
.unit-member > .badge { margin-left: auto; }
.content-section-head { margin-bottom: 12px; }
.learning-tests { margin-top: 30px; }
.briefing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.briefing-item { padding: 22px; }
.briefing-item h3 { margin: 14px 0 10px; font-size: 18px; }
.briefing-item p { color: var(--muted); font-size: 14px; }
.briefing-item.meeting .module-icon { margin-bottom: 0; }
.meeting-date, .meeting-location { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.meeting-location { margin-bottom: 12px; }
.unit-admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.unit-admin-head h2 { margin-bottom: 5px; }
.unit-import-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; padding-bottom: 15px; border-bottom: 1px solid #ececee; }
.admin-person { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.admin-person .avatar { width: 36px; height: 36px; font-size: 12px; }
.admin-work-status { display: block; margin-top: 6px; }
.profile-layout { max-width: 1060px; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-summary { padding: 28px; text-align: center; }
.profile-summary h2 { margin-top: 20px; }
.profile-summary p { margin-top: 7px; }
.profile-avatar-wrap { display: grid; justify-items: center; gap: 16px; }
.avatar-xl { width: 144px; height: 144px; font-size: 34px; }
.profile-form-hint { line-height: 1.5; }
input[readonly] { background: var(--canvas); color: var(--muted); }
.calendar-panel { overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.calendar-toolbar h2 { margin-bottom: 4px; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.calendar-scroll { width: 100%; overflow: visible; }
.calendar-grid { width: 100%; min-width: 0; display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); }
.calendar-day { min-width: 0; border-right: 1px solid #e7e7ea; }
.calendar-day:last-child { border-right: 0; }
.calendar-day > header, .calendar-time-column > header { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 48px; padding: 13px 12px; border-bottom: 1px solid #e7e7ea; background: #fafafb; }
.calendar-day > header strong { min-width: 0; font-size: 12px; }
.calendar-day > header time, .calendar-time-column > header { color: var(--faint); font-size: 11px; }
.calendar-day > header time { white-space: nowrap; }
.calendar-day-name-short, .calendar-date-short { display: none; }
.calendar-day.today > header { background: #eaf3fc; color: var(--accent); }
.calendar-time-column { border-right: 1px solid #e7e7ea; }
.calendar-time-rail { position: relative; height: 540px; }
.calendar-time-rail span { position: absolute; right: 8px; transform: translateY(-50%); color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.calendar-time-rail span.first { transform: none; }
.calendar-time-rail span.last { transform: translateY(-100%); }
.calendar-day-content { position: relative; height: 540px; overflow: hidden; background: repeating-linear-gradient(to bottom, transparent 0, transparent 59px, #e7e7ea 59px, #e7e7ea 60px); }
.calendar-empty { padding: 14px 3px; color: var(--faint); font-size: 11px; text-align: center; }
.calendar-meeting { position: absolute; left: 6px; right: 6px; display: grid; align-content: start; gap: 2px; min-width: 0; padding: 5px; overflow: hidden; border: 0; border-left: 3px solid var(--accent); border-radius: 7px; background: #f0f6fc; color: var(--ink); text-align: left; }
.calendar-meeting:hover { background: #e2eef9; }
.calendar-meeting time { min-width: 0; display: flex; align-items: center; gap: 3px; color: var(--accent); font-size: 11px; line-height: 1.2; white-space: nowrap; }
.calendar-meeting time .icon { width: 14px; height: 14px; }
.calendar-meeting strong { min-width: 0; overflow: hidden; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.meeting-details dd { overflow-wrap: anywhere; }
.briefing-files-section { margin-top: 28px; }
.briefing-file-list { display: grid; gap: 10px; }
.briefing-file { display: flex; align-items: center; gap: 15px; padding: 16px 18px; color: var(--ink); }
.briefing-file .grow { display: grid; gap: 4px; }
.briefing-file-meeting { color: var(--accent); font-size: 12px; }
.briefing-file-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-bottom: 18px; border-bottom: 1px solid #ececee; }
.briefing-file-form .full { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .calendar-day > header, .calendar-time-column > header { min-height: 66px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 9px 8px; }
  .user-name { display: none; }
  .brand { min-width: 180px; }
  .course-grid, .test-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .people-list { grid-template-columns: 1fr; }
  .module-setting { grid-template-columns: 30px 1fr 1fr; }
  .module-setting .module-url { grid-column: 2 / -1; }
  .unit-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .unit-members, .unit-children { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .header { padding-inline: 16px; }
  .brand { min-width: 0; }
  .brand-company { display: none; }
  .brand-name { font-size: 14px; }
  .search-trigger { min-width: 42px; width: 42px; padding: 0; justify-content: center; }
  .search-trigger span { display: none; }
  .user-chip { display: flex; padding: 2px; margin-left: 0; border-left: 0; }
  .profile-layout { grid-template-columns: 1fr; }
  .home { padding: 14px 14px 16px; }
  .home-columns { gap: 12px; }
  .home-left { gap: 12px; }
  .home-card { padding: 14px; }
  .module-grid { gap: 10px; }
  .module-card { padding: 14px; }
  .contacts-layout { grid-template-columns: 1fr; }
  .person-card { position: static; }
  .office-panel { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; overflow-x: auto; padding-bottom: 4px; }
  .admin-nav button { white-space: nowrap; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .unit-layout, .briefing-grid { grid-template-columns: 1fr; }
  .unit-sidebar { position: static; }
  .unit-admin-head { flex-direction: column; }
  .locations-map-toolbar { flex-wrap: wrap; gap: 8px; }
  .locations-map { height: 480px; }
  .locations-map-footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 767px) {
  .org-chart-toolbar { align-items: flex-start; flex-direction: column; }
  .org-chart-viewport { min-height: 480px; height: 64dvh; }
  .org-chart-hint { font-size: 11px; }
  .org-member { align-items: flex-start; }
  .org-member-actions { flex-direction: column; }
  .page { padding: 20px 14px 36px; }
  .office-directory { padding: 20px 14px 36px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar-controls { width: 100%; justify-content: space-between; }
  .calendar-grid { grid-template-columns: 38px repeat(7, minmax(0, 1fr)); }
  .calendar-day > header, .calendar-time-column > header { min-height: 54px; align-items: center; justify-content: center; padding: 7px 2px; text-align: center; }
  .calendar-day-name-full, .calendar-date-full { display: none; }
  .calendar-day-name-short, .calendar-date-short { display: inline; }
  .calendar-time-rail span { right: 3px; font-size: 8px; }
  .calendar-day { min-height: 240px; }
  .calendar-meeting { left: 2px; right: 2px; gap: 3px; padding: 4px 2px; border-left-width: 2px; border-radius: 4px; }
  .calendar-meeting time { flex-wrap: wrap; gap: 0 2px; font-size: 8px; white-space: normal; }
  .calendar-meeting time .icon { display: none; }
  .calendar-meeting-end { flex-basis: 100%; }
  .calendar-meeting strong { font-size: 10px; line-height: 1.2; }
  .briefing-file { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .briefing-file > .btn { margin-left: auto; }
  .briefing-file-form { grid-template-columns: 1fr; }
  .briefing-file-form .full { grid-column: auto; }
  .home-greeting { margin-bottom: 12px; }
  .home-greeting h1 { font-size: 22px; }
  .home-greeting .date { font-size: 11px; }
  .greeting-row { gap: 8px; }
  .work-toggle { max-width: 150px; min-height: 38px; padding: 8px 10px; font-size: 11px; }
  .home-columns { grid-template-columns: .95fr 1.05fr; }
  .module-grid { display: flex; flex-direction: column; overflow-y: auto; padding-right: 2px; }
  .module-card { min-height: 94px; flex: 0 0 auto; gap: 7px; }
  .module-card p { display: none; }
  .module-card h3 { font-size: 13px; }
  .module-icon { width: 34px; height: 34px; border-radius: 10px; }
  .module-icon .icon { width: 20px; height: 20px; }
  .section-head h2 { font-size: 14px; }
  .section-link { font-size: 0; }
  .news-item { padding: 8px 0; }
  .news-item h3 { font-size: 12px; }
  .news-item .meta { font-size: 10px; gap: 5px; }
  .task-title { font-size: 12px; }
  .task-date { display: none; }
  .task-item { gap: 7px; }
  .add-task input { min-width: 0; font-size: 12px; padding-inline: 9px; }
  .home-card .empty { padding: 16px 4px; font-size: 12px; }
  .course-grid, .test-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar select { width: 100%; }
  .login-shell { grid-template-columns: 1fr; max-width: 480px; }
  .login-intro { min-height: 190px; padding: 28px; }
  .login-intro h1 { font-size: 27px; margin: 14px 0 8px; }
  .login-intro p:last-child { display: none; }
  .login-form { padding: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .module-setting { grid-template-columns: 26px 1fr; }
  .module-setting .module-description, .module-setting .module-url { grid-column: 2; }
  .sync-box { align-items: flex-start; flex-direction: column; }
  .article-body { padding: 20px; }
  .modal { padding: 20px; }
}
@media (max-width: 430px) {
  .header { gap: 8px; padding-inline: 12px; height: 58px; }
  .brand-logo { width: 32px; height: 32px; }
  .header-actions { gap: 1px; }
  .header-actions .btn { min-height: 40px; }
  .home { height: calc(100dvh - 58px); padding: 12px 10px; }
  .page-offices .locations-map-panel { height: calc(100dvh - 58px); }
  .home-columns { gap: 8px; }
  .home-left { gap: 8px; }
  .home-card { padding: 11px; border-radius: 14px; }
  .home-greeting h1 { font-size: 20px; }
  .module-card { border-radius: 14px; padding: 12px; min-height: 88px; }
  .module-external { right: 10px; top: 10px; }
  .section-head { margin-bottom: 5px; }
  .news-item h3 { -webkit-line-clamp: 2; }
  .admin-panel { padding: 15px; }
  .hide-mobile { display: none; }
}
@media (max-height: 740px) and (min-width: 768px) {
  .home { padding-top: 12px; padding-bottom: 12px; }
  .home-greeting { margin-bottom: 10px; }
  .home-greeting h1 { font-size: 24px; }
  .home-card { padding: 14px; }
  .module-card { padding: 14px; gap: 7px; }
  .module-icon { width: 35px; height: 35px; }
  .news-item { padding-block: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (pointer: coarse) {
  .btn-sm, .section-link { min-height: 44px; }
}
