/* =====================================================================
   Look v5 „Basecamp“ – Expedition bei Nacht.
   Nachtblauer Schiefer, Lagerfeuer-Orange als Akzent, Gletscherblau und
   Tannen-Türkis für Daten. Höhenlinien im Hintergrund, Berge im Kopf.
   Wird nach styles.css geladen und überschreibt dessen Werte.
   ===================================================================== */
:root {
  /* Hell: Kartenpapier und Stein */
  --bg: #efece4; --surface: #fbfaf6; --surface-2: #f4f1e9; --border: #e0dbcf;
  --ink: #1b2328; --ink-2: #4b565c; --ink-3: #848c8f;
  --side: #1b2328; --side-ink: #eef2f3; --chip: #ebe6da; --grid: #e6e1d5; --hl: rgba(232, 116, 58, .08);
  /* Daten (geprüft): Gletscherblau, Lagerfeuer-Orange, Tannen-Türkis */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s1-soft: rgba(42, 120, 214, .12); --s2-soft: rgba(235, 104, 52, .13); --s3-soft: rgba(27, 175, 122, .13); --s4-soft: rgba(237, 161, 0, .15);
  --o1: #86b6ef; --o2: #2a78d6; --o3: #184f95;
  --good: #14805a; --bad: #c4372f; --warn: #a86400; --warn-bg: #fbecd2;
  --radius: 22px;
  /* Akzent: Lagerfeuer */
  --fire: #e8743a;
  --grad: linear-gradient(100deg, #f2a03d 0%, #e8743a 55%, #d4532e 100%);
  --glow1: rgba(232, 116, 58, .14); --glow2: rgba(42, 120, 214, .10);
  --topo-opacity: .35;
  --card-sheen: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 60%);
  --shadow: 0 1px 2px rgba(27, 35, 40, .05), 0 8px 24px rgba(27, 35, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Dunkel: Bergnacht */
    --bg: #0e1418; --surface: #161d22; --surface-2: #1b242a; --border: rgba(214, 228, 235, .08);
    --ink: #eef2f3; --ink-2: #b7c2c7; --ink-3: #7f8b91;
    --side: #0b1013; --chip: rgba(214, 228, 235, .07); --grid: rgba(214, 228, 235, .07); --hl: rgba(232, 116, 58, .12);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s1-soft: rgba(57, 135, 229, .18); --s2-soft: rgba(217, 89, 38, .2); --s3-soft: rgba(25, 158, 112, .2); --s4-soft: rgba(201, 133, 0, .22);
    --o1: #184f95; --o2: #2a78d6; --o3: #86b6ef;
    --good: #3cc58c; --bad: #ff7b6e; --warn: #f2a03d; --warn-bg: #33261a;
    --fire: #f08a45;
    --grad: linear-gradient(100deg, #ffb457 0%, #f08a45 55%, #e2603a 100%);
    --glow1: rgba(240, 138, 69, .16); --glow2: rgba(57, 135, 229, .10);
    --topo-opacity: .18;
    --card-sheen: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 70%);
    --shadow: 0 10px 34px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1418; --surface: #161d22; --surface-2: #1b242a; --border: rgba(214, 228, 235, .08);
  --ink: #eef2f3; --ink-2: #b7c2c7; --ink-3: #7f8b91;
  --side: #0b1013; --chip: rgba(214, 228, 235, .07); --grid: rgba(214, 228, 235, .07); --hl: rgba(232, 116, 58, .12);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s1-soft: rgba(57, 135, 229, .18); --s2-soft: rgba(217, 89, 38, .2); --s3-soft: rgba(25, 158, 112, .2); --s4-soft: rgba(201, 133, 0, .22);
  --o1: #184f95; --o2: #2a78d6; --o3: #86b6ef;
  --good: #3cc58c; --bad: #ff7b6e; --warn: #f2a03d; --warn-bg: #33261a;
  --fire: #f08a45;
  --grad: linear-gradient(100deg, #ffb457 0%, #f08a45 55%, #e2603a 100%);
  --glow1: rgba(240, 138, 69, .16); --glow2: rgba(57, 135, 229, .10);
  --topo-opacity: .18;
  --card-sheen: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 70%);
  --shadow: 0 10px 34px rgba(0, 0, 0, .35);
}

/* Hintergrund: Lagerfeuer-Schein + Höhenlinien wie auf einer Wanderkarte */
body {
  background:
    radial-gradient(800px 520px at 92% -6%, var(--glow1), transparent 62%),
    radial-gradient(700px 520px at 4% 105%, var(--glow2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: url("topo.svg") repeat; background-size: 800px 640px; opacity: var(--topo-opacity);
}
.app { position: relative; z-index: 1; }

/* Seitenleiste: dunkle Bergwand mit Gipfeln am Fuß */
.app { grid-template-columns: 252px 1fr; }
.side {
  margin: 12px 0 12px 12px; height: calc(100vh - 24px); top: 12px; border-radius: 24px;
  background:
    url("mountains.svg") bottom / 100% 64px no-repeat,
    radial-gradient(260px 200px at 0% 0%, rgba(240, 138, 69, .18), transparent 70%),
    linear-gradient(180deg, #19232a, #0b1013);
  box-shadow: 0 18px 44px rgba(11, 16, 19, .35);
  border: 1px solid rgba(214, 228, 235, .06);
  padding-bottom: 72px;
}
.brand .small { color: var(--fire); opacity: 1; letter-spacing: .18em; }
.brand .big { font-size: 22px; letter-spacing: -.01em; text-transform: uppercase; font-weight: 800; }
.navlabel { color: #f2a03d; opacity: .7; }
.navlink { border-radius: 14px; padding: 9px 12px; }
.navlink.active { background: rgba(240, 138, 69, .14); color: #fff; opacity: 1; box-shadow: inset 3px 0 0 var(--fire); }
.navlink.active svg { color: var(--fire); }
.navlink.active .count { background: var(--fire); color: #1b1006; }
.theme-switch button { border-radius: 10px; }
.theme-switch button.on { background: rgba(240, 138, 69, .25); }

main { padding: 30px 34px 56px; }
.page-head h1 { font-size: 32px; letter-spacing: -.03em; font-weight: 800; }

/* Karten wie robuste Ausrüstung: kräftige Rundung, ruhige Fläche */
.card { border-radius: var(--radius); background: var(--card-sheen), var(--surface); }
.card h2 { font-size: 15px; }
.kpi .label { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.kpi .label i { width: 9px; height: 9px; }
.kpi .value { font-weight: 800; letter-spacing: -.03em; }

/* Runde Symbole wie Abzeichen */
.chip-ic { border-radius: 12px; width: 32px; height: 32px; }
.alerts .ic { border-radius: 12px; }

/* Knöpfe: Lagerfeuer */
.seg { border-radius: 14px; }
.seg button { border-radius: 10px; }
.seg button.on { background: var(--surface); color: var(--fire); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); font-weight: 600; }
.chips button { border-radius: 10px; }
.chips button.on { background: var(--fire); border-color: var(--fire); color: #fff; }
.btn { border-radius: 12px; }
.btn.dark { background: var(--grad); border-color: transparent; color: #1b1006; font-weight: 600; box-shadow: 0 6px 16px rgba(232, 116, 58, .28); }
.progress > div, .progress.blue > div { background: var(--grad); }
.badge { border-radius: 8px; }
.tomorrow { background: var(--s4-soft); }

/* Kopfbereich: Gipfel im Hintergrund, Lagerfeuer-Zahl */
.hero {
  border-radius: 26px; padding: 26px 28px 74px; position: relative; overflow: hidden;
  background:
    url("mountains.svg") bottom right / 62% 74px no-repeat,
    radial-gradient(520px 300px at 0% 0%, var(--glow1), transparent 65%),
    var(--surface);
}
.hero > * { position: relative; }
.hero-value {
  font-size: 62px; font-weight: 800; letter-spacing: -.045em; padding-bottom: 4px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-value.missing { background: none; -webkit-text-fill-color: var(--ink-3); color: var(--ink-3); font-size: 38px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: var(--ink-2); }
.hero-stats > div { border-radius: 18px; background: var(--card-sheen), var(--surface-2); padding: 14px 16px; }
.hero-stats b { font-size: 24px; font-weight: 800; }
.hero-stats .mini { height: 34px; margin-top: 6px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fire); margin-right: 8px; animation: ember 2s infinite; }
@keyframes ember {
  0% { box-shadow: 0 0 0 0 rgba(240, 138, 69, .65); }
  70% { box-shadow: 0 0 0 9px rgba(240, 138, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 138, 69, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Trichter, Ranglisten, Finanzaufstellung */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel .step { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; font-size: 13px; }
.funnel .bar { height: 24px; border-radius: 10px; background: var(--chip); overflow: hidden; }
.funnel .bar div { height: 100%; border-radius: 10px; background: var(--grad); min-width: 4px; }
.funnel .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel .v small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rank li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.rank .n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--chip); color: var(--ink-2); }
.rank li:first-child .n { background: var(--fire); color: #fff; }
.rank .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.rank .v small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; }
.rank .bar { grid-column: 2 / 4; height: 5px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.rank .bar div { height: 100%; background: var(--s1); border-radius: 99px; }
.fin { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.fin .r { text-align: right; }
.fin .minus { color: var(--ink-2); }
.fin .total { font-weight: 800; border-top: 1px solid var(--border); padding-top: 7px; }

/* Formulare */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.form label.wide { grid-column: 1 / -1; }
.form.inline { display: flex; flex-wrap: wrap; gap: 8px; }
.form.inline > * { flex: 1 1 110px; min-width: 0; }
.form.inline > input[name=name], .form.inline > input[name=note] { flex: 2 1 160px; }
.form.inline > button { flex: 0 0 auto; }
.form input, .form select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 9px 11px; outline: none; min-width: 0; width: 100%;
}
.form input:focus, .form select:focus { border-color: var(--fire); box-shadow: 0 0 0 3px var(--hl); }
.form button { height: 40px; }
.list .iconbtn { flex: none; width: 30px; height: 30px; border-radius: 10px; font-size: 14px; color: var(--ink-2); background: transparent; }
.list .iconbtn:hover { color: var(--ink); border-color: var(--fire); }
.hero-top .seg { flex-wrap: wrap; }

/* 3D-Ansicht */
.viewer { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--border);
  background: radial-gradient(70% 90% at 50% 30%, rgba(240, 138, 69, .12), transparent 70%), var(--surface-2); }
.viewer model-viewer { width: 100%; height: 380px; --poster-color: transparent; }
.viewer-label { position: absolute; left: 14px; bottom: 12px; display: flex; flex-direction: column; font-size: 12px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 7px 10px; pointer-events: none; }
.viewer-label b { color: var(--ink); font-size: 13px; }

@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .form { grid-template-columns: minmax(0, 1fr); }
  .hero-top { flex-direction: column; align-items: stretch; }
  .hero-top .seg { flex-wrap: nowrap; width: 100%; }
  .hero-top .seg button { flex: 1; padding: 7px 4px; font-size: 12px; }
  .viewer model-viewer { height: 300px; }
  .side { margin: 0; height: auto; top: 0; border-radius: 0 0 20px 20px; background: linear-gradient(180deg, #19232a, #0b1013); }
  .brand .big { font-size: 16px; }
  .navs { border-radius: 20px 20px 0 0; background: linear-gradient(180deg, #19232a, #0b1013); }
  .navlink { padding: 7px 8px; border-radius: 12px; }
  .navlink.active { box-shadow: inset 0 -3px 0 var(--fire); }
  .page-head h1 { font-size: 26px; }
  .side { padding-bottom: 10px; }
  .hero { padding: 20px 20px 64px; border-radius: 22px; background-size: 100% 56px, auto, auto; }
  .hero-value { font-size: 44px; }
  .funnel .step { grid-template-columns: 96px 1fr 80px; }
  main { padding: 18px 16px 100px; }
}
@media print { body { background: #fff; } body::before { display: none; } }

/* v7: Auf-einen-Blick, To-dos mit Haken, Statistik */
.glances { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.glance { display: flex; gap: 12px; align-items: center; text-decoration: none; background: var(--card-sheen), var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.glance:hover { transform: translateY(-2px); border-color: var(--fire); }
.glance div { display: flex; flex-direction: column; min-width: 0; }
.glance span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.glance b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.glance small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-card .card-head { align-items: center; }
.ring { position: relative; width: 54px; height: 54px; flex: none; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.todos2 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todos2 .todo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); transition: opacity .3s, transform .3s; }
.todos2 .todo:hover { border-color: rgba(240, 138, 69, .5); }
.todo-text { flex: 1; min-width: 0; font-size: 14px; }
.check { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; transition: all .2s; }
.check svg { width: 15px; height: 15px; }
.check:hover { border-color: var(--fire); color: var(--fire); }
.todo.done .check { background: var(--grad); border-color: transparent; color: #1b1006; }
.todo.done .todo-text { color: var(--ink-3); text-decoration: line-through; }
.todo.pop { transform: scale(.98); opacity: .6; }
.todo-foot { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.stat-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stat-kpis .value { font-size: 24px; }
.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.insight { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; }
.insight span { font-size: 20px; line-height: 1; }
.insight p { margin: 0; font-size: 13px; color: var(--ink-2); }
.insight b { color: var(--ink); }
h2.sect { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--fire); margin: 26px 0 12px; }
@media (max-width: 1100px) { .stat-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .glances { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stat-kpis, .glances { grid-template-columns: repeat(2, minmax(0, 1fr)); } .insight-grid { grid-template-columns: minmax(0, 1fr); } }
