/* ── Dashboard – Desktop-Auswertung (gleiche Designsprache wie „Meine Ergebnisse") ── */

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/open-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/open-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/montserrat-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/montserrat-latin-700-normal.woff2') format('woff2');
}

:root {
  --bg: #f3efe6;
  --surface: #ffffff;
  --surface-2: #f8f5ee;
  --ink: #1c2a20;
  --muted: #647067;
  --line: #e4ddce;
  --forest: #1f3d27;
  --forest-2: #2f5d3a;
  --leaf: #6a9f3a;
  --gold: #c8962e;
  --gold-soft: #f6ead0;
  --shadow: 0 1px 2px rgba(28, 42, 32, 0.06), 0 6px 20px rgba(28, 42, 32, 0.06);
  --radius: 20px;
  --font-head: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
  color-scheme: light;
}

/* dark mode: switched with the toggle (js/theme.js), light is the default */
:root[data-theme="dark"] {
  --bg: #0e1511;
  --surface: #16211a;
  --surface-2: #1b281f;
  --ink: #eaf0e8;
  --muted: #9aaa9e;
  --line: #26362b;
  --forest: #1a3322;
  --forest-2: #2a5234;
  --leaf: #8cc063;
  --gold: #e0b555;
  --gold-soft: #2e2716;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

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

/* base size +10 % – every rem below scales with it */
html { font-size: 110%; touch-action: manipulation; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
}

button, select, input { font: inherit; color: inherit; }

/* ── Buttons & inputs ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn.primary {
  background: var(--forest-2);
  color: #fff;
  font-family: var(--font-head);
  box-shadow: 0 6px 16px rgba(31, 61, 39, 0.25);
}
.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
@media (hover: hover) and (pointer: fine) {
.btn.ghost:hover { border-color: var(--leaf); }
}
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.88rem; }

.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  outline: none;
}
.input:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 20%, transparent); }
.input.code { text-transform: uppercase; letter-spacing: 0.15em; text-align: center; font-weight: 600; }

/* ── Overlays (login, consent) ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg);
}
#privacy-overlay { z-index: 9998; }
.overlay-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}
.overlay-card.wide { max-width: 440px; }
.overlay-card h2 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 16px; }
.overlay-crest { width: 80px; height: auto; margin-bottom: 12px; }
.overlay-form { display: flex; flex-direction: column; gap: 10px; }
.overlay-note { margin: 18px 0 8px; font-size: 0.85rem; color: var(--muted); }
.form-error { color: #c0392b; font-size: 0.88rem; margin-bottom: 10px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 6px 0; color: var(--muted); font-size: 0.8rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.privacy-box {
  text-align: left;
  font-size: 0.86rem;
  color: var(--muted);
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.privacy-box p + p { margin-top: 8px; }
.privacy-box a { color: var(--forest-2); }
.privacy-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  font-size: 0.86rem;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  cursor: pointer;
}
.privacy-check input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--forest-2); }
#privacy-accept-dash { width: 100%; }

/* Top bar and menu: css/nav.css */

/* ── Page ── */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.intro h1 {
  font-family: var(--font-head);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 560px;
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field select {
  min-width: 180px;
  min-height: 42px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23647067' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.field select:disabled { opacity: 0.8; cursor: default; }

/* ── KPIs ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.kpi-card.accent {
  color: #fff;
  border-color: transparent;
  background:
    radial-gradient(circle at 120% -30%, rgba(255, 255, 255, 0.12) 0 30%, transparent 30.5%),
    linear-gradient(150deg, var(--forest) 0%, var(--forest-2) 100%);
}
.kpi-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kpi-label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.kpi-card.accent .kpi-label { color: rgba(255, 255, 255, 0.8); }

/* ── Cards ── */
.grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 18px;
  align-items: start;
}
.card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.card + .card, .grid + .card { margin-top: 18px; }
.grid > .card { margin-top: 0; }
.empty-note { color: var(--muted); font-size: 0.9rem; grid-column: 1 / -1; }
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.card-head h2 { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; }
.card-sub { font-size: 0.8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot.normal { background: var(--leaf); }
.dot.best { background: var(--gold); margin-left: 8px; }

/* ── Target ── */
.target-wrapper {
  display: flex;
  justify-content: center;
  padding: 10px;
  border-radius: 50%;
  background: var(--surface-2);
  width: fit-content;
  margin: 0 auto;
}
#target-main {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  border-radius: 50%;
}

/* Ring distribution */
#ring-distribution { margin-top: 18px; }
.ring-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
}
.ring-bar-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.ring-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
}
.ring-bar-count { font-size: 0.72rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.ring-bar-label { font-family: var(--font-head); font-size: 0.78rem; font-weight: 700; margin-top: 4px; }

/* ── Top 5 ── */
#top5-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.top5-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px 12px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
}
.top5-item canvas {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
  border-radius: 50%;
  margin-bottom: 8px;
}
.top5-score {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.top5-date { font-size: 0.78rem; color: var(--muted); }
.top5-item.teiler-target {
  background: var(--gold-soft);
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
}
.teiler-headline {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

/* ── Timeline ── */
.timeline-canvas { position: relative; height: 260px; }
.timeline canvas { width: 100% !important; height: 100% !important; }

/* ── Summary ── */
.personal-summary p { font-size: 1rem; line-height: 1.65; max-width: 820px; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  #top5-container { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  #btn-print { display: none; }
  .page { padding: 18px 16px 32px; }
  .intro h1 { font-size: 1.35rem; }
  .field select { min-width: 0; width: 100%; }
  .filters, .field { width: 100%; }
  #top5-container { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 1.9rem; }
}

/* ── Print ── */
@media print {
  :root { --bg: #fff; --shadow: none; }
  .card, .kpi-card { break-inside: avoid; }
  .kpi-card.accent { color: var(--ink); background: var(--surface); border-color: var(--line); }
  .kpi-card.accent .kpi-label { color: var(--muted); }
}
