/* Themen-Hub – gemeinsames Stylesheet (Look angelehnt an aufgaben.wipke.de) */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg0: #0b1220; --bg1: #0f172a; --bg2: #1e293b;
  --acc1: #4f46e5; --acc2: #7c3aed; --acc3: #a855f7;
  --line: rgba(148,163,184,0.35);
  --txt: #f1f5f9; --muted: #94a3b8;
  --ok: #22c55e; --warn: #f59e0b; --err: #ef4444;
}
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--txt);
  background: radial-gradient(1200px 700px at 10% -10%, rgba(124,58,237,0.18), transparent 55%),
              radial-gradient(1000px 700px at 110% 10%, rgba(79,70,229,0.18), transparent 50%),
              linear-gradient(160deg, var(--bg0), var(--bg1));
  min-height: 100vh;
}
a { color: #c7d2fe; }
.muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .9rem;
  background: linear-gradient(to right, var(--acc1), var(--acc2));
  border: 1px solid rgba(165,180,252,0.7); color: #fff;
  transition: transform 140ms, box-shadow 140ms, opacity 140ms;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(79,70,229,0.45); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: rgba(15,23,42,0.6); border-color: var(--line); color: var(--txt); }
.btn.danger { background: linear-gradient(to right, #b91c1c, #ef4444); border-color: rgba(252,165,165,0.6); }
.btn.sm { padding: .32rem .6rem; font-size: .8rem; border-radius: 9px; }

/* Inputs */
input, select, textarea {
  width: 100%; padding: .55rem .8rem; font: inherit; font-size: .9rem;
  background: rgba(15,23,42,0.72); border: 1px solid var(--line);
  border-radius: 10px; color: var(--txt); outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--acc3); box-shadow: 0 0 0 1px rgba(168,85,247,0.55);
}
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: .8rem; color: #e2e8f0; margin-bottom: .3rem; font-weight: 500; }
.field { margin-bottom: .9rem; }

/* Card / Panel */
.card {
  background: linear-gradient(135deg, rgba(15,23,42,0.78), rgba(30,41,59,0.7));
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(2,6,23,0.5);
}

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1.2rem; border-bottom: 1px solid var(--line);
  background: rgba(11,18,32,0.7); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; }
.brand .dot { width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #f9fafb, var(--acc3));
  display: flex; align-items: center; justify-content: center; color: #111827; }
.spacer { flex: 1; }
.nav-link { cursor: pointer; color: var(--muted); font-size: .9rem; padding: .35rem .6rem; border-radius: 8px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(124,58,237,0.25); }

.wrap { max-width: 1000px; margin: 0 auto; padding: 1.4rem 1.2rem 4rem; }

/* Themen-Grid */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.thema-card { padding: 1.1rem; cursor: pointer; transition: transform 140ms, border-color 140ms; }
.thema-card:hover { transform: translateY(-2px); border-color: rgba(165,180,252,0.6); }
.thema-card h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.badge { display: inline-block; font-size: .72rem; padding: .15rem .5rem; border-radius: 999px;
  background: rgba(124,58,237,0.25); border: 1px solid var(--line); color: #ddd6fe; }
.badge.aktiv { background: rgba(34,197,94,0.2); color: #bbf7d0; }
.badge.ruht { background: rgba(245,158,11,0.2); color: #fde68a; }
.badge.abgeschlossen { background: rgba(148,163,184,0.2); color: #e2e8f0; }
.badge.shared { background: rgba(56,189,248,0.2); color: #bae6fd; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* Zeitleiste */
.timeline { position: relative; margin-top: 1rem; padding-left: 1.4rem; }
.timeline::before { content:''; position:absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.year-head { margin: 1.2rem 0 .6rem; font-weight: 700; color: #cbd5e1; cursor: pointer; user-select: none; }
.year-head .chev { display: inline-block; width: 1rem; transition: transform 140ms; }
.year-head.collapsed .chev { transform: rotate(-90deg); }
.tl-item { position: relative; margin-bottom: .8rem; padding: .8rem 1rem; }
.tl-item::before { content:''; position:absolute; left: -1.4rem; top: 1rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--acc3); box-shadow: 0 0 0 3px rgba(168,85,247,0.25); }
.tl-item.typ-dokument::before { background: #38bdf8; }
.tl-item.typ-termin::before { background: #f59e0b; }
.tl-item.typ-mail::before { background: #22c55e; }
.tl-date { font-size: .78rem; color: var(--muted); }
.tl-typ { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.note-pre { white-space: pre-wrap; color: #e2e8f0; font-size: .9rem; margin-top: .35rem; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(2,6,23,0.7); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; z-index: 200; padding: 4vh 1rem; overflow:auto; }
.modal-bg.show { display: flex; }
.modal { width: 100%; max-width: 520px; padding: 1.6rem; }
.modal h2 { margin-bottom: 1rem; font-size: 1.2rem; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
th { color: var(--muted); font-weight: 600; }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast { padding: .7rem 1.1rem; border-radius: 12px; font-size: .88rem; color: #fff;
  background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,64,175,0.9));
  border: 1px solid var(--line); border-left: 4px solid var(--acc3);
  box-shadow: 0 8px 30px rgba(2,6,23,0.6); animation: tin .2s ease; max-width: 320px; }
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--err); }
@keyframes tin { from { opacity:0; transform: translateX(20px); } }

.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.hidden { display: none !important; }
.link-btn { background:none; border:none; color:#c7d2fe; cursor:pointer; font: inherit; padding:0; }
.link-btn:hover { text-decoration: underline; }
