/* ============================================================
   DozentDesk – Zenkner-Technology Corporate Design
   Übernommen vom ABN Scanner (Schwesterprodukt), ohne CDNs/Fonts von Dritten.
   Default: White Mode · Dark Mode über html.dark
   ============================================================ */

:root {
  --bg: #f8fafc;
  --bg-grad-1: rgba(6, 182, 212, 0.05);
  --bg-grad-2: rgba(59, 130, 246, 0.04);
  --panel: #ffffff;
  --panel-border: #e2e8f0;
  --card: #ffffff;
  --card-border: #cbd5e1;
  --card-sub-bg: #f8fafc;
  --card-hover-border: #0284c7;
  --header-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #f1f5f9;
  --text: #0f172a;
  --text-2: #334155;
  --label: #1e293b;
  --muted: #64748b;
  --accent: #0284c7;
  --accent-strong: #0369a1;
  --accent-light: #0ea5e9;
  --accent-2: #2563eb;
  --accent-dim: rgba(2, 132, 199, 0.08);
  --accent-glow: rgba(2, 132, 199, 0.2);
  --accent-soft-border: rgba(2, 132, 199, 0.3);
  --border: #e2e8f0;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --shadow-box: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04);
  --success: #059669;
  --success-dim: rgba(16, 185, 129, 0.1);
  --success-border: rgba(16, 185, 129, 0.35);
  --warn: #92400e;
  --warn-dim: rgba(245, 158, 11, 0.1);
  --warn-border: rgba(245, 158, 11, 0.35);
  --danger: #e11d48;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color-scheme: light;
}

html.dark {
  --bg: #04070d;
  --bg-grad-1: rgba(6, 182, 212, 0.08);
  --bg-grad-2: rgba(59, 130, 246, 0.06);
  --panel: rgba(12, 20, 34, 0.8);
  --panel-border: rgba(255, 255, 255, 0.08);
  --card: rgba(16, 28, 46, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-sub-bg: rgba(8, 13, 24, 0.6);
  --card-hover-border: rgba(6, 182, 212, 0.4);
  --header-bg: rgba(6, 10, 18, 0.85);
  --footer-bg: #04070d;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --label: #cbd5e1;
  --muted: #64748b;
  --accent: #06b6d4;
  --accent-strong: #22d3ee;
  --accent-light: #22d3ee;
  --accent-2: #3b82f6;
  --accent-dim: rgba(6, 182, 212, 0.12);
  --accent-glow: rgba(6, 182, 212, 0.25);
  --accent-soft-border: rgba(6, 182, 212, 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(8, 13, 24, 0.85);
  --input-border: rgba(255, 255, 255, 0.12);
  --shadow-box: 0 0 35px -5px rgba(6, 182, 212, 0.15);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --success: #34d399;
  --success-dim: rgba(16, 185, 129, 0.12);
  --warn: #fcd34d;
  --warn-dim: rgba(245, 158, 11, 0.12);
  --danger: #fb7185;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, var(--bg-grad-1) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, var(--bg-grad-2) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 var(--font-sans);
  transition: background-color .2s, color .2s;
}
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -0.02em; color: var(--text); margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
.hidden { display: none !important; }
.sprite { position: absolute; }
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
html:not(.dark) .only-dark, html.dark .only-light { display: none; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

/* ── Header ── */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--header-bg); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; padding-bottom: 14px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.4)); transition: transform .2s; }
.brand:hover img { transform: scale(1.05); }
.brand-line { display: flex; align-items: center; gap: 8px; }
.brand-name { font: 700 18px/1.2 var(--font-head); letter-spacing: -0.02em; color: var(--text); }
.brand-name span { color: var(--accent); }
.brand-badge { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #0e7490; background: #cffafe; border: 1px solid #a5f3fc; padding: 2px 8px; border-radius: 999px; }
html.dark .brand-badge { color: #22d3ee; background: rgba(8, 51, 68, .8); border-color: rgba(21, 94, 117, .6); }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.topnav { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 0; background: none; color: var(--text-2); font: 500 12px var(--font-sans); text-decoration: none; cursor: pointer; transition: all .15s; }
.nav-link:hover { color: var(--accent); background: var(--accent-dim); }
.theme-switch-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--card-sub-bg); color: var(--text); cursor: pointer; transition: all .2s; }
.theme-switch-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
html.dark .theme-switch-btn .only-dark { color: #fbbf24; }
.status-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: #ecfeff; border: 1px solid #a5f3fc; color: #155e75; font: 600 11px var(--font-mono); }
html.dark .status-pill { background: rgba(8, 51, 68, .4); border-color: rgba(6, 182, 212, .3); color: #67e8f9; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #06b6d4; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ── Layout ── */
.main { flex: 1; display: flex; flex-direction: column; gap: 32px; padding-top: 32px; padding-bottom: 32px; }
.stack { display: flex; flex-direction: column; gap: 32px; }

/* ── Hero ── */
.hero { text-align: center; max-width: 48rem; margin: 0 auto; padding-top: 4px; }
.hero-logo { display: block; margin: 0 auto 14px; filter: drop-shadow(0 8px 20px rgba(15, 118, 110, .25)); }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #155e75; background: rgba(207, 250, 254, .8); border: 1px solid rgba(103, 232, 249, .8); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.hero-badge .ic { color: #0891b2; }
html.dark .hero-badge { color: #67e8f9; background: rgba(8, 51, 68, .5); border-color: rgba(21, 94, 117, .5); }
.hero h1 { font-size: clamp(28px, 4vw, 36px); font-weight: 700; line-height: 1.15; margin-bottom: 12px; }
.hero p { color: var(--text-2); font-size: 15px; line-height: 1.7; }
.gradient-text { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
html.dark .gradient-text { background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 50%, #3b82f6 100%); -webkit-background-clip: text; background-clip: text; }

/* ── Panels ── */
.glass-panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 16px; }
html.dark .glass-panel { backdrop-filter: blur(12px); }
.glow-box { box-shadow: var(--shadow-box); }
.step { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 640px) { .step { padding: 32px; } }
.step-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.step-title { display: flex; align-items: center; gap: 12px; }
.step-num { width: 28px; height: 28px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #06b6d4, #2563eb); box-shadow: 0 4px 10px rgba(37, 99, 235, .25); }
.step-title h2 { font-size: 18px; font-weight: 700; }
.step-title p { font-size: 12px; color: var(--muted); }
.sub-panel { background: var(--card-sub-bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.sub-panel h3 { font-size: 15px; }

/* ── Buttons ── */
.btn-primary, .btn-ghost, .btn-success {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 0; cursor: pointer;
  font: 600 14px var(--font-sans); white-space: nowrap; transition: all .2s;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); box-shadow: 0 4px 15px rgba(2, 132, 199, .25); }
html.dark .btn-primary { background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%); box-shadow: 0 4px 15px rgba(6, 182, 212, .3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 22px rgba(2, 132, 199, .35); }
.btn-primary:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-primary.big { padding: 12px 26px; }
.btn-ghost { color: var(--text-2); background: var(--card-sub-bg); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.btn-ghost.small { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn-ghost.danger:hover { color: var(--danger); border-color: var(--danger); background: rgba(225, 29, 72, .06); }
.link-danger { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--danger); font: 600 12px var(--font-sans); cursor: pointer; }
.link-danger:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, .zt-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Formulare ── */
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--label); min-width: 0; }
label small { font-weight: 500; color: var(--muted); }
.zt-input { width: 100%; min-width: 0; background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text); font: 500 14px/1.5 var(--font-sans); border-radius: 8px; padding: 8px 12px; transition: all .2s; }
.zt-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
textarea.zt-input { line-height: 1.6; resize: vertical; }
.zt-input.slim { width: auto; flex: 1 1 180px; padding: 7px 10px; font-size: 13px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-2 { grid-column: span 2; } }
@media (min-width: 960px) { .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.block-label { gap: 8px; }

/* ── Kurs-Kacheln ── */
.kurs-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kurs-grid .muted { font-size: 13px; padding: 4px 2px; }
.list-item { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--card); color: var(--text); font: inherit; cursor: pointer; transition: all .2s; }
.list-item:hover { border-color: var(--card-hover-border); box-shadow: var(--shadow-card); }
.list-item.active { border-color: var(--accent); background: var(--accent-dim); box-shadow: 0 0 0 1px var(--accent) inset; }
.list-item strong { font: 600 14px/1.35 var(--font-head); }
.list-item small { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

/* ── Toolbar & Aktionen ── */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--accent-dim); border: 1px solid var(--accent-soft-border); }
.toolbar-info { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.toolbar-icon { width: 28px; height: 28px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent); background: rgba(6, 182, 212, .2); }
.toolbar strong { margin-left: 4px; font: 700 14px var(--font-head); color: #0c4a6e; }
html.dark .toolbar strong { color: #67e8f9; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.action-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; background: var(--card-sub-bg); border: 1px solid var(--border); }
.action-left { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 320px; }
@media (max-width: 640px) { .btn-primary.big { width: 100%; } }
.status { font-size: 13px; color: var(--muted); min-height: 1.2em; margin-top: -6px; }

.switch { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .2s; }
html.dark .switch span { background: #334155; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }

/* ── Hinweise ── */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px; font-size: 13px; line-height: 1.6; }
.notice h4 { font-size: 14px; margin-bottom: 4px; }
.notice-icon { width: 32px; height: 32px; flex: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.notice-icon .ic { width: 18px; height: 18px; }
.notice.ok { background: var(--success-dim); border: 1px solid var(--success-border); color: var(--text-2); }
.notice.ok .notice-icon { color: var(--success); background: rgba(16, 185, 129, .18); }
.notice.ok h4 { color: var(--success); }
.notice.warn { background: var(--warn-dim); border: 1px solid var(--warn-border); color: var(--warn); font-weight: 500; }

/* ── Fortschritt & Karten ── */
.progress-row { display: flex; align-items: center; gap: 12px; font: 600 12px var(--font-mono); color: var(--muted); }
.bar { flex: 1; height: 8px; border-radius: 999px; background: var(--card-sub-bg); border: 1px solid var(--border); overflow: hidden; }
.bar div { height: 100%; width: 0; background: linear-gradient(90deg, #06b6d4, #10b981); transition: width .3s; }
.karten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.karten:empty::before { content: 'Noch keine Einträge – gib oben Stichworte ein und klicke auf „Einträge erzeugen“.'; display: block; padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; border: 2px dashed var(--card-border); border-radius: 12px; }
.karte { padding: 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); transition: all .2s; animation: rein .25s ease both; }
.karte:hover { border-color: var(--card-hover-border); box-shadow: var(--shadow-card); }
.karte.done { background: var(--success-dim); border-color: var(--success-border); }
.karte.done textarea { color: var(--muted); }
@keyframes rein { from { opacity: 0; transform: translateY(4px); } }
.karte-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ue { font: 700 12px/1 var(--font-mono); color: #fff; padding: 6px 10px; border-radius: 8px; background: linear-gradient(135deg, #06b6d4, #2563eb); }
.karte.done .ue { background: linear-gradient(135deg, #10b981, #059669); }
.zeit { font: 500 12px var(--font-mono); color: var(--muted); }
.karte-head .check { margin-left: auto; flex-direction: row; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.karte-head .check input { width: 16px; height: 16px; accent-color: #10b981; }
.karte-body { display: grid; gap: 12px; }
@media (min-width: 900px) { .karte-body { grid-template-columns: 1.8fr 1fr; } }
.feld { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: start; }
.feld-label { grid-column: 1 / -1; font: 700 11px var(--font-sans); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.feld textarea { width: 100%; min-height: 48px; background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text); font: 500 14px/1.5 var(--font-sans); border-radius: 8px; padding: 8px 12px; resize: vertical; }
.feld textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
.btn.copy { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--card-sub-bg); color: var(--text-2); cursor: pointer; transition: all .2s; }
.btn.copy:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.btn.copy.copied { color: var(--success); border-color: var(--success-border); background: var(--success-dim); }

/* ── Leerzustand ── */
.empty { align-items: center; text-align: center; }
.empty h2 { font-size: 20px; }
.how { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); text-align: left; }
.how li { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px; background: var(--card-sub-bg); border: 1px solid var(--border); }
.how span { width: 28px; height: 28px; margin-bottom: 6px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font: 700 12px var(--font-mono); color: #fff; background: linear-gradient(135deg, #06b6d4, #2563eb); }
.how b { font-family: var(--font-head); font-size: 14px; }
.how small { color: var(--muted); font-size: 12px; }

/* ── Footer & Toast ── */
.footer { margin-top: 48px; padding: 32px 0; background: var(--footer-bg); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text-2); font: 500 13px var(--font-head); }
.footer-brand img { opacity: .8; }
.footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.copy { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) { .footer-inner { flex-direction: column; text-align: center; } .footer nav { justify-content: center; } }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 999px; background: #0f172a; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(15, 23, 42, .25); transition: opacity .2s, transform .2s; }
html.dark .toast { background: #f1f5f9; color: #0f172a; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
html.dark ::-webkit-scrollbar-thumb { background: #1e293b; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
label.nav-link { flex-direction: row; font-weight: 500; color: var(--text-2); }
