/* Design "Freundlich" (Vorschlag 4, 30.10.2026)
   Nur Aussehen: Farben, Rundungen, Schrift, Abstände der Bausteine.
   Keine Seite, kein Knopf und kein Menüpunkt wechselt den Platz.
   Eingebunden in base.html nur wenn config DESIGN_STIL == 'freundlich';
   ohne den Schalter sieht die Akademie aus wie bisher.
   Firmenfarbe kommt weiter aus --brand-primary (company.primary_color). */

@font-face {
    font-family: 'Nunito Sans';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/nunito-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Nunito Sans';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/nunito-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --df-text: #1e293b;
    --df-muted: #64748b;
    --df-line: #e6eaf0;
    --df-flaeche: #f6f8fb;
    --df-rund: 18px;
    --df-rund-klein: 12px;
    --df-schatten: 0 2px 10px rgba(15, 23, 42, .06);
    /* zarte Firmenfarbe; ältere Browser bekommen ein neutrales Hellgrau */
    --df-brand-zart: #eef2f7;
    --df-brand-ring: rgba(15, 23, 42, .18);
}
@supports (color: color-mix(in srgb, red 50%, white)) {
    :root {
        --df-brand-zart: color-mix(in srgb, var(--brand-primary) 9%, #fff);
        --df-brand-ring: color-mix(in srgb, var(--brand-primary) 35%, transparent);
    }
}

body {
    font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--df-text);
    background: var(--df-flaeche);
    -webkit-font-smoothing: antialiased;
}
h1, .h1, h2, .h2, h3, .h3 { font-weight: 800; letter-spacing: -.01em; }
h4, .h4, h5, .h5, h6, .h6 { font-weight: 700; }
.text-muted { color: var(--df-muted) !important; }
.text-primary { color: var(--brand-primary) !important; }
.bg-primary:not(.badge) { background-color: var(--brand-primary) !important; }
.border-bottom { border-color: var(--df-line) !important; }

/* Kopfzeile: zart in Firmenfarbe, Schrift in Firmenfarbe */
.navbar-custom {
    background-color: var(--df-brand-zart) !important;
    border-bottom: 1px solid var(--df-line);
}
.navbar-custom .navbar-brand,
.navbar-custom .nav-link,
.navbar-custom .nav-link:focus,
.navbar-custom .nav-link:hover { color: var(--brand-primary) !important; font-weight: 800; }
.navbar-custom .nav-link.dropdown-toggle {
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
    font-weight: 700;
}
.navbar-custom .navbar-brand i {
    background: var(--brand-primary);
    color: #fff;
    width: 34px; height: 34px;
    border-radius: 11px;
    display: inline-grid; place-items: center;
    font-size: 15px;
}
.dropdown-menu {
    border: 1px solid var(--df-line);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
    padding: 6px;
}
.dropdown-item { border-radius: 10px; padding: 9px 12px; }
.dropdown-item:active { background-color: var(--brand-primary); }

/* Seitenleiste (nur ab Tablet sichtbar): bleibt dunkel, Einträge als weiche Flächen */
.sidebar { background-color: #172033; }
.sidebar .nav-link { border-radius: 12px; margin: 2px 6px; padding: 8px 10px; color: #c3ccd8; font-size: .95rem; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link.active { background: var(--brand-primary); color: #fff; }
/* "Nächster Kurs": langer Kurstitel lief rechts aus dem Kasten */
.sidebar .flex-grow-1 { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }

/* Karten */
.card {
    border: 1px solid var(--df-line);
    border-radius: var(--df-rund);
    box-shadow: var(--df-schatten);
}
.card > .card-header:first-child { border-radius: calc(var(--df-rund) - 1px) calc(var(--df-rund) - 1px) 0 0; }
.card > .card-footer:last-child { border-radius: 0 0 calc(var(--df-rund) - 1px) calc(var(--df-rund) - 1px); }
.card > .card-img-top { border-radius: calc(var(--df-rund) - 1px) calc(var(--df-rund) - 1px) 0 0; }
.card-header { background-color: #fff; border-bottom-color: var(--df-line); padding: .85rem 1.1rem; }
.card-header .card-title, .card-header h5, .card-header h6 { font-weight: 800; }
.card-footer { background-color: #fbfcfd; border-top-color: var(--df-line); }
.list-group-item { border-color: var(--df-line); }
.list-group-flush > .list-group-item { padding-top: 1rem; padding-bottom: 1rem; }
.modal-content { border: 0; border-radius: 22px; box-shadow: 0 24px 60px rgba(15, 23, 42, .2); }
.modal-header, .modal-footer { border-color: var(--df-line); }

/* Knöpfe: rund, kräftige Schrift */
.btn {
    border-radius: 999px;
    font-weight: 650;
    padding: .5rem 1rem;
    transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn-sm { padding: .3rem .8rem; }
.btn-lg { padding: .75rem 1.5rem; }
.btn-group > .btn, .btn-group-sm > .btn { padding-left: .75rem; padding-right: .75rem; }
.btn:focus-visible, .btn:focus { box-shadow: 0 0 0 .22rem var(--df-brand-ring); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline-secondary { color: #475569; border-color: #cfd6df; background: #fff; }
.btn-outline-secondary:hover { background: #f1f4f8; color: var(--df-text); border-color: #b9c2ce; }
.btn-outline-info { color: #0b6590; border-color: #a9d3e8; background: #fff; }
.btn-outline-info:hover { background: #e9f5fb; color: #084a69; border-color: #7fbfdd; }
.btn-success { background-color: #15803d; border-color: #15803d; }
.btn-success:hover { background-color: #126b33; border-color: #126b33; }
.btn-outline-success { color: #15803d; border-color: #9dd3ae; }
.btn-outline-success:hover { background-color: #15803d; border-color: #15803d; }
.btn-outline-warning { color: #92560a; border-color: #f1c98a; }
.btn-outline-warning:hover { background-color: #fdf2df; color: #7a4705; border-color: #e7b25e; }
.btn-outline-danger { border-color: #f0a9a9; }
.btn-light { background: #fff; border-color: var(--df-line); }

/* Abzeichen: zarte Flächen statt kräftiger Blöcke */
.badge { border-radius: 999px; font-weight: 800; padding: .38em .75em; letter-spacing: .01em; }
body .badge.bg-primary   { background: var(--df-brand-zart) !important; color: var(--brand-primary) !important; }
body .badge.bg-success   { background: #e3f4e8 !important; color: #14632f !important; }
body .badge.bg-warning   { background: #fdf0d8 !important; color: #7a4705 !important; }
body .badge.bg-danger    { background: #fde4e4 !important; color: #a3171b !important; }
body .badge.bg-info      { background: #e3f1fa !important; color: #0b5274 !important; }
body .badge.bg-secondary { background: #e8ecf1 !important; color: #475569 !important; }
body .badge.bg-dark      { background: #334155 !important; color: #fff !important; }
body .sidebar .badge.bg-warning { background: #fbbf24 !important; color: #3b2600 !important; }

/* Hinweiskästen */
.alert { border: 0; border-radius: 16px; }
.alert-info    { background: #eef6fc; color: #1d4f73; }
.alert-warning { background: #fff7e6; color: #6b4600; }
.alert-success { background: #e9f7ee; color: #14532d; }
.alert-danger  { background: #fdecec; color: #8a1c1c; }
.alert-secondary, .alert-light { background: #f1f4f8; color: #334155; }

/* Fortschritt */
.progress { background-color: #e9edf2; border-radius: 999px; }
.progress-bar { background-color: var(--brand-primary); border-radius: 999px; }
.progress-bar.bg-success { background-color: #16a34a !important; }

/* Formulare */
.form-control, .form-select { border-radius: var(--df-rund-klein); border-color: #d3dae3; }
.form-control-sm, .form-select-sm { border-radius: 10px; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 .22rem var(--df-brand-ring);
}
.form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.form-label { font-weight: 700; }
.input-group > .form-control:not(:last-child), .input-group > .form-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > :not(:first-child):not(.dropdown-menu) { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* Tabellen */
.table > thead th, .table > thead td {
    background: #f6f8fb;
    color: #475569;
    font-weight: 800;
    border-bottom-color: var(--df-line);
}
.table > :not(caption) > * > * { border-bottom-color: var(--df-line); }
.table > :not(:first-child) { border-top: 1px solid var(--df-line); }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: var(--df-brand-zart); }

/* Reiter */
.nav-tabs { border-bottom-color: var(--df-line); }
.nav-tabs .nav-link { border-radius: 12px 12px 0 0; font-weight: 700; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 700; }
.nav-pills .nav-link.active { background-color: var(--brand-primary); }
.page-link { color: var(--brand-primary); }
.page-item.active .page-link { background-color: var(--brand-primary); border-color: var(--brand-primary); }

/* Handy: Fingerfreundlich, ohne Bausteine zu verschieben */
@media (max-width: 767.98px) {
    .btn:not(.btn-sm):not(.btn-close) { min-height: 44px; }
    .form-control, .form-select { min-height: 44px; }
    .card { border-radius: 16px; }
    .card > .card-header:first-child { border-radius: 15px 15px 0 0; }
    /* Zeilen, die bei grosser Schrift rechts ueber den Rand liefen (schon im alten Design):
       umbrechen statt ueberstehen - gleiche Reihenfolge, gleicher Platz */
    .navbar-custom .navbar-brand { white-space: normal; min-width: 0; font-size: 1.05rem; margin-right: .5rem; }
    h1.h2, h2.h2, .h2 { font-size: 1.45rem; }
    /* lange deutsche Woerter ("Röntgenbildauswertung") trennen statt ueberstehen */
    h1, h2, h3, h4, h5, h6, .card-title, .fw-bold { overflow-wrap: break-word; hyphens: auto; }
    .card-header.d-flex > *, .list-group-item.d-flex > *,
    .list-group-item .d-flex.align-items-center > * { min-width: 0; }
    .card-header.d-flex,
    .card-header .d-flex.justify-content-between,
    .list-group-item.d-flex,
    .list-group-item .d-flex.gap-2 { flex-wrap: wrap; gap: .4rem; }
    .btn-toolbar, .btn-toolbar > .btn-group { flex-wrap: wrap; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
}
