@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0e1116;
  --elev: #171b24;
  --elev-2: #1c2230;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --faint: #727b8c;
  --red: #ff5c5c;
  --gold: #f0c14a;
  --orange: #f0a04b;
  --blue: #8eafff;
  --blue-dim: rgba(142, 175, 255, 0.12);
  --green: #3dcc8a;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.wrap {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}
.topbar .brand { color: var(--faint); letter-spacing: 0.01em; }
.topbar nav { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; justify-content: flex-end; }
.topbar button, .topbar .linkish {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 4px 0;
  text-decoration: none;
}
.topbar button:hover, .topbar .linkish:hover { color: var(--text); }
.who { color: var(--faint); }

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.banner {
  margin: 14px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 92, 92, 0.12);
  color: #ffb4b4;
  border: 1px solid rgba(255, 92, 92, 0.25);
}
.banner.ok {
  background: rgba(61, 204, 138, 0.1);
  color: #b7f0d4;
  border-color: rgba(61, 204, 138, 0.25);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 14px;
}
.kpi, .tile, .card, .drop, .proj {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.kpi { padding: 14px 14px 12px; min-height: 112px; }
.kpi b {
  display: block;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kpi span, .kpi small { display: block; color: var(--muted); }
.kpi span { margin-top: 6px; font-size: 13px; }
.kpi small { margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: var(--faint); }
.kpi.danger b { color: var(--red); }
.kpi.warning b { color: var(--gold); }

.tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 188px;
  padding: 18px 16px 16px;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.tile:hover {
  transform: translateY(-3px);
  background: var(--elev-2);
  border-color: rgba(142, 175, 255, 0.45);
  box-shadow: var(--shadow);
}
.tile .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--blue-dim);
  color: var(--blue);
}
.tile .go {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--faint);
}
.tile:hover .go { color: var(--blue); }
.tile h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}
.nums { margin-top: auto; display: flex; gap: 14px 16px; flex-wrap: wrap; }
.nums b {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.nums span { color: var(--muted); font-size: 12.5px; }
.tone-danger { color: var(--red); }
.tone-warning { color: var(--gold); }
.tone-lag { color: var(--orange); }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px 14px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}
.section-head h2 { margin: 0; font-size: 20px; font-weight: 650; }
.section-head .count { color: var(--muted); font-size: 14px; }
.back {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  background: var(--elev);
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
}
.back:hover { border-color: var(--blue); }
.caption { color: var(--faint); font-size: 13px; margin: -4px 0 12px; }

.card { overflow: hidden; }
.filters {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr 1.15fr;
  gap: 12px 14px;
  padding: 14px 14px 8px;
}
label.field { display: flex; flex-direction: column; gap: 6px; color: var(--faint); font-size: 12px; }
input, select {
  width: 100%;
  background: #10141c;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 12px;
  outline: none;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
input:focus, select:focus { border-color: rgba(142, 175, 255, 0.7); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { text-align: left; padding: 11px 12px; vertical-align: top; }
th {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
th .arr { color: var(--blue); margin-left: 4px; }
td { border-bottom: 1px solid rgba(255, 255, 255, 0.045); font-size: 13.5px; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { font-variant-numeric: tabular-nums; }
.block-sub { color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.late { color: var(--red); font-size: 12px; margin-top: 2px; }
.muted { color: var(--faint); }
.diamond { color: var(--gold); margin-right: 4px; }
.pills { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
  white-space: nowrap;
}
.pill.bad { background: rgba(255, 92, 92, 0.16); color: #ff8d8d; }
.pill.warn { background: rgba(240, 193, 74, 0.16); color: var(--gold); }
.pill.lag { background: rgba(240, 160, 75, 0.16); color: var(--orange); }
.pill.ok { background: rgba(61, 204, 138, 0.14); color: #7ee0b2; }
.pill.info { background: rgba(142, 175, 255, 0.14); color: var(--blue); }
.pill.crit, .pill.muted { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.empty { padding: 28px 16px; color: var(--muted); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; padding: 4px 2px 10px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.gantt-wrap { overflow-x: auto; padding: 4px 8px 16px; }
.gantt-wrap svg { min-width: 980px; display: block; }

.bar-list { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr auto; gap: 10px; align-items: center; }
.bar-name { font-size: 13px; }
.bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: #2a3142;
}
.bar > span { display: block; height: 100%; }
.seg-done { background: #3dcc8a; }
.seg-over { background: var(--red); }
.seg-burn { background: var(--gold); }
.seg-rest { background: #3a4458; }
.hbar { height: 10px; border-radius: 6px; background: #2c6bed; min-width: 2px; }
.bar-meta { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-card { padding-bottom: 8px; margin-bottom: 12px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 14px 16px 0; color: var(--muted); font-size: 12.5px; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth {
  width: min(420px, 100%);
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 26px 24px;
}
.auth .mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--blue-dim);
  color: var(--blue);
  margin-bottom: 14px;
}
.auth h1 { font-size: 24px; }
.auth .sub { margin-bottom: 18px; }
.auth form { display: flex; flex-direction: column; gap: 12px; }
.primary, .google, .ghost {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid transparent;
  font-weight: 600;
}
.primary { background: #2f6fed; color: white; }
.primary:hover { background: #3b7bff; }
.primary:disabled { opacity: 0.6; cursor: progress; }
.google {
  background: #10141c;
  border-color: var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.google:hover { border-color: var(--muted); }
.ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.switch { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.switch button { background: none; border: 0; color: var(--blue); padding: 0; }
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 12px;
  margin: 4px 0;
}
.or::before, .or::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.drop {
  padding: 28px 20px;
  text-align: center;
  border-style: dashed;
  margin-bottom: 16px;
}
.drop.hot { border-color: var(--blue); background: #1a2233; }
.drop p { margin: 0 0 6px; }
.drop .hint { color: var(--faint); margin-bottom: 14px; }
.grid-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.proj { padding: 16px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; min-height: 140px; }
.proj:hover { border-color: rgba(142, 175, 255, 0.4); }
.proj h2 { margin: 0; font-size: 16px; font-weight: 650; }
.proj p { margin: 0; color: var(--muted); font-size: 13px; }
.proj .row { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.danger-link { background: none; border: 0; color: var(--faint); padding: 0; }
.danger-link:hover { color: var(--red); }
.ver-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ver-row select { width: min(420px, 100%); }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 20px, 1440px); }
  .tiles, .filters { grid-template-columns: 1fr; }
  .kpi b { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
