/* ==========================================================================
 * AzubiLaunch -- Komponenten-Stil
 * Mobile-First + Desktop-Breakpoint bei 900px.
 * ALLE Farben / Shadows / Borders über var(--...) aus variables.css.
 * ========================================================================== */


/* ==========================================================================
 * APP-NAVIGATION: TopBar (mobile), Sidebar (desktop), BottomNav+FAB (mobile)
 * ========================================================================== */

/* --- Mobile Top-Bar -------------------------------------------------------- */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--topbar-height) + var(--safe-area-top));
    padding: var(--safe-area-top) var(--space-4) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: var(--topbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 90;
}
/* Brand: Rocket-Icon (Akzent) + Gradient-Wordmark -- einheitlich mobile + desktop */
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.brand:hover { text-decoration: none; color: var(--text-primary); }
.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.brand-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.topbar-avatar {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 14px;
}
.topbar-avatar:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* User-Menu-Popover (Theme / Profil / Admin / Abmelden) */
.user-menu {
    z-index: 1100;
    width: 260px;
    max-width: calc(100vw - 24px);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-2);
    animation: userMenuIn .15s ease-out;
}
@keyframes userMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.user-menu-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
}
.user-menu-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 14px;
}
.user-menu-name {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-menu-mail {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-menu-sep {
    height: 1px;
    background: var(--border);
    margin: var(--space-2) 0;
}
.user-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: 10px var(--space-3);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font: inherit;
    font-family: var(--font-headline);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}
.user-menu-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.user-menu-item .icon { color: var(--text-secondary); }
.user-menu-danger { color: var(--status-absage); }
.user-menu-danger .icon { color: var(--status-absage); }

/* Icon-only Button (Theme-Toggle, Notifications etc) */
.icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-hover); }
.icon-btn .icon { font-size: 20px; }

@media (min-width: 900px) {
    #top-bar { display: none; }
}

/* --- Desktop-Sidebar ------------------------------------------------------- */
#sidebar {
    display: none;
}

@media (min-width: 900px) {
    #sidebar {
        position: fixed;
        top: 0; left: 0;
        width: var(--sidebar-width);
        height: 100vh;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        background: var(--bg-secondary);
        border-right: 1px solid var(--border);
        padding: var(--space-8) var(--space-4) var(--space-6);
        z-index: 80;
    }
    #sidebar .brand {
        padding: 0 var(--space-2);
        margin-bottom: var(--space-8);
        font-size: 20px;
    }
    #sidebar .brand-icon { width: 40px; height: 40px; }
    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: var(--space-1);
        flex: 1;
    }
    .sidebar-nav a {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-md);
        border-left: 3px solid transparent;
        color: var(--text-secondary);
        font-family: var(--font-headline);
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        transition: color .15s, background .15s, border-color .15s;
    }
    .sidebar-nav a:hover {
        color: var(--text-primary);
        background: var(--bg-card);
    }
    .sidebar-nav a.active {
        color: var(--text-primary);
        background: var(--bg-card-hover);
        border-left-color: var(--accent);
    }
    .sidebar-user {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3);
        border-radius: var(--radius-md);
        background: var(--bg-card);
        border: 1px solid var(--border);
        width: 100%;
        min-width: 0;
        text-decoration: none;
        color: var(--text-primary);
        font: inherit;
        cursor: pointer;
        transition: background .15s, border-color .15s;
    }
    .sidebar-user:hover { background: var(--bg-card-hover); border-color: var(--border-hover); text-decoration: none; }
    .sidebar-user-name {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-family: var(--font-headline);
        font-size: 13px;
        font-weight: 600;
    }
    .sidebar-user-mail {
        color: var(--text-muted);
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --- Onboarding-Badge (nur Sidebar / Desktop) ----------------------------- */
#sidebar-onboarding[hidden] { display: none; }
.sidebar-onboarding {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
    transition: background .15s, border-color .15s;
}
.sidebar-onboarding:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.onb-ring {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.onb-ring svg { display: block; }
.onb-ring-bg {
    fill: none;
    stroke: var(--border-strong);
    stroke-width: 3;
}
.onb-ring-fg {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset .3s ease;
}
.onb-ring-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1;
}
.onb-ring-total {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 1px;
}
.onb-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.onb-title {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.1;
}
.onb-hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.onb-chev {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* --- Mobile Bottom-Tab-Bar mit zentralem FAB ------------------------------- */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    gap: 0;
    background: var(--topbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-hairline-up);
    z-index: 90;
}
.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-headline);
    font-weight: 500;
    transition: color .15s;
}
.tab:hover   { color: var(--text-secondary); text-decoration: none; }
.tab.active  { color: var(--accent); }
.tab .icon   { font-size: 24px; }
.tab-label   { font-size: 10px; letter-spacing: 0.04em; }

/* Zentraler FAB im Bottom-Nav */
.tab-fab-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-3);
}
.fab {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--accent-gradient);
    color: var(--color-on-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-glow-xl);
    transform: translateY(-12px);
    transition: transform .12s, filter .12s;
    text-decoration: none;
}
.fab:hover    { filter: brightness(1.1); text-decoration: none; color: var(--color-on-accent); }
.fab:active   { transform: translateY(-10px) scale(0.95); }
.fab .icon    { font-size: 28px; }

@media (min-width: 900px) {
    #bottom-nav { display: none; }
}

/* ==========================================================================
 * BUTTONS
 * ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-headline);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
    min-height: 44px;        /* Touch-Target */
}
.btn:hover    { background: var(--bg-card-hover); border-color: var(--border-hover); text-decoration: none; color: var(--text-primary); }
.btn:active   { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent-gradient);
    border-color: transparent;
    color: var(--color-on-accent);
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.1); background: var(--accent-gradient); color: var(--color-on-accent); box-shadow: var(--shadow-glow-strong); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--border); }

.btn-block   { width: 100%; }
.btn-danger  { color: var(--status-absage); }
.btn-success { color: var(--status-zusage); }

.btn-sm      { padding: 8px 14px; font-size: 13px; min-height: 36px; }
.btn-xs      { padding: 6px 10px; font-size: 12px; min-height: 28px; }


/* ==========================================================================
 * CARD
 * ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
}
.card-lg { padding: var(--space-8); }

/* Glass-Card (für Dashboards, transluzent) */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
}

/* Card mit farbigem Status-Balken links */
.card-status {
    position: relative;
    padding-left: calc(var(--space-6) + 6px);
    --status: var(--text-muted);
}
.card-status::before {
    content: '';
    position: absolute;
    top: var(--space-3);
    bottom: var(--space-3);
    left: var(--space-3);
    width: 3px;
    border-radius: var(--radius-pill);
    background: var(--status);
}


/* ==========================================================================
 * FORM
 * ========================================================================== */
.form-group { margin-bottom: var(--space-4); }
.form-label {
    display: block;
    font-family: var(--font-headline);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    letter-spacing: 0.01em;
}
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font: inherit;
    font-family: var(--font-body);
    transition: border-color .15s, box-shadow .15s;
    min-height: 48px;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}
.form-textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.5;
}

/* 6-stelliger OTP-Code */
.form-input-code {
    font-family: var(--font-mono);
    font-size: 32px;
    text-align: center;
    letter-spacing: 12px;
    font-variant-numeric: tabular-nums;
    padding: 16px;
}


/* ==========================================================================
 * LAUNCHPAD-CARD (öffentlicher Bewerbungs-Link in der Sidebar)
 * ========================================================================== */
.launchpad-card h3 .icon { color: var(--accent); }
.lp-card-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    margin-bottom: var(--space-3);
    font-size: 12px;
}
.lp-card-stat-label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.lp-card-stat-value { color: var(--text-primary); font-weight: 500; font-size: 13px; }
.lp-card-url {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}
.lp-card-url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    min-width: 0;
}
.lp-card-url-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.lp-card-feedback {
    border-top: 1px solid var(--border);
    padding-top: var(--space-3);
}
.lp-card-feedback-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-headline);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: var(--space-2);
}
.lp-fb-item {
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    background: var(--bg-card);
}
.lp-fb-item.unread {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.lp-fb-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    margin-bottom: 2px;
}
.lp-fb-from { margin-bottom: var(--space-2); }
.lp-fb-termin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--status-zusage) 15%, transparent);
    color: var(--status-zusage);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: var(--space-2);
}
.lp-fb-msg {
    font-size: 13px;
    white-space: pre-wrap;
    color: var(--text-primary);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--border);
    margin-top: var(--space-2);
}
.lp-fb-mark {
    margin-top: var(--space-2);
    font-size: 11px;
    padding: 4px 10px;
}

/* Anlagen-Auswahl im Config-Modal */
.lp-anlagen-grid {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: 1fr;
    max-height: 240px;
    overflow-y: auto;
    padding: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
}
.lp-anlagen-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.lp-anlagen-option:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.lp-anlagen-opt-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ==========================================================================
 * DOKUMENT-LISTE (Sidebar auf der Bewerbungs-Detail-View)
 * Zeile = Link (DOCX-Download); 3-Punkt-Menü für weitere Aktionen.
 * ========================================================================== */
.dok-item {
    text-decoration: none;
    color: inherit;
}
.dok-item:hover { text-decoration: none; }
.dok-ico-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    padding: 0;
}
.dok-ico-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
    color: var(--text-primary);
    text-decoration: none;
}
.dok-ico-btn .icon { font-size: 18px; }

/* Kompaktes Context-Menü — nutzt user-menu-Basis (bg, border, padding)
   aus dem Sidebar-User-Menü, schmaler und ohne Header. */
.dok-menu {
    width: 220px;
}


/* ==========================================================================
 * EDITOR-ACTIONS (Anschreiben- + Lebenslauf-Editor — Fußzeile)
 * ========================================================================== */
.editor-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
.editor-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}
.editor-actions-spacer { flex: 1; }
.editor-actions-outputs { justify-content: flex-end; }


/* ==========================================================================
 * LEBENSLAUF-LAYOUT-PICKER (Karten mit SVG-Mini-Skizze)
 * ========================================================================== */
.ll-layout-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-2);
}
@media (max-width: 600px) {
    .ll-layout-picker { grid-template-columns: 1fr; }
}
.ll-layout-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
    text-align: left;
}
.ll-layout-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.ll-layout-card.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    box-shadow: var(--shadow-glow);
}
.ll-sketch {
    display: block;
    width: 100%;
    height: auto;
    max-height: 160px;
    border-radius: var(--radius-sm);
}
.ll-sk-page    { fill: var(--bg-bright); }
.ll-sk-sidebar { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.ll-sk-title   { fill: var(--text-primary); }
.ll-sk-h       { fill: var(--accent); }
.ll-sk-line    { fill: var(--text-secondary); opacity: .6; }
.ll-sk-dim     { fill: var(--text-muted); opacity: .6; }
.ll-sk-foto    { fill: var(--outline); opacity: .6; }
.ll-sk-rule    { stroke: var(--border-strong); stroke-width: .6; }
.ll-layout-meta { display: flex; flex-direction: column; gap: 2px; }
.ll-layout-title {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}
.ll-layout-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Akzent-Farbwähler (Swatches + Custom-Color-Input) */
.akzent-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.akzent-swatch,
.akzent-custom {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .1s, border-color .15s, box-shadow .15s;
    position: relative;
}
.akzent-swatch:hover,
.akzent-custom:hover { transform: scale(1.08); border-color: var(--border-hover); }
.akzent-swatch.active,
.akzent-custom.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
}
.akzent-check {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    opacity: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.akzent-swatch.active .akzent-check { opacity: 1; }
.akzent-custom {
    background: linear-gradient(135deg,
        #ff6b6b 0%, #feca57 25%, #1dd1a1 50%, #5f27cd 75%, #ff6b6b 100%);
    overflow: hidden;
}
.akzent-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
}
.akzent-custom-label {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
    pointer-events: none;
}


/* ==========================================================================
 * INLINE-ALERT (persistent im Formular, z.B. Modal-Fehler mit Aktions-Link)
 * Farbmodi per --alert-color (default: danger/absage). Alternativen:
 *   .inline-alert--info      (accent / indigo)
 *   .inline-alert--warning   (status-kontakt / amber)
 * ========================================================================== */
.inline-alert {
    --alert-color: var(--status-absage);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--alert-color) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--alert-color) 45%, transparent);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: var(--space-4);
}
.inline-alert--info    { --alert-color: var(--accent); }
.inline-alert--warning { --alert-color: var(--status-kontakt); }
.inline-alert .icon { color: var(--alert-color); flex-shrink: 0; }
.inline-alert strong { display: block; margin-bottom: 2px; }
.inline-alert a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
}
.inline-alert a:hover { color: var(--accent-hover); }


/* ==========================================================================
 * TOAST
 * ========================================================================== */
#toast-container {
    position: fixed;
    bottom: calc(var(--tab-height) + var(--safe-area-bottom) + var(--space-4));
    left: 50%;
    transform: translateX(-50%);
    /* Über Modal-Backdrop (1001) und User-Menu (1100) — sonst werden
       Fehler-Toasts verschluckt, wenn aus einem Modal heraus ein API-
       Fehler kommt. */
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: var(--shadow-card);
    animation: toastIn .25s ease-out;
}
.toast-success { border-color: var(--status-zusage); }
.toast-error   { border-color: var(--status-absage); }

@media (min-width: 900px) {
    #toast-container { bottom: var(--space-8); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
 * MODAL
 * ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    backdrop-filter: blur(6px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: backdropIn .2s;
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn .25s ease-out;
    box-shadow: var(--shadow-card);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-family: var(--font-headline); }
.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-body { padding: var(--space-6); overflow-y: auto; }

/* Preview-Modal: groß, iframe füllt die Body-Fläche komplett */
.modal.modal-preview {
    max-width: min(1100px, 95vw);
    max-height: 95vh;
    width: 100%;
}

/* Silent-Mode (Auto-PDF-Download aus Dok-Liste / Editor):
   Modal + Backdrop unsichtbar, aber iframe muss im DOM bleiben, damit
   html2canvas das .sheet-Element messen und rendern kann. Der User
   sieht nur den Loader-Toast, keine visuelle Preview. */
.modal.modal-silent                         { opacity: 0; pointer-events: none; }
.modal-backdrop:has(.modal.modal-silent)    { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.modal.modal-preview .modal-body {
    padding: 0;
    flex: 1;
    display: flex;
    min-height: 0;
}
.preview-wrap {
    flex: 1;
    display: flex;
    min-height: 0;
    background: var(--bg-primary);
}
.preview-iframe {
    flex: 1;
    width: 100%;
    border: 0;
    min-height: 70vh;
    background: #e5e6ec; /* matcht preview-body-Hintergrund im iframe */
}

@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }


/* ==========================================================================
 * LIST-ITEM (Cards in Listen: Firmen, Bewerbungen, Termine, Dokumente)
 * ========================================================================== */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    text-decoration: none;
    color: var(--text-primary);
}
.list-item:hover { background: var(--bg-card-hover); border-color: var(--border-hover); text-decoration: none; color: var(--text-primary); }
.list-item-main  { flex: 1; min-width: 0; }
.list-item-title {
    font-family: var(--font-headline);
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-item-sub {
    color: var(--text-secondary);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-item-meta {
    color: var(--text-muted);
    font-size: 13px;
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--text-muted);
}
.empty-state .emoji { font-size: 48px; margin-bottom: var(--space-4); }

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}
.list-header h1 { margin: 0; }

.search-input { flex: 1; min-width: 200px; }


/* ==========================================================================
 * PIPELINE (Dashboard-Filter)
 * ========================================================================== */
.pipeline {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-2) 0;
    margin: 0 calc(-1 * var(--space-4));
    padding-left:  var(--space-4);
    padding-right: var(--space-4);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 900px) {
    .pipeline { margin: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
}
.pipe-pill {
    --pill-color: var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    color: var(--text-secondary);
    font: inherit;
    font-family: var(--font-headline);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.pipe-pill:hover  { border-color: var(--pill-color); color: var(--text-primary); }
.pipe-pill.active {
    background: color-mix(in srgb, var(--pill-color) 18%, transparent);
    border-color: var(--pill-color);
    color: var(--text-primary);
}
.pipe-count {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: var(--pill-color);
    color: var(--color-on-accent);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    align-items: center;
    justify-content: center;
}
.pipe-label { white-space: nowrap; }


/* ==========================================================================
 * STATUS-BADGE (Pipeline-Status auf Cards, Detail-Seite)
 * ========================================================================== */
.status-badge {
    --sc: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--sc) 15%, transparent);
    color: var(--sc);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* Nächste-Aktion-Card (Bewerbung-Detail) */
.aktion-card {
    --aktion-color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    width: 100%;
    padding: var(--space-4) var(--space-5);
    background: color-mix(in srgb, var(--aktion-color) 8%, var(--bg-card));
    border: 1px solid color-mix(in srgb, var(--aktion-color) 40%, var(--border));
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    margin-bottom: var(--space-4);
}
.aktion-card.aktion-empty {
    --aktion-color: var(--text-muted);
    background: var(--bg-card);
    border-color: var(--border);
    border-style: dashed;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.aktion-card.aktion-empty:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}
.aktion-card.aktion-empty .icon { color: var(--text-muted); font-size: 24px; }

.aktion-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    flex: 1;
}
.aktion-left > .icon { font-size: 24px; flex-shrink: 0; }
.aktion-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}
.aktion-text {
    font-family: var(--font-headline);
    font-weight: 500;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aktion-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}
@media (max-width: 520px) {
    .aktion-card { flex-direction: column; align-items: flex-start; }
    .aktion-actions { width: 100%; }
    .aktion-actions .btn { flex: 1; }
}

/* Vorlage-Picker (Anschreiben-Editor) */
.vorlage-picker {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}
.vorlage-pill {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    color: var(--text-secondary);
    font: inherit;
    font-family: var(--font-headline);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.vorlage-pill:hover  { border-color: var(--accent); color: var(--text-primary); }
.vorlage-pill.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: var(--accent);
    color: var(--text-primary);
}


/* ==========================================================================
 * STATS-CARDS (Dashboard-Bento)
 * ========================================================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}
@media (min-width: 900px) {
    .stats { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
}
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: relative;
    overflow: hidden;
}
.stat-label {
    font-family: var(--font-headline);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-2);
}
.stat-value {
    font-family: var(--font-headline);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}
@media (min-width: 900px) {
    .stat-value { font-size: 36px; }
}


/* ==========================================================================
 * TIMELINE (Bewerbung-Detail)
 * ========================================================================== */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline li {
    position: relative;
    padding: 0 0 var(--space-5) 32px;
}
.timeline-dot {
    position: absolute;
    left: 3px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-pill);
    background: var(--bg-secondary);
    border: 3px solid var(--accent);
}
.timeline-when {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.timeline-head {
    font-family: var(--font-headline);
    font-weight: 600;
}
.timeline-body {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
    white-space: pre-wrap;
}


/* ==========================================================================
 * AUDIT-LOG (Admin)
 * ========================================================================== */
.audit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.audit-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}
.audit-row:last-child { border-bottom: none; }
.audit-dot {
    --sc: var(--accent);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--sc) 20%, transparent);
    color: var(--sc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.audit-body { min-width: 0; }
.audit-line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    flex-wrap: wrap;
}
.audit-target {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
}
.audit-details {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    margin-top: 2px;
}
.audit-when {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
}


/* ==========================================================================
 * CRON-LISTE (Admin)
 * ========================================================================== */
.cron-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.cron-row {
    display: grid;
    grid-template-columns: 12px minmax(100px, 1fr) auto auto;
    gap: var(--space-3);
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.cron-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
}
.cron-when { font-family: var(--font-mono); color: var(--text-secondary); font-size: 12px; }
.cron-meta { font-family: var(--font-mono); color: var(--text-muted); font-size: 11px; }
.cron-stats {
    display: flex;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: 12px;
}
.cron-error {
    margin: 0 0 var(--space-2) 24px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--status-absage) 12%, transparent);
    border-left: 3px solid var(--status-absage);
    color: var(--status-absage);
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: pre-wrap;
    border-radius: 4px;
}


/* ==========================================================================
 * ACTIVITY-FEED (Dashboard)
 * ========================================================================== */
.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.activity-item > a,
.activity-item > div {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: background .1s;
}
.activity-item > a:hover {
    background: var(--bg-card-hover);
    text-decoration: none;
    color: var(--text-primary);
}
.activity-dot {
    --sc: var(--accent);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--sc) 20%, transparent);
    color: var(--sc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.activity-body { min-width: 0; }
.activity-title {
    font-family: var(--font-headline);
    font-weight: 500;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-sub {
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-note {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-when {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    flex-shrink: 0;
    align-self: center;
}

/* ==========================================================================
 * LAUNCHPAD INBOX (Dashboard-Sidebar-Card)
 * ========================================================================== */
.launchpad-inbox-card .lp-inbox-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    margin-left: var(--space-2);
    vertical-align: middle;
}
.lp-inbox-item {
    --sc: var(--accent);
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: var(--space-2);
    transition: background .1s, transform .1s;
    position: relative;
}
.lp-inbox-item:hover {
    background: var(--bg-card-hover);
    text-decoration: none;
    color: var(--text-primary);
}
.lp-inbox-item.is-unread {
    background: color-mix(in srgb, var(--sc) 8%, var(--bg-card));
    border-left: 3px solid var(--sc);
    padding-left: calc(var(--space-3) - 3px);
}
.lp-inbox-dot {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--sc) 20%, transparent);
    color: var(--sc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lp-inbox-body { min-width: 0; }
.lp-inbox-title {
    font-size: 13px;
    font-family: var(--font-headline);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lp-inbox-sub {
    margin-top: 2px;
}
.lp-inbox-termin {
    margin-top: 4px;
    color: var(--text-secondary);
}
.lp-inbox-snippet {
    margin-top: 4px;
    line-height: 1.4;
}
.lp-inbox-unread-mark {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc);
    align-self: center;
    flex-shrink: 0;
}

/* ==========================================================================
 * LAUNCHPAD DASHBOARD-ALERT (prominenter Banner oben)
 * ========================================================================== */
.launchpad-alert {
    --lp-alert-color: var(--accent);
    margin: var(--space-3) 0 var(--space-4);
}
.launchpad-alert-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--lp-alert-color) 18%, var(--bg-card)) 0%,
        color-mix(in srgb, var(--lp-alert-color) 8%, var(--bg-card)) 100%
    );
    border: 1px solid color-mix(in srgb, var(--lp-alert-color) 40%, transparent);
    border-left: 4px solid var(--lp-alert-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--lp-alert-color) 15%, transparent);
    transition: transform .15s, box-shadow .15s;
}
.launchpad-alert-main:hover {
    text-decoration: none;
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--lp-alert-color) 22%, transparent);
}
.launchpad-alert-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lp-alert-color);
    box-shadow: 0 0 0 0 var(--lp-alert-color);
    animation: lp-pulse 1.8s infinite;
    flex-shrink: 0;
}
@keyframes lp-pulse {
    0%   { box-shadow: 0 0 0 0   color-mix(in srgb, var(--lp-alert-color) 60%, transparent); }
    70%  { box-shadow: 0 0 0 12px transparent; }
    100% { box-shadow: 0 0 0 0   transparent; }
}
.launchpad-alert-body { min-width: 0; }
.launchpad-alert-title {
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
}
.launchpad-alert-sub {
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-secondary);
}
.launchpad-alert-arrow {
    color: var(--lp-alert-color);
    flex-shrink: 0;
}

/* ==========================================================================
 * NAV-BADGE (Sidebar-Dashboard-Link + Mobile-BottomNav-Indikator)
 * ========================================================================== */
.nav-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--status-absage, #ef4444);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-card);
}
/* Mobile-BottomNav-Variante: kleiner roter Dot oben rechts am Icon */
.tab-icon-wrap {
    position: relative;
}
.nav-badge-dot {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
}

/* Launchpad-Card auf Bewerbung-Detail-Seite: Glow + Title-Badge + Flash */
.launchpad-card.has-unread {
    border: 1px solid var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent),
                0 4px 16px color-mix(in srgb, var(--accent) 15%, transparent);
}
.lp-card-title-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    margin-left: var(--space-2);
    vertical-align: middle;
}
.flash-highlight {
    animation: card-flash 1.5s ease-out;
}
@keyframes card-flash {
    0%   { box-shadow: 0 0 0 0   color-mix(in srgb, var(--accent) 60%, transparent); }
    30%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 40%, transparent); }
    100% { box-shadow: 0 0 0 0   transparent; }
}


/* ==========================================================================
 * GLOBALE SUCHE (Header-Trigger + Overlay)
 * ========================================================================== */

/* Sidebar-Trigger (Desktop) */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 10px 12px;
    margin-bottom: var(--space-4);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.sidebar-search:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.sidebar-search > span:nth-child(2) { flex: 1; }
.sidebar-search kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Overlay */
.search-overlay {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    backdrop-filter: blur(6px);
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh var(--space-4) var(--space-4);
    animation: backdropIn .15s;
}
.search-panel {
    width: 100%;
    max-width: 640px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    animation: modalIn .2s ease-out;
}
.search-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.search-input-row .icon { color: var(--text-muted); }
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
    font-family: var(--font-body);
}
.search-input::placeholder { color: var(--text-muted); }
.search-hint {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.search-results {
    max-height: 60vh;
    overflow-y: auto;
}
.search-section {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
}
.search-section:last-child { border-bottom: none; }
.search-section-label {
    padding: var(--space-2) var(--space-5);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.search-item {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    padding: 10px var(--space-5);
    text-decoration: none;
    color: var(--text-primary);
    transition: background .1s;
}
.search-item:hover {
    background: var(--bg-card-hover);
    text-decoration: none;
    color: var(--text-primary);
}
.search-item > .icon {
    color: var(--text-muted);
    font-size: 22px;
    flex-shrink: 0;
}
.search-item-emoji {
    font-size: 20px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}
.search-item-body { min-width: 0; flex: 1; }
.search-item-title {
    font-family: var(--font-headline);
    font-weight: 500;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-item-sub {
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}


/* ==========================================================================
 * KANBAN-BOARD
 * ========================================================================== */
.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-4);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    align-items: start;
}
.kan-col {
    --col-color: var(--accent);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: calc(100dvh - var(--topbar-height) - var(--space-12));
}
.kan-col-head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kan-col-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--col-color);
    flex-shrink: 0;
}
.kan-col-title {
    flex: 1;
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.kan-col-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-pill);
}
.kan-col-body {
    padding: var(--space-2);
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: background .15s;
    min-height: 60px;
}
.kan-col-body.drop-over {
    background: color-mix(in srgb, var(--col-color) 14%, transparent);
}
.kan-empty {
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-4);
    font-size: 13px;
}

.kan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--col-color);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    cursor: grab;
    position: relative;
    transition: background .15s, border-color .15s, transform .15s;
}

/* Compact-Variante fürs Dashboard: ersetzt die 4 Stat-Cards oben.
   Spalten teilen sich die verfügbare Breite (kein horizontaler Scroll),
   feste Höhe (~220 px), Karten straff und schmal. */
.kanban-compact {
    gap: var(--space-2);
    overflow-x: hidden;
    /* minmax(0, 1fr) erlaubt Spalten, sehr schmal zu werden — damit
       4–5 Spalten in den Dashboard-Top-Bereich passen, ohne Overflow. */
    grid-auto-columns: minmax(0, 1fr);
    padding-bottom: 0;
}
.kanban-compact .kan-col {
    min-height: 180px;
    max-height: 220px;
    border-radius: var(--radius-md);
}
.kanban-compact .kan-col-head {
    padding: 6px var(--space-3);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.kanban-compact .kan-col-title { font-size: 11px; }
.kanban-compact .kan-col-count { font-size: 10px; padding: 1px 6px; }
.kanban-compact .kan-col-body  {
    padding: 6px;
    gap: 6px;
    min-height: 40px;
}
.kanban-compact .kan-card {
    padding: 6px 10px;
    border-left-width: 2px;
}
.kanban-compact .kan-card-title {
    font-size: 12px;
    padding-right: 4px;
    line-height: 1.25;
}
.kanban-compact .kan-card-sub   { font-size: 10.5px; line-height: 1.25; }
.kanban-compact .kan-card-tag   {
    font-size: 9px;
    padding: 1px 5px;
    margin-top: 3px;
}
/* Actions (Öffnen / Status) nur on-hover / focus — sonst lenken sie
   von der reinen Status-Übersicht ab und kosten Platz. */
.kanban-compact .kan-card-actions {
    top: 3px;
    right: 3px;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
}
.kanban-compact .kan-card:hover .kan-card-actions,
.kanban-compact .kan-card:focus-within .kan-card-actions {
    opacity: 1;
}
.kanban-compact .kan-card-open,
.kanban-compact .kan-card-move {
    width: 20px;
    height: 20px;
    background: var(--bg-card);
}
.kanban-compact .kan-card-open .icon,
.kanban-compact .kan-card-move .icon { font-size: 13px; }
/* Auf Mobile immer sichtbar, sonst kein Move-Button erreichbar */
@media (max-width: 900px) {
    .kanban-compact .kan-card-actions { opacity: 1; }
}
.kan-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    border-left-color: var(--col-color);
}
.kan-card:active { cursor: grabbing; }
.kan-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}
.kan-card-title {
    font-family: var(--font-headline);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
    padding-right: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kan-card-sub {
    color: var(--text-secondary);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kan-card-tag {
    --sc: var(--status-positiv);
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: color-mix(in srgb, var(--sc) 20%, transparent);
    color: var(--sc);
    border-radius: var(--radius-pill);
}
.kan-card-positive {
    border-left-color: var(--status-positiv);
}
.kan-card-actions {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    display: flex;
    gap: 4px;
}
.kan-card-open, .kan-card-move {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}
.kan-card-open:hover, .kan-card-move:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    text-decoration: none;
}
@media (max-width: 900px) {
    .kan-card { cursor: default; }
}


/* ==========================================================================
 * KALENDER-GRID
 * ========================================================================== */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.cal-title { margin: 0; font-size: 20px; }
.cal-nav {
    width: 40px; height: 40px; padding: 0;
    font-size: 22px; line-height: 1;
    min-height: 40px;
}
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.cal-wd {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-day {
    aspect-ratio: 1 / 1;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 6px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    overflow: hidden;
}
.cal-day:hover          { border-color: var(--border-hover); }
.cal-day.out .cal-num   { color: var(--text-muted); opacity: .4; }
.cal-day.today          { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cal-day.today .cal-num { color: var(--accent); font-weight: 700; }
.cal-day.has-event      { background: var(--bg-card); }

.cal-num {
    font-family: var(--font-headline);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.cal-dots {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}
.cal-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
}
.cal-more { font-size: 10px; color: var(--text-muted); margin-left: 2px; font-family: var(--font-mono); }

@media (max-width: 420px) {
    .cal-day { padding: 3px; }
    .cal-num { font-size: 11px; }
    .cal-dot { width: 5px; height: 5px; }
}


/* ==========================================================================
 * PROFIL-FOTO
 * ========================================================================== */
.profil-foto-card {
    display: flex;
    gap: var(--space-6);
    align-items: center;
}
.foto-preview {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: var(--bg-input);
    border: 2px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.foto-preview img { width: 100%; height: 100%; object-fit: cover; }
.foto-placeholder {
    font-size: 40px;
    opacity: .5;
    color: var(--text-muted);
    font-family: var(--font-headline);
    font-weight: 700;
}
.foto-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* ==========================================================================
 * BEREICHS-TABS (CD-IA: Liste/Board/Firmen, Anlagen/Vorlagen, Kalender/Geplant)
 * ========================================================================== */
.bw-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-bright);
    border-radius: var(--radius-md);
    margin: var(--space-2) 0 var(--space-5);
}
.bw-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.bw-tab:hover { color: var(--text-primary); }
.bw-tab.is-active {
    background: var(--bg-card);
    color: var(--accent-dim);
    font-weight: 600;
    box-shadow: var(--shadow-card);
}
/* Eingebettete Views: doppeltes Seiten-Padding neutralisieren */
.bw-embed > .page { padding: 0; max-width: none; }
.bereich-head-only { padding-bottom: 0 !important; }

/* Bewerbungs-Liste (Bereich "Meine Bewerbungen") */
.bw-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.bw-filter .input-icon-wrap {
    position: relative;
    flex: 1 1 240px;
}
.bw-filter .input-icon-wrap .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.bw-filter input[type="search"],
.bw-filter select {
    width: 100%;
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    font: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
}
.bw-filter input[type="search"] { padding-left: 40px; }
.bw-filter select { flex: 0 1 220px; width: auto; }
.bw-filter input:focus-visible, .bw-filter select:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
    outline: none;
}
.bw-count { margin: 0 0 var(--space-2); }
.bw-rows { display: grid; gap: var(--space-2); }
.bw-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, background-color .15s ease;
}
.bw-row:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.bw-row-bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.bw-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bw-row-title { font-weight: 600; font-size: 15px; }
.bw-row-sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-prio {
    width: 22px; height: 22px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--radius-pill);
    background: var(--status-absage);
    color: var(--color-on-accent);
    font-size: 13px; font-weight: 700;
}
.bw-row-chev { color: var(--text-muted); flex: none; }
@media (max-width: 560px) {
    .bw-row .status-badge { display: none; }
}

/* Launchpad-Besuche: wer die Mappe wann geöffnet hat (siehe besucheHtml) */
.lp-visits { margin-top: var(--space-3); }
.lp-visits > summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 0;
}
.lp-visit-list { list-style: none; margin: 6px 0 0; padding: 0; }
.lp-visit {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 5px 0;
    border-bottom: 1px solid var(--border-subtle, rgba(15,20,30,.07));
    font-size: 13px;
}
.lp-visit:last-child { border-bottom: 0; }
.lp-visit-when { font-variant-numeric: tabular-nums; }
.lp-visit-meta { color: var(--text-secondary); font-size: 12px; text-align: right; }

/* Gesendete Mail im Verlauf nachlesen (openGesendeteMail) */
.timeline-mail { margin-top: 6px; }
.mail-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px var(--space-3);
    margin: 0 0 var(--space-4);
    font-size: 13px;
}
.mail-meta dt { color: var(--text-secondary); }
.mail-meta dd { margin: 0; }
.mail-body {
    white-space: pre-wrap;
    word-break: break-word;
    font: inherit;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg-secondary, #f4f4f8);
    border: 1px solid var(--border-subtle, rgba(15,20,30,.08));
    border-radius: var(--radius-md, 10px);
    padding: var(--space-4);
    margin: 0;
    max-height: 55vh;
    overflow: auto;
}
