/* ВУМК — дизайн-система. Без внешних зависимостей (работает во внутренней сети). */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f1b2d;
  --muted: #5b6b7f;
  --faint: #94a3b8;
  --primary: #1d4ed8;
  --primary-600: #1e40af;
  --primary-50: #eef3ff;
  --primary-100: #dbe5ff;
  --navy: #0d2340;
  --navy-2: #13305a;
  --accent: #0e9f8e;
  --success: #15803d; --success-bg: #e8f7ee;
  --warning: #b45309; --warning-bg: #fff4e0;
  --danger: #c62828;  --danger-bg: #fdecec;
  --info: #1d4ed8;    --info-bg: #e8f0ff;
  --overdue: #7f1d1d; --overdue-bg: #f9d9d9;
  --muted-bg: #eef1f5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .05);
  --shadow-lg: 0 10px 40px rgba(15, 27, 45, .14);
  --sidebar-w: 264px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code { background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.icon { display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #cfdcf0; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, var(--accent)); display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; letter-spacing: .02em; box-shadow: 0 4px 14px rgba(59,130,246,.35); }
.brand-text { line-height: 1.15; }
.brand-text b { display: block; font-size: .98rem; }
.brand-text small { color: #9fb3d1; font-size: .74rem; }
.nav { padding: .6rem .6rem 1rem; flex: 1; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #7f96b8; padding: 1rem .7rem .35rem; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .52rem .7rem; border-radius: 9px; color: #cfdcf0; font-size: .9rem; margin-bottom: 1px; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(59,130,246,.22); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.nav a .icon { opacity: .9; }
.nav .count { margin-left: auto; background: #ef4444; color: #fff; font-size: .7rem; border-radius: 999px; padding: 0 .45rem; font-weight: 600; }
.sidebar-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .75rem; color: #7f96b8; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .65rem 1.6rem; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); min-height: 60px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: none; border: 0; padding: .3rem; cursor: pointer; color: var(--text); }
.year-chip { font-size: .8rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: .25rem .65rem; border-radius: 999px; white-space: nowrap; }
.bell { position: relative; color: var(--muted); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; }
.bell:hover { background: var(--muted-bg); color: var(--text); text-decoration: none; }
.bell .dot { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .25rem .4rem; border-radius: 10px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--muted-bg); }
.user-menu .who { line-height: 1.15; text-align: left; }
.user-menu .who b { display: block; font-size: .86rem; font-weight: 600; }
.user-menu .who small { color: var(--muted); font-size: .74rem; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 220px; padding: .35rem; z-index: 50; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .5rem .65rem; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--muted-bg); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex-shrink: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: .66rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }

.content { padding: 1.5rem 1.6rem 3rem; max-width: 1480px; width: 100%; }

/* ---------------------------------------------------------------- page header */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; }
.page-header .sub { color: var(--muted); margin-top: .2rem; font-size: .92rem; }
.page-header .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .84rem; color: var(--muted); margin-bottom: .45rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { color: var(--faint); }

/* ---------------------------------------------------------------- cards / grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.1rem; min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.card-body { padding: 1.1rem; }
.card-body.flush { padding: 0; }
.card-footer { padding: .8rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.grid-wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 1.1rem; }

/* ---------------------------------------------------------------- KPI */
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: flex; gap: .9rem; align-items: flex-start; color: inherit; position: relative; overflow: hidden; }
a.kpi:hover { text-decoration: none; border-color: var(--primary-100); box-shadow: 0 6px 22px rgba(29,78,216,.12); }
.kpi-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.kpi-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.kpi-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi-sub { color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.kpi.success .kpi-icon { background: var(--success-bg); color: var(--success); }
.kpi.warning .kpi-icon { background: var(--warning-bg); color: var(--warning); }
.kpi.danger .kpi-icon  { background: var(--danger-bg);  color: var(--danger); }
.kpi.info .kpi-icon    { background: var(--info-bg);    color: var(--info); }
.kpi.accent .kpi-icon  { background: #e0f5f2; color: var(--accent); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .52rem .95rem; border-radius: 9px; border: 1px solid transparent; font: inherit; font-size: .9rem; font-weight: 550; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; }
.btn:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 1px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-secondary, .btn-light { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover, .btn-light:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #116632; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a61f1f; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--muted-bg); color: var(--text); }
.btn-outline-danger { background: var(--surface); color: var(--danger); border-color: #f1b5b5; }
.btn-outline-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: .32rem .62rem; font-size: .82rem; border-radius: 7px; }
.btn-xs { padding: .18rem .45rem; font-size: .76rem; border-radius: 6px; }
.btn-icon { padding: .38rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--muted-bg); color: var(--muted); line-height: 1.45; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger  { background: var(--danger-bg);  color: var(--danger); }
.badge.info    { background: var(--info-bg);    color: var(--info); }
.badge.overdue { background: var(--overdue-bg); color: var(--overdue); }
.badge.primary { background: var(--primary-50); color: var(--primary); }
.badge.muted   { background: var(--muted-bg); color: var(--muted); }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 6px; background: var(--muted-bg); color: var(--muted); font-size: .76rem; font-weight: 500; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: .65rem .8rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table tr[data-href] { cursor: pointer; }
.table .num, .table .text-right { text-align: right; white-space: nowrap; }
.table .center { text-align: center; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .title-cell { font-weight: 600; color: var(--text); }
.table .sub-cell { color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.table.compact td, .table.compact th { padding: .45rem .6rem; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border-strong); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.2rem; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .85rem; color: #23324a; }
.field .req { color: var(--danger); margin-left: 2px; }
.help { color: var(--muted); font-size: .78rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], input[type=tel], input[type=month], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border-strong); border-radius: 9px; font: inherit; font-size: .92rem; background: #fff; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[readonly], .readonly { background: var(--surface-2); color: var(--muted); }
input[type=file] { font: inherit; font-size: .88rem; padding: .45rem; border: 1px dashed var(--border-strong); border-radius: 9px; background: var(--surface-2); width: 100%; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: 1.25rem; flex-wrap: wrap; }
.form-section { font-weight: 700; font-size: .95rem; color: var(--navy); padding-bottom: .35rem; border-bottom: 1px solid var(--border); margin: .5rem 0 .2rem; grid-column: 1 / -1; display: flex; align-items: center; gap: .45rem; }
.file-error { color: var(--danger); font-size: .8rem; }
.current-file { font-size: .82rem; color: var(--muted); }

/* фильтры */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.filters .field { min-width: 150px; flex: 0 1 190px; }
.filters .field.grow { flex: 1 1 240px; }
.filters .field > label { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.filters input, .filters select { padding: .42rem .6rem; font-size: .87rem; }
.filters .btns { display: flex; gap: .4rem; }

/* ---------------------------------------------------------------- alerts */
.flashes { margin-bottom: 1rem; display: grid; gap: .5rem; }
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem 1rem; border-radius: 10px; border: 1px solid; font-size: .9rem; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; font-size: 1.1rem; line-height: 1; }
.alert-success { background: var(--success-bg); border-color: #b7e4c7; color: #14532d; }
.alert-danger, .alert-error { background: var(--danger-bg); border-color: #f5c2c2; color: #7f1d1d; }
.alert-warning { background: var(--warning-bg); border-color: #fbd38d; color: #7c2d12; }
.alert-info, .alert-message { background: var(--info-bg); border-color: #bfd3fe; color: #1e3a8a; }

/* ---------------------------------------------------------------- misc components */
.empty { text-align: center; padding: 2.6rem 1rem; color: var(--muted); }
.empty .icon { color: var(--faint); margin-bottom: .5rem; }
.empty h3 { color: var(--text); margin-bottom: .25rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .82rem; }
.xsmall { font-size: .75rem; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.center { text-align: center; }
.bold { font-weight: 700; }
.flex { display: flex; align-items: center; gap: .5rem; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-lg { gap: 1rem; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.w-100 { width: 100%; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-primary { color: var(--primary); }

.kv { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: .55rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }

.file-chip { display: inline-flex; align-items: center; gap: .55rem; padding: .45rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); max-width: 100%; }
.file-chip:hover { border-color: var(--primary-100); background: var(--primary-50); text-decoration: none; }
.file-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; font-size: .87rem; }
.file-chip .meta { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.file-chip .ext { font-size: .62rem; font-weight: 800; text-transform: uppercase; padding: .2rem .35rem; border-radius: 5px; color: #fff; background: var(--faint); }
.ext-pdf { background: #dc2626 !important; } .ext-doc, .ext-docx, .ext-rtf, .ext-odt { background: #2563eb !important; }
.ext-xls, .ext-xlsx, .ext-ods { background: #15803d !important; } .ext-ppt, .ext-pptx, .ext-odp { background: #ea580c !important; }
.ext-jpg, .ext-jpeg, .ext-png { background: #7c3aed !important; } .ext-zip, .ext-rar { background: #475569 !important; }

.user-chip { display: inline-flex; align-items: center; gap: .45rem; }
.user-chip .meta { color: var(--muted); font-size: .76rem; display: block; line-height: 1.2; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.1rem; overflow-x: auto; }
.tabs a, .tabs button { padding: .6rem .95rem; color: var(--muted); border: 0; background: none; font: inherit; font-weight: 550; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { background: var(--muted-bg); color: var(--muted); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; }
.tabs a.active .count { background: var(--primary-50); color: var(--primary); }

.pagination { display: flex; gap: .3rem; justify-content: center; padding: 1rem; flex-wrap: wrap; align-items: center; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 .6rem; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); color: var(--text); font-size: .85rem; background: #fff; }
.pagination a:hover { border-color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pagination .gap { border: 0; background: none; }
.pagination .total { border: 0; background: none; color: var(--muted); }

.progress { height: 8px; background: var(--muted-bg); border-radius: 999px; overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.progress.success > span { background: var(--success); } .progress.warning > span { background: #f59e0b; } .progress.danger > span { background: var(--danger); }
.progress-line { display: flex; align-items: center; gap: .55rem; }
.progress-line .progress { flex: 1; }
.progress-line .pct { font-size: .8rem; font-weight: 650; min-width: 38px; text-align: right; }

/* горизонтальные столбики */
.bars { display: grid; gap: .6rem; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: .7rem; align-items: center; font-size: .86rem; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #23324a; }
.bar-row .track { height: 12px; background: var(--muted-bg); border-radius: 999px; overflow: hidden; display: flex; }
.bar-row .track > span { display: block; height: 100%; background: var(--primary); }
.bar-row .val { font-weight: 700; font-size: .82rem; min-width: 28px; text-align: right; }
.seg-success { background: var(--success) !important; } .seg-warning { background: #f59e0b !important; } .seg-danger { background: var(--danger) !important; }
.seg-overdue { background: var(--overdue) !important; } .seg-muted { background: #cbd5e1 !important; } .seg-info { background: #3b82f6 !important; } .seg-accent { background: var(--accent) !important; }
.seg-1 { background: #1d4ed8 !important; } .seg-2 { background: #0e9f8e !important; } .seg-3 { background: #f59e0b !important; } .seg-4 { background: #7c3aed !important; } .seg-5 { background: #db2777 !important; } .seg-6 { background: #64748b !important; }

/* кольцевая диаграмма (conic-gradient задаётся inline-стилем) */
.donut-wrap { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ""; position: absolute; inset: 22px; background: var(--surface); border-radius: 50%; }
.donut .center-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; text-align: center; font-weight: 750; font-size: 1.25rem; line-height: 1.1; }
.donut .center-label small { display: block; font-size: .68rem; color: var(--muted); font-weight: 500; }
.legend { display: grid; gap: .35rem; font-size: .84rem; }
.legend .item { display: flex; align-items: center; gap: .45rem; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* сводная матрица сдачи */
.matrix { border-collapse: separate; border-spacing: 0; font-size: .82rem; }
.matrix th, .matrix td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: .45rem .55rem; }
.matrix thead th { background: var(--surface-2); position: sticky; top: 0; z-index: 2; font-weight: 600; color: var(--muted); font-size: .74rem; vertical-align: bottom; min-width: 96px; max-width: 150px; white-space: normal; line-height: 1.25; }
.matrix tbody th { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; font-weight: 550; white-space: nowrap; min-width: 210px; }
.matrix td { text-align: center; }
.cell-state { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 700; font-size: .78rem; }
.cell-state.approved { background: var(--success-bg); color: var(--success); }
.cell-state.pending { background: var(--warning-bg); color: var(--warning); }
.cell-state.revision { background: var(--danger-bg); color: var(--danger); }
.cell-state.overdue { background: var(--overdue); color: #fff; }
.cell-state.waiting { background: var(--muted-bg); color: var(--faint); }
.cell-state.late { box-shadow: inset 0 0 0 2px #f59e0b; }

/* календарь */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.calendar .dow { background: var(--surface-2); text-align: center; font-size: .74rem; font-weight: 700; color: var(--muted); padding: .45rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-transform: uppercase; }
.calendar .day { min-height: 112px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .35rem; font-size: .78rem; background: #fff; min-width: 0; }
.calendar .day.other { background: var(--surface-2); color: var(--faint); }
.calendar .day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.calendar .day .num { font-weight: 700; font-size: .8rem; margin-bottom: .2rem; }
.calendar .ev { display: block; padding: .18rem .35rem; border-radius: 6px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; border-left: 3px solid; color: var(--text); }
.calendar .ev:hover { text-decoration: none; filter: brightness(.97); }
.ev.info { background: var(--info-bg); border-color: #3b82f6; } .ev.success { background: var(--success-bg); border-color: var(--success); }
.ev.muted { background: var(--muted-bg); border-color: var(--faint); text-decoration: line-through; } .ev.danger { background: var(--danger-bg); border-color: var(--danger); }

/* история */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: -4px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--faint); }
.timeline li.success::after { border-color: var(--success); background: var(--success-bg); }
.timeline li.danger::after { border-color: var(--danger); background: var(--danger-bg); }
.timeline li.warning::after { border-color: #f59e0b; background: var(--warning-bg); }
.timeline li.info::after { border-color: var(--primary); background: var(--primary-50); }
.timeline .when { color: var(--muted); font-size: .76rem; }
.timeline .what { font-weight: 600; font-size: .88rem; }
.timeline .note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .65rem; margin-top: .3rem; font-size: .85rem; white-space: pre-wrap; }

/* уведомления */
.notif { display: flex; gap: .8rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: #f7faff; }
.notif .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--info-bg); color: var(--info); }
.notif.success .ico { background: var(--success-bg); color: var(--success); } .notif.warning .ico { background: var(--warning-bg); color: var(--warning); } .notif.danger .ico { background: var(--danger-bg); color: var(--danger); }
.notif .t { font-weight: 600; } .notif .b { color: var(--muted); font-size: .86rem; } .notif .w { color: var(--faint); font-size: .75rem; }

/* дерево папок */
.tree { list-style: none; padding: 0; margin: 0; }
.tree ul { list-style: none; padding-left: 1rem; margin: 0; }
.tree a { display: flex; align-items: center; gap: .45rem; padding: .38rem .55rem; border-radius: 8px; color: var(--text); font-size: .88rem; }
.tree a:hover { background: var(--muted-bg); text-decoration: none; }
.tree a.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.folder-card { display: flex; gap: .8rem; align-items: center; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); }
.folder-card:hover { border-color: var(--primary-100); background: var(--primary-50); text-decoration: none; }
.folder-card .fi { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #fff4e0; color: #d97706; flex-shrink: 0; }
.folder-card .fi.upload { background: #e0f5f2; color: var(--accent); }

/* бланк анализа урока */
.criteria-table td { vertical-align: middle; }
.score-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.score-group label { padding: .35rem .7rem; cursor: pointer; font-weight: 650; font-size: .85rem; border-right: 1px solid var(--border); user-select: none; }
.score-group label:last-child { border-right: 0; }
.score-group input { position: absolute; opacity: 0; pointer-events: none; }
.score-group input:checked + span { color: #fff; }
.score-group label:has(input:checked) { background: var(--primary); color: #fff; }
.score-group label.s0:has(input:checked) { background: var(--danger); }
.score-group label.s1:has(input:checked) { background: #f59e0b; }
.score-group label.s2:has(input:checked) { background: var(--success); }
.score-total { position: sticky; bottom: 0; background: var(--navy); color: #fff; padding: .8rem 1.1rem; border-radius: 0 0 var(--radius) var(--radius); display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- auth */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-hero { background: radial-gradient(1200px 600px at -10% -20%, #2563eb 0%, transparent 60%), radial-gradient(800px 500px at 120% 120%, #0e9f8e 0%, transparent 55%), var(--navy); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-size: 2.1rem; max-width: 520px; line-height: 1.15; margin-bottom: 1rem; }
.auth-hero p { color: #c7d6ee; max-width: 520px; font-size: 1rem; }
.auth-hero ul { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .7rem; max-width: 520px; }
.auth-hero li { display: flex; gap: .65rem; align-items: center; color: #dbe6f7; }
.auth-hero li .icon { color: #7dd3c7; }
.auth-form { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.5rem; }

/* ---------------------------------------------------------------- errors */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-page .code { font-size: 4.5rem; font-weight: 800; color: var(--primary-100); line-height: 1; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.sidebar-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,27,45,.45); z-index: 55; }
  .menu-btn { display: inline-grid; }
  .grid-2, .grid-3, .grid-wide-left { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .user-menu .who, .year-chip { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 1rem .9rem 2rem; }
  .topbar { padding: .55rem .9rem; }
  .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: .15rem; }
  .kv dd { margin-bottom: .5rem; }
  .filters .field { flex: 1 1 100%; }
  .calendar .day { min-height: 70px; }
  .calendar .ev { font-size: 0; padding: 0; height: 6px; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .track { grid-column: 1 / -1; grid-row: 2; }
}

@media print {
  .sidebar, .topbar, .no-print, .filters, .pagination, .page-header .actions { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
