@font-face {
  font-family: "Vazirmatn";
  src: url("/vendor/fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
       url("/vendor/fonts/Vazirmatn-Variable.woff2") format("woff2 supports variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --origin: #2ecc71;
  --destination: #ff5b5b;
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  padding: 24px 20px 8px;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 1px;
}

.subtitle {
  color: var(--muted);
  margin: 4px 0 0;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.mode-buttons {
  display: flex;
  gap: 8px;
}

.mode-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

#map {
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
}

.route-labels {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-inline-end: 4px;
}

.origin-dot { background: var(--origin); }
.destination-dot { background: var(--destination); }

.primary-btn {
  margin-top: 12px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.primary-btn:hover { opacity: 0.9; }

.save-status {
  margin-inline-start: 10px;
  font-size: 13px;
  color: var(--muted);
}

select, canvas {
  max-width: 100%;
}

select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 320px;
}

#price-chart {
  /* No fixed size here -- Chart.js sets this canvas's inline style
     itself (responsive: true) based on .chart-wrap's height above.
     Fixing the height directly on the canvas instead of the wrapper
     was the bug: as a flex item, the canvas's own box fed back into
     its parent's size, which Chart.js then re-measured, growing the
     chart every tick. display:block avoids the few extra px of
     inline-baseline gap under the canvas. */
  display: block;
}

.no-data-msg {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

#status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}

.status-ok { color: var(--origin); }
.status-bad { color: var(--destination); }

.marker-pin {
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.marker-pin.origin { background: var(--origin); }
.marker-pin.destination { background: var(--destination); }
