.dashboard {
  width: 100%;
  /* max-width: 1900px; */ 
  max-width: 795px; 
  margin: 0 auto;
}

.time-range-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.time-range-nav button {
  padding: 0.5rem 1.5rem;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;
}

.time-range-nav button:hover {
  background: #f5f5f5;
  border-color: #0066cc;
}

.time-range-nav button.active {
  background: #0066cc;
  border-color: #0066cc;
  color: white;
}

.time-range-label {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.current-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem; 
}

.value-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.value-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

.value-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

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

.chart-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chart-container {
  background: white;
  padding: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 1rem;
  background: #e0e0e0;
  padding: 0.5rem;
  border-radius: 4px;
  margin: -0.5rem -0.5rem 0.5rem -0.5rem;
}

.chart-container h3 .unit {
  font-weight: normal;
  color: #666;
  font-size: 0.9rem;
}

.current-value {
  text-align: left;
  font-size: 0.9rem;
  color: #0066cc;
  font-weight: 600;
}

.chart-wrapper {
  width: 100%;
  aspect-ratio: 2 / 1;
  position: relative;
}

.chart-stats {
/*  margin-top: 0.5rem; */
  text-align: center;
  font-size: 0.7rem;
  color: #666;
  font-weight: 500;
  background: #e0e0e0;
  padding: 0.5rem;
  border-radius: 4px;
  margin: 0.2rem -0.5rem -0.5rem -0.5rem;
}

.bar-trend {
  font-size: 0.9em;
  cursor: help;
}

.dashboard-footer {
/*  margin-top: 2rem;
*/  padding-top: 1rem;
}

.footer-divider {
  border: none;
  border-top: 1px solid #ccc;
  margin: 0 0 0.5rem 0;
}

.footer-credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
}

.footer-left {
  text-align: left;
}

.footer-right {
  text-align: right;
}

.footer-sponsor {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

.footer-sponsor a {
  color: #0066cc;
  text-decoration: none;
}

.footer-sponsor a:hover {
  text-decoration: underline;
}

.version-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.anleitung-btn {
  background: none;
  border: 1px solid #0066cc;
  border-radius: 6px;
  color: #0066cc;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.2rem 0.75rem;
  transition: background 0.15s, color 0.15s;
}

.anleitung-btn:hover {
  background: #0066cc;
  color: #fff;
}

.version-short {
  display: none;
}

.version-full {
  display: inline;
  color: #666;
}

.time-range-short {
  display: none;
}

.time-range-full {
  display: inline;
}

/* Responsive Design für schmale Bildschirme (Smartphones) */
@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
  
  .current-values {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard {
    padding: 0 0.5rem;
  }
  
  .time-range-nav button {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }
  
  .time-range-short {
    display: inline;
  }
  
  .time-range-full {
    display: none;
  }
  
  .time-range-label {
    font-size: 1rem;
  }
  
  .version-short {
    display: inline;
    color: #666;
  }
  
  .version-full {
    display: none;
  }
}

/* Anleitung Modal */
.anleitung-modal {
  background: white;
  border-radius: 12px;
  width: 90vw;
  max-width: 900px;
  height: 85vh;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.anleitung-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.9rem;
  background: #1a3a5c;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.anleitung-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  padding: 0 0.2rem;
}

.anleitung-modal-close:hover {
  color: #ddd;
}

.anleitung-frame {
  width: 100%;
  flex: 1;
  border: none;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 1.5rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
}

.form-group input[type="datetime-local"] {
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-group input[type="datetime-local"]:focus {
  outline: none;
  border-color: #0066cc;
}

.error-message {
  padding: 0.75rem;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 6px;
  color: #c00;
  font-size: 0.9rem;
}

.modal-info {
  padding: 0.75rem;
  background: #f0f8ff;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #555;
}

.modal-info p {
  margin: 0.25rem 0;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-buttons button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel {
  background: #f5f5f5;
  color: #666;
}

.btn-cancel:hover {
  background: #e0e0e0;
}

.btn-apply {
  background: #0066cc;
  color: white;
}

.btn-apply:hover {
  background: #0052a3;
}

@media (max-width: 768px) {
  .modal-content {
    padding: 1.5rem;
  }
  
  .modal-content h2 {
    font-size: 1.25rem;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
}

/* ── Tabelle & Druck ──────────────────────────────────────── */

.table-toggle-btn {
  padding: 0.5rem 1.5rem;
  background: white;
  border: 2px solid #0066cc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #0066cc;
  transition: all 0.2s ease;
}

.table-toggle-btn:hover {
  background: #e6f0fa;
}

.table-toggle-btn.active {
  background: #0066cc;
  border-color: #0066cc;
  color: white;
}

.table-view {
  margin-bottom: 1.5rem;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.btn-print {
  padding: 0.45rem 1.2rem;
  background: white;
  border: 2px solid #555;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;
}

.btn-print:hover {
  background: #f0f0f0;
}

.weather-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.weather-table th,
.weather-table td {
  border-left: 1px solid rgba(255,255,255,0.3);
  border-right: 1px solid rgba(255,255,255,0.3);
}

.weather-table td {
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
}

.weather-table th {
  background: #0066cc;
  color: white;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: top;
}

.weather-table thead tr:nth-child(2) th {
  background: #3388dd;
  font-weight: 400;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
}

.weather-table thead tr:first-child th:first-child {
  text-align: left;
}

.weather-table td {
  padding: 0.45rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid #eee;
  color: #333;
}

.weather-table td:first-child {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}

.weather-table tbody tr:nth-child(even) {
  background: #f5f8fd;
}

.weather-table tbody tr:hover {
  background: #e6f0fa;
}

/* Drucken */
@media print {
  .no-print,
  .time-range-nav,
  .time-range-label,
  .dashboard-footer,
  .modal-overlay {
    display: none !important;
  }

  body {
    background: white;
  }

  .dashboard {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .weather-table {
    box-shadow: none;
    font-size: 0.8rem;
  }

  .weather-table th {
    background: #333 !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .weather-table tbody tr:nth-child(even) {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
