/* ─── Variables ────────────────────────────────────────────────────────────── */
/* Zentrale Design-Tokens als CSS-Custom-Properties (var(--name)).
   Einmal hier definiert und überall im Stylesheet wiederverwendet –
   Farbänderungen müssen so nur an einer Stelle vorgenommen werden. */
:root {
    --primary:        #4a6cf7;
    --primary-hover:  #3a5ce5;
    --primary-light:  rgba(74, 108, 247, 0.1);
    --success:        #10b981;
    --success-light:  #d1fae5;
    --warning:        #f59e0b;
    --warning-light:  #fef3c7;
    --danger:         #ef4444;
    --danger-light:   #fee2e2;

    --sidebar-bg:     #16213e;
    --sidebar-border: rgba(255,255,255,0.05);
    --sidebar-text:   #8fa3c8;
    --sidebar-active: rgba(74, 108, 247, 0.18);

    --bg:       #f0f4ff;
    --surface:  #ffffff;
    --border:   #e4e9f2;
    --shadow:   0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

    --radius:    12px;
    --radius-sm: 7px;

    --text:       #1a2744;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ─── Reset ────────────────────────────────────────────────────────────────── */
/* Normalisiert Browser-Standardstile: Entfernt Abstände, setzt box-sizing auf border-box
   (Padding und Border werden in die Breite eingerechnet) und definiert Basis-Typografie. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); }

/* ─── App Layout ───────────────────────────────────────────────────────────── */
/* Flexbox-Container für das zweiteilige Layout: Sidebar links (feste Breite),
   Hauptinhalt rechts (flex:1, füllt den verbleibenden Platz). */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */
/* Dunkle Seitenleiste mit fester Breite (230px). position:sticky + height:100vh
   lässt sie beim Scrollen sichtbar bleiben. Enthält Logo, Nav und Logout. */
.sidebar {
    width: 230px;
    min-width: 230px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(143, 163, 200, 0.5);
    padding: 10px 10px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.14s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    text-decoration: none;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

.nav-link.active .nav-icon {
    filter: brightness(1.4);
}

.nav-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--sidebar-border);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    color: #f87171;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.14s;
    text-align: left;
}

.btn-logout:hover {
    background: rgba(239,68,68,0.1);
}

/* ─── Main Content ─────────────────────────────────────────────────────────── */
/* Scrollbarer Bereich rechts neben der Sidebar. flex:1 füllt den Restplatz.
   content-wrapper zentriert den Inhalt mit max-width und Innenabstand. */
.main-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.content-wrapper {
    max-width: 940px;
    margin: 0 auto;
    padding: 36px 28px;
}

/* ─── Page Header ──────────────────────────────────────────────────────────── */
/* Seitentitel (h1) und optionaler Untertitel (p) am Seitenanfang jeder Unterseite. */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 14px;
}

/* ─── Greeting Bar (Dashboard) ─────────────────────────────────────────────── */
/* Breite Willkommensleiste mit blau-lila Farbverlauf (linear-gradient).
   Zeigt personalisierten Nutzernamen und das aktuelle Datum. */
.greeting-bar {
    background: linear-gradient(135deg, #4a6cf7 0%, #764ba2 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.greeting-bar h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.greeting-bar p {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 5px;
}

/* ─── Grid ─────────────────────────────────────────────────────────────────── */
/* CSS Grid mit zwei gleichbreiten Spalten (1fr 1fr) für die Dashboard-Widgets.
   Unter 700px Bildschirmbreite wechselt es zu einer einspaltige Ansicht. */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Unter 700px: einspaltiges Layout, Sidebar wird ausgeblendet */
@media (max-width: 700px) {
    .grid-2 { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
/* Weiße Inhaltscontainer mit abgerundeten Ecken, Rahmen und Schatten.
   card-header = Titelzeile mit Icon und optionalem Link-Button.
   card-body   = Hauptbereich mit dem eigentlichen Inhalt. */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.card-header .card-icon {
    font-size: 16px;
}

.card-header .card-action {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
/* Einheitliches Styling für alle Formulare: Label (klein, uppercase), Input,
   Textarea und Select mit blauem Fokus-Ring und Hover-Effekten. */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: var(--font);
    appearance: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

/* Zwei Formularfelder nebeneinander (z. B. Datum + Uhrzeit) */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
/* Fünf Button-Varianten: primary (blau, Hauptaktion), success (grün, Bestätigung),
   danger (rot, Löschen), secondary (grau, neutral), ghost (transparent, dezent).
   btn-sm verkleinert den Button für kompakte Listen-Aktionen. */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.14s ease;
    text-decoration: none;
    font-family: var(--font);
    line-height: 1;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { background: #059669; border-color: #059669; }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-light); }

.btn-secondary {
    background: var(--bg);
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-ghost {
    background: none;
    border-color: transparent;
    color: var(--text-muted);
    padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 18px;
}

/* ─── Item List ─────────────────────────────────────────────────────────────── */
/* Einheitliche Listen-Darstellung für alle Eintragstypen. Jedes li enthält
   item-content (Titel + Meta-Infos) und optional item-actions (Buttons). */
.item-list {
    list-style: none;
}

.item-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.item-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.item-list li:first-child {
    padding-top: 0;
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.item-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

/* Erledigte Einträge: Titel durchgestrichen und ausgegraut */
.item-erledigt .item-title {
    text-decoration: line-through;
    color: var(--text-light);
}

/* ─── Badges ────────────────────────────────────────────────────────────────── */
/* Kleine Pill-förmige Kennzeichnungen für Dringlichkeit und Status.
   Varianten: danger (rot/überfällig), warning (gelb/bald), success, info, neutral. */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-danger  { background: var(--danger-light);  color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-success { background: var(--success-light); color: #065f46; }
.badge-info    { background: var(--primary-light); color: #1e40af; }
.badge-neutral { background: var(--bg); color: var(--text-muted); }

/* ─── Empty State ───────────────────────────────────────────────────────────── */
/* Zentrierter Platzhaltertext, der angezeigt wird wenn eine Liste leer ist. */
.empty-state {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ─── Alert ─────────────────────────────────────────────────────────────────── */
/* Farbige Hinweisboxen für Fehlermeldungen (alert-danger, rot) und
   Erfolgsmeldungen (alert-success, grün) mit linkem Akzentbalken. */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-danger  { background: var(--danger-light);  color: #991b1b; border-left: 3px solid var(--danger);  }
.alert-success { background: var(--success-light); color: #065f46; border-left: 3px solid var(--success); }

/* ─── Kalender ──────────────────────────────────────────────────────────────── */
/* Monatliche Tabellen-Kalenderansicht: month-nav für Vor/Zurück-Navigation,
   kalender-table für das 7-Spalten-Raster, tag-nr für den Tageszahlen-Kreis,
   termin-pill für kompakte farbige Terminanzeigen in den Tageszellen. */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.month-nav h2 {
    font-size: 17px;
    font-weight: 600;
}

.month-nav-links {
    display: flex;
    gap: 8px;
}

.kalender-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.kalender-table th {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 6px;
    text-align: center;
    border-bottom: 2px solid var(--border);
}

.kalender-table td {
    border: 1px solid var(--border);
    vertical-align: top;
    padding: 6px 7px;
    height: 72px;
}

.kalender-table td.leer {
    background: #fafbff;
}

.kalender-table td.heute {
    background: #eff4ff;
}

/* Tageszahl in der Kalender-Zelle; heutiger Tag erhält blauen Kreis */
.tag-nr {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-bottom: 3px;
    border-radius: 50%;
}

.heute .tag-nr {
    background: var(--primary);
    color: #fff;
}

/* Termin-Pill: kompakte farbige Anzeige innerhalb einer Kalender-Zelle */
.termin-pill {
    display: block;
    font-size: 10px;
    background: var(--primary);
    color: #fff;
    border-radius: 3px;
    padding: 1px 5px;
    margin-bottom: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ─── Auth Layout ───────────────────────────────────────────────────────────── */
/* Layout für Login und Registrierung: auth-body zentriert die Karte auf einem
   blau-lila Gradient-Hintergrund. auth-card ist die weiße Formular-Box. */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4a6cf7 0%, #764ba2 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 18px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 54px;
    height: 54px;
    background: var(--primary);
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 24px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(74,108,247,0.35);
}

.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-light);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* ─── Weather Widget ────────────────────────────────────────────────────────── */
/* Darstellung des Wetter-Widgets: weather-main zeigt Emoji und Temperatur groß
   nebeneinander, weather-desc und weather-meta geben Beschreibung und Standort aus. */
.weather-main {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.weather-icon { font-size: 44px; line-height: 1; }

.weather-temp {
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
}

.weather-desc {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.weather-meta {
    font-size: 13px;
    color: var(--text-light);
}

/* ─── News link ─────────────────────────────────────────────────────────────── */
/* Klickbare Nachrichtenüberschriften: im Ruhezustand wie normaler Text,
   beim Hovern färben sie sich blau (primary-Farbe) ohne Unterstrich. */
.news-link {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

.news-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* ─── Section within card-body ─────────────────────────────────────────────── */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* ─── Tag / Kategorie-Badge ────────────────────────────────────────────────── */
/* Kleine graue Pill-Etikette für Kategorien und Themen.
   Erscheint inline neben Titeln. */
.tag-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-left: 5px;
    vertical-align: middle;
}

/* ─── Priorität-Farben ─────────────────────────────────────────────────────── */
/* Überschreibt badge-danger/warning/neutral mit angepassten Größen für
   die Priorität-Anzeige neben Aufgabentiteln. */
.item-title .badge {
    font-size: 10px;
    padding: 1px 7px;
    margin-left: 5px;
    vertical-align: middle;
}

/* ─── Wiederholungs-Label ──────────────────────────────────────────────────── */
.repeat-label {
    color: var(--primary);
    font-size: 11px;
    font-weight: 500;
}

/* ─── Sortierleiste ────────────────────────────────────────────────────────── */
/* Schmale Leiste mit klickbaren Sortier-Links oberhalb der Listen. */
.sort-bar {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.sort-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.sort-link:hover { text-decoration: underline; }

/* ─── Termin-Punkt (farbiger Kreis) ───────────────────────────────────────── */
/* Kleiner farbiger Kreis vor einem Termin-Listeneintrag,
   der die individuelle Terminfarbe visualisiert. */
.termin-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

/* ─── Vergangene Termine ───────────────────────────────────────────────────── */
.item-vergangen .item-title {
    color: var(--text-muted);
}

/* ─── Deadline-Pill im Kalender ────────────────────────────────────────────── */
/* Wie termin-pill, aber in Rot für Deadlines. */
.deadline-pill {
    background: var(--danger) !important;
}

/* ─── Kalender: Diese Woche hervorheben ────────────────────────────────────── */
.kalender-table td.diese-woche {
    background: rgba(74, 108, 247, 0.04);
    border-color: rgba(74, 108, 247, 0.18);
}

/* ─── Wochenansicht ────────────────────────────────────────────────────────── */
/* 7-Spalten-Grid (Mo–So) mit scrollbaren Tagesspalten. */
.woche-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 260px;
}

@media (max-width: 900px) {
    .woche-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .woche-grid { grid-template-columns: 1fr 1fr; }
}

.woche-tag {
    border-right: 1px solid var(--border);
    min-height: 200px;
}
.woche-tag:last-child { border-right: none; }

.woche-tag-header {
    padding: 10px 8px 6px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 5px;
}

.woche-tag-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.woche-tag-nr {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.heute-kreis {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.woche-heute .woche-tag-header { background: rgba(74,108,247,0.07); }
.woche-we .woche-tag-name      { color: #ef4444; }

.woche-tag-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.woche-eintrag {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--text);
    border-left: 3px solid var(--primary);
    line-height: 1.3;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.woche-deadline {
    background: var(--danger-light);
    border-left-color: var(--danger);
    color: #991b1b;
}

.woche-zeit {
    font-weight: 600;
    margin-right: 3px;
    color: var(--text-muted);
}

.woche-leer {
    font-size: 12px;
    color: var(--text-light);
    padding: 4px 6px;
}

/* ─── Pin-Icon ─────────────────────────────────────────────────────────────── */
.pin-icon {
    vertical-align: middle;
    margin-right: 2px;
}

/* ─── Eintrag-Voransicht ───────────────────────────────────────────────────── */
.preview-item {
    padding: 4px 0;
}

.preview-typ-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Hamburger-Button (nur mobil sichtbar) ────────────────────────────────── */
/* Floating Button oben links, der die Sidebar öffnet/schließt. */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 200;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    line-height: 1;
}

/* ─── Sidebar-Overlay (mobil) ──────────────────────────────────────────────── */
/* Halbtransparentes Overlay hinter der offenen Sidebar; Klick schließt Sidebar. */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 150;
}

/* ─── Sidebar-Schließen-Button ─────────────────────────────────────────────── */
/* Nur mobil sichtbar; erscheint rechts im Sidebar-Header als runder X-Button. */
.sidebar-close-btn {
    display: none; /* Auf Desktop komplett verborgen */
    margin-left: auto;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.20);
    color: #fff;
}

/* ─── Mobile: Hamburger + Sidebar-Overlay + offene Sidebar aktivieren ──────── */
@media (max-width: 700px) {
    .hamburger-btn   { display: flex; align-items: center; justify-content: center; }
    .sidebar-close-btn { display: flex; }

    /* Sidebar standardmäßig ausgeblendet (position:fixed, außerhalb links) */
    .sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 160;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    /* .sidebar-open wird per JS gesetzt und schiebt die Sidebar ins Bild */
    .sidebar.sidebar-open {
        transform: translateX(0);
    }
}

/* ─── Sidebar-Suche ────────────────────────────────────────────────────────── */
/* Suchleiste innerhalb der Sidebar, leitet an suche.php weiter. */
.sidebar-search {
    display: flex;
    align-items: center;
    margin: 12px 12px 6px;
    background: rgba(255,255,255,0.09);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.16);
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}
.sidebar-search:focus-within {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.14);
}

.sidebar-search-input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    padding: 9px 4px 9px 14px;
    outline: none;
    font-family: var(--font);
}

.sidebar-search-input::placeholder { color: rgba(180,200,230,0.55); }

.sidebar-search-btn {
    background: none;
    border: none;
    color: rgba(180,200,230,0.7);
    padding: 8px 12px 8px 6px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: color 0.15s;
}
.sidebar-search-btn:hover { color: #fff; }

/* ─── Dark-Mode-Button ─────────────────────────────────────────────────────── */
/* Toggle-Button in der Sidebar-Fußzeile. */
.dark-mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.14s;
    margin-bottom: 6px;
    text-align: left;
    font-family: var(--font);
}
.dark-mode-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* ─── Navigations-Badge (überfällige Deadlines) ────────────────────────────── */
/* Rotes Pill-Badge rechts im Navigationslink, zeigt Anzahl überfälliger Deadlines. */
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

/* ─── Fortschrittsbalken ───────────────────────────────────────────────────── */
/* Aufgaben-Fortschritt im Dashboard. track = graue Spur, fill = blauer Balken. */
.progress-bar-wrapper {
    margin-bottom: 12px;
}

.progress-bar-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #764ba2);
    border-radius: 10px;
    transition: width 0.4s ease;
    min-width: 4px;
}

/* ─── Widget-Karten (Drag & Drop) ──────────────────────────────────────────── */
/* Basis-Widget; dragging-Klasse wird während des HTML5-Drag gesetzt. */
.widget-card {
    cursor: grab;
    transition: box-shadow 0.15s, opacity 0.15s;
}

.widget-card.dragging {
    opacity: 0.45;
    box-shadow: 0 8px 24px rgba(74,108,247,0.18);
    cursor: grabbing;
}

/* ─── Suchbegriff-Hervorhebung ─────────────────────────────────────────────── */
/* <mark>-Tag: Suchbegriff wird auf der Suchergebnis-Seite gelb hinterlegt. */
mark {
    background: #fef9c3;
    color: #78350f;
    border-radius: 2px;
    padding: 0 1px;
}

/* ─── Dark Mode ─────────────────────────────────────────────────────────────── */
/* Alle CSS-Custom-Properties werden auf dunkle Varianten überschrieben.
   Das Attribut [data-theme="dark"] wird per JavaScript auf <html> gesetzt. */
[data-theme="dark"] {
    --bg:       #0f172a;
    --surface:  #1e293b;
    --border:   #334155;
    --shadow:   0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
    --text:       #e2e8f0;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --primary-light: rgba(74, 108, 247, 0.2);
    --success-light: rgba(16, 185, 129, 0.15);
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger-light:  rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .auth-card { background: var(--surface); }

[data-theme="dark"] .greeting-bar {
    background: linear-gradient(135deg, #1e40af 0%, #4a1d96 100%);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-select {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .kalender-table td.leer { background: #0d1629; }
[data-theme="dark"] .kalender-table td.heute { background: #1e3a5f; }
[data-theme="dark"] .kalender-table th { background: var(--bg); }

[data-theme="dark"] .woche-tag-header { background: var(--bg); }
[data-theme="dark"] .woche-heute .woche-tag-header { background: rgba(74,108,247,0.12); }

[data-theme="dark"] mark { background: #451a03; color: #fde68a; }

