/* ── Base & Resets ──────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
}

body {
  font-family: 'Outfit', sans-serif;
  overflow-y: scroll;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Glassmorphism Components ───────────────────────────────────────────── */

.glass-header {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.glass-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.glass-panel {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
}

/* ── Typography & Elements ──────────────────────────────────────────────── */

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.value {
  font-size: 2.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  margin-top: 0.5rem;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Meter Grid inside Panels ───────────────────────────────────────────── */

.meter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.meter-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.meter-item:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-2px);
}

.meter-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.meter-val {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.meter-unit {
  font-size: 0.65rem;
  font-weight: 500;
  color: #64748b;
}

/* ── Buttons & Inputs ───────────────────────────────────────────────────── */

.badge {
  font-size: 0.65rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-btn {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  color: #64748b;
}
.control-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.action-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0,0,0,0.2) !important;
  color: #64748b !important;
  border-color: transparent !important;
}

.solar-btn {
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.solar-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.ac-btn {
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.ac-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.emerald-btn {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.emerald-btn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
}

.date-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  outline: none;
  font-family: inherit;
}
.date-input:focus {
  border-color: #34d399;
}
/* For Webkit Date input dark mode */
::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.5;
  cursor: pointer;
}

/* ── Charts & Leaflet Map ───────────────────────────────────────────────── */

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

/* Override Leaflet styles to match dark theme */
.leaflet-container {
  background: #0b0f19;
  font-family: 'Outfit', sans-serif;
}
.leaflet-bar a {
  background-color: rgba(15, 23, 42, 0.8) !important;
  color: #94a3b8 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.leaflet-bar a:hover {
  background-color: rgba(30, 41, 59, 0.9) !important;
  color: #fff !important;
}
.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 0.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.9);
}

/* Table Hover */
tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
