* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    font-size: 16px;
}

/* Header */
header {
    background: #1a1a1a;
    color: white;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}
.logo { font-weight: 700; font-size: 1rem; letter-spacing: 0.05em; }
.nav-link { color: #aaa; text-decoration: none; font-size: 0.9rem; }
.nav-link.active { color: white; font-weight: 600; }
.header-user { color: #bbb; font-size: 0.82rem; }
.nav-toggle {
    display: none;
    background: none; border: none; color: white;
    font-size: 1.4rem; cursor: pointer; padding: 0; margin-right: 0.25rem;
}

/* Haupt-Navigation (linke Leiste) */
.mainnav {
    width: 216px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    padding: 0.75rem 0 1.5rem;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}
.mainnav-gruppe {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: #b0b0b0;
    padding: 0.9rem 1.25rem 0.35rem;
}
.mainnav-link {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 1.25rem;
    text-decoration: none; color: #444; font-size: 0.9rem;
    border-left: 3px solid transparent;
}
.mainnav-link:hover { background: #f6f6f4; }
.mainnav-link.active {
    background: #f0f0ef; border-left-color: #1a1a1a;
    color: #1a1a1a; font-weight: 600;
}
.mainnav-ic { font-size: 1.05rem; width: 22px; text-align: center; }
.nav-overlay {
    display: none; position: fixed; inset: 56px 0 0 0;
    background: rgba(0,0,0,0.35); z-index: 90;
}

/* Layout */
.layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #e8e8e8;
    padding: 1rem 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.25rem;
    text-decoration: none;
    color: #444;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 0.1s;
}
.sidebar-link:hover { background: #f5f5f5; }
.sidebar-link.active {
    background: #f0f0f0;
    border-left-color: #1a1a1a;
    color: #1a1a1a;
    font-weight: 600;
}
.sidebar-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-badge {
    margin-left: auto;
    background: #1a1a1a;
    color: white;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
}
.sidebar-badge-grau { background: #ccc; color: #555; }
.sidebar-badge-gruen { background: #22c55e; color: white; }
.sidebar-badge-blau { background: #3b82f6; color: white; }
.sidebar-badge-rot { background: #ef4444; color: white; }

/* Main content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 860px;
    min-width: 0;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
h1 { font-size: 1.4rem; font-weight: 700; }
.subtitle { color: #666; font-size: 0.85rem; margin-top: 0.2rem; }

/* Badges */
.badge {
    background: #1a1a1a;
    color: white;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-grau { background: #ccc; color: #555; }

/* Status badge */
.status-badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.status-neu { background: #f0f4ff; color: #1e40af; }
.status-kontaktiert { background: #f0fdf4; color: #166534; }
.status-interesse { background: #fefce8; color: #854d0e; }
.status-termin { background: #eff6ff; color: #1d4ed8; }
.status-absage { background: #fef2f2; color: #991b1b; }
.status-kein_interesse { background: #f5f5f5; color: #666; }

/* Status-Aktionen */
.status-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    align-items: center;
}
.btn-status {
    background: #f5f5f5;
    color: #444;
    border: 1px solid #e0e0e0;
    font-size: 0.78rem !important;
    padding: 0.3rem 0.6rem !important;
}

/* Bulk-Leiste */
.bulk-bar {
    position: sticky;
    top: 56px;
    z-index: 50;
    background: #1a1a1a;
    color: white;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Karten */
.karten-grid { display: flex; flex-direction: column; gap: 1rem; }
.karte {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    border: 1px solid #e8e8e8;
}
.karte-erledigt { opacity: 0.6; }
.karte-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.karte-titel { font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.karte-meta { font-size: 0.82rem; color: #666; margin-top: 0.2rem; }

/* Vorschau */
.vorschau {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: #444;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Kontakt-Box */
.kontakt-box { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.btn-kontakt {
    background: #fff8e1;
    color: #b45309;
    border: 1px solid #fde68a;
    font-weight: 600;
    text-align: center;
}
.telefon-form { display: flex; gap: 0.4rem; }
.telefon-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
    font-family: inherit;
}
.telefon-input:focus { outline: none; border-color: #1a1a1a; }
.kontakt-label { display: flex; align-items: center; font-size: 1rem; flex-shrink: 0; }

/* Textarea */
.label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.4;
}
.textarea:focus { outline: none; border-color: #1a1a1a; }

/* Aktionen */
.karte-aktionen { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.btn:active { opacity: 0.8; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-primary { background: #1a1a1a; color: white; }
.btn-whatsapp { background: #25D366; color: white; }
.btn-mail { background: #f0f4ff; color: #1a56db; border: 1px solid #c7d7fa; }
.btn-kleinanzeigen { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; font-weight: 600; }
.btn-geomap { background: #1a56db; color: white; }
.btn-success { background: #e8f5e9; color: #2e7d32; }
.btn-ghost { background: #f0f0f0; color: #444; }
.kein-kontakt { font-size: 0.85rem; color: #999; align-self: center; }

/* Leer */
.leer-hinweis {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #666;
    border: 1px dashed #ddd;
}

/* Mobile / Tablet: Hauptnavigation als ausklappbare Schublade */
@media (max-width: 820px) {
    .nav-toggle { display: block; }
    .mainnav {
        position: fixed; top: 56px; left: 0; z-index: 95;
        height: calc(100vh - 56px);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.12);
    }
    body.nav-offen .mainnav { transform: translateX(0); }
    body.nav-offen .nav-overlay { display: block; }
}

/* Mobile */
@media (max-width: 640px) {
    .sidebar { display: none; }
    .main-content { padding: 1rem; }
    .page-header { flex-direction: column; }
}

/* Tagesübersicht */
.tagesuebersicht {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.tages-karte {
    flex: 1;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    min-width: 0;
}
.tages-karte.tages-highlight { border-color: #22c55e; background: #f0fdf4; }
.tages-karte.tages-warning  { border-color: #f59e0b; background: #fffbeb; }
.tages-karte.tages-blau     { border-color: #3b82f6; background: #eff6ff; }
.tages-link { text-decoration: none; color: inherit; display: block; }
.tages-zahl { font-size: 2rem; font-weight: 800; line-height: 1; }
.tages-label { font-size: 0.78rem; color: #666; margin-top: 0.25rem; }
.tages-sub   { font-size: 0.72rem; color: #f59e0b; margin-top: 0.2rem; font-weight: 600; }

/* Nachfassen-Banner */
.nachfassen-banner {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.75rem;
}

/* Checkliste-Button */
.btn-checkliste {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
    font-weight: 600;
}

@media (max-width: 640px) {
    .tagesuebersicht { flex-direction: column; }
}

/* Briefing */
.briefing-sektion {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.briefing-titel {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

/* Aktien */
.aktien-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.aktie-karte {
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}
.aktie-karte.aktie-positiv { border-color: #bbf7d0; background: #f0fdf4; }
.aktie-karte.aktie-negativ { border-color: #fecaca; background: #fef2f2; }
.aktie-name    { font-size: 0.75rem; color: #666; margin-bottom: 0.3rem; font-weight: 600; }
.aktie-preis   { font-size: 1.2rem; font-weight: 800; }
.aktie-waehrung { font-size: 0.7rem; color: #888; font-weight: 400; }
.aktie-change  { font-size: 0.82rem; font-weight: 700; margin-top: 0.2rem; }
.change-positiv { color: #16a34a; }
.change-negativ { color: #dc2626; }

/* News */
.news-liste { display: flex; flex-direction: column; gap: 0.6rem; }
.news-item {
    display: block;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
.news-item:hover { background: #f8f8f8; }
.news-quelle { font-size: 0.72rem; color: #888; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.news-titel  { font-size: 0.9rem; font-weight: 600; color: #1a1a1a; line-height: 1.3; }
.news-text   { font-size: 0.8rem; color: #666; margin-top: 0.3rem; line-height: 1.4; }

/* Wissensdatenbank */
.objekt-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.form-feld { display: flex; flex-direction: column; gap: 0.3rem; }
.objekt-daten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}
.objekt-daten-item {
    background: #f8f8f8;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}
.objekt-daten-label { font-size: 0.72rem; color: #888; font-weight: 600; text-transform: uppercase; display: block; }
.objekt-daten-wert  { font-size: 0.9rem; font-weight: 600; color: #1a1a1a; }

/* KI-Antwort Box */
.ki-antwort {
    margin-top: 0.75rem;
    background: #f0f4ff;
    border: 1px solid #c7d7fa;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #1e3a8a;
    white-space: pre-wrap;
}

/* E-Mail */
.mail-ungelesen { border-left: 3px solid #1a1a1a; }

/* WhatsApp Setup */
.setup-schritt {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #fde68a;
}
.setup-schritt:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.setup-nr {
    width: 32px; height: 32px;
    background: #f59e0b; color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem;
    flex-shrink: 0;
}
.setup-schritt p { font-size: 0.88rem; color: #666; margin-top: 0.3rem; line-height: 1.5; }

/* Upload */
.upload-form { margin-bottom: 0.75rem; }
.upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #1a1a1a;
    color: white;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}
.upload-label input[type="file"] { display: none; }
.upload-label:hover { opacity: 0.85; }
.upload-hint { font-size: 0.78rem; color: #aaa; margin-top: 0.4rem; }

/* Dokument-Zeilen */
.dok-zeile {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}
.dok-kopf {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    user-select: none;
    background: #f8f8f8;
}
.dok-kopf:hover { background: #f0f0f0; }
.dok-icon  { font-size: 1rem; flex-shrink: 0; }
.dok-name  { font-size: 0.88rem; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dok-datum { font-size: 0.75rem; color: #aaa; flex-shrink: 0; }
.dok-pfeil { font-size: 0.75rem; color: #aaa; flex-shrink: 0; margin-left: 0.25rem; }
.dok-body  { padding: 0.75rem; border-top: 1px solid #e8e8e8; background: white; }
