/* =========================================================================
   Kommando-Zentrale.
   Aufbau: Kopfband (Kommandant + Orbit), Fortschrittsboegen, "Das steht an".
   ========================================================================= */

/* ---------- Raster ----------
   Desktop:  Kopf / Boegen / Liste + Seitenleiste
   Handy:    Kopf / Liste / Boegen / Seitenleiste  - das Wichtigste zuerst. */
.hub-layout {
  display: grid; gap: 22px;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-areas: "hero hero" "goal goal" "arcs arcs" "main side";
  align-items: start;
  padding-bottom: 150px;           /* Platz fuer die schwebende Aktionsleiste */
}
.hub-layout > .hub-hero { grid-area: hero; margin-bottom: 0; }
.hub-layout > .hub-arcs { grid-area: arcs; margin-bottom: 0; }
.hub-layout > .hub-goal { grid-area: goal; margin-bottom: 0; }
.hub-layout > .hub-main { grid-area: main; }
.hub-layout > .hub-side { grid-area: side; }

/* ---------- Kopfband ---------- */
.hub-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px; align-items: center; margin-bottom: 22px; padding: 24px 30px;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 85% 50%, rgba(74,141,255,0.20), transparent 55%),
    radial-gradient(ellipse at 10% 0%, rgba(168,85,247,0.14), transparent 50%),
    linear-gradient(180deg, rgba(15,20,33,0.92), rgba(8,11,20,0.92));
}
.hub-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,0.012) 3px 4px);
}
.hub-greet { font-size: 0.78rem; letter-spacing: 3px; text-transform: uppercase; color: var(--text-dim); font-family: var(--font-display); }
.hub-name { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--text-bright); letter-spacing: 1px; line-height: 1.1; margin: 4px 0 18px; }
.hub-name .p-badge { vertical-align: middle; margin-left: 8px; font-size: 0.8rem; }

.hub-wallet .lbl { font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); }
.hub-wallet .big {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1;
  color: var(--gold); text-shadow: 0 0 30px rgba(245,166,35,0.28); font-variant-numeric: tabular-nums;
}
.hub-wallet .big small { font-size: 0.45em; color: var(--text-dim); margin-left: 6px; text-shadow: none; }
.hub-sub { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 0.86rem; color: var(--text-dim); }
.hub-sub b { color: var(--text-bright); font-family: var(--font-mono); font-weight: 500; }

/* ---------- Orbit ---------- */
.orbit { position: relative; width: 100%; max-width: 250px; aspect-ratio: 1; margin: 0 auto; }
.orbit .core {
  position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fdf6e3, #d9cfb8 45%, #8c8577 80%, #3c3a36);
  box-shadow: 0 0 40px rgba(245,230,200,0.25), inset -10px -12px 24px rgba(0,0,0,0.55);
}
.orbit .ring { position: absolute; inset: var(--inset); border-radius: 50%; border: 1px dashed rgba(96,140,220,0.22); }
.orbit .spin { position: absolute; inset: var(--inset); animation: orbitSpin var(--dur) linear infinite; animation-delay: var(--delay); }
.orbit .body {
  position: absolute; left: 50%; top: 0; width: var(--size); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  animation: orbitCounter var(--dur) linear infinite; animation-delay: var(--delay);
  cursor: pointer; transition: filter 0.15s;
}
.orbit .body:hover { filter: drop-shadow(0 0 10px var(--cyan)); }
.orbit .body svg { width: 100%; height: 100%; display: block; }
.orbit .empty-note { position: absolute; left: 0; right: 0; bottom: -4px; text-align: center; font-size: 0.74rem; color: var(--text-dim); }
@keyframes orbitSpin    { to { transform: rotate(360deg); } }
@keyframes orbitCounter { to { transform: translate(-50%, -50%) rotate(-360deg); } }

/* ---------- Fortschrittsboegen ---------- */
.hub-arcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.arc-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; text-align: left;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-panel); color: inherit; font: inherit;
  transition: transform 0.15s var(--ease), border-color 0.15s;
}
.arc-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.arc-card svg { flex: 0 0 54px; width: 54px; height: 54px; transform: rotate(-90deg); }
.arc-card .track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 6; }
.arc-card .fill  { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.arc-card .t { font-size: 0.7rem; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-dim); }
.arc-card .v { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--text-bright); }

/* ---------- Das steht an ---------- */
.hub-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.agenda-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.agenda-head h2 { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 1.5px; color: var(--text-bright); margin: 0; }
.agenda-head .count { font-size: 0.8rem; color: var(--text-dim); }

.agenda { display: flex; flex-direction: column; gap: 10px; }
.agenda-item {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px 14px 18px; border-radius: 12px; background: var(--bg-panel); border: 1px solid var(--line);
  animation: agendaIn 0.35s var(--ease) both;
}
.agenda-item::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--tone); }
.agenda-item.urgent   { --tone: var(--red);    border-color: rgba(255,77,106,0.35); background: linear-gradient(90deg, rgba(255,77,106,0.08), var(--bg-panel) 40%); }
.agenda-item.ready    { --tone: var(--green); }
.agenda-item.progress { --tone: var(--cyan); }
.agenda-item.info     { --tone: var(--text-dim); opacity: 0.85; }
.agenda-item .ico { font-size: 1.6rem; text-align: center; }
.agenda-item .ti { font-weight: 600; color: var(--text-bright); font-size: 0.95rem; }
.agenda-item .de { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }
.agenda-item .de .cd { font-family: var(--font-mono); color: var(--cyan); }
.agenda-item .go { display: flex; gap: 8px; }
.agenda-item .go .btn { width: auto; padding: 8px 14px; font-size: 0.82rem; }
.agenda-item.urgent .go .btn.primary { border-color: rgba(255,77,106,0.6); background: linear-gradient(180deg, rgba(255,77,106,0.3), rgba(255,77,106,0.08)); }
.agenda-item.ready .go .btn.primary  { border-color: rgba(52,224,127,0.55); background: linear-gradient(180deg, rgba(52,224,127,0.25), rgba(52,224,127,0.06)); }
.agenda-item.done { animation: agendaOut 0.4s var(--ease) forwards; }
@keyframes agendaIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes agendaOut { to { opacity: 0; transform: translateX(30px); height: 0; padding: 0; margin: 0; border-width: 0; } }

.agenda-empty {
  padding: 32px 20px; text-align: center; border-radius: 12px; border: 1px dashed var(--line-strong); color: var(--text-dim);
}
.agenda-empty .big { font-size: 2.2rem; display: block; margin-bottom: 8px; }

.hub-side .panel { margin-bottom: 16px; }
.hub-side .mini-kv { display: flex; justify-content: space-between; font-size: 0.84rem; padding: 3px 0; }
.hub-side .mini-kv b { font-family: var(--font-mono); font-weight: 500; color: var(--text-bright); }
.hub-side details summary { cursor: pointer; font-size: 0.8rem; color: var(--text-dim); list-style: none; }
.hub-side details summary::-webkit-details-marker { display: none; }
.hub-side details summary::before { content: '\25B8  '; }
.hub-side details[open] summary::before { content: '\25BE  '; }

/* ---------- Waehrend du weg warst ---------- */
.away h2 { margin-bottom: 4px; }
.away .gone { font-family: var(--font-display); font-size: 0.85rem; letter-spacing: 2px; color: var(--cyan); text-transform: uppercase; margin-bottom: 18px; }
.away-fact {
  display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 11px 0;
  border-bottom: 1px solid var(--line); opacity: 0; animation: agendaIn 0.4s var(--ease) forwards;
}
.away-fact:last-child { border-bottom: 0; }
.away-fact .ico { font-size: 1.5rem; text-align: center; }
.away-fact .tx { font-size: 0.92rem; color: var(--text-bright); }
.away-fact .nt { font-size: 0.76rem; color: var(--text-dim); margin-top: 2px; }
.away-fact.good .tx { color: var(--text-bright); }
.away-fact.bad  .tx { color: #ffb3c0; }
.away-fact.warn .tx { color: #ffd89a; }

/* ---------- Zahl hochzaehlen ---------- */
.countup { display: inline-block; }

@media (max-width: 900px) {
  .hub-layout { grid-template-columns: 1fr; grid-template-areas: "hero" "goal" "main" "arcs" "side"; padding-bottom: 20px; }
  .hub-hero { grid-template-columns: minmax(0, 1fr) 150px; padding: 20px 18px; gap: 12px; }
  .orbit { max-width: 150px; }
}
@media (max-width: 640px) {
  /* Auf dem Handy ist der Orbit Dekoration, die den Platz der Liste frisst. */
  .hub-hero { grid-template-columns: 1fr; }
  .hub-hero .orbit { display: none; }
  .hub-name { margin-bottom: 12px; }
}
@media (max-width: 520px) {
  .agenda-item { grid-template-columns: 36px minmax(0, 1fr); }
  .agenda-item .go { grid-column: 1 / -1; }
  .agenda-item .go .btn { flex: 1; }
  .hub-name { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .orbit .spin, .orbit .body { animation: none; }
  .agenda-item, .away-fact { animation: none; opacity: 1; }
}

/* Naechstes Ziel + Einsteiger-Boost */
.hub-goal { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.hub-goal[hidden] { display: none; }
.hg-boost { font-size: .82rem; color: var(--text); padding: 7px 12px; border-radius: 10px; background: linear-gradient(90deg, rgba(62,230,142,.16), rgba(62,230,142,.03)); border: 1px solid rgba(62,230,142,.35); }
.hg-boost b { color: var(--green); }
.hg-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(47,224,228,.3); background: linear-gradient(120deg, rgba(47,224,228,.1), rgba(10,14,24,.85) 55%); }
.hg-card.ready { border-color: var(--gold); box-shadow: 0 0 22px rgba(255,197,66,.2); background: linear-gradient(120deg, rgba(255,197,66,.14), rgba(10,14,24,.85) 55%); }
.hg-card.done { border-color: var(--gold); }
.hg-ico { font-size: 2rem; line-height: 1; flex: none; }
.hg-main { flex: 1; min-width: 0; }
.hg-main small, .hg-card small { color: var(--cyan); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.hg-card.ready small { color: var(--gold); }
.hg-main b, .hg-card b { display: block; color: var(--text-bright); font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .02em; }
.hg-main p { margin: 2px 0 8px; font-size: .8rem; color: var(--text-dim); }
.hg-bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.hg-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.hg-card.ready .hg-bar i { background: linear-gradient(90deg, #ffb52e, var(--gold)); }
.hg-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .74rem; color: var(--text-dim); margin-top: 5px; }
.hg-rew { display: flex; gap: 10px; flex-wrap: wrap; color: var(--gold); }
.hg-act { flex: none; }
@media (max-width: 640px) {
  .hg-card { flex-wrap: wrap; }
  .hg-act { width: 100%; } .hg-act .btn { width: 100%; }
}

/* Tagesbriefing + Alles abholen */
.agenda-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.agenda-head .count { margin-left: auto; }
.hub-collect[hidden] { display: none; }
.briefing { max-height: 78vh; overflow-y: auto; }
.bf-sec { font-family: var(--font-display); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin: 16px 0 8px; text-align: left; }
.bf-ev { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 7px 4px; border-top: 1px solid var(--line); text-align: left; }
.bf-ev b { display: block; color: var(--text-bright); font-size: .86rem; font-weight: 600; }
.bf-ev small { color: var(--text-dim); font-size: .76rem; }
.bf-ev time { font-size: .7rem; color: var(--text-dim); font-family: var(--font-mono); }
.bf-col { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bf-col span { font-size: .8rem; padding: 5px 10px; border-radius: 999px; background: rgba(255,197,66,.1); border: 1px solid rgba(255,197,66,.3); color: var(--text); }
.bf-all { width: 100%; margin-top: 12px; padding: 13px; font-size: 1rem; }
.bf-got { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.bf-g { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(62,230,142,.08); border: 1px solid rgba(62,230,142,.25); animation: pbPop .45s cubic-bezier(.2,1.4,.4,1) both; }
.bf-g > span { font-size: 1.3rem; text-align: center; }
.bf-g b { display: block; color: var(--text-bright); font-size: .88rem; }
.bf-g small { color: var(--text-dim); font-size: .76rem; }
.bf-none { color: var(--text-dim); text-align: center; }
.bf-sug { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.bf-go { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(47,224,228,.3); background: rgba(47,224,228,.06); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.bf-go:hover { background: rgba(47,224,228,.14); }
.bf-go span { font-size: 1.3rem; }
.bf-go b { color: var(--text-bright); font-size: .88rem; }
.bf-go small { color: var(--text-dim); font-size: .72rem; line-height: 1.3; }
