/* Farmbasa temperature monitoring.
   Palette follows the restrained navy/blue system of the corporate site:
   light neutral canvas, white surfaces, navy text, blue action colour.
   The logo keeps its own brand colour; the interface does not repeat the
   logo gradient as decoration. */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/static/fonts/golos-text-latin.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: #f7f7fa;
  --surface: #ffffff;
  --surface-soft: #f1f3f4;
  --surface-muted: #f7f8fa;
  --ink: #0c204d;
  --ink-soft: #24365e;
  --muted: #5f6b7a;
  --muted-soft: #7b8494;
  --line: #dfe4eb;
  --line-strong: #c7cfda;
  --brand: #0067bb;
  --brand-dark: #00549a;
  --brand-soft: #e8f2fb;
  --ok: #1f7a4d;
  --ok-bg: #eaf5ef;
  --stale: #667085;
  --stale-bg: #f2f4f7;
  --alarm: #b42318;
  --alarm-bg: #fdf0ee;
  --nodata: #8a5a00;
  --nodata-bg: #fff6e5;
  --focus: #0067bb;
  --radius: 4px;
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --content: 1280px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--brand-soft); color: var(--ink); }

.brand-stripe {
  height: 3px;
  background: var(--brand);
}

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--content);
  margin: 0 auto;
  min-height: 72px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-logo {
  display: block;
  height: 44px;
  width: auto;
}
.brand-divider {
  width: 1px;
  height: 30px;
  background: var(--line);
  flex: none;
}
.brand-product {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
}
.main-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 28px;
  margin-left: 12px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  padding: 0 1px;
}
.nav-link:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.nav-link.is-active { color: var(--ink); border-bottom-color: var(--brand); }
.user-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.user-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-name .icon { width: 15px; height: 15px; }
.logout-form { margin: 0; }
.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 0;
  font-size: 13px;
}
.logout-button:hover { color: var(--brand); }
.logout-button .icon { width: 15px; height: 15px; }

/* ---------- Source banner ---------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.banner-icon { display: inline-flex; margin-top: 2px; }
.banner-lost { background: var(--alarm-bg); color: #7a1d14; }
.banner-disabled { background: var(--stale-bg); color: var(--stale); }
.banner-ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 32px 64px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 0 22px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 600;
}
.lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 680px;
}
.refresh-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  padding-bottom: 3px;
}
.refresh-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.refresh-sep {
  width: 1px;
  height: 13px;
  background: var(--line-strong);
  font-size: 0;
  flex: none;
}
.refresh-info.is-error { color: var(--alarm); }
.refresh-info.is-error .refresh-dot { background: var(--alarm); }

/* ---------- Summary strip ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.summary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 20px 24px 18px;
  color: var(--ink);
  transition: background-color .15s ease;
}
.summary-card:last-child { border-right: 0; }
.summary-card:hover { background: var(--surface-muted); }
.summary-card.is-active { background: var(--surface); }
.summary-card.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--brand);
}
.summary-icon {
  position: absolute;
  top: 20px;
  right: 22px;
  display: grid;
  place-items: center;
  color: var(--muted-soft);
}
.summary-icon .icon { width: 17px; height: 17px; }
.summary-number {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.summary-label { color: var(--muted); font-size: 13px; }
.summary-ok .summary-icon { color: var(--ok); }
.summary-stale .summary-icon { color: var(--stale); }
.summary-alarm .summary-icon { color: var(--alarm); }
.summary-no_data .summary-icon { color: var(--nodata); }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.toolbar-note { margin: 0; color: var(--muted); font-size: 13px; }
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 240px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted-soft);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.search-field .icon { width: 16px; height: 16px; }
.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.search-field input::placeholder { color: var(--muted-soft); }
.segmented {
  display: flex;
  align-items: center;
  gap: 24px;
}
.segmented-button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 5px 0;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.segmented-button:hover { color: var(--ink); }
.segmented-button.is-active { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- Camera sheet ---------- */
.camera-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}
.camera-card {
  --status-color: var(--stale);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.camera-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--status-color);
}
.camera-card:hover { background: var(--surface-muted); border-color: var(--line-strong); color: var(--ink); }
.camera-card.status-ok { --status-color: var(--ok); }
.camera-card.status-stale { --status-color: var(--stale); }
.camera-card.status-alarm { --status-color: var(--alarm); }
.camera-card.status-no_data { --status-color: var(--nodata); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.4;
  white-space: nowrap;
}
.card-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--status-color, var(--muted));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.status-pill .icon { width: 14px; height: 14px; stroke-width: 1.9; }
.status-pill.status-ok { --status-color: var(--ok); }
.status-pill.status-stale { --status-color: var(--stale); }
.status-pill.status-alarm { --status-color: var(--alarm); }
.status-pill.status-no_data { --status-color: var(--nodata); }
.problem-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 9px 0 0;
  color: var(--alarm);
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
}
.problem-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.problem-line .icon { width: 14px; height: 14px; }

.sensor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.sensor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 8px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f6;
}
.sensor-row:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sensor-name {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sensor-reading { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sensor-value { color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.unit { color: var(--muted-soft); font-size: 11px; font-weight: 400; }
.sensor-note { grid-column: 1 / -1; color: var(--muted-soft); font-size: 10.5px; line-height: 1.35; }
.sensor-stale .sensor-value { color: var(--stale); font-weight: 500; }
.sensor-stale .sensor-note { color: var(--stale); }
.sensor-alarm .sensor-value { color: var(--alarm); }
.sensor-alarm .sensor-note { color: var(--alarm); font-weight: 500; }
.sensor-no_data .sensor-value { color: var(--muted-soft); }
.sensor-no_data .sensor-note { color: var(--nodata); }

.card-spark {
  flex: 1;
  min-height: 56px;
  margin: 10px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
}
.sparkline { display: block; width: 100%; height: 100%; min-height: 56px; }
.no-spark { color: var(--muted-soft); font-size: 11px; }
.card-foot {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted-soft);
  font-size: 11px;
  min-width: 0;
}
.card-updated { white-space: nowrap; }
.limits-hint { white-space: nowrap; color: var(--muted-soft); }
.card-open {
  margin-left: auto;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}
.camera-card:hover .card-open { text-decoration: underline; }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.panel-head h2 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.panel-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.counter {
  min-width: 30px;
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Camera page ---------- */
.page-head-camera { align-items: flex-start; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}
.back-link:hover { color: var(--brand); }
.back-link .icon { width: 15px; height: 15px; }
.camera-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.camera-title-row h1 { margin: 0; }
.problem-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 10px 0;
  border-top: 1px solid #f3c9c4;
  border-bottom: 1px solid #f3c9c4;
  background: transparent;
  color: var(--alarm);
  font-size: 13px;
  font-weight: 500;
}
.page-head + .panel,
.problem-banner + .panel { margin-top: 24px; }
.chart-panel { padding: 20px 24px 16px; }
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chart-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.button-secondary, .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.button-secondary {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}
.button-secondary:hover { border-color: var(--ink); color: var(--ink); background: var(--surface-muted); }
.button-secondary .icon { width: 15px; height: 15px; }
.button-primary {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff;
}
.button-primary:hover { background: var(--ink-soft); border-color: var(--ink-soft); color: #fff; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: 460px; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .82);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}
.chart-message {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: 340px;
  padding: 7px 10px;
  border: 1px solid #e8cf9f;
  border-radius: 2px;
  background: #fff8e8;
  color: #6f4a00;
  font-size: 12px;
}
.chart-coverage { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.chart-help { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.chart-tooltip { min-width: 190px; }
.chart-tooltip-time { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.chart-tooltip-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.chart-tooltip-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chart-tooltip-name { color: var(--ink-soft); font-size: 12px; }
.chart-tooltip-value { margin-left: auto; color: var(--ink); font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-muted);
  white-space: nowrap;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-muted); }
.cell-main { display: block; color: var(--ink); font-weight: 500; }
.cell-sub { display: block; color: var(--muted-soft); font-size: 11px; margin-top: 1px; }
.mobile-updated { display: none; }
.cell-value { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cell-muted { color: var(--muted); white-space: nowrap; }
.cell-status { white-space: nowrap; }
.cell-error { color: #7a1d14; font-size: 12px; max-width: 380px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-bad { background: var(--alarm-bg); color: var(--alarm); }
.row-stale .cell-value { color: var(--stale); }
.row-alarm .cell-value { color: var(--alarm); }
.row-no_data .cell-value { color: var(--muted-soft); }

/* ---------- System ---------- */
.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 24px;
}
.system-card { margin-bottom: 0; }
.facts { margin: 0; }
.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f6;
}
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; min-width: 0; color: var(--ink-soft); font-size: 13px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.facts > div.fact-wide { grid-template-columns: minmax(0, 1fr); gap: 3px; }
.facts > div.fact-wide dd { text-align: left; }
.facts-compact dd { font-variant-numeric: tabular-nums; }
.error-text { color: #7a1d14; }
.empty-inline { margin: 4px 0; color: var(--muted); font-size: 14px; }
.empty-state {
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 28px;
  color: var(--muted);
}
.empty-state h2 { margin: 0 0 8px; color: var(--ink); font-size: 18px; font-weight: 600; }
.empty-state p { margin: 0; max-width: 680px; }
code {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 5px;
  font-size: .88em;
  overflow-wrap: anywhere;
}

/* ---------- Login / error ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--surface-soft);
}
.login-body .brand-stripe {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
.login-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 34px 28px;
}
.login-logo { display: block; height: 54px; width: auto; margin-bottom: 26px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-card h1 { margin: 0 0 8px; color: var(--ink); font-size: 28px; line-height: 1.15; letter-spacing: -.025em; font-weight: 600; }
.login-lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-form { display: grid; gap: 7px; }
.login-form label { margin-top: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 500; }
.login-form input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 11px;
  background: #fff;
  color: var(--ink);
}
.login-form input:focus { border-color: var(--ink); outline: 2px solid var(--brand-soft); outline-offset: 1px; }
.login-form .button-primary { width: 100%; margin-top: 16px; height: 44px; font-size: 14px; }
.login-note { margin: 18px 0 0; color: var(--muted-soft); font-size: 12px; text-align: center; }
.alert { border-radius: 2px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: var(--alarm-bg); border: 1px solid #f3c9c4; color: #7a1d14; }
.error-card { text-align: left; }
.error-code { margin: 0; color: var(--brand); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.error-card h1 { margin-top: 12px; }
.error-card .button-primary { margin-top: 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted-soft);
  font-size: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  .camera-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-grid .system-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 10px 18px; padding: 12px 20px; }
  .brand-logo { height: 38px; }
  .brand-product { display: none; }
  .brand-divider { display: none; }
  .main-nav { order: 3; width: 100%; height: 36px; margin-left: 0; gap: 24px; }
  .user-box { margin-left: auto; }
  .container { padding: 0 20px 48px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; padding-top: 30px; }
  .refresh-info { padding-bottom: 0; }
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-card:nth-child(3) { border-right: 0; }
  .summary-card:nth-child(4), .summary-card:nth-child(5) { border-top: 1px solid var(--line); }
  .summary-card:nth-child(4) { border-right: 1px solid var(--line); }
  .chart { height: 400px; }
  .system-grid { grid-template-columns: 1fr; gap: 20px; }
  .system-grid .system-card:last-child { grid-column: auto; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .header-inner { padding: 10px 16px; }
  .brand-logo { height: 34px; }
  .user-name { display: none; }
  .container { padding: 0 16px 40px; }
  .page-head { padding-top: 26px; padding-bottom: 18px; }
  .page-head h1 { font-size: 28px; }
  .refresh-info { flex-wrap: wrap; white-space: normal; row-gap: 4px; }
  .refresh-sep { display: none; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { padding: 16px 16px 14px; }
  .summary-card:nth-child(2n) { border-right: 0; }
  .summary-card:nth-child(3) { border-right: 1px solid var(--line); }
  .summary-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .summary-card:last-child { grid-column: 1 / -1; border-right: 0; }
  .summary-number { font-size: 1.7rem; }
  .summary-icon { top: 16px; right: 16px; }
  .summary-label { font-size: 12px; }
  .camera-grid { grid-template-columns: 1fr; }
  .camera-card { padding: 17px 16px 14px; }
  .card-open { font-size: 0; }
  .card-open::after { content: "Открыть"; font-size: 11px; }
  .toolbar { align-items: stretch; flex-direction: column; gap: 10px; padding: 14px 0; }
  .search-field { width: 100%; }
  .segmented { width: 100%; overflow-x: auto; gap: 20px; }
  .segmented-button { flex: 0 0 auto; }
  .chart-toolbar { align-items: stretch; flex-direction: column; }
  .range-switch { width: 100%; overflow-x: auto; gap: 18px; }
  .chart-actions { width: 100%; }
  .chart-actions .button-secondary { flex: 1; }
  .chart { height: 350px; }
  .chart-panel { padding: 16px; }
  .panel { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 9px 8px; }
  .current-table th:nth-child(3), .current-table td:nth-child(3) { display: none; }
  .mobile-updated { display: block; }
  .footer-inner { flex-direction: column; gap: 4px; padding: 16px; }
  .login-body { padding: 28px 16px; }
  .login-card { padding: 26px 22px 22px; }
  .login-logo { height: 46px; }
  .login-card h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
