:root {
  --bg: #f4f6f8;
  --panel: #fff;
  --text: #17212b;
  --muted: #677383;
  --line: #dce3ea;
  --accent: #126a4b;
  --accent-2: #255f9e;
  --bad: #c73d32;
  --warn: #c58a19;
  --ok: #1f8a5b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent-2); text-decoration: none; }
input, select, textarea, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
}
button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: auto;
  min-height: 40px;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
}
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 64px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; color: var(--text); letter-spacing: .08em; }
.topbar nav, .account { display: flex; gap: 14px; align-items: center; }
.page { max-width: 1440px; margin: 0 auto; padding: 28px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}
.hero h1 { margin: 0 0 10px; font-size: 38px; line-height: 1.08; }
.hero p { margin: 0; color: var(--muted); max-width: 720px; }
.search-panel, .auth-box, .admin-panel, .notice, .form-wide {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.search-panel { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 14px;
}
.section-head h2, .admin-panel h2, .reports h2 { margin: 0; }
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.region-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--ok);
  border-radius: 8px;
  padding: 16px;
}
.region-card.warning { border-left-color: var(--warn); }
.region-card.problem { border-left-color: var(--bad); background: #fff6f5; }
.card-top { display: flex; justify-content: space-between; gap: 10px; }
.card-top h3 { margin: 0; font-size: 18px; }
.card-top span, .muted { color: var(--muted); font-size: 14px; }
.sparkline { width: 100%; height: 52px; margin: 12px 0; }
.sparkline polyline { fill: none; stroke: var(--accent-2); stroke-width: 3; }
.metric { font-size: 30px; font-weight: 800; }
.map-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 160px);
}
.filters {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
}
.filters h1 { margin-top: 0; }
.stack { display: grid; gap: 10px; }
#fuel-map {
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e7ecef;
}
.station-list { display: grid; gap: 8px; margin-top: 16px; }
.station-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
}
.station-row span { color: var(--muted); font-size: 14px; }
.station-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}
.station-head h1 { margin: 0 0 8px; }
.status-grid, .fuel-form-grid, .admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.fuel-card, .report-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.risk-bar {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b9c68, #dfc24b, #c73d32);
  overflow: hidden;
}
.risk-bar span {
  display: block;
  height: 100%;
  background: rgba(199, 61, 50, .42);
}
.reports { margin-top: 24px; display: grid; gap: 10px; }
.tabs { display: flex; gap: 10px; }
.form-wide form { display: grid; gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 8px; }
.payment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.payment-grid label, .admin-panel label { display: flex; align-items: center; gap: 8px; }
.payment-grid input[type=checkbox], .admin-panel input[type=checkbox] { width: auto; }
.admin-grid { align-items: start; }
.admin-panel.wide { grid-column: 1 / -1; }
.station-admin-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.station-admin-form textarea { grid-column: 1 / -1; min-height: 90px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.inline { display: flex; gap: 8px; }
.inline select { width: auto; }
.flash { margin-bottom: 14px; padding: 12px 14px; border-radius: 6px; background: #e8f6ef; border: 1px solid #b7e0ca; }
.flash.bad, .error-box { background: #fff0ef; border-color: #efc0bc; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .topbar, .hero, .map-layout, .station-head { grid-template-columns: 1fr; }
  .topbar { position: static; }
  .search-panel { grid-template-columns: 1fr; }
  #fuel-map { min-height: 460px; }
}

.region-alert {
  display: inline-flex;
  width: fit-content;
  margin: 10px 0;
  padding: 5px 8px;
  border-radius: 6px;
  background: #c73d32;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 22px 0 8px;
}
.fuel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.fuel-card-head h3 { margin: 0; }
.fuel-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  flex: 0 0 auto;
}
.fuel-dot.green { background: var(--ok); }
.fuel-dot.yellow { background: var(--warn); }
.fuel-dot.red { background: var(--bad); }
.fuel-dot.unknown { background: var(--muted); }
.fuel-card-green { border-left: 5px solid var(--ok); }
.fuel-card-yellow { border-left: 5px solid var(--warn); }
.fuel-card-red { border-left: 5px solid var(--bad); }
.fuel-card-unknown { border-left: 5px solid var(--muted); }
.fuel-status-main {
  margin: 12px 0;
  font-weight: 800;
  font-size: 18px;
}
.status-breakdown, .pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-breakdown span, .pill-list span {
  display: inline-flex;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.summary-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.summary-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.danger-button {
  background: var(--bad);
}
.payment-list {
  display: grid;
  gap: 8px;
  max-width: 420px;
}
.payment-list label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.payment-list input[type=checkbox] { width: auto; }
.pill-list.vertical {
  display: grid;
  grid-template-columns: 1fr;
}
.pill-ok {
  border-color: #b7e0ca !important;
  color: var(--ok) !important;
  background: #f0fbf5 !important;
}
.pill-bad {
  border-color: #efc0bc !important;
  color: var(--bad) !important;
  background: #fff6f5 !important;
}
.card-top h3 a {
  color: var(--text);
}
.card-top h3 a:hover {
  color: var(--accent-2);
}
.brand {
  display: inline-grid;
  gap: 0;
  line-height: 1;
  text-transform: none;
}
.brand span:first-child { font-weight: 900; letter-spacing: .08em; }
.brand span:last-child { font-size: 13px; font-weight: 700; letter-spacing: 0; }
.hero h2 {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
  max-width: 840px;
}
.is-hidden { display: none !important; }
.load-more-stations { margin-top: 12px; width: 100%; }
.official-alert {
  border-color: #efc0bc;
  background: #fff0ef;
  border-left: 5px solid var(--bad);
}
.official-alert h2 { color: var(--bad); }
.limit-panel .limit-value {
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
}
.limit-panel .limit-source {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}
.fuel-status-main span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1;
  white-space: normal;
}
.brand span { display: block; }
.brand span:first-child { font-weight: 900; letter-spacing: .08em; }
.brand span:last-child { font-size: 13px; font-weight: 700; letter-spacing: 0; }
