/* ====== ADITES PV-Direktvermarktung ====== */

:root {
  --brand-primary: #0E2233;
  --brand-accent: #00A878;
  --brand-accent-light: rgba(0, 168, 120, 0.08);
  --brand-bg: #F7FAFC;
  --brand-bg-light: #FAFCFE;
  --brand-border: #E5E7EB;
  --brand-muted: #6B7280;
  --radius-xl: 1.25rem;
  --radius-md: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --brand-success: #10B981;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Inter");
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--brand-bg);
  color: #111827;
  margin: 0;
}

/* ====== Navbar ====== */
.adites-navbar {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #1a3a4f 100%) !important;
  box-shadow: 0 2px 20px rgba(14, 34, 51, 0.15);
  padding: 0.75rem 0;
}

.navbar-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-brand-title {
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.navbar-brand-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}


.main-container {
  min-height: calc(100vh - 60px);
}

.input-panel {
  background: white;
  border-right: 1px solid var(--brand-border);
  padding: 1.5rem;
}

.results-panel {
  background: var(--brand-bg);
  padding: 1.5rem;
}

@media (min-width: 992px) {
  .input-panel {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
  }
}

/* ====== Utility ====== */
.text-brand {
  color: var(--brand-primary);
  font-weight: 600;
}

/* ====== Cards ====== */
.config-card {
  background: white;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.config-card .card-header {
  background: linear-gradient(180deg, rgba(247,250,252,0.8) 0%, white 100%) !important;
  border-bottom: 2px solid var(--brand-border) !important;
  padding: 1rem 1.25rem !important;
}

.config-card .card-header h6 {
  color: var(--brand-primary);
  font-weight: 700;
  margin: 0;
  font-size: 1rem;
}

.config-card .card-body {
  padding: 1.25rem;
}

/* Location cards */
.location-card {
  border-left: 4px solid var(--brand-accent);
}

.location-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Module sub-card */
.module-card {
  background: var(--brand-bg-light);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

/* ====== Buttons ====== */
.btn-cta {
  --bs-btn-bg: var(--brand-accent);
  --bs-btn-border-color: var(--brand-accent);
  --bs-btn-hover-bg: #059669;
  --bs-btn-hover-border-color: #059669;
  --bs-btn-color: #fff;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  box-shadow: 0 6px 14px rgba(0,168,120,0.25);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: none;
  width: 100%;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,168,120,0.35);
}

.btn-cta:disabled,
.btn-cta.disabled {
  opacity: 0.85;
  cursor: progress;
  transform: none;
  box-shadow: 0 6px 14px rgba(0,168,120,0.2);
}

.btn-add {
  background: transparent;
  border: 1.5px dashed var(--brand-accent);
  color: var(--brand-accent);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-add:hover {
  background: var(--brand-accent-light);
  border-style: solid;
}

.btn-remove {
  background: transparent;
  border: none;
  color: #EF4444;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
}

.btn-export {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-export:hover {
  background: #1a3a4f;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(14, 34, 51, 0.2);
}

/* ====== Form ====== */
.form-control, .Select__control {
  border-radius: var(--radius-sm) !important;
  border-color: var(--brand-border) !important;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--brand-accent) !important;
  box-shadow: 0 0 0 3px rgba(0,168,120,0.15) !important;
}

.form-label {
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.form-inline-feedback {
  font-size: 0.78rem;
  color: #B45309;
  min-height: 1rem;
  margin-top: 0.1rem;
}
.form-inline-feedback:empty { display: none; }

/* Spalten einer Row auf gleiche vertikale Ausrichtung zwingen: Labels
 * bekommen eine feste Mindesthöhe (2 Zeilen), damit Labels mit Zeilenumbruch
 * nicht die darunterliegenden Inputs verschieben. */
.form-row-aligned > [class*="col-"] {
  display: flex;
  flex-direction: column;
}
.form-row-aligned .form-label {
  min-height: 2.5em;
  display: flex;
  align-items: flex-end;
  line-height: 1.25;
}

/* ====== Results ====== */
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--brand-muted);
  text-align: center;
  padding: 2rem;
}

.results-placeholder .icon {
  font-size: 3.25rem;
  color: var(--brand-accent);
  opacity: 0.3;
  margin-bottom: 1rem;
  line-height: 1;
}

.results-placeholder .placeholder-title {
  color: #6B7280;
  font-weight: 600;
}

.results-placeholder .placeholder-text {
  color: #9CA3AF;
}

.kpi-card {
  background: white;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.kpi-card .kpi-icon {
  font-size: 1.25rem;
  color: var(--brand-muted);
  margin-bottom: 0.35rem;
}

.kpi-card .kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1.1;
}

.kpi-card .kpi-label {
  font-size: 0.78rem;
  color: var(--brand-muted);
  margin-top: 0.25rem;
}

.kpi-card-pos .kpi-icon { color: var(--brand-success); }
.kpi-card-neg .kpi-icon { color: #EF4444; }

/* Wertfarben in Tabellen */
.val-positive { color: var(--brand-success); font-weight: 600; }
.val-negative { color: #DC2626; font-weight: 600; }
.val-neutral  { color: var(--brand-muted); }

/* Upload */
.upload-icon {
  font-size: 1.5rem;
  color: #6c757d;
  display: block;
  margin-bottom: 0.25rem;
}

/* Tables */
.results-table > :not(caption) > * > th,
.results-table th {
  background-color: var(--brand-primary) !important;
  color: white !important;
  font-weight: 600;
  font-size: 0.85rem;
}

.results-table td {
  font-size: 0.9rem;
}

/* ====== Station Info ====== */
.station-info {
  display: inline-flex;
  align-items: center;
  background: var(--brand-bg-light);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--brand-muted);
  margin-bottom: 0.75rem;
}

/* ====== Charts ====== */
.dash-graph {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-md);
  margin: 1rem 0;
}

/* ====== Comparison ====== */
.comparison-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--brand-border);
}

/* ====== Animation ====== */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== Skeleton (Loading Placeholder) ====== */
.arb-skeleton {
  background: linear-gradient(90deg,
    rgba(229, 231, 235, 0.6) 25%,
    rgba(243, 244, 246, 0.9) 50%,
    rgba(229, 231, 235, 0.6) 75%
  );
  background-size: 200% 100%;
  animation: arbSkeletonShimmer 1.4s infinite linear;
}

@keyframes arbSkeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ====== Sticky Action Bar ====== */
.arb-sticky-bar {
  backdrop-filter: blur(6px);
}

/* ====== Spinner ====== */
.spinner-grow {
  --bs-spinner-bg: var(--brand-accent) !important;
}

/* ====== Responsive ====== */
@media (max-width: 992px) {
  .input-panel, .results-panel {
    max-height: none;
  }
}

/* ====== Login Page ====== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary) 0%, #1a3a4f 40%, #0a4a3a 100%);
  padding: 2rem;
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  margin-bottom: 1rem;
}

.login-title {
  color: var(--brand-primary);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--brand-muted);
  font-size: 0.9rem;
  margin: 0;
}

.login-label {
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.85rem;
}

.login-input {
  padding: 0.65rem 0.85rem !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.95rem;
}

.login-alert {
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}

/* ====== Navbar User Section ====== */
.navbar-user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.navbar-user-info {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  text-align: right;
}

.navbar-user-name {
  font-weight: 600;
  color: white;
}

.navbar-user-type {
  font-size: 0.75rem;
  opacity: 0.7;
}

.navbar-calc-limit {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 0.15rem;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
}

/* ====== Navbar Navigation Links ====== */
.navbar-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 2rem;
}

.navbar-nav-link {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.navbar-nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.navbar-nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 -3px 0 var(--brand-accent);
}

