@font-face { font-family: Inter; src: url(fonts/inter-cyrillic-wght-normal.woff2) format("woff2"); font-weight: 100 900; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }
:root {
  --navy: #1A2B57; --red: #B53240; --red-d: #982836; --bg: #F3F5F9; --card: #FFFFFF; --line: #E3E6EC; --grid: #EEF0F4;
  --ink: #1A1F2B; --muted: #6B7280; --link: #1D5FD1; --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--link); }
h1, h2, h3 { font-weight: 500; margin: 0; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Шапка */
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.top img { height: 46px; display: block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.nav a:hover { background: var(--bg); }
.nav a.on { background: var(--navy); color: #fff; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.who form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--link); padding: 0; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 24px 40px; }
.foot { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: right; }
.pilot { font-size: 11px; color: var(--muted); border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--red); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; text-decoration: none; font-weight: 500; font-size: 13px; }
.btn:hover { background: var(--red-d); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #CFD3DB; font-weight: 400; }
.btn.ghost:hover { background: var(--bg); }
.btn.soft { background: #FDF0F0; color: #C8262C; font-weight: 400; }
.btn.soft:hover { background: #FBE2E2; }

/* Заголовок раздела */
.crumb-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs { color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs b { color: var(--ink); font-weight: 500; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat { text-align: center; }
.stat h3, .donut-card h3 { font-size: 15px; text-align: center; }
.hero { font-size: 58px; font-weight: 700; letter-spacing: -.01em; margin-top: 34px; font-variant-numeric: tabular-nums; }
.donut-body { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 8px; flex-wrap: wrap; }
.legend-v { min-width: 180px; }
.leg { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 2px 0; min-width: 0; }
.leg-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.leg-v { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 500; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* Диаграммы */
.block-head { margin: 20px 0; padding: 0; }
details.charts > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; font-weight: 500; }
details.charts > summary::-webkit-details-marker { display: none; }
details.charts > summary::after { content: ""; border: 5px solid transparent; border-top: 6px solid #333; margin-top: 5px; }
details.charts[open] > summary::after { transform: rotate(180deg); margin-top: -4px; }
.pick { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 18px 0; color: var(--muted); font-size: 13px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
.chart-grid .wide { grid-column: 1 / -1; }
.chart-card h3 { font-size: 15px; margin-bottom: 8px; }
.plot { width: 100%; min-height: 260px; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; font-size: 12px; margin-top: 6px; }
.grid { stroke: var(--grid); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 11px; }
.axis { fill: var(--muted); font-size: 11px; }
.cap { fill: var(--ink); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
details.tbl-w { margin-top: 8px; font-size: 12px; color: var(--muted); }
details.tbl-w summary { cursor: pointer; }
.tbl { overflow-x: auto; margin-top: 6px; }
table.mini { border-collapse: collapse; font-size: 12px; color: var(--ink); }
table.mini th, table.mini td { border: 1px solid var(--line); padding: 3px 7px; text-align: right; }
table.mini th { font-weight: 500; text-align: left; max-width: 180px; }
.tip { position: fixed; z-index: 50; display: none; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(20, 30, 60, .16); border-radius: 10px; padding: 9px 12px; font-size: 12px; max-width: 380px; pointer-events: none; }
.tip-t { font-weight: 600; margin-bottom: 4px; }
.tip-r { display: flex; align-items: center; gap: 7px; padding: 1px 0; }
.tip-n { flex: 1; color: var(--muted); }
.tip-f { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); font-weight: 500; }

/* Реестр */
.reg-card { margin-top: 20px; }
.reg-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.reg-top h2 { font-size: 17px; }
.per { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
select { font: inherit; padding: 5px 8px; border: 1px solid #CFD3DB; border-radius: 8px; background: #fff; }
.tools { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; flex-wrap: wrap; }
details.drop { position: relative; }
details.drop > summary { list-style: none; cursor: pointer; }
details.drop > summary::-webkit-details-marker { display: none; }
.drop-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 26px rgba(20, 30, 60, .14); padding: 8px 12px; width: 340px; max-height: 380px; overflow: auto; }
.drop-menu label { display: flex; gap: 8px; padding: 3px 0; }
.muted { color: var(--muted); }
.t-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.reg { border-collapse: collapse; width: 100%; font-size: 12px; }
table.reg th { background: var(--navy); color: #fff; font-weight: 600; text-align: left; padding: 10px 10px; vertical-align: top; min-width: 96px; }
table.reg th a { color: #fff; text-decoration: none; display: block; }
table.reg th .arr { opacity: .55; margin-left: 3px; }
table.reg th.on .arr { opacity: 1; }
table.reg td { padding: 11px 10px; vertical-align: top; border-top: 1px solid var(--grid); }
table.reg tr:nth-child(even) td { background: #FAFBFC; }
td.w-long { min-width: 240px; }
td.w-org { min-width: 240px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.clamp.open { display: block; }
.more { background: none; border: 0; padding: 0; color: var(--link); font-size: 12px; margin-top: 2px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 500; white-space: nowrap; color: #fff; background: #6B7280; }
.badge.ok { background: #2E7D32; }
.badge.pause { background: #F2A100; color: #1A1F2B; }
.badge.pause2 { background: #B86E00; }
.badge.stop { background: #C62F44; }
.badge.arch { background: #6B35A3; }
.badge.bad { background: #333A45; }
.badge.ext { background: #1F68C2; }
.chip { display: inline-block; background: #E7E9EE; border-radius: 6px; padding: 2px 7px; font-size: 11.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--muted); font-size: 13px; gap: 10px; flex-wrap: wrap; }
.pages { display: flex; gap: 5px; }
.pages a, .pages span { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; padding: 0 8px; }
.pages .on { background: var(--red); border-color: var(--red); color: #fff; }
.pages .gap { border: 0; background: none; }

/* Карточка */
.hero-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px 24px; display: flex; align-items: center; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.hero-card h1 { font-size: 22px; }
.hero-card .sub { font-weight: 600; margin-top: 2px; }
.hero-card .small { font-size: 12px; opacity: .8; margin-top: 2px; }
.hero-card .grow { flex: 1; min-width: 240px; }
.back { color: #fff; border: 1px solid rgba(255, 255, 255, .8); border-radius: 8px; padding: 8px 22px; text-decoration: none; }
.copy { background: #fff; color: var(--red); border: 0; border-radius: 99px; padding: 10px 26px; }
.sec { margin-bottom: 16px; }
.sec h2 { font-size: 16px; margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 22px; }
.f .k { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 3px; }
.f .v { font-size: 14px; overflow-wrap: anywhere; }
.f.w2 { grid-column: span 2; }
.f.w4 { grid-column: 1 / -1; }
table.hist { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13px; }
table.hist th { background: var(--navy); color: #fff; font-weight: 600; text-align: left; padding: 10px 14px; }
table.hist td { padding: 11px 14px; border-top: 1px solid var(--grid); vertical-align: top; }
.hist-note { font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 520px; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Вход */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 30px 16px; }
.login-page img { width: 156px; margin-bottom: 26px; }
.login-box { background: #fff; border-radius: 16px; box-shadow: 0 10px 28px rgba(20, 30, 60, .08); padding: 34px 40px; width: 100%; max-width: 400px; }
.login-box h1 { font-size: 27px; }
.login-box p { color: var(--muted); margin: 6px 0 18px; }
.lbl { display: block; font-size: 13px; margin: 14px 0 6px; }
.in { width: 100%; font: inherit; padding: 11px 13px; border: 1px solid #CFD3DB; border-radius: 10px; }
.in:focus, select:focus { outline: 2px solid #9DB8EC; outline-offset: 0; }
.login-box .btn { width: 100%; justify-content: center; margin-top: 20px; padding: 13px; font-size: 15px; border-radius: 10px; }
.err { background: #FDECEC; color: #A61B25; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 12px; }
.ok-msg { background: #E9F6EC; color: #1D6B2C; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.forgot { text-align: center; margin-top: 18px; font-size: 13px; }
.forgot summary { color: var(--link); cursor: pointer; list-style: none; }
.forgot summary::-webkit-details-marker { display: none; }

/* Администратор */
.a-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.a-head h1 { font-size: 26px; }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--red); text-decoration: none; font-size: 12px; font-weight: 600; }
.a-card { margin-bottom: 20px; }
.a-card-h { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; }
.a-card-h h2 { font-size: 17px; }
table.adm { width: 100%; border-collapse: collapse; font-size: 13px; }
table.adm th { background: var(--navy); color: #fff; font-weight: 500; text-align: left; padding: 11px 14px; }
table.adm td { padding: 11px 14px; border-top: 1px solid var(--grid); vertical-align: middle; }
table.adm tr.off td { color: var(--muted); }
.t-round { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.res { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; }
.res.good { background: #E3F6E8; color: #1D6B2C; }
.res.bad { background: #FDE8E8; color: #B3202A; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.switch input { width: 38px; height: 20px; appearance: none; -webkit-appearance: none; background: #CBD0D8; border-radius: 99px; position: relative; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: left .15s; }
.switch input:checked { background: #2C6FE0; }
.switch input:checked::after { left: 20px; }
.inline { display: inline; margin: 0; }
.add-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.add-form label { font-size: 12px; color: var(--muted); }
.add-form .in { padding: 8px 10px; margin-top: 4px; }

@media (max-width: 900px) {
  .grid2, .chart-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f.w2, .f.w4 { grid-column: 1 / -1; }
  .add-form { grid-template-columns: 1fr 1fr; }
  .wrap, .top-in { padding-left: 16px; padding-right: 16px; }
}
@media print { .top, .btn, .tools, .pager { display: none; } }
