/* Автонавикс Дашборд — тёмная тема */
:root {
  --bg: #070b11;
  --bg-2: #0a1019;
  --panel: #101824;
  --panel-2: #0d141e;
  --panel-3: #131d2b;
  --border: #1e2b3d;
  --border-soft: #172233;
  --text: #e7eef8;
  --text-2: #c3cfdf;
  --muted: #8494aa;
  --muted-2: #5d6c80;
  --accent: #2f81f7;
  --accent-2: #63a8ff;
  --accent-soft: rgba(47, 129, 247, 0.14);
  --green: #2ecc71;
  --green-soft: rgba(46, 204, 113, 0.14);
  --amber: #f5a623;
  --amber-soft: rgba(245, 166, 35, 0.14);
  --red: #ff5c6c;
  --red-soft: rgba(255, 92, 108, 0.14);
  --purple: #a371f7;
  --cyan: #39c5cf;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 14% -8%, rgba(47, 129, 247, 0.10), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(163, 113, 247, 0.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.dashboard-page { background-color: var(--bg); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
::selection { background: rgba(47, 129, 247, 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #223146; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3f59; }

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 34px; height: 34px; }

.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: "Cascadia Code", "Consolas", monospace; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #162131;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: #1b2a3d; border-color: #2b3e57; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #3b8df8, #2473e6);
  border-color: #3282f0;
  color: #fff;
  box-shadow: 0 8px 20px rgba(47, 129, 247, 0.22);
}
.btn-primary:hover { background: linear-gradient(180deg, #4a98ff, #2a7aee); border-color: #4a98ff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); }
.btn-danger { background: rgba(255, 92, 108, 0.10); border-color: rgba(255, 92, 108, 0.38); color: #ff8a96; }
.btn-danger:hover { background: rgba(255, 92, 108, 0.18); }
.btn-sm { min-height: 30px; padding: 5px 9px; border-radius: 7px; font-size: 12px; }
.btn-icon { width: 38px; padding: 0; }
.btn-link { background: none; border: 0; color: var(--accent-2); padding: 0; min-height: auto; }
.btn-link:hover { text-decoration: underline; }
.btn[aria-busy="true"] .btn-label { opacity: .6; }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.field .hint { font-size: 11px; color: var(--muted-2); }
.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #0b121c;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: #506075; }
.input:hover, .select:hover, .textarea:hover { border-color: #2a3c54; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.18);
  background: #0c1521;
}
.input[aria-invalid="true"] { border-color: var(--red); }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7e8ea5 50%), linear-gradient(135deg, #7e8ea5 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
.textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.checkbox { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 13px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Общие карточки ---------- */
.card {
  background: linear-gradient(180deg, rgba(18, 27, 40, 0.94), rgba(13, 20, 30, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.card-title { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.card-subtitle { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill-green { background: var(--green-soft); color: #65e39a; }
.pill-amber { background: var(--amber-soft); color: #ffc35c; }
.pill-red { background: var(--red-soft); color: #ff8d98; }
.pill-blue { background: var(--accent-soft); color: #85baff; }
.pill-gray { background: rgba(132, 148, 170, 0.12); color: #a7b5c8; }
.pill-purple { background: rgba(163, 113, 247, 0.13); color: #c7a6ff; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 13, 20, 0.9);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
}
.topbar-inner {
  max-width: 1560px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

/* Дашборд: логотип, меню и данные входа в одну строку */
.topbar-dash .topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 1 auto;
  overflow: visible;
}
.topbar-tabs .tab { padding: 0; height: 64px; white-space: nowrap; font-size: 12.5px; gap: 7px; }
.topbar-tabs .tab .icon { width: 15px; height: 15px; }
.topbar-tabs .tab.active::after { bottom: 0; }
.topbar-dash .topbar-right { margin-left: auto; }
@media (max-width: 1500px) {
  .topbar-tabs { gap: 9px; }
  .topbar-tabs .tab .icon { display: none; }
}
@media (max-width: 1360px) {
  .topbar-dash .topbar-inner { gap: 14px; }
  .brand-sub { display: none; }
  .topbar-tabs .tab { font-size: 12px; }
}
@media (max-width: 1240px) {
  .topbar-tabs { gap: 7px; }
  .topbar-tabs .tab { font-size: 11.5px; }
  .topbar-tabs .tab .icon { display: none; }
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2f81f7, #1354b8);
  box-shadow: 0 5px 16px rgba(47, 129, 247, 0.35);
  flex: 0 0 auto;
}
.brand-mark svg { width: 20px; height: 20px; color: #fff; }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .10em; line-height: 1.1; }
.brand-sub { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.topbar-center { text-align: center; color: var(--text-2); font-size: 14px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #21334a, #162436);
  border: 1px solid #2b3e56;
  color: #b9cce4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  flex: 0 0 auto;
}
.user-name { font-size: 12px; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.user-role { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-impersonation {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
  color: #ffd79a;
  white-space: nowrap;
}
.user-impersonation .icon { width: 11px; height: 11px; color: var(--amber); }
.user-impersonation form { display: inline; margin: 0; }
.user-impersonation .imp-exit {
  border: 0;
  background: none;
  padding: 0;
  margin-left: 2px;
  color: #ffd79a;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 10px;
  cursor: pointer;
}
.user-impersonation .imp-exit:hover { color: #fff0d6; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: .15s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); border-color: var(--border); }

/* ---------- Плашка «вошёл как» ---------- */
.impersonation-banner {
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.18), rgba(245, 166, 35, 0.06));
  border-bottom: 1px solid rgba(245, 166, 35, 0.28);
  color: #ffd28a;
  font-size: 12px;
}
.impersonation-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.impersonation-banner strong { color: #ffe3b3; }

/* ---------- Вкладки ---------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 24px;
  max-width: 1560px;
  margin: 0 auto;
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border: 0;
  background: none;
  white-space: nowrap;
}
.tab:hover { color: var(--text-2); text-decoration: none; }
.tab.active { color: var(--text); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(47, 129, 247, 0.55);
}
.tab .pill { margin-left: 2px; }

/* ---------- Контент ---------- */
.page { max-width: 1560px; margin: 0 auto; padding: 22px 24px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.period-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0a111a;
}
.period-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.period-switch button:hover { color: var(--text); }
.period-switch button.active { background: #1b2c42; color: #fff; box-shadow: inset 0 0 0 1px #2a4260; }

/* ---------- Сетка дашборда ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.dashboard-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side-stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1280px) {
  .dashboard-grid { grid-template-columns: 260px minmax(0, 1fr); }
  .dashboard-grid .side-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid .side-right .card { height: 100%; }
}
@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .side-right { grid-template-columns: 1fr; }
}

/* ---------- Донат готовности ---------- */
.readiness-card { padding: 20px 18px 16px; text-align: center; }
.readiness-title { font-size: 12px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.donut {
  --p: 0;
  --donut-color: var(--green);
  position: relative;
  width: 150px;
  height: 150px;
  margin: 18px auto 12px;
  border-radius: 50%;
  background: conic-gradient(var(--donut-color) calc(var(--p) * 1%), #1b293b 0);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 38px rgba(46, 204, 113, 0.08);
}
.donut::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #121c29, #0b121c 70%);
  border: 1px solid #1c2a3c;
}
.donut-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.donut-value { font-size: 38px; line-height: 1; font-weight: 760; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.donut-label { margin-top: 5px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .10em; }
.donut.green { --donut-color: var(--green); }
.donut.amber { --donut-color: var(--amber); }
.donut.red { --donut-color: var(--red); }
.donut.blue { --donut-color: var(--accent); }

.readiness-meta { display: flex; justify-content: center; gap: 18px; color: var(--muted); font-size: 11px; }
.readiness-meta b { color: var(--text); font-weight: 700; }

.component-list { display: flex; flex-direction: column; gap: 13px; }
.component-row { display: flex; flex-direction: column; gap: 6px; }
.component-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.component-top b { font-weight: 650; color: var(--text); }
.progress { height: 6px; border-radius: 99px; background: #1a2839; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2ecc71, #56e394); transition: width .6s ease; }
.progress.blue > span { background: linear-gradient(90deg, #2f81f7, #69adff); }
.progress.amber > span { background: linear-gradient(90deg, #d98a13, #ffc35c); }
.progress.red > span { background: linear-gradient(90deg, #d94352, #ff8d98); }

/* ---------- Таблица ---------- */
.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #0d151f;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: rgba(47, 129, 247, 0.045); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .clickable { cursor: pointer; }
.data-table .unit-name { display: flex; flex-direction: column; gap: 2px; min-width: 170px; white-space: normal; }
.data-table .unit-name b { font-weight: 650; color: var(--text); font-size: 12.5px; }
.data-table .unit-name span { color: var(--muted); font-size: 10.5px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .num b { color: var(--text); font-weight: 650; }
.data-table .num span { color: var(--muted); font-size: 10.5px; margin-left: 3px; }
.data-table .actions { text-align: right; }
.row-actions { display: inline-flex; gap: 5px; justify-content: flex-end; }
.table-empty { padding: 34px 20px; text-align: center; color: var(--muted); }

.status-cell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.status-sub { color: var(--muted); font-size: 10.5px; }

.score-cell { display: flex; align-items: center; gap: 9px; }
.score-ring {
  --p: 0;
  --score-color: var(--green);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(var(--score-color) calc(var(--p) * 1%), #1b293b 0);
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}
.score-ring::after { content: ""; position: absolute; inset: 4px; background: #0e1621; border-radius: 50%; }
.score-ring b { position: relative; z-index: 1; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-ring.green { --score-color: var(--green); }
.score-ring.blue { --score-color: var(--accent); }
.score-ring.amber { --score-color: var(--amber); }
.score-ring.red { --score-color: var(--red); }
.score-ring.gray { --score-color: #4b5b70; }
.score-meta { display: flex; flex-direction: column; gap: 2px; }
.score-meta b { font-size: 12px; }
.score-meta span { font-size: 10px; color: var(--muted); }

/* ---------- Карточки статистики ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 27, 40, .9), rgba(12, 19, 29, .95));
  position: relative;
  overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--accent); opacity: .8; }
.kpi.green::before { background: var(--green); }
.kpi.amber::before { background: var(--amber); }
.kpi.red::before { background: var(--red); }
.kpi-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; }
.kpi-value { margin-top: 8px; font-size: 25px; line-height: 1.1; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 3px; }
.kpi-foot { margin-top: 5px; font-size: 10.5px; color: var(--muted); }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }

.stats-list { display: flex; flex-direction: column; }
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.stat-row:last-child { border-bottom: 0; }
.stat-name { color: var(--muted); font-size: 11.5px; }
.stat-value { font-size: 19px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 3px; }

/* ---------- График ---------- */
.chart-card .card-body { padding: 10px 14px 10px; }
.chart-wrap { position: relative; height: 250px; width: 100%; }
.chart-wrap.tall { height: 300px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: rgba(10, 16, 25, .45); border-radius: 10px; }
.chart-legend { display: flex; align-items: center; gap: 16px; font-size: 11px; color: var(--muted); padding: 0 4px 8px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.legend-dot.blue { background: var(--accent); }
.legend-dot.red { background: var(--red); }

/* ---------- Пустые состояния и загрузка ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 46px 24px; }
.empty-icon { width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 16px; border: 1px solid rgba(47, 129, 247, .22); }
.empty-title { margin: 0 0 7px; font-size: 18px; font-weight: 730; }
.empty-text { margin: 0 0 18px; max-width: 460px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.connect-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 720px; width: 100%; margin: 8px 0 22px; text-align: left; }
.connect-step { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #0c141e; }
.connect-step b { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.connect-step span { font-size: 11px; color: var(--muted); }
@media (max-width: 700px) { .connect-steps { grid-template-columns: 1fr; } }

.skeleton { position: relative; overflow: hidden; background: #162131; border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-row { height: 12px; margin: 10px 0; }
.skeleton-card { height: 130px; border-radius: 12px; }
.skeleton-chart { height: 250px; border-radius: 12px; }
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Всплывающие сообщения ---------- */
.flash-stack { position: fixed; top: 76px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.flash {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: #111c2b; color: var(--text-2); box-shadow: var(--shadow);
  font-size: 12.5px; line-height: 1.45; animation: flash-in .2s ease-out;
}
@keyframes flash-in { from { opacity: 0; transform: translateY(-5px); } }
.flash.success { border-color: rgba(46, 204, 113, .35); background: rgba(15, 45, 30, .96); color: #b9f4d1; }
.flash.error { border-color: rgba(255, 92, 108, .35); background: rgba(48, 18, 24, .96); color: #ffc4ca; }
.flash.warning { border-color: rgba(245, 166, 35, .35); background: rgba(47, 35, 15, .96); color: #ffdfa5; }
.flash button { margin-left: auto; border: 0; background: none; color: inherit; opacity: .65; padding: 0; }
.flash button:hover { opacity: 1; }

/* ---------- Логин ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.login-visual {
  position: relative;
  overflow: hidden;
  padding: 54px 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-soft);
  background:
    radial-gradient(700px 500px at 22% 18%, rgba(47, 129, 247, .24), transparent 62%),
    radial-gradient(600px 500px at 82% 80%, rgba(163, 113, 247, .13), transparent 60%),
    linear-gradient(160deg, #0a111b 0%, #080d14 70%);
}
.login-visual::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(90, 130, 180, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 130, 180, .055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 45% 40%, #000 20%, transparent 78%);
}
.login-visual::after {
  content: "";
  position: absolute; width: 520px; height: 520px; right: -220px; top: 12%;
  border: 1px solid rgba(47, 129, 247, .14); border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(47, 129, 247, .035), 0 0 0 140px rgba(47, 129, 247, .02);
}
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
.login-brand .brand-name { font-size: 15px; }
.login-visual-content { position: relative; z-index: 1; max-width: 540px; }
.login-eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid rgba(47, 129, 247, .28); border-radius: 99px; color: #8fc0ff; background: rgba(47, 129, 247, .08); font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.login-title { margin: 19px 0 12px; font-size: clamp(30px, 3.2vw, 45px); line-height: 1.08; letter-spacing: -.045em; font-weight: 780; }
.login-title span { color: #6caeff; }
.login-lead { margin: 0; max-width: 470px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.login-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.login-feature { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: rgba(16, 24, 36, .75); border-radius: 8px; padding: 7px 10px; color: var(--text-2); font-size: 11.5px; }
.login-feature .icon { color: var(--accent-2); }
.login-visual-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 20px; color: var(--muted-2); font-size: 11px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 30px; background: #080d14; }
.login-card { width: 100%; max-width: 390px; }
.login-card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; }
.login-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 12.5px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; min-height: 44px; margin-top: 6px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-toggle { position: absolute; right: 5px; top: 5px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); border-radius: 7px; display: grid; place-items: center; }
.password-toggle:hover { color: var(--text); background: rgba(255,255,255,.05); }
.login-error { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; padding: 10px 11px; border: 1px solid rgba(255, 92, 108, .3); border-radius: 9px; background: rgba(255, 92, 108, .08); color: #ffb7bf; font-size: 12px; }
.login-hint { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); color: var(--muted-2); font-size: 11px; line-height: 1.6; }
.login-hint code { color: var(--text-2); background: #111a26; border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 5px; }
.login-foot { margin-top: 22px; text-align: center; color: var(--muted-2); font-size: 10.5px; }
@media (max-width: 920px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
}

/* ---------- Админка ---------- */
.admin-page { min-height: 100vh; }
.admin-tabs { max-width: 1560px; margin: 0 auto; padding: 0 24px; display: flex; gap: 24px; border-bottom: 1px solid var(--border-soft); }
.admin-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-side { position: sticky; top: 84px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.admin-stat { padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--panel-2); }
.admin-stat b { display: block; font-size: 21px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.admin-stat span { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; }
.admin-table td { font-size: 12px; }
.admin-table .login-cell { font-weight: 650; color: var(--text); }
.admin-table .name-cell { color: var(--text-2); }
.role-badge { display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 5px; font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.role-admin { background: var(--accent-soft); color: #8fc0ff; border: 1px solid rgba(47,129,247,.25); }
.role-client { background: rgba(46, 204, 113, .1); color: #74e6a4; border: 1px solid rgba(46,204,113,.22); }
.wialon-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.wialon-state.linked { color: #75e2a3; }
.wialon-dot { width: 6px; height: 6px; border-radius: 50%; background: #46566b; }
.wialon-state.linked .wialon-dot { background: var(--green); box-shadow: 0 0 8px rgba(46,204,113,.7); }
.table-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.table-actions form { display: inline; }
.table-actions .btn { min-height: 27px; padding: 3px 7px; font-size: 11px; }
.log-details { max-width: 520px; color: var(--text-2); white-space: normal; word-break: break-word; font-size: 11.5px; }
.log-action { font-family: "Cascadia Code", "Consolas", monospace; font-size: 10.5px; color: #9db7d6; background: #101b29; border: 1px solid var(--border-soft); border-radius: 4px; padding: 2px 5px; white-space: nowrap; }
.logs-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logs-filter .input, .logs-filter .select { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.logs-filter .input { width: 210px; }
.logs-filter .select { width: 210px; }
.admin-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1080px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Модалки / drawer ---------- */
dialog.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  max-width: min(620px, calc(100vw - 32px));
  width: 100%;
}
dialog.modal::backdrop { background: rgba(2, 6, 11, .72); backdrop-filter: blur(4px); }
.modal-card { background: #101925; border: 1px solid #26384f; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--border-soft); }
.modal-title { margin: 0; font-size: 16px; font-weight: 720; }
.modal-body { padding: 18px 19px; max-height: min(70vh, 680px); overflow: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 19px; border-top: 1px solid var(--border-soft); background: #0c141e; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: rgba(255,255,255,.06); color: var(--text); }
.form-section-title { margin: 0 0 12px; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.unit-modal-head { display: flex; gap: 12px; align-items: flex-start; }
.unit-avatar { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex: 0 0 auto; }
.unit-modal-title { margin: 0; font-size: 17px; font-weight: 730; line-height: 1.25; }
.unit-modal-sub { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.unit-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 16px 0 18px; }
.unit-fact { padding: 10px 11px; border: 1px solid var(--border-soft); border-radius: 9px; background: #0c141e; }
.unit-fact span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.unit-fact b { display: block; margin-top: 4px; font-size: 15px; font-weight: 720; font-variant-numeric: tabular-nums; }
.unit-fact b small { font-size: 10px; color: var(--muted); font-weight: 500; }
.breakdown { display: flex; flex-direction: column; gap: 11px; }
.breakdown-row { display: grid; grid-template-columns: 1fr 52px; gap: 10px; align-items: center; }
.breakdown-label { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; }
.breakdown-label b { color: var(--text); }
.breakdown-value { text-align: right; font-size: 11px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.breakdown-value.na { color: var(--muted-2); font-weight: 500; }
.recommendation { display: flex; gap: 9px; padding: 9px 10px; border-radius: 8px; background: rgba(47,129,247,.06); border: 1px solid rgba(47,129,247,.16); color: var(--text-2); font-size: 11.5px; line-height: 1.5; margin-top: 7px; }
.recommendation .icon { color: var(--accent-2); margin-top: 1px; }
.sensor-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sensor-tag { padding: 4px 7px; border-radius: 5px; background: #0c141e; border: 1px solid var(--border-soft); color: var(--muted); font-size: 10.5px; }
.sensor-tag.ok { color: #9fe7bd; border-color: rgba(46,204,113,.18); background: rgba(46,204,113,.06); }
.sensor-tag.missing { color: #6d7d91; text-decoration: line-through; }

/* ---------- Разное ---------- */
.subtle-divider { height: 1px; background: var(--border-soft); margin: 16px 0; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 9px; border: 1px solid rgba(47,129,247,.2); background: rgba(47,129,247,.06); color: var(--text-2); font-size: 12px; line-height: 1.55; }
.notice.warning { border-color: rgba(245,166,35,.25); background: rgba(245,166,35,.07); color: #ffe0aa; }
.notice.error { border-color: rgba(255,92,108,.28); background: rgba(255,92,108,.07); color: #ffc0c7; }
.notice .icon { color: var(--accent-2); margin-top: 1px; }
.notice.warning .icon { color: var(--amber); }
.notice.error .icon { color: var(--red); }
.quality-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .quality-summary { grid-template-columns: repeat(2, 1fr); } }
.quality-hero { display: flex; align-items: center; gap: 18px; }
.quality-hero .donut { width: 118px; height: 118px; margin: 0; }
.quality-hero .donut::after { inset: 13px; }
.quality-hero .donut-value { font-size: 29px; }
.quality-hero-text { min-width: 0; }
.quality-hero-text h3 { margin: 0 0 4px; font-size: 14px; }
.quality-hero-text p { margin: 0; color: var(--muted); font-size: 11.5px; }
.quality-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.quality-legend span { font-size: 10.5px; color: var(--muted); }
.quality-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }

.page-foot { margin-top: 22px; display: flex; justify-content: space-between; gap: 14px; color: var(--muted-2); font-size: 10.5px; flex-wrap: wrap; }
.page-foot .status-line { display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(46,204,113,.12); }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.table-toolbar .left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-toolbar .right { display: flex; align-items: center; gap: 7px; }
.updated-at { color: var(--muted-2); font-size: 10.5px; white-space: nowrap; }

@media (max-width: 760px) {
  .topbar-inner { grid-template-columns: 1fr auto; padding: 0 14px; min-height: 58px; }
  .topbar-center { display: none; }
  .brand-sub { display: none; }
  .page { padding: 16px 14px 30px; }
  .tabs { padding: 0 14px; gap: 18px; }
  .admin-tabs { padding: 0 14px; }
  .impersonation-inner { padding: 8px 14px; flex-wrap: wrap; }
  .page-title { font-size: 19px; }
  .card-head { padding: 13px 14px; }
  .card-body { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .user-name { max-width: 92px; }
  .unit-facts { grid-template-columns: repeat(2, 1fr); }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .quality-summary { grid-template-columns: 1fr; }
  .chart-wrap { height: 220px; }
}

@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .topbar-right { gap: 4px; }
  .topbar-right > .btn { padding: 0 7px; min-height: 31px; }
}
.flash.hidden { display: none !important; }
[hidden] { display: none !important; }

/* Компактнее основная таблица, чтобы 9 колонок помещались в центр */
.data-table th { padding: 9px 6px; }
.data-table td { padding: 10px 6px; }
.data-table .unit-name { min-width: 150px; }
.data-table th:first-child, .data-table td:first-child { padding-left: 12px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 12px; }

.brand-mark { overflow: hidden; padding: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* Сводка по парку */
.fleet-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.fleet-kpi-grid .kpi { padding: 14px 15px; }
.fleet-kpi-grid .kpi-value { display: flex; align-items: baseline; gap: 7px; }
.grade-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 6px; border-radius: 6px;
  background: rgba(47, 129, 247, .14); color: #8fc0ff;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  border: 1px solid rgba(47,129,247,.22);
}
.grade-bar { display: flex; height: 9px; border-radius: 99px; overflow: hidden; background: #1a2839; margin-top: 10px; }
.grade-bar span { display: block; height: 100%; transition: width .5s ease; }
.grade-a { background: #2ecc71; }
.grade-b { background: #4b9bff; }
.grade-c { background: #f5a623; }
.grade-d { background: #ff7a45; }
.grade-e { background: #ff5c6c; }
.grade-none { background: #3a4b60; }
.grade-legend { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 7px; }
.grade-legend span { color: var(--muted); font-size: 10px; }
.grade-legend b { color: var(--text-2); font-weight: 700; }
@media (max-width: 1280px) { .fleet-kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 760px) { .fleet-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 430px) { .fleet-kpi-grid { grid-template-columns: 1fr; } }
.quality-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .quality-summary { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .quality-summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 430px) { .quality-summary { grid-template-columns: 1fr; } }

/* Первая карточка рейтинга шире, чтобы донат не сплющивало */
.quality-summary { grid-template-columns: minmax(330px, 1.35fr) repeat(4, minmax(0, 1fr)); }
.quality-summary > .card:first-child { min-width: 0; }
.quality-hero { gap: 16px; }
.quality-hero .donut { flex: 0 0 112px; width: 112px; height: 112px; }
.quality-hero .donut::after { inset: 12px; }
.quality-hero .donut-value { font-size: 28px; }
.quality-hero-text { flex: 1 1 auto; min-width: 0; }
.quality-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin-top: 8px; }
.quality-legend span { white-space: nowrap; }
@media (max-width: 1280px) {
  .quality-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality-summary > .card:first-child { grid-column: span 2; }
}
@media (max-width: 860px) {
  .quality-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-summary > .card:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .quality-summary { grid-template-columns: 1fr; }
  .quality-summary > .card:first-child { grid-column: auto; }
  .quality-hero { align-items: flex-start; }
  .quality-hero .donut { flex-basis: 96px; width: 96px; height: 96px; }
  .quality-hero .donut-value { font-size: 24px; }
}

/* ---------- Техобслуживание ---------- */
.maint-filter { margin-bottom: 14px; }
.maint-toolbar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.maint-unit-field { display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.maint-unit-field .select { min-height: 36px; }
.maint-toolbar .period-switch { margin-bottom: 1px; }
.maint-custom { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.maint-custom .input { width: 145px; min-height: 34px; padding: 6px 9px; }
.maint-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 13px; }
.maint-kpi-grid .kpi { padding: 14px 15px; }
.maint-note { margin-bottom: 14px; }
.card.mb-3 { margin-bottom: 16px; }
.maint-records td { vertical-align: top; }
.works-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: #0d1622; color: var(--text-2); font-size: 11px; font-weight: 600;
}
.works-toggle:hover { border-color: #2a4260; color: var(--text); }
.works-toggle .icon { transition: transform .15s; }
.works-toggle.open .icon { transform: rotate(90deg); }
.works-detail td { padding: 0 12px 12px !important; background: #0b131d; }
.works-detail .works-list { display: grid; grid-template-columns: 1fr 120px; gap: 6px 16px; padding: 10px 12px; border-left: 2px solid var(--accent); }
.works-detail .works-list .work-name { color: var(--text-2); font-size: 12px; }
.works-detail .works-list .work-amount { text-align: right; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.maint-actions { display: inline-flex; gap: 4px; }
.maint-actions .btn { min-height: 28px; padding: 3px 7px; font-size: 11px; }
.maint-works-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 9px; }
.maint-works-head .form-section-title { margin: 0; }
.maint-works { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow-y: auto; padding-right: 3px; }
.maint-work-row { display: grid; grid-template-columns: minmax(0, 1fr) 126px 30px; gap: 7px; align-items: center; }
.maint-work-row .input { min-height: 36px; padding: 6px 9px; }
.maint-work-row .icon-btn { width: 28px; height: 28px; color: var(--muted); border: 1px solid transparent; }
.maint-work-row .icon-btn:hover { color: var(--red); background: rgba(255,92,108,.07); border-color: rgba(255,92,108,.2); }
.maint-total { text-align: right; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; }
.maint-total strong { color: var(--text); font-size: 17px; margin-left: 5px; font-variant-numeric: tabular-nums; }
.maint-empty { padding: 30px 18px; text-align: center; color: var(--muted); }
@media (max-width: 980px) { .maint-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .maint-kpi-grid { grid-template-columns: 1fr; }
  .maint-unit-field { width: 100%; min-width: 0; }
  .maint-work-row { grid-template-columns: minmax(0,1fr) 90px 28px; }
}

/* Параметры ТС в качестве вождения */
.parameter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.parameter-card { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #0c141e; min-width: 0; }
.parameter-card.available { border-color: rgba(46, 204, 113, .22); background: rgba(46, 204, 113, .04); }
.parameter-card.missing { border-color: var(--border-soft); }
.parameter-card .parameter-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.parameter-name { font-size: 11px; font-weight: 650; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parameter-status { width: 7px; height: 7px; border-radius: 50%; background: #4a5a70; flex: 0 0 auto; }
.parameter-card.available .parameter-status { background: var(--green); box-shadow: 0 0 7px rgba(46,204,113,.6); }
.parameter-card.missing .parameter-status { background: #4a5a70; }
.parameter-value { margin-top: 7px; font-size: 14px; font-weight: 720; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parameter-card.missing .parameter-value { color: var(--muted-2); font-weight: 500; font-size: 12px; }
.parameter-hint { margin-top: 3px; font-size: 9.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1280px) { .parameter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .parameter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 430px) { .parameter-grid { grid-template-columns: 1fr; } }
.quality-params-note { font-size: 11.5px; }

/* Профиль вождения */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-block { min-width: 0; padding: 12px 13px; border: 1px solid var(--border-soft); border-radius: 10px; background: #0c141e; }
.profile-title { margin-bottom: 9px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.profile-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 44px; align-items: center; gap: 8px; margin: 5px 0; }
.profile-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.profile-bar { height: 7px; border-radius: 99px; background: #1a2839; overflow: hidden; }
.profile-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f81f7, #69adff); }
.profile-bar.green span { background: linear-gradient(90deg, #2ecc71, #56e394); }
.profile-bar.amber span { background: linear-gradient(90deg, #d98a13, #ffc35c); }
.profile-bar.red span { background: linear-gradient(90deg, #d94352, #ff8d98); }
.profile-value { text-align: right; color: var(--text-2); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.profile-foot { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 10.5px; }
.profile-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 11.5px; }
.profile-stat span { color: var(--muted); }
.profile-stat b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } .profile-row { grid-template-columns: 68px minmax(0,1fr) 42px; } }

.profile-block.profile-full { grid-column: 1 / -1; }
#profile-pedal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 760px) { #profile-pedal { grid-template-columns: 1fr; } }

/* Штрафы */
.gis-notice { align-items: center; border-color: rgba(163,113,247,.28); background: rgba(163,113,247,.07); color: #d8c7ff; }
.gis-notice .icon { color: #c7a6ff; }
.gis-notice b { color: #e6d9ff; }
.gis-notice .pill { flex: 0 0 auto; }
.fine-reason { white-space: normal; min-width: 220px; max-width: 420px; color: var(--text-2); font-size: 11.5px; line-height: 1.45; }
@media (max-width: 760px) { .fine-reason { min-width: 180px; max-width: 260px; } }

/* Топливные карты */
.fuel-methods { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.fuel-method { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: #0c141e; min-width: 0; }
.fuel-method-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); flex: 0 0 auto; }
.fuel-method-icon.purple { background: rgba(163,113,247,.12); color: #c7a6ff; }
.fuel-method-icon.green { background: rgba(46,204,113,.12); color: #74e6a4; }
.fuel-method b { display: block; font-size: 12px; margin-bottom: 3px; }
.fuel-method span { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.fuel-method .pill, .fuel-method .btn { margin-left: auto; flex: 0 0 auto; }
.fuel-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.fuel-kpi-grid .kpi { padding: 13px 14px; }
.fuel-diff-good { color: #65e39a; }
.fuel-diff-warn { color: #ffc35c; }
.fuel-diff-bad { color: #ff8d98; }
.fuel-station { color: var(--muted); font-size: 10.5px; white-space: normal; max-width: 150px; }
@media (max-width: 1280px) { .fuel-kpi-grid { grid-template-columns: repeat(3,1fr); } .fuel-methods { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .fuel-kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 430px) { .fuel-kpi-grid { grid-template-columns: 1fr; } }

/* Группировка заправок по ТС */
.fuel-group-row td { padding: 0 !important; background: #0e1824; border-bottom: 1px solid var(--border); }
.fuel-group-toggle { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--text); text-align: left; flex-wrap: wrap; }
.fuel-group-toggle:hover { background: rgba(47,129,247,.05); }
.fuel-group-chevron { color: var(--muted); transition: transform .15s; flex: 0 0 auto; }
.fuel-group-toggle.open .fuel-group-chevron { transform: rotate(180deg); }
.fuel-group-name { font-size: 12.5px; font-weight: 700; margin-right: 4px; }
.fuel-group-meta { color: var(--muted); font-size: 10.5px; padding-left: 9px; border-left: 1px solid var(--border); white-space: nowrap; }
.fuel-group-toggle .pill { margin-left: auto; }
.fuel-child-date { padding-left: 32px !important; color: var(--muted); }

/* Регламент ТО */
.maint-plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px 18px; }
.maint-plan-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #0b131d; min-width: 0; }
.maint-plan-item b { display: block; font-size: 11.5px; margin-bottom: 3px; }
.maint-plan-item span { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.maint-plan-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.maint-plan-note .icon { color: var(--accent-2); flex: 0 0 auto; margin-top: 1px; }
@media (max-width: 1100px) { .maint-plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .maint-plan-grid { grid-template-columns: 1fr; } }

/* Видео */
.video-layout { display: grid; grid-template-columns: 270px minmax(0,1fr) 224px; gap: 14px; align-items: start; }
.video-sidebar { max-height: 650px; display: flex; flex-direction: column; overflow: hidden; }
.video-sidebar .card-head { flex: 0 0 auto; }
.video-unit-list { overflow-y: auto; padding: 5px 6px; min-height: 220px; }
.video-unit { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background .12s, border-color .12s; }
.video-unit:hover { background: rgba(47,129,247,.06); }
.video-unit.active { background: var(--accent-soft); border-color: rgba(47,129,247,.35); }
.video-unit-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--muted); flex: 0 0 auto; }
.video-unit.active .video-unit-icon { color: var(--accent-2); background: rgba(47,129,247,.12); }
.video-unit-info { min-width: 0; flex: 1; }
.video-unit-info b { display: block; font-size: 10.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-unit-info span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.video-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.video-dot.online { background: #43d17c; box-shadow: 0 0 0 3px rgba(67,209,124,.12); }
.video-dot.offline { background: #65788d; }
.video-unit .video-dot { margin-left: auto; }
.video-legend { display: flex; gap: 13px; padding: 9px 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9.5px; flex: 0 0 auto; }
.video-legend span { display: inline-flex; align-items: center; gap: 5px; }
.video-list-empty { padding: 24px 12px; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.5; }
.video-stage-card { overflow: hidden; }
.video-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--border); }
.video-stage-title { min-width: 0; }
.video-stage-title b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-stage-title span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 2px; }
.video-stage { position: relative; aspect-ratio: 16 / 9; min-height: 260px; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.video-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #7f8c9c; text-align: center; padding: 18px; }
.video-placeholder-icon { width: 54px; height: 54px; border-radius: 50%; border: 1px solid #26374a; display: grid; place-items: center; margin-bottom: 7px; color: #506178; background: #0a1119; }
.video-placeholder b { color: #c8d2dd; font-size: 14px; }
.video-placeholder span { font-size: 11px; color: #8495a8; }
.video-placeholder small { font-size: 9.5px; color: #5e6e80; max-width: 280px; line-height: 1.45; }
.video-stage-badge { position: absolute; left: 11px; top: 10px; display: inline-flex; align-items: center; gap: 5px; color: #9eacbc; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.08); border-radius: 5px; padding: 3px 7px; font-size: 8.5px; letter-spacing: .06em; }
.video-stage-badge span { color: #65788d; }
.video-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #e05a63; box-shadow: 0 0 0 2px rgba(224,90,99,.15); }
.video-stage-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 13px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9.5px; }
.video-stage-foot span { display: inline-flex; align-items: center; gap: 5px; }
.video-camera-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 3px; padding: 3px; background: #000; }
.video-camera-grid.count-1 { grid-template-columns: 1fr; }
.video-camera-grid.count-2, .video-camera-grid.count-3 { grid-template-columns: repeat(2,1fr); }
.video-camera-grid.count-3 .video-camera-tile:last-child { grid-column: span 2; }
.video-camera-tile { min-height: 80px; border: 1px solid #1e2c3b; background: radial-gradient(circle at 50% 40%, #0b131c, #030608 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #61758b; }
.video-camera-tile b { font-size: 10px; color: #8999ab; }
.video-camera-tile span { font-size: 8.5px; color: #526477; }
.video-controls .card-head { padding-bottom: 4px; }
.video-control-section { padding: 9px 0; border-bottom: 1px solid var(--border); }
.video-control-section:last-of-type { border-bottom: 0; }
.video-control-section .label { display: block; margin-bottom: 7px; }
.video-layout-buttons { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }
.video-layout-btn { padding: 7px 0; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.video-layout-btn:hover { color: var(--text); border-color: #34485e; }
.video-layout-btn.active { color: #cfe4ff; border-color: rgba(47,129,247,.5); background: var(--accent-soft); }
.video-control-stack { display: flex; flex-direction: column; gap: 6px; }
.video-control-stack .btn { justify-content: flex-start; }
.video-control-stack .btn.active { color: var(--accent-2); background: var(--accent-soft); }
.video-control-note { display: flex; align-items: flex-start; gap: 7px; padding-top: 11px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.video-control-note .icon { color: var(--accent-2); flex: 0 0 auto; margin-top: 1px; }
@media (max-width: 1250px) { .video-layout { grid-template-columns: 240px minmax(0,1fr); } .video-controls { grid-column: 1 / -1; } .video-controls .card-body { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; } .video-control-section { border-bottom: 0; min-width: 180px; } .video-control-stack { flex-direction: row; flex-wrap: wrap; } .video-control-note { flex: 1; min-width: 220px; } }
@media (max-width: 760px) { .video-layout { grid-template-columns: 1fr; } .video-controls { grid-column: auto; } .video-sidebar { max-height: 260px; } .video-stage { min-height: 200px; } .video-stage-foot { flex-direction: column; gap: 3px; } .page-head .toolbar { flex-wrap: wrap; } }
