/*
 * ============================================================================
 * TRICOMA ENERGY - Bootstrap 5.3 Theme Override
 * ============================================================================
 * 
 * Dieses CSS wird NACH Bootstrap 5.3 eingebunden und �berschreibt/erweitert
 * die Standard-Bootstrap-Styles f�r das tricoma energy Design.
 * 
 * Verwendung:
 * <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
 * <link href="tricoma-energy-theme.css" rel="stylesheet">
 * 
 * ============================================================================
 */

/* ============================================================================
   CSS CUSTOM PROPERTIES (Override Bootstrap)
   ============================================================================ */

:root,
[data-bs-theme="light"] {
  /* Brand Colors */
  --te-primary: #0086dd; /*#2563eb;*/
  --te-primary-hover: #1d4ed8;
  --te-primary-subtle: #dbeafe;
  
  /* Neutral Palette (Slate) */
  --te-gray-50: #f8fafc;
  --te-gray-100: #f1f5f9;
  --te-gray-200: #e2e8f0;
  --te-gray-300: #cbd5e1;
  --te-gray-400: #94a3b8;
  --te-gray-500: #64748b;
  --te-gray-600: #475569;
  --te-gray-700: #334155;
  --te-gray-800: #1e293b;
  --te-gray-900: #0f172a;
  
  /* Energy Colors */
  --te-solar: #f59e0b;
  --te-solar-light: #fef3c7;
  --te-battery: #10b981;
  --te-battery-light: #d1fae5;
  --te-grid-import: #ef4444;
  --te-grid-export: #22c55e;
  --te-consumption: #8b5cf6;
  
  /* Semantic */
  --te-body-bg: var(--te-gray-50);
  --te-card-bg: #ffffff;
  --te-card-border: var(--te-gray-200);
  --te-text-primary: var(--te-gray-900);
  --te-text-secondary: var(--te-gray-600);
  --te-text-muted: var(--te-gray-500);
  
  /* Shadows */
  --te-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --te-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --te-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --te-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Border Radius */
  --te-radius-sm: 6px;
  --te-radius: 8px;
  --te-radius-lg: 12px;
  --te-radius-xl: 16px;
  
  /* Override Bootstrap Variables */
  --bs-body-bg: var(--te-body-bg);
  --bs-body-color: var(--te-text-primary);
  --bs-border-color: var(--te-gray-200);
  --bs-border-radius: var(--te-radius);
  --bs-border-radius-sm: var(--te-radius-sm);
  --bs-border-radius-lg: var(--te-radius-lg);
  --bs-primary: var(--te-primary);
  --bs-primary-rgb: 37, 99, 235;
}

/* Dark Mode */
[data-bs-theme="dark"] {
  --te-body-bg: #0f172a;
  --te-card-bg: #1e293b;
  --te-card-border: #334155;
  --te-text-primary: #f1f5f9;
  --te-text-secondary: #94a3b8;
  --te-text-muted: #64748b;
  
  --te-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --te-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --te-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --te-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  
  --bs-body-bg: var(--te-body-bg);
  --bs-body-color: var(--te-text-primary);
  --bs-border-color: var(--te-card-border);
  
  --te-solar-light: rgba(245, 158, 11, 0.15);
  --te-battery-light: rgba(16, 185, 129, 0.15);
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   HEADER / NAVBAR
   ============================================================================ */

.navbar-te {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--te-gray-200);
}

[data-bs-theme="dark"] .navbar-te {
  background: rgba(15, 23, 42, 0.9) !important;
  border-bottom-color: var(--te-card-border);
}

.navbar-te .navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
}

.navbar-te .nav-link {
  color: var(--te-text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  margin: 0.25rem;
  border-radius: var(--te-radius);
  transition: all 0.15s ease;
}

.navbar-te .nav-link:hover {
  color: var(--te-text-primary);
  background: var(--te-gray-100);
}

[data-bs-theme="dark"] .navbar-te .nav-link:hover {
  background: var(--te-gray-800);
}

.navbar-te .nav-link.active {
  color: var(--te-primary);
  background: var(--te-primary-subtle);
}

/* Badge f�r BETA */
.badge-beta {
  background: var(--te-solar);
  color: var(--te-gray-900);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--te-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* ============================================================================
   SUBNAV
   ============================================================================ */

.subnav-te {
  background: var(--te-primary);
  padding: 0;
}

.subnav-te .nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: var(--te-radius);
  margin: 0.25rem;
}

.subnav-te .nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.subnav-te .nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.2);
}

/* Wizard Button */
.btn-wizard {
  font-weight: 600;
  border: none;
  border-radius: 50rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-wizard:hover {
  
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
  background: var(--te-card-bg);
  border: 1px solid var(--te-card-border);
  border-radius: var(--te-radius-xl);
  box-shadow: var(--te-shadow-sm);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--te-shadow-md);
}

/* Active Card */
.card.active,
.card.is-active {
  border-color: var(--te-primary);
  background: linear-gradient(0deg, var(--te-primary-subtle) 0%, var(--te-card-bg) 60%);
  box-shadow: var(--te-shadow-md);
}

.card.active .card-header,
.card.is-active .card-header {
  border-bottom-color: var(--te-primary);
}

.card.active .card-title,
.card.is-active .card-title {
  color: var(--te-primary);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--te-card-border);
  padding: 1.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--te-text-primary);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--te-text-muted);
}

.card-body {
  padding: 1.25rem;
}

/* Stat Cards */
.card-stat {
  border-radius: var(--te-radius-xl);
}

.card-stat .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--te-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.card-stat .stat-icon.solar { background: var(--te-solar-light); }
.card-stat .stat-icon.battery { background: var(--te-battery-light); }
.card-stat .stat-icon.grid { background: rgba(239, 68, 68, 0.1); }
.card-stat .stat-icon.consumption { background: rgba(139, 92, 246, 0.1); }

.card-stat .stat-label {
  font-size: 0.8125rem;
  color: var(--te-text-secondary);
  margin-bottom: 0.25rem;
}

.card-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--te-text-primary);
  line-height: 1.2;
}

.card-stat .stat-meta {
  font-size: 0.75rem;
  color: var(--te-text-muted);
  margin-top: 0.25rem;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-te {
  --bs-table-bg: transparent;
  font-size: 0.875rem;
}

.table-te thead th {
  background: var(--te-gray-50);
  color: var(--te-text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--te-card-border);
  white-space: nowrap;
}

.table-te thead th:first-child {
	border-top-left-radius: var(--te-radius-xl);
}

.table-te thead th:last-child {
	border-top-right-radius: var(--te-radius-xl);
}

[data-bs-theme="dark"] .table-te thead th {
  background: var(--te-gray-800);
}

.table-te tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--te-card-border);
  color: var(--te-text-primary);
}

.table-te tbody tr:last-child td {
  border-bottom: none;
}

.table-te tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--te-radius-xl);
}

.table-te tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--te-radius-xl);
}

.table-te tbody tr:hover {
  background: var(--te-gray-50);
}

[data-bs-theme="dark"] .table-te tbody tr:hover {
  background: var(--te-gray-800);
}

/* Table Cell Variants */
.table-te .cell-mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
}

.table-te .cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-te .cell-actions {
  text-align: right;
  white-space: nowrap;
}

/* Clickable Rows */
.table-te.table-clickable tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  font-weight: 500;
  border-radius: var(--te-radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--te-radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--te-radius-lg);
}

.btn-primary {
  background: var(--te-primary);
  border-color: var(--te-primary);
}

.btn-primary:hover {
  background: var(--te-primary-hover);
  border-color: var(--te-primary-hover);
}

.btn-outline-secondary {
  color: var(--te-text-secondary);
  border-color: var(--te-gray-300);
}

.btn-outline-secondary:hover {
  background: var(--te-gray-100);
  border-color: var(--te-gray-400);
  color: var(--te-text-primary);
}

[data-bs-theme="dark"] .btn-outline-secondary {
  border-color: var(--te-gray-600);
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background: var(--te-gray-700);
  border-color: var(--te-gray-500);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--te-text-secondary);
}

.btn-ghost:hover {
  background: var(--te-gray-100);
  color: var(--te-text-primary);
}

[data-bs-theme="dark"] .btn-ghost:hover {
  background: var(--te-gray-700);
}

/* Icon Button */
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--te-text-primary);
  margin-bottom: 0.5rem;
}

.form-control,.Feld,
.form-select,input[type="text"], input[type="email"], input[type="number"], input[type="tel"], input[type="password"], input[type="url"], input[type="search"], textarea, select {
  border: 1px solid var(--te-gray-300);
  border-radius: var(--te-radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  color: var(--te-text-primary);
  background-color: var(--te-card-bg);
  transition: all 0.15s ease;
}

.Feld:hover,
.form-control:hover,
.form-select:hover {
  border-color: var(--te-gray-400);
}

.Feld:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--te-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  border-color: var(--te-gray-600);
  background-color: var(--te-gray-800);
}

.form-control::placeholder {
  color: var(--te-text-muted);
}

/* Form Control Sizes */
.form-control-sm {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.8125rem !important;
}

.form-control-lg {
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border-radius: var(--te-radius-lg);
}

/* Input Group */
.input-group-text {
  background: var(--te-gray-100);
  border-color: var(--te-gray-300);
  color: var(--te-text-secondary);
  font-size: 0.875rem;
}

[data-bs-theme="dark"] .input-group-text {
  background: var(--te-gray-700);
  border-color: var(--te-gray-600);
}

/* Checkbox & Radio */
.form-check-input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  border-color: var(--te-gray-400);
}

.form-check-input:checked {
  background-color: var(--te-primary);
  border-color: var(--te-primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-check-label {
  font-size: 0.9375rem;
  color: var(--te-text-primary);
}

/* Switch */
.form-switch .form-check-input {
  width: 2.5rem;
  height: 1.375rem;
  border-radius: 50rem;
}

/* Form Text/Help */
.form-text {
  font-size: 0.8125rem;
  color: var(--te-text-muted);
}

/* Validation States */
.is-invalid {
  border-color: var(--te-grid-import) !important;
}

.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.invalid-feedback {
  font-size: 0.8125rem;
  color: var(--te-grid-import);
}

.is-valid {
  border-color: var(--te-battery) !important;
}

.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 50rem;
}

.badge-te-success {
  background: var(--te-battery-light);
  color: #065f46;
}

.badge-te-warning {
  background: var(--te-solar-light);
  color: #92400e;
}

.badge-te-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
}

.badge-te-info {
  background: var(--te-primary-subtle);
  color: var(--te-primary);
}

.badge-te-neutral {
  background: var(--te-gray-100);
  color: var(--te-text-secondary);
}

[data-bs-theme="dark"] .badge-te-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
[data-bs-theme="dark"] .badge-te-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-bs-theme="dark"] .badge-te-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
[data-bs-theme="dark"] .badge-te-neutral { background: var(--te-gray-700); color: var(--te-text-secondary); }

/* Status Dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online { background: var(--te-battery); }
.status-dot.offline { background: var(--te-gray-400); }
.status-dot.warning { background: var(--te-solar); }
.status-dot.error { background: var(--te-grid-import); }

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
  border-radius: var(--te-radius-lg);
  border: 1px solid;
  font-size: 0.9375rem;
}

.alert-te-info {
  background: var(--te-primary-subtle);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1e40af;
}

.alert-te-success {
  background: var(--te-battery-light);
  border-color: rgba(16, 185, 129, 0.3);
  color: #065f46;
}

.alert-te-warning {
  background: var(--te-solar-light);
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
}

.alert-te-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #991b1b;
}

/* ============================================================================
   PROGRESS BARS
   ============================================================================ */

.progress {
  height: 0.75rem;
  border-radius: 50rem;
  background: var(--te-gray-200);
}

[data-bs-theme="dark"] .progress {
  background: var(--te-gray-700);
}

.progress-bar {
  border-radius: 50rem;
}

.progress-bar-solar {
  background: linear-gradient(90deg, var(--te-solar), #fbbf24);
}

.progress-bar-battery {
  background: linear-gradient(90deg, #059669, var(--te-battery));
}

/* Energy Bar (Bidirectional) */
.energy-bar {
  position: relative;
  height: 48px;
  background: var(--te-gray-100);
  border-radius: var(--te-radius-lg);
  overflow: hidden;
}

[data-bs-theme="dark"] .energy-bar {
  background: var(--te-gray-800);
}

.energy-bar-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--te-gray-400);
  z-index: 2;
}

.energy-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
}

.energy-bar-fill.import {
  left: 50%;
  background: linear-gradient(90deg, transparent, var(--te-grid-import));
  justify-content: flex-end;
  border-radius: 0 var(--te-radius) var(--te-radius) 0;
}

.energy-bar-fill.export {
  right: 50%;
  background: linear-gradient(270deg, transparent, var(--te-grid-export));
  justify-content: flex-start;
  border-radius: var(--te-radius) 0 0 var(--te-radius);
}

/* ============================================================================
   PAGE HEADER
   ============================================================================ */

.page-header-te {
  padding: 2rem 0 1.5rem;
  text-align: center;
}

.page-header-te .page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--te-text-primary);
  margin-bottom: 0.5rem;
}

.page-header-te .page-subtitle {
  font-size: 1rem;
  color: var(--te-text-secondary);
}

/* Section Headers */
.section-header-te {
  margin-bottom: 1.5rem;
}

.section-header-te .section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--te-text-primary);
  margin-bottom: 0.25rem;
}

.section-header-te .section-subtitle {
  font-size: 0.875rem;
  color: var(--te-text-secondary);
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: var(--te-gray-400);
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--te-text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.9375rem;
  color: var(--te-text-secondary);
  max-width: 320px;
  margin: 0 auto;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer-te {
  background: var(--te-gray-900);
  color: var(--te-gray-400);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-te .footer-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
}

.footer-te a {
  color: var(--te-gray-400);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-te a:hover {
  color: white;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

/* Text Colors */
.text-te-primary { color: var(--te-text-primary) !important; }
.text-te-secondary { color: var(--te-text-secondary) !important; }
.text-te-muted { color: var(--te-text-muted) !important; }
.text-te-solar { color: var(--te-solar) !important; }
.text-te-battery { color: var(--te-battery) !important; }
.text-te-danger { color: var(--te-grid-import) !important; }
.text-te-success { color: var(--te-grid-export) !important; }

/* Background Colors */
.bg-te-page { background-color: var(--te-body-bg) !important; }
.bg-te-card { background-color: var(--te-card-bg) !important; }
.bg-te-solar-light { background-color: var(--te-solar-light) !important; }
.bg-te-battery-light { background-color: var(--te-battery-light) !important; }

/* Shadows */
.shadow-te-sm { box-shadow: var(--te-shadow-sm) !important; }
.shadow-te { box-shadow: var(--te-shadow) !important; }
.shadow-te-md { box-shadow: var(--te-shadow-md) !important; }
.shadow-te-lg { box-shadow: var(--te-shadow-lg) !important; }

/* Border Radius */
.rounded-te { border-radius: var(--te-radius) !important; }
.rounded-te-lg { border-radius: var(--te-radius-lg) !important; }
.rounded-te-xl { border-radius: var(--te-radius-xl) !important; }

/* Live Indicator */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--te-text-muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--te-battery);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Timestamp */
.timestamp {
  font-size: 0.75rem;
  color: var(--te-text-muted);
}

/* ============================================================================
   SUBNAV COLLAPSIBLE (Mobile Solution)
   ============================================================================ */

.subnav-te {
  background: var(--te-primary);
  padding: 0;
}

/* Desktop: Horizontal Tabs */
.subnav-te .subnav-desktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /*padding: 0 1rem;*/
}

.subnav-te .subnav-desktop .nav {
  display: flex;
  gap: 0.25rem;
}

.subnav-te .subnav-desktop .nav-link {
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  margin: 1rem;
}

.subnav-te .subnav-desktop .nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.subnav-te .subnav-desktop .nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.2);
}

/* Mobile: Collapsible Panel */
.subnav-te .subnav-mobile {
  display: none;
}

.subnav-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.subnav-collapse-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 500;
  font-size: 0.9375rem;
}

.subnav-collapse-current i {
  font-size: 1.125rem;
  opacity: 0.8;
}

.subnav-collapse-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subnav-collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.subnav-collapse-toggle i {
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}

.subnav-collapse-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.subnav-collapse-body {
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.subnav-collapse-body .nav {
  padding: 0.5rem;
  flex-direction: column;
  gap: 0.25rem;
}

.subnav-collapse-body .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.subnav-collapse-body .nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.subnav-collapse-body .nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.2);
}

.subnav-collapse-body .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  opacity: 0.7;
}

.subnav-collapse-body .nav-link.active i {
  opacity: 1;
}

/* Subnav Actions (Wizard Button etc.) */
.subnav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subnav-actions-mobile {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.preiseinstellung_table {
	margin-left: 10px;
}

.preiseinstellung_table table td, .preiseinstellung_table table th {
	padding: 4px;
	width: auto;
}

.preiseinstellung_table input, .preiseinstellung_table select {
	padding: 4px 8px;
	margin-bottom: 8px;
}

.energy-bar {
      position: relative;
      height: 48px;
      background: var(--te-gray-100);
      border-radius: var(--te-radius-lg);
      overflow: hidden;
    }
    
    [data-bs-theme="dark"] .energy-bar {
      background: var(--te-gray-800);
    }
    
    .energy-bar-center {
      position: absolute;
      left: 50%;
      top: 0;
      bottom: 0;
      width: 2px;
      background: var(--te-gray-400);
      z-index: 2;
    }
    
    .energy-bar-track {
      display: flex;
      height: 100%;
    }
    
    .energy-bar-left,
    .energy-bar-right {
      width: 50%;
      display: flex;
      align-items: center;
    }
    
    .energy-bar-left {
      justify-content: flex-end;
    }
    
    .energy-bar-fill {
      height: 100%;
      display: flex;
      align-items: center;
      padding: 0 0.75rem;
      font-size: 0.875rem;
      font-weight: 600;
      color: white;
    }
    
    .energy-bar-fill.export {
      background: linear-gradient(270deg, var(--te-grid-export), transparent);
      border-radius: var(--te-radius) 0 0 var(--te-radius);
      justify-content: flex-start;
    }
    
    .energy-bar-fill.import {
      background: linear-gradient(90deg, var(--te-grid-import), transparent);
      border-radius: 0 var(--te-radius) var(--te-radius) 0;
      justify-content: flex-end;
    }
    
    .energy-bar-scale {
      display: flex;
      justify-content: space-between;
      font-size: 0.6875rem;
      color: var(--te-text-muted);
      margin-top: 0.25rem;
      padding: 0 0.25rem;
    }
    
    /* Battery Icon */
    .battery-visual {
      position: relative;
      width: 80px;
      height: 40px;
      background: var(--te-gray-100);
      border: 2px solid var(--te-gray-400);
      border-radius: var(--te-radius);
    }
    
    [data-bs-theme="dark"] .battery-visual {
      background: var(--te-gray-800);
      border-color: var(--te-gray-600);
    }
    
    .battery-visual::after {
      content: '';
      position: absolute;
      right: -6px;
      top: 50%;
      transform: translateY(-50%);
      width: 4px;
      height: 16px;
      background: var(--te-gray-400);
      border-radius: 0 2px 2px 0;
    }
    
    [data-bs-theme="dark"] .battery-visual::after {
      background: var(--te-gray-600);
    }
    
    .battery-fill {
      position: absolute;
      left: 2px;
      top: 2px;
      bottom: 2px;
      background: var(--te-battery);
      border-radius: calc(var(--te-radius-sm) - 2px);
      transition: width 0.3s ease;
    }
    
    .battery-fill.low { background: var(--te-grid-import); }
    .battery-fill.medium { background: var(--te-solar); }
    
    /* Weather Widget */
    .weather-forecast {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 0.5rem;
      text-align: center;
    }
    
    .weather-hour {
      padding: 0.5rem;
      border-radius: var(--te-radius);
      background: var(--te-gray-50);
    }
    
    [data-bs-theme="dark"] .weather-hour {
      background: var(--te-gray-800);
    }

.preise_bedingungen_ausgabe {
	
	font-size: 14px;
/*    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;*/
}

.preise_bedingungen_ausgabe hr {
	border-color: #ccc;
	padding: 0;
	margin: 0;
}


 /* ========================================================================
       SETUP PAGE LAYOUT
       ======================================================================== */
    
    .setup-hero {
      background: linear-gradient(135deg, var(--te-primary) 0%, #1e40af 100%);
      color: white;
      padding: 3rem;
      margin-bottom: 2rem;
	  border-radius: 16px;
    }
    
    .setup-hero-content {
      max-width: 600px;
    }
    
    .setup-hero-title {
      font-size: 2rem;
      font-weight: 800;
      margin-bottom: 0.5rem;
      letter-spacing: -0.025em;
    }
    
    .setup-hero-subtitle {
      font-size: 1.125rem;
      opacity: 0.9;
      margin-bottom: 1.5rem;
    }
    
    /* Progress Overview */
    .setup-progress-bar {
      height: 8px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 4px;
      overflow: hidden;
      margin-bottom: 0.75rem;
    }
    
    .setup-progress-fill {
      height: 100%;
      background: white;
      border-radius: 4px;
      transition: width 0.5s ease;
    }
    
    .setup-progress-stats {
      display: flex;
      justify-content: space-between;
      font-size: 0.875rem;
      opacity: 0.9;
    }
    
    /* ========================================================================
       SETUP CARDS
       ======================================================================== */
    
    .setup-card {
      background: var(--te-card-bg);
      border: 1px solid var(--te-card-border);
      border-radius: var(--te-radius-xl);
      overflow: hidden;
      transition: all 0.2s ease;
      height: 100%;
      display: flex;
      flex-direction: column;
    }
    
    .setup-card:hover {
      box-shadow: var(--te-shadow-lg);
      transform: translateY(-2px);
    }
    
    .setup-card-link {
      text-decoration: none;
      color: inherit;
      display: flex;
      flex-direction: column;
      height: 100%;
    }
    
    .setup-card-link:hover {
      color: inherit;
    }
    
    /* Card Header */
    .setup-card-header {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      padding: 1.25rem 1.25rem 0;
    }
    
    .setup-card-icon {
      width: 64px;
      height: 64px;
      border-radius: var(--te-radius-lg);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      flex-shrink: 0;
    }
    
    .setup-card-icon.solar { background: var(--te-solar-light); }
    .setup-card-icon.battery { background: var(--te-battery-light); }
    .setup-card-icon.wallbox { background: var(--te-primary-subtle); }
    .setup-card-icon.smarthome { background: rgba(139, 92, 246, 0.1); }
    .setup-card-icon.location { background: rgba(236, 72, 153, 0.1); }
   /* .setup-card-icon.account { background: var(--te-gray-100); }
    
    [data-bs-theme="dark"] .setup-card-icon.account {
      background: var(--te-gray-800);
    }*/
    
    .setup-card-header-content {
      flex: 1;
      min-width: 0;
    }
    
    .setup-card-step {
      font-size: 0.6875rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--te-text-muted);
      margin-bottom: 0.25rem;
    }
    
    .setup-card-title {
      font-size: 1.125rem;
      font-weight: 700;
      color: var(--te-text-primary);
      margin-bottom: 0.25rem;
    }
    
    .setup-card-duration {
      font-size: 0.75rem;
      color: var(--te-text-muted);
      display: flex;
      align-items: center;
      gap: 0.25rem;
    }
    
    /* Status Badge */
    .setup-card-status {
      padding: 0.375rem 0.75rem;
      border-radius: 50rem;
      font-size: 0.75rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 0.375rem;
      flex-shrink: 0;
    }
    
    .setup-card-status.completed {
      background: var(--te-battery-light);
      color: #065f46;
    }
    
    [data-bs-theme="dark"] .setup-card-status.completed {
      background: rgba(16, 185, 129, 0.2);
      color: #34d399;
    }
    
    .setup-card-status.in-progress {
      background: var(--te-primary-subtle);
      color: var(--te-primary);
    }
    
    .setup-card-status.pending {
      background: var(--te-gray-100);
      color: var(--te-text-muted);
    }
    
    [data-bs-theme="dark"] .setup-card-status.pending {
      background: var(--te-gray-800);
    }
    
    .setup-card-status.optional {
      background: var(--te-solar-light);
      color: #92400e;
    }
    
    [data-bs-theme="dark"] .setup-card-status.optional {
      background: rgba(245, 158, 11, 0.2);
      color: #fbbf24;
    }
    
    /* Card Body */
    .setup-card-body {
      padding: 1rem 1.25rem;
      flex: 1;
    }
    
    .setup-card-description {
      font-size: 0.875rem;
      color: var(--te-text-secondary);
      line-height: 1.5;
      margin-bottom: 1rem;
    }
    
    /* Data Summary (f�r abgeschlossene Schritte) */
    .setup-card-data {
      background: var(--te-gray-50);
      border-radius: var(--te-radius);
      padding: 0.875rem;
    }
    
    [data-bs-theme="dark"] .setup-card-data {
      background: var(--te-gray-800);
    }
    
    .setup-card-data-title {
      font-size: 0.6875rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--te-text-muted);
      margin-bottom: 0.5rem;
    }
    
    .setup-card-data-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.5rem;
    }
    
    .setup-card-data-item {
      display: flex;
      flex-direction: column;
    }
    
    .setup-card-data-label {
      font-size: 0.6875rem;
      color: var(--te-text-muted);
    }
    
    .setup-card-data-value {
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--te-text-primary);
    }
    
    /* Requirements (f�r ausstehende Schritte) */
    .setup-card-requirements {
      background: var(--te-solar-light);
      border-radius: var(--te-radius);
      padding: 0.875rem;
    }
    
    [data-bs-theme="dark"] .setup-card-requirements {
      background: rgba(245, 158, 11, 0.1);
    }
    
    .setup-card-requirements-title {
      font-size: 0.75rem;
      font-weight: 600;
      color: #92400e;
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      gap: 0.375rem;
    }
    
    [data-bs-theme="dark"] .setup-card-requirements-title {
      color: var(--te-solar);
    }
    
    .setup-card-requirements-list {
      list-style: none;
      padding: 0;
      margin: 0;
      font-size: 0.8125rem;
      color: #78350f;
    }
    
    [data-bs-theme="dark"] .setup-card-requirements-list {
      color: var(--te-text-secondary);
    }
    
    .setup-card-requirements-list li {
      display: flex;
      align-items: flex-start;
      gap: 0.375rem;
      padding: 0.125rem 0;
    }
    
    .setup-card-requirements-list li i {
      flex-shrink: 0;
      margin-top: 0.125rem;
    }
    
    /* Card Footer */
    .setup-card-footer {
      padding: 1rem 1.25rem;
      border-top: 1px solid var(--te-card-border);
      background: var(--te-gray-50);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    
    [data-bs-theme="dark"] .setup-card-footer {
      background: rgba(0, 0, 0, 0.2);
    }
    
    .setup-card-action {
      font-size: 0.875rem;
      font-weight: 600;
      color: var(--te-primary);
      display: flex;
      align-items: center;
      gap: 0.375rem;
    }
    
    .setup-card-action i {
      transition: transform 0.15s ease;
    }
    
    .setup-card-link:hover .setup-card-action i {
      transform: translateX(4px);
    }
    
    .setup-card-footer-meta {
      font-size: 0.75rem;
      color: var(--te-text-muted);
    }
    
    /* ========================================================================
       COMPLETION BANNER
       ======================================================================== */
    
    .setup-complete-banner {
      background: linear-gradient(135deg, #059669 0%, #10b981 100%);
      color: white;
      border-radius: var(--te-radius-xl);
      padding: 2rem;
      text-align: center;
      margin-bottom: 2rem;
    }
    
    .setup-complete-icon {
      width: 64px;
      height: 64px;
      background: rgba(255, 255, 255, 0.2);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 1rem;
      font-size: 2rem;
    }
    
    .setup-complete-title {
      font-size: 1.5rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
    }
    
    .setup-complete-text {
      opacity: 0.9;
      margin-bottom: 1.5rem;
    }
    
    /* ========================================================================
       NEXT STEP HIGHLIGHT
       ======================================================================== */
    
    .setup-next-step {
      position: relative;
    }
    
    .setup-next-step .setup-card {
      border: 2px solid var(--te-primary);
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    }
    
    .setup-next-step-badge {
      position: absolute;
      top: -12px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--te-primary);
      color: white;
      padding: 0.375rem 1rem;
      border-radius: 50rem;
      font-size: 0.75rem;
      font-weight: 600;
      white-space: nowrap;
      z-index: 10;
    }
    
    /* ========================================================================
       LOCKED STATE
       ======================================================================== */
    
    .setup-card.locked {
      opacity: 0.6;
      pointer-events: none;
    }
    
    .setup-card.locked .setup-card-icon {
      filter: grayscale(100%);
    }
    
    /* ========================================================================
       RESPONSIVE
       ======================================================================== */
    
    @media (max-width: 767.98px) {
      .setup-hero {
        padding: 2rem;
      }
      
      .setup-hero-title {
        font-size: 1.5rem;
      }
      
      .setup-card-data-grid {
        grid-template-columns: 1fr;
      }
    }

/* Wrapper: keine dicke "Pille", sondern schlanker Zeitstrahl */
.tw-price-timeline{
  position: relative;
  width: 100%;
  height: 8px;                 /* schlank wie im Screenshot */
  border-radius: 2px;
  overflow: visible;           /* wichtig: Now-Marker darf oben/unten raus */
  background: rgba(20, 184, 166, .22); /* dezente Basislinie */
  border: 0;                   /* kein Kasten-Look */
}

/* Segmente liegen exakt auf der Linie */
.tw-price-timeline__bar{
  position: absolute;
  inset: 0;
  display: flex;
  gap: 0;                      /* keine L�cken */
  border-radius: 2px;
  overflow: hidden;            /* Segmente sauber rund abgeschnitten */
}

/* Segment-Blocks (werden per inline background gesetzt) */
.tw-price-seg{
  height: 8px;
  flex: 1 1 auto;
  border-radius: 2px;        /* sorgt f�r weiche �berg�nge */
}

/* Past: statt opacity auf jedem Segment -> Overlay (wirkt sauberer) */
.tw-price-timeline__past{
  position: absolute;
  left: 0;
  top: 0;
  height: 8px;
  width: 0%;                   /* wird von dir serverseitig oder JS gesetzt */
  background: rgba(255,255,255,.55);
  border-radius: 2px;
  pointer-events: none;
}

/* Now-Marker: vertikale "Pille" */
.tw-price-timeline__now{
  position: absolute;
  left: 0%;                    /* wird von dir serverseitig oder JS gesetzt */
  top: -5px;                   /* ragt �ber die Linie */
  width: 6px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 2px;

  /* Marker-Farbe (passt zu gr�n/mint UI) */
  /*background: rgb(20, 184, 166);*/
	background: #565656;

  /* wei�er Halo wie im Screenshot */
  box-shadow: 0 0 0 3px rgba(255,255,255,.85);

  pointer-events: none;
}

.tw-price-seg--green{  background: rgb(34,197,94); }
.tw-price-seg--orange{ background: rgb(249,115,22); } 

/* Responsive Breakpoint */
@media (min-width: 768px) {
  .subnav-te .subnav-desktop {
    display: flex;
  }
  
  .subnav-te .subnav-mobile {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  .subnav-te .subnav-desktop {
    display: none;
  }
  
  .subnav-te .subnav-mobile {
    display: block;
  }
	
  .navbar-te .nav-link {
  	margin: 0.25rem;
  }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 991.98px) {
  .navbar-te .navbar-nav {
    padding: 1rem 0;
  }
  
  .navbar-te .nav-link {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 767.98px) {
  .page-header-te .page-title {
    font-size: 1.5rem;
  }
  
  .card-stat .stat-value {
    font-size: 1.25rem;
  }
}