:root {
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1a253e;
  --bg-header: #0e1526;
  --border-color: #212e4a;
  --border-subtle: #192338;
  --color-primary: #f97316;
  --color-primary-hover: #ea580c;
  --color-secondary: #0ea5e9;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Nav */
.site-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-badge {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  align-items: center;
}

.nav-menu a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
}

.nav-menu a:hover, .nav-menu a.active {
  color: var(--color-text);
  background: var(--bg-card-hover);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--color-text);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--color-primary);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* Cards & Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-5 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Wettervorhersage Band */
.forecast-scroll-container {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-top: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) rgba(255, 255, 255, 0.05);
}

.forecast-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.forecast-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.forecast-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

.forecast-item-card {
  min-width: 110px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.forecast-item-card:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.forecast-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.forecast-icon {
  font-size: 1.5rem;
  margin: 0.25rem 0;
  display: block;
}

.forecast-temp {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
}

.forecast-clouds {
  font-size: 0.72rem;
  color: #38bdf8;
  margin-top: 0.2rem;
}

.forecast-wind {
  font-size: 0.68rem;
  color: var(--color-text-dim);
  margin-top: 0.15rem;
}

/* Sektions-Header – Sachlich und unaufdringlich */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.4rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-counter {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.15rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.card-header-small {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94a3b8;
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reg-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 500;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.card-value {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.card-unit {
  font-size: 1rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 0.25rem;
}

.card-subtext {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.6rem;
  line-height: 1.4;
}

/* Status-Pills für Betriebsmodi */
.status-pill-active {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill-inactive {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Puffer Visualisierung */
.puffer-container {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

/* Speicherbehälter mit stufenlosem thermischem Farbverlauf */
.thermal-tank {
  width: 145px;
  height: 240px;
  border: 3px solid #3b4e78;
  border-radius: 44px / 22px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.7), 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem 0.4rem;
  transition: background 0.8s ease;
}

.thermal-tank::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.tank-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 2;
  text-align: center;
}

.tank-marker-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2px;
  white-space: nowrap;
}

.tank-marker-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  line-height: 1.1;
  white-space: nowrap;
}

/* Fallback / Legacy */
.puffer-tank {
  width: 140px;
  height: 240px;
  border: 3px solid #3b4e78;
  border-radius: 40px / 20px;
  position: relative;
  background: #0f172a;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}

/* Form Styles */
.form-card {
  max-width: 440px;
  margin: 3rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Alerts */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--color-success); color: #34d399; }
.alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--color-danger); color: #f87171; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--color-warning); color: #fbbf24; }

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-card-hover);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  font-size: 0.85rem;
  color: var(--color-text-dim);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Pulse status */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-success);
  margin-right: 6px;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@media (max-width: 768px) {
  .nav-container { flex-direction: column; align-items: flex-start; }
  .puffer-container { flex-direction: column; }
  .nav-menu { flex-wrap: wrap; }
}

/* Interaktive Kacheln – Sachliches Leitstand-Design */
.card-clickable {
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.card-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  background-color: #162036;
}
.card-clickable:active {
  transform: translateY(0);
}

/* Modal Overlay */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.modal-icon-badge {
  font-size: 1.4rem;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.modal-cur-badge {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Filter Bar */
.modal-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.3rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
}

/* Custom Filter Box */
.custom-filter-panel {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.custom-filter-two-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}

.filter-col-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-col-start {
  border-left: 3px solid #06b6d4;
}

.filter-col-end {
  border-left: 3px solid #f59e0b;
}

.filter-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.filter-col-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text);
}

.dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot-start { background: #06b6d4; box-shadow: 0 0 8px #06b6d4; }
.dot-end { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

.time-display-pill {
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
}
.pill-start { color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }
.pill-end { color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

/* --- Interaktiver Kalender --- */
.cal-wrapper {
  background: rgba(11, 15, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.65rem;
}

.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0 0.2rem;
}

.cal-month-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.btn-cal-nav {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.15s ease;
}
.btn-cal-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-text-dim);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day-cell {
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.cal-day-cell:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cal-day-cell.other-month {
  color: #475569;
  opacity: 0.4;
  cursor: default;
}

.cal-day-cell.is-today {
  border: 1px solid rgba(56, 189, 248, 0.5);
  font-weight: 700;
}

.cal-day-cell.selected-start {
  background: #0891b2 !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.cal-day-cell.selected-end {
  background: #d97706 !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* --- Uhrzeit als Rad (Time Wheel) --- */
.time-wheel-card {
  background: rgba(11, 15, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.time-wheel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.time-wheel-val-text {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
}
.font-cyan { color: #22d3ee; }
.font-amber { color: #fbbf24; }

.time-wheel-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.2rem 0;
}

.wheel-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.btn-wheel-step {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-muted);
  width: 32px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-wheel-step:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.wheel-drum-viewport {
  position: relative;
  width: 64px;
  height: 90px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.wheel-drum {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 30px;
  padding-bottom: 30px;
  box-sizing: border-box;
}
.wheel-drum::-webkit-scrollbar {
  display: none;
}

.wheel-item {
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #64748b;
  scroll-snap-align: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, transform 0.15s;
}

.wheel-item.active {
  color: #fff;
  transform: scale(1.15);
}

.wheel-glass-lens {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 30px;
  border-top: 1px solid rgba(56, 189, 248, 0.4);
  border-bottom: 1px solid rgba(56, 189, 248, 0.4);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0.03) 100%);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

.wheel-colon {
  font-size: 1.5rem;
  font-weight: 800;
  color: #94a3b8;
  margin-top: -12px;
}

.wheel-label {
  font-size: 0.65rem;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Touch & Feinschieber */
.time-range-slider {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 4px;
  appearance: none;
  outline: none;
  cursor: pointer;
  margin-top: 0.2rem;
}
.time-range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}
.time-range-slider.slider-cyan::-webkit-slider-thumb {
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
}
.time-range-slider.slider-amber::-webkit-slider-thumb {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}
.time-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.custom-filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-presets {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-preset:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Stats Grid in Modal */
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.modal-stat-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.stat-val {
  font-size: 1.15rem;
  font-weight: 800;
}

/* Chart Canvas */
.modal-chart-wrapper {
  position: relative;
  background: #0b0f17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#modalHistoryChart {
  width: 100%;
  height: 320px;
  display: block;
}

.chart-loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 23, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  z-index: 10;
  border-radius: 14px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.chart-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #fff;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -120%);
  white-space: nowrap;
}
