@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #fafaf5;
  --surface: #ffffff;
  --surface-alt: #f5f3ec;
  --border: #e5e2d9;
  --border-light: #edebe4;
  --text: #3d3d35;
  --text-muted: #6b6860;
  --text-light: #9b9687;
  --accent: #7a8b6e;
  --accent-light: #e8efdf;
  --accent-hover: #637456;
  --accent-secondary: #c4a97d;
  --green: #5a6e4a;
  --green-light: #e8efdf;
  --red: #b8453a;
  --red-light: #fbeeed;
  --amber: #c4a97d;
  --amber-light: #fbf6ed;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --transition: 0.2s ease;
}

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

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* === HEADER === */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: height 0.25s ease, box-shadow 0.25s ease;
}
.header.compact {
  height: 44px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo {
  height: 40px;
  width: auto;
  display: block;
  transition: height 0.25s ease;
}
.header.compact .header-logo {
  height: 26px;
}
.header-praxis {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 1px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === BUTTONS === */
.btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  background: var(--surface-alt);
  border-color: #d5d3ce;
}
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-toggle-off {
  color: var(--text-light);
  border-color: var(--border-light);
  background: var(--surface-alt);
  opacity: 0.7;
  text-decoration: line-through;
}

/* === MAIN === */
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 32px;
}

/* === HERO === */
.hero-question {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-question span {
  color: var(--accent);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.hero-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  cursor: default;
}
.hero-kpi:first-child {
  border-left: 3px solid var(--accent);
}
.hero-kpi[data-click]:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.hero-kpi-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 8px;
}
.hero-kpi-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.hero-kpi-value small {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}
.hero-kpi-context {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.trend-up {
  color: var(--green);
  background: var(--green-light);
}
.trend-down {
  color: var(--red);
  background: var(--red-light);
}

.hero-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  margin-top: 8px;
}
.hero-spark span {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.3;
  transition: opacity var(--transition);
}
.hero-spark span:last-child {
  opacity: 1;
}

/* === NAV PILLS === */
.section-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 56px;
  z-index: 90;
  background: var(--bg);
  padding: 10px 0;
  margin-top: -10px;
}
.nav-pill {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.nav-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.nav-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* === CHART CARDS === */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.chart-card-full {
  grid-column: 1 / -1;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.chart-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ECharts container */
.echart-container {
  width: 100%;
  height: 280px;
}
.echart-container-sm {
  width: 100%;
  height: 200px;
}
.echart-container-tall {
  width: 100%;
  height: 360px;
}

/* === TOGGLE CHIPS === */
.toggle-group {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  border-radius: 6px;
  padding: 2px;
}
.toggle-chip {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all var(--transition);
}
.toggle-chip.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* === DATA QUALITY BAR === */
.data-quality-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 12px;
  color: var(--text-muted);
}
.data-quality-bar:hover {
  background: var(--surface-alt);
}
.dq-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.dq-dot.warn {
  background: var(--amber);
}
.dq-dot.error {
  background: var(--red);
}
.dq-summary {
  flex: 1;
}
.dq-chevron {
  transition: transform var(--transition);
  font-size: 14px;
  color: var(--text-light);
}
.dq-chevron.open {
  transform: rotate(180deg);
}
.dq-details {
  display: none;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  margin-top: -25px;
  margin-bottom: 24px;
  font-size: 12px;
  color: var(--text-muted);
}
.dq-details.open {
  display: block;
}
.dq-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dq-item-label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 2px;
}
.dq-item-value {
  font-weight: 600;
  font-size: 13px;
}

/* === FILTER === */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}
.filter-select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* === ACCORDION === */
.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acc-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.acc-group:hover {
  box-shadow: var(--shadow);
}
.acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.acc-header:hover {
  background: var(--surface-alt);
}
.acc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.acc-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.acc-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.acc-group-name {
  font-size: 14px;
  font-weight: 600;
}
.acc-group-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 10px;
}
.acc-group-count {
  font-size: 12px;
  color: var(--text-light);
}
.acc-chevron {
  font-size: 12px;
  color: var(--text-light);
  transition: transform var(--transition);
}
.acc-group.open .acc-chevron {
  transform: rotate(180deg);
}
.acc-body {
  display: none;
  padding: 0 20px 16px;
  border-top: 1px solid var(--border-light);
}
.acc-group.open .acc-body {
  display: block;
}

.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.acc-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 8px 8px;
  border-bottom: 1px solid var(--border-light);
}
.acc-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border-light);
}
.acc-table tr:last-child td {
  border-bottom: none;
}
.acc-table tr:hover td {
  background: var(--surface-alt);
}
.acc-ziffer {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.acc-ziffer:hover {
  text-decoration: underline;
}
.acc-ziffer::after {
  content: "→";
  font-size: 10px;
  opacity: 0;
  transition: opacity var(--transition);
}
.acc-ziffer:hover::after {
  opacity: 1;
}
.acc-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.acc-sparkline-col {
  width: 72px;
  text-align: center;
}
.mini-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}
.mini-bars span {
  width: 10px;
  background: var(--accent);
  opacity: 0.5;
  border-radius: 2px 2px 0 0;
}
.mini-bars span:last-child {
  opacity: 1;
}

/* === ZIFFER DETAIL PANEL === */
.ziffer-detail-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(61, 61, 53, 0.3);
  backdrop-filter: blur(4px);
  z-index: 500;
  animation: fadeIn 0.2s ease;
}
.ziffer-detail-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
}
.ziffer-detail-panel {
  background: var(--surface);
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 1px 3px rgba(0, 0, 0, 0.08);
  width: 580px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}
.zdp-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.zdp-ziffer-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.zdp-bezeichnung {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.zdp-gruppe-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-top: 6px;
  display: inline-block;
  background: var(--surface-alt);
  color: var(--text-muted);
}
.zdp-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}
.zdp-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.zdp-body {
  padding: 20px 28px 28px;
}
.zdp-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.zdp-kpi {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.zdp-kpi-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.zdp-kpi-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.zdp-chart-container {
  margin-bottom: 16px;
}

/* Treemap blocks */
.treemap-block {
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}
.treemap-block:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  animation: fadeInUp 0.5s ease forwards;
}
.drop-zone {
  width: 100%;
  max-width: 520px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 48px 32px;
  transition: all 0.25s ease;
  cursor: pointer;
  background: var(--surface);
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.drop-zone.dragover {
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(122, 139, 110, 0.12);
}
.drop-icon {
  width: 56px;
  height: 56px;
  background: var(--surface-alt);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: var(--accent);
}
.drop-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}
.drop-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}
.drop-or {
  font-size: 12px;
  color: var(--text-light);
  margin: 16px 0;
}
.drop-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 24px;
  max-width: 360px;
}
.drop-hint code {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  background: var(--surface-alt);
  padding: 1px 5px;
  border-radius: 3px;
}
.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition);
}
.demo-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* === LOGIN OVERLAY === */
#loginOverlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 250, 245, 0.92);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.login-logo {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 14px;
  color: white;
  font-weight: 700;
  font-size: 22px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.login-praxis {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.login-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.login-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  letter-spacing: 0.1em;
  outline: none;
  transition: border-color var(--transition);
}
.login-input:focus {
  border-color: var(--accent);
}
.login-error {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
}
.login-contact {
  font-size: 11px;
  color: var(--text-light);
}
.login-contact a {
  color: var(--accent);
  text-decoration: none;
}

/* === FOOTER === */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 11px;
  color: var(--text-light);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-in {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}
.delay-1 {
  animation-delay: 0.05s;
}
.delay-2 {
  animation-delay: 0.1s;
}
.delay-3 {
  animation-delay: 0.15s;
}
.delay-4 {
  animation-delay: 0.2s;
}
.delay-5 {
  animation-delay: 0.25s;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 20px 16px;
  }
  .header {
    padding: 0 16px;
  }
  .dq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ziffer-detail-panel {
    width: 95%;
    margin: 16px;
  }
  .filter-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .header-praxis {
    display: none;
  }
}
