/* === Basis === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f0;
    color: #333;
    line-height: 1.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Navigation === */
.navbar {
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand { color: #fff; font-size: 18px; font-weight: bold; }
.nav-brand:hover { text-decoration: none; opacity: 0.9; }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: #cbd5e1; font-size: 14px; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-separator { width: 1px; height: 16px; background: #475569; }
.nav-user { color: #94a3b8; font-size: 13px; }

/* === Container === */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* === Footer === */
.footer { text-align: center; padding: 20px; color: #999; font-size: 13px; }
.footer-disclaimer { color: #b91c1c; font-size: 11px; margin-top: 4px; }

/* === Badges === */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-admin { background: #dbeafe; color: #1e40af; }
.badge-therapeut { background: #dcfce7; color: #166534; }

/* === Page Header === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 { font-size: 24px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

/* === Badge === */
.badge {
    background: #e2e8f0;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

/* === Flash Messages === */
.flash-messages { margin-bottom: 16px; }
.flash {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* === Tables === */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
.table th { background: #f8fafc; color: #64748b; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.table-compact th, .table-compact td { padding: 6px 10px; font-size: 13px; }
.actions { white-space: nowrap; }
.actions .btn { margin-right: 4px; }

/* === Forms === */
.form { max-width: 700px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 14px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }
.form-check { display: flex; align-items: center; padding-top: 24px; }
.form-check label { display: flex; align-items: center; gap: 8px; }
.form-actions { display: flex; gap: 8px; margin-top: 24px; }
.search-form { display: flex; gap: 8px; margin-bottom: 24px; }
.search-form input { padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; width: 300px; }

/* === Info Card === */
.info-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.info-card h2 { font-size: 16px; margin-bottom: 12px; color: #1e293b; }

/* === DL horizontal === */
.dl-horizontal { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; }
.dl-horizontal dt { color: #64748b; font-size: 13px; }
.dl-horizontal dd { font-size: 14px; }

/* === Radix Layout === */
.radix-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.chart-container {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 16px;
}
.chart-container svg { width: 100%; height: auto; }
.radix-tables { display: flex; flex-direction: column; gap: 0; }

/* === Planet Symbols === */
.planet-symbol { font-size: 16px; margin-right: 2px; }
.sign-symbol {
    font-family: "Segoe UI Symbol", "Noto Sans Symbols2", "DejaVu Sans", sans-serif;
    font-size: 18px;
    color: #000;
    margin-right: 2px;
    font-variant-emoji: text;
}
.retro { color: #dc2626; font-weight: bold; font-size: 12px; }

/* === Aspect Colors === */
.aspect-konjunktion { color: #2563eb; font-weight: 600; }
.aspect-quadrat { color: #dc2626; font-weight: 600; }
.aspect-opposition { color: #dc2626; }
.aspect-spiegelpunkt { color: #8b5cf6; }

/* === Houses Grid === */
.houses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}
.house-item { padding: 4px 8px; font-size: 13px; }
.house-item.highlight { background: #eff6ff; border-radius: 4px; font-weight: 500; }

/* === Journal === */
.journal-entries { margin-bottom: 16px; }
.journal-entry { padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.journal-entry strong { color: #1e293b; font-size: 13px; }
.journal-entry p { margin-top: 4px; white-space: pre-wrap; }
.journal-time { color: #94a3b8; font-size: 11px; margin-left: 8px; }
.journal-form { margin-top: 12px; }
.journal-entry-header { display: flex; align-items: center; justify-content: space-between; }
.journal-actions { display: flex; gap: 4px; }
.btn-journal {
    background: none; border: 1px solid #e2e8f0; border-radius: 4px;
    padding: 2px 8px; font-size: 11px; cursor: pointer; color: #64748b;
    font-family: inherit; transition: background 0.15s, color 0.15s;
}
.btn-journal:hover { background: #f1f5f9; color: #1e293b; }
.btn-journal-delete:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.journal-edit-form {
    padding: 10px 0; border-bottom: 1px solid #f1f5f9;
    background: #f8fafc; border-radius: 6px; padding: 12px; margin: 4px 0;
}
.journal-edit-buttons { display: flex; gap: 4px; align-items: flex-start; padding-top: 0; }

/* === Geocoding === */
.geocode-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}
.geocode-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.geocode-item:hover { background: #f8fafc; }
.geocode-item:last-child { border-bottom: none; }

/* === Empty State === */
.empty-state { color: #94a3b8; padding: 40px 0; text-align: center; }
.note { color: #64748b; font-style: italic; }

/* === MRL === */
.mrl-directions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.mrl-direction h2 { font-size: 18px; margin-bottom: 4px; }
.direction-desc { color: #64748b; font-size: 13px; margin-bottom: 16px; }

.mrl-phase {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 3px solid #e2e8f0;
}
.mrl-phase.phase-active {
    border-left-color: #2563eb;
    background: #f8faff;
}

.phase-header { margin-bottom: 8px; }
.phase-title { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.phase-house { font-weight: 700; font-size: 15px; }
.phase-age { color: #64748b; font-size: 13px; }
.badge-active { background: #2563eb; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.phase-ruler { font-size: 13px; color: #475569; }

.mrl-triggers { margin-top: 8px; }
.mrl-triggers td { font-size: 12px; padding: 4px 8px; }
.mrl-triggers th { font-size: 11px; padding: 4px 8px; }

.trigger-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}
.type-direkt { background: #dbeafe; color: #1d4ed8; }
.type-herrschaft { background: #fef3c7; color: #92400e; }
.type-herrschaft_neben { background: #e0e7ff; color: #3730a3; }
.type-konstellation { background: #fce7f3; color: #9d174d; }
.type-gsp { background: #d1fae5; color: #065f46; }

.trigger-gsp td { color: #065f46; font-style: italic; }
.empty-state-small { color: #94a3b8; font-size: 12px; padding: 6px 0; }

/* === GSP === */
.gsp-activated { background: #f0fdf4; }
.gsp-activated td:first-child { color: #065f46; }
.gsp-desc { color: #64748b; font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Progression === */
.prog-dir {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}
.prog-fwd { background: #dbeafe; color: #1d4ed8; }
.prog-rev { background: #fef3c7; color: #92400e; }
.prog-past td { color: #94a3b8; }

/* === Transite === */
.transit-table td { vertical-align: middle; }
.transit-pos { color: #94a3b8; font-size: 11px; display: block; }
.transit-resonanz { background: #fffbeb; border-left: 3px solid #f59e0b; }
.badge-resonanz {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}
.transit-form label { white-space: nowrap; }

/* === Events === */
.event-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.event-summary-item {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 6px; border: 1px solid #e2e8f0;
    background: #fff; text-decoration: none; font-size: 13px;
    transition: background 0.15s;
}
.event-summary-item:hover { background: #f8fafc; text-decoration: none; }
.event-summary-item.active { background: #eff6ff; border-color: #2563eb; }
.event-count { font-weight: 700; color: #1e293b; }
.event-typ-badge {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    white-space: nowrap;
}
.evt-tra { background: #dbeafe; color: #1d4ed8; }
.evt-mrl { background: #fef3c7; color: #92400e; }
.evt-pro { background: #d1fae5; color: #065f46; }
.event-table td { font-size: 12px; padding: 5px 8px; }
.event-table th { font-size: 11px; padding: 5px 8px; }

/* === Ausgabe (Gesamtübersicht) === */
.ausgabe-chapter { page-break-inside: avoid; }
.chapter-title { border-bottom: 2px solid #2563eb; padding-bottom: 4px; }
.mrl-phase-compact {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-left: 2px solid #e2e8f0;
    font-size: 13px;
}
.mrl-phase-compact.phase-active { border-left-color: #2563eb; background: #f8faff; }

/* === Chapter Toggle === */
.chapter-arrow {
    display: inline-block;
    width: 16px;
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.15s;
    margin-right: 4px;
}
.chapter-title:hover .chapter-arrow { color: #2563eb; }
.chapter-collapsed { opacity: 0.85; }
.chapter-collapsed .chapter-title { border-bottom-color: #e2e8f0; }
/* === Format Toggle === */
.format-toggle { display: flex; gap: 0; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; }
.format-option {
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}
.format-option:first-child { border-right: 1px solid #d1d5db; }
.format-option.active { background: #2563eb; color: #fff; }
.format-option input[type="radio"] { display: none; }

/* === Remedy / Mittel === */
.remedy-inline { display: flex; flex-wrap: wrap; gap: 3px; }
.remedy-pill {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}
.remedy-notice { background: #fffbeb; border: 1px solid #fde68a; }
.remedy-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.remedy-hit-count { color: #2563eb; font-weight: 700; }

/* === Differentiation === */
.diff-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 960px) {
    .diff-layout { grid-template-columns: 1fr; }
}
.diff-tier-a { border-left: 3px solid #16a34a; }
.diff-tier-b { border-left: 3px solid #f59e0b; }
.diff-tier-c { border-left: 3px solid #e2e8f0; }
.diff-remedy {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.diff-remedy:last-child { border-bottom: none; }
.diff-remedy-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.diff-score {
    font-size: 12px;
    color: #2563eb;
    font-weight: 600;
}
.diff-remedy-detail { margin-top: 2px; }
.diff-konstellationen {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}
.pill-tendenz {
    opacity: 0.65;
    border: 1px dashed #93c5fd;
}
.pill-tendenz small {
    color: #94a3b8;
    font-size: 10px;
}
.pill-resonanz {
    background: #fffbeb !important;
    color: #92400e !important;
    border: 1px solid #fde68a;
}

/* === Chat === */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
    margin-bottom: 8px;
}
.chat-msg {
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.chat-user {
    background: #eff6ff;
    color: #1e293b;
    margin-left: 40px;
    text-align: right;
}
.chat-assistant {
    background: #f1f5f9;
    color: #1e293b;
    margin-right: 40px;
}
.chat-input-row {
    display: flex;
    gap: 6px;
}

/* === Query Tabs === */
.query-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}
.query-tab {
    padding: 8px 16px;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.query-tab:hover { color: #1e293b; text-decoration: none; }
.query-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* === Chart Tooltip === */
.chart-tooltip {
    display: none;
    position: absolute;
    background: #1e293b;
    color: #f1f5f9;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre;
    pointer-events: none;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-width: 250px;
}

/* === Statistics === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-number { font-size: 28px; font-weight: 700; color: #2563eb; }
.stat-label { font-size: 13px; color: #64748b; margin-top: 2px; }
.stats-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 768px) {
    .stats-two-col { grid-template-columns: 1fr; }
}

.print-only { display: none; }
.print-header { text-align: center; margin-bottom: 20px; }
.print-header h1 { font-size: 22px; margin-bottom: 4px; }
.print-header p { color: #64748b; font-size: 13px; margin: 2px 0; }

/* === Print === */
@media print {
    .no-print { display: none !important; }
    .print-only { display: block !important; }
    .navbar, .footer { display: none !important; }
    .container { max-width: 100%; padding: 0; }
    .info-card { box-shadow: none; border: 1px solid #e2e8f0; break-inside: avoid; }
    body { background: #fff; font-size: 11px; }
    .table th, .table td { padding: 4px 6px; font-size: 10px; }
    .table th { font-size: 9px; }
    .chapter-body { display: block !important; }
    .chapter-arrow { display: none !important; }
}

/* === Login === */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 32px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.login-container h2 {
    margin-bottom: 24px;
    text-align: center;
    color: #1e293b;
}
.login-container .form-group {
    margin-bottom: 16px;
}
.login-container label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #475569;
}
.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 15px;
}
.login-container input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}
.login-container .btn-primary {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
}

/* === KI-Modul === */
.ki-hinweis {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    color: #92400e;
}

.ki-details summary {
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
}
.ki-details summary h2 { font-size: 16px; }
.ki-details-card { margin-top: 4px; }

.ki-zusammenfassung { background: #f0f9ff; border-color: #bae6fd; }
.ki-tier { margin: 8px 0; }
.ki-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin: 2px 4px;
}
.ki-badge-3 { background: #bbf7d0; color: #14532d; }
.ki-badge-2 { background: #fef08a; color: #713f12; }
.ki-badge-1 { background: #e2e8f0; color: #475569; }
.ki-meta { margin-top: 12px; font-size: 12px; color: #64748b; }

.ki-mittel {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    margin: 10px 0;
    background: #fff;
}
.ki-mittel-3 { border-left: 4px solid #22c55e; }
.ki-mittel-2 { border-left: 4px solid #eab308; }
.ki-mittel-1 { border-left: 4px solid #94a3b8; }

.ki-mittel-header h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.ki-ebenen-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
}

.ki-section { margin: 8px 0 4px; padding: 6px 0; }
.ki-label {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ki-section p { margin-top: 4px; font-size: 14px; }

.ki-konst-list {
    list-style: none;
    padding: 4px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ki-konst-list li {
    font-size: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px 8px;
    border-radius: 4px;
}
.ki-weg, .ki-typ {
    font-size: 11px;
    color: #64748b;
    margin-left: 4px;
}
.ki-tendenz { font-size: 11px; color: #d97706; font-style: italic; }
.ki-beschreibung { display: block; font-size: 12px; color: #64748b; }
.ki-kein-match { font-size: 13px; color: #94a3b8; font-style: italic; }

.ki-nachbewertung { background: #fafafa; }
.ki-nachbewertung-item {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0;
}
.ki-relevant { background: #f0fdf4; border-color: #86efac; }
.ki-irrelevant { background: #f9fafb; border-color: #e5e7eb; }
.ki-nachbewertung-header { display: flex; align-items: center; gap: 10px; }
.ki-badge-relevant {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #bbf7d0;
    color: #14532d;
}
.ki-badge-irrelevant {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #6b7280;
}
.ki-nachbewertung-konst { font-size: 12px; color: #64748b; margin: 4px 0; }
.ki-nachbewertung-text { font-size: 14px; margin-top: 4px; }

/* === KI Filter (Schritt 2b) === */
.ki-filter-mittel-liste { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ki-filter-zeitraum {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.ki-filter-zeitraum .form-group { margin-bottom: 0; }
.ki-filter-zeitraum input[type="date"] { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 4px; }
.form-inline { display: flex; align-items: center; gap: 8px; }
.form-inline label { margin-bottom: 0; white-space: nowrap; }

.ki-filter-actions-top { margin: 8px 0; }
.ki-filter-select-all { font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }

.ki-filter-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}
.ki-filter-table th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ki-filter-th-check { width: 32px; }
.ki-filter-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.ki-filter-table tbody tr:hover { background: #f8fafc; }
.ki-filter-row-resonanz { background: #fefce8; }
.ki-filter-row-resonanz:hover { background: #fef9c3 !important; }

.ki-filter-konst { font-weight: 600; }
.ki-filter-typen { display: flex; flex-wrap: wrap; gap: 4px; }
.ki-filter-typ-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}
.ki-filter-typ-transit { background: #dbeafe; color: #1e40af; }
.ki-filter-typ-mrl { background: #f3e8ff; color: #6b21a8; }
.ki-filter-typ-prog { background: #dcfce7; color: #166534; }
.ki-filter-zeitraum-cell { font-size: 12px; color: #64748b; white-space: nowrap; }
.ki-filter-mittel-count { text-align: center; font-weight: 600; }
.ki-filter-resonanz { text-align: center; }
.ki-filter-stern { color: #f59e0b; font-size: 18px; }

.btn-lg { padding: 10px 24px; font-size: 16px; }

/* === Mittel-Detail Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: #fff;
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    position: relative;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 10px 10px 0 0;
    z-index: 1;
}
.modal-header h2 { font-size: 18px; margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}
.modal-close:hover { background: #f1f5f9; color: #1e293b; }
.modal-body { padding: 16px 20px 20px; }
.modal-loading {
    text-align: center;
    padding: 40px 0;
    color: #64748b;
    font-size: 14px;
}
.modal-error {
    text-align: center;
    padding: 24px 0;
    color: #dc2626;
    font-size: 14px;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
}
.modal-tab {
    padding: 8px 16px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.modal-tab:hover { color: #1e293b; }
.modal-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* Modal Sections */
.modal-section { margin-bottom: 16px; }
.modal-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    margin-bottom: 6px;
}
.modal-section ul {
    list-style: none;
    padding: 0;
}
.modal-section li {
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 1px solid #f8fafc;
    line-height: 1.5;
}
.modal-section li:last-child { border-bottom: none; }
.modal-quelle {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 4px;
}
.modal-gruppe {
    margin-bottom: 20px;
}
.modal-gruppe-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}

/* Konstellationen im Modal */
.modal-konst-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
}
.modal-konst-list li {
    font-size: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 3px 8px;
    border-radius: 4px;
    border-bottom: none;
}

/* Weihe-Punkte im Modal */
.modal-weihe-punkte { display: flex; flex-direction: column; gap: 10px; }
.modal-weihe-punkt {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
}
.modal-weihe-bild {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}
.modal-weihe-info { font-size: 13px; }
.modal-weihe-info strong { display: block; margin-bottom: 2px; }

/* Boericke-Link */
.modal-boericke {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 4px;
    color: #2563eb;
}

/* Info-Button (bei Mittelnamen) */
.btn-mittel-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    border: none;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
    transition: background 0.15s;
}
.btn-mittel-info:hover { background: #c7d2fe; }

/* Weihe-Punkte Admin */
.weihe-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* === KI-Modell-Badges === */
.ki-modell-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}
.ki-modell-badge-claude { background: #dbeafe; color: #1e40af; }
.ki-modell-badge-grok { background: #ffedd5; color: #9a3412; }

/* === KI-Vergleichsansicht === */
.ki-vergleich-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.ki-mittel-gemeinsam {
    border-left-color: #16a34a !important;
    background: #f0fdf4;
}
.ki-badge-gemeinsam {
    display: inline-block;
    color: #16a34a;
    font-size: 14px;
    margin-left: 4px;
}

/* === Responsive === */
@media (max-width: 960px) {
    .radix-layout { grid-template-columns: 1fr; }
    .chart-container { position: static; }
    .mrl-directions { grid-template-columns: 1fr; }
    .ki-vergleich-grid { grid-template-columns: 1fr; }
}
