/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: #f5f5f3;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
code { font-family: 'DM Mono', monospace; font-size: 0.9em; background: #f0f0f0; padding: 1px 5px; border-radius: 3px; }
pre { font-family: 'DM Mono', monospace; }

/* === Navbar === */
.navbar {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}
.navbar-icon { font-size: 18px; }
.navbar-links { display: flex; gap: 4px; }
.nav-link {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  transition: all 0.15s;
}
.nav-link:hover, .nav-link.active {
  background: #f4f4f4;
  color: #222;
}

/* === Main === */
.main-content {
  flex: 1;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 1.5rem 2rem;
}

/* === Footer === */
.footer {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 12px 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #bbb;
  background: #fff;
}
.footer a { color: #aaa; }
.footer a:hover { color: #555; }

/* === Flash messages === */
.flash-msg {
  background: #FAEEDA;
  color: #854F0B;
  border: 1px solid #FAC775;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 1rem;
}

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.btn-primary:hover { background: #444; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  transition: all 0.15s;
}
.btn-outline:hover { background: #f4f4f4; }

/* === Login === */
.login-page {
  background: #f5f5f3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-icon  { font-size: 2.5rem; margin-bottom: 12px; }
.login-title { font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.login-sub   { font-size: 13px; color: #aaa; margin-bottom: 1.5rem; }
.login-form  { text-align: left; }
.login-back  { display: block; margin-top: 1.5rem; font-size: 13px; color: #aaa; }
.login-back:hover { color: #555; }

.form-group  { margin-bottom: 1rem; }
.form-label  { display: block; font-size: 12px; font-weight: 500; color: #888; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.06em; }
.form-input  {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  background: #f8f8f8;
}
.form-input:focus { border-color: #378ADD; background: #fff; }

/* ================================================================
   WEATHER DASHBOARD COMPONENTS
   ================================================================ */

.wd-root { }

/* Top bar */
.wd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 1.25rem;
}
.wd-station-name {
  font-size: 12px;
  font-weight: 500;
  color: #999;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.wd-timestamp {
  font-size: 12px;
  color: #ccc;
  font-family: 'DM Mono', monospace;
}
.wd-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #1D9E75;
}
.wd-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #1D9E75;
  animation: wd-pulse 2s infinite;
}
@keyframes wd-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* Tabs */
.wd-tabs {
  display: flex;
  gap: 4px;
  background: #ebebeb;
  border-radius: 8px;
  padding: 3px;
}
.wd-tab {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #888;
  transition: all 0.15s;
}
.wd-tab.active, .wd-tab:hover {
  background: #fff;
  color: #222;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
/* Navigation row: tabs + prev/next + datepicker */
.wd-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 10px;
}
.wd-period-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wd-period-label {
  font-size: 13px;
  font-weight: 500;
  color: #444;
  font-family: 'DM Mono', monospace;
  min-width: 200px;
  text-align: center;
}
.wd-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  color: #555;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  user-select: none;
}
.wd-nav-btn:hover { background: #f4f4f4; border-color: rgba(0,0,0,0.2); }
.wd-nav-btn.disabled { color: #ddd; border-color: rgba(0,0,0,0.06); cursor: default; pointer-events: none; }
.wd-datepicker {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #f8f8f8;
  color: #333;
  font-family: 'DM Mono', monospace;
  outline: none;
}
.wd-chart-period {
  color: #ccc;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

/* Metric cards */
.wd-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}
@media (max-width: 1100px) { .wd-metrics { grid-template-columns: repeat(3, 1fr); } }
@media (max-width:  640px) { .wd-metrics { grid-template-columns: repeat(2, 1fr); } }

.wd-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 14px 12px 10px;
}
.wd-card-label {
  font-size: 11px;
  font-weight: 500;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.wd-card-value {
  font-size: 28px;
  font-weight: 300;
  font-family: 'DM Mono', monospace;
  line-height: 1;
  color: #111;
}
.wd-card-unit {
  font-size: 12px;
  color: #bbb;
  font-family: 'DM Mono', monospace;
  margin-top: 2px;
}
.wd-card-minmax {
  font-size: 11px;
  color: #ccc;
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

/* Trends */
.wd-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin-top: 6px;
}
.wd-trend-up     { background: #EAF3DE; color: #3B6D11; }
.wd-trend-down   { background: #FAEEDA; color: #854F0B; }
.wd-trend-stabil { background: #f0f0f0; color: #999; }
.wd-batt-ok  { background: #EAF3DE; color: #3B6D11; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.wd-batt-low { background: #FCEBEB; color: #A32D2D; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }

/* Chart panels */
.wd-panel {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
}
.wd-panel-title {
  font-size: 11px;
  font-weight: 500;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wd-panel-title span { color: #ccc; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }

.wd-charts-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.wd-charts-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 900px) {
  .wd-charts-main { grid-template-columns: 1fr; }
  .wd-charts-row  { grid-template-columns: 1fr; }
}

/* Compare */
.wd-compare-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
}
.wd-compare-src { width: 70px; color: #aaa; }
.wd-compare-val { font-family: 'DM Mono', monospace; font-weight: 500; width: 55px; }
.wd-bar-outer { flex: 1; height: 4px; background: #f0f0f0; border-radius: 2px; }
.wd-bar-inner { height: 100%; border-radius: 2px; }

/* Rain week */
.wd-rain-row { margin: 5px 0; }
.wd-rain-lbl { font-size: 11px; color: #aaa; display: flex; justify-content: space-between; margin-bottom: 3px; }
.wd-rain-bar { height: 5px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.wd-rain-fill { height: 100%; border-radius: 3px; background: #378ADD; }

/* Forecast */
.wd-forecast-item {
  display: flex;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 13px;
  gap: 8px;
}
.wd-forecast-item:last-child { border-bottom: none; }
.wd-forecast-day  { width: 30px; color: #aaa; font-size: 12px; }
.wd-forecast-icon { font-size: 14px; }
.wd-forecast-bar  { flex: 1; height: 3px; background: #f0f0f0; border-radius: 2px; overflow: hidden; }
.wd-forecast-fill { height: 100%; background: linear-gradient(90deg, #378ADD, #E24B4A); border-radius: 2px; }
.wd-forecast-temps { font-family: 'DM Mono', monospace; font-size: 12px; color: #aaa; white-space: nowrap; }
.wd-forecast-high { color: #E24B4A; font-weight: 500; }
.wd-forecast-low  { color: #378ADD; }

/* Stat pills */
.wd-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #999;
  background: #f6f6f6;
  border-radius: 20px;
  padding: 3px 10px;
}
.wd-stat-val { font-family: 'DM Mono', monospace; color: #333; font-weight: 500; }

.wd-footer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wd-divider { border-top: 1px solid rgba(0,0,0,0.06); margin: 10px 0; }
