/*
 * Theme für die Bootstrap-Seiten – gleiche Optik wie das neue Tailwind-Design der Startseite
 * (Indigo/Violett, Navigation oben mit Verlauf, getönter Hintergrund, farbige Kacheln).
 * Farben = Tailwind-Palette (indigo-600 #4f46e5, violet-600 #7c3aed, sky-500 #0ea5e9 …).
 */
:root {
    --app-accent: #4f46e5;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: #4338ca;
    --bs-link-hover-color-rgb: 67, 56, 202;
    --bs-body-font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-body-color: #1e293b;
    --bs-secondary-color: #64748b;
    --bs-border-color: #e2e8f0;
    --bs-border-radius: .5rem;
    --bs-border-radius-lg: .75rem;
    --bs-focus-ring-color: rgba(99, 102, 241, .35);
}
body {
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 45%, #f0f9ff 100%) fixed;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.text-muted { color: #64748b !important; }

.dropdown-menu {
    border: 0; border-radius: .75rem; padding: .375rem; box-shadow: 0 10px 25px -5px rgba(15, 23, 42, .15), 0 0 0 1px rgba(15, 23, 42, .05);
}
.dropdown-item { border-radius: .375rem; padding: .45rem .75rem; font-size: .9rem; color: #475569; }
.dropdown-item .bi { color: #94a3b8; }
.dropdown-item:hover, .dropdown-item:focus { background: #eef2ff; color: #4338ca; text-decoration: none; }
.dropdown-item.active, .dropdown-item:active { background: #e0e7ff; color: #3730a3; font-weight: 500; }
.dropdown-item.active .bi { color: #4f46e5; }

/* ---------- Seitentitel ---------- */
main h1.h3, main h1.h4 { font-weight: 600; letter-spacing: -.01em; color: #0f172a; }

/* ---------- Karten ---------- */
.card {
    border: 0; border-radius: .75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 0 0 1px rgba(15, 23, 42, .05);
}
.card:has(> .card-header) { border-top: 4px solid #6366f1; overflow: hidden; }
/* Farben im Wechsel, wenn mehrere Karten nebeneinander/untereinander stehen */
.row > [class*="col"]:nth-child(3n+2) > .card:has(> .card-header) { border-top-color: #0ea5e9; }
.row > [class*="col"]:nth-child(3n+3) > .card:has(> .card-header) { border-top-color: #8b5cf6; }
.card-header { background: #fff !important; border-bottom: 1px solid #f1f5f9; padding: .85rem 1.1rem; }
.card-header > strong .bi:first-child, .card-header > .bi:first-child {
    display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-right: .35rem; border-radius: .5rem;
    background: #e0e7ff; color: #4338ca;
}

/* Kennzahl-Kacheln (Spalte mit .card.card-body.py-2) → farbige Verläufe */
[class*="col"] > .card.card-body.py-2 {
    color: #fff; border: 0 !important; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 8px 16px -6px rgba(99, 102, 241, .45);
}
[class*="col"]:nth-child(5n+2) > .card.card-body.py-2 { background: linear-gradient(135deg, #0ea5e9, #06b6d4); box-shadow: 0 8px 16px -6px rgba(14, 165, 233, .45); }
[class*="col"]:nth-child(5n+3) > .card.card-body.py-2 { background: linear-gradient(135deg, #10b981, #14b8a6); box-shadow: 0 8px 16px -6px rgba(16, 185, 129, .45); }
[class*="col"]:nth-child(5n+4) > .card.card-body.py-2 { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 8px 16px -6px rgba(245, 158, 11, .45); }
[class*="col"]:nth-child(5n+5) > .card.card-body.py-2 { background: linear-gradient(135deg, #f43f5e, #ec4899); box-shadow: 0 8px 16px -6px rgba(244, 63, 94, .45); }
[class*="col"] > .card.card-body.py-2.border-primary { background: linear-gradient(135deg, #1e293b, #334155); box-shadow: 0 8px 16px -6px rgba(15, 23, 42, .4); }
[class*="col"] > .card.card-body.py-2 .text-muted,
[class*="col"] > .card.card-body.py-2 .text-danger,
[class*="col"] > .card.card-body.py-2 .text-success { color: rgba(255, 255, 255, .88) !important; }
[class*="col"] > .card.card-body.py-2 a { color: #fff; }
[class*="col"] > .card.card-body.py-2 .fw-semibold, [class*="col"] > .card.card-body.py-2 .fs-5 { font-size: 1.2rem; font-weight: 700 !important; }

/* ---------- Tabellen ---------- */
.table { --bs-table-hover-bg: #f8fafc; }
.table > :not(caption) > * > * { border-bottom-color: #f1f5f9; }
.table thead.table-light th, .table thead.table-light td, .table > thead > tr > th {
    background: #eef2ff !important; color: rgba(55, 48, 163, .75); font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; border-bottom: 0; padding-top: .6rem; padding-bottom: .6rem;
}
.table tfoot.table-light td, .table tfoot.table-light th { background: #f5f3ff !important; color: #312e81; }
.table-danger { --bs-table-bg: #fff1f2; --bs-table-color: inherit; }
.table-warning { --bs-table-bg: #fffbeb; --bs-table-color: inherit; }
.table-success { --bs-table-bg: #ecfdf5; --bs-table-color: inherit; }

/* ---------- Knöpfe ---------- */
.btn { border-radius: .5rem; font-weight: 500; }
.btn-primary {
    --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5; --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3; --bs-btn-disabled-bg: #818cf8; --bs-btn-disabled-border-color: #818cf8;
    box-shadow: 0 1px 2px rgba(79, 70, 229, .3);
}
.btn-outline-primary {
    --bs-btn-color: #4f46e5; --bs-btn-border-color: #c7d2fe; --bs-btn-hover-bg: #4f46e5; --bs-btn-hover-border-color: #4f46e5;
    --bs-btn-active-bg: #4338ca; --bs-btn-active-border-color: #4338ca;
}
.btn-outline-secondary {
    --bs-btn-color: #334155; --bs-btn-border-color: #cbd5e1; --bs-btn-bg: #fff; --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: #0f172a;
    --bs-btn-hover-border-color: #cbd5e1; --bs-btn-active-bg: #e2e8f0; --bs-btn-active-color: #0f172a; --bs-btn-active-border-color: #cbd5e1;
}
.btn:hover { text-decoration: none; }

/* ---------- Status-Badges: weich statt grell ---------- */
.badge { border-radius: 999px; font-weight: 500; padding: .3em .65em; }
.badge.text-bg-success { background: #d1fae5 !important; color: #047857 !important; }
.badge.text-bg-danger { background: #ffe4e6 !important; color: #be123c !important; }
.badge.text-bg-warning { background: #fef3c7 !important; color: #b45309 !important; }
.badge.text-bg-info { background: #e0f2fe !important; color: #0369a1 !important; }
.badge.text-bg-primary { background: #e0e7ff !important; color: #4338ca !important; }
.badge.text-bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.badge.text-bg-dark { background: #1e293b !important; color: #fff !important; }

/* ---------- Formulare ---------- */
.form-control, .form-select { border-color: #cbd5e1; }
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .2); }
.form-check-input:checked { background-color: #4f46e5; border-color: #4f46e5; }
.form-label { font-weight: 500; color: #334155; }
.form-section-title { color: #4f46e5; }

/* ---------- Reiter ---------- */
.nav-tabs { border-bottom: 1px solid #e2e8f0; gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: #64748b; font-weight: 500; }
.nav-tabs .nav-link:hover { color: #4338ca; border-bottom-color: #c7d2fe; text-decoration: none; }
.nav-tabs .nav-link.active { color: #4338ca; background: transparent; border-bottom-color: #4f46e5; }
.nav-pills .nav-link.active { background: #4f46e5; }

/* ---------- Meldungen ---------- */
.alert { border: 0; border-radius: .6rem; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06); }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fff1f2; color: #9f1239; }
.alert-warning { background: #fffbeb; color: #92400e; }
.alert-info { background: #eef2ff; color: #3730a3; }
.alert-secondary { background: #f1f5f9; color: #334155; }

/* ---------- Seitennummern, Liste ---------- */
.pagination { --bs-pagination-active-bg: #4f46e5; --bs-pagination-active-border-color: #4f46e5; --bs-pagination-color: #4f46e5; }
.list-group-item.active { background: #4f46e5; border-color: #4f46e5; }

@media print {
    body { background: #fff; }
    .card:has(> .card-header) { border-top: 0; }
    [class*="col"] > .card.card-body.py-2 { background: #fff !important; color: #000 !important; box-shadow: none; }
}
