/* FL-COCKPIT – Anwendungsstile auf Basis von Bootstrap 5.3
   Gestaltung im Stil eines Fahrschul-Portals: weiße Kopfzeile, schmale Symbolleiste,
   helle Arbeitsfläche, Karten mit weichem Schatten, Listen mit Farbbalken und Status-Badges.
   Die Hausfarbe kommt aus den Layout-Einstellungen (--fd-primary). */

:root {
  --fc-header-h: 92px;
  --fc-rail-w: 112px;
  --fc-bg: #f2f3f5;
  --fc-surface: #ffffff;
  --fc-line: #e3e6ea;
  --fc-text: #2f343b;
  --fc-muted: #6b7380;
  --fc-zebra: #f3f4f6;
  --fc-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .06);
  --fc-radius: calc(var(--fd-radius, 8px) + 2px);

  --bs-primary: var(--fd-primary);
  --bs-primary-rgb: var(--fd-primary-rgb);
  --bs-link-color: var(--fd-primary);
  --bs-link-color-rgb: var(--fd-primary-rgb);
  --bs-link-hover-color: color-mix(in srgb, var(--fd-primary) 80%, #000);
  --bs-border-radius: var(--fd-radius);
  --bs-border-radius-lg: calc(var(--fd-radius) * 1.25);
  --bs-border-radius-sm: calc(var(--fd-radius) * .75);
  --bs-focus-ring-color: rgba(var(--fd-primary-rgb), .25);
  --bs-body-font-family: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--fc-text);
}
[data-bs-theme="dark"] {
  --fc-bg: #14171c;
  --fc-surface: #1d2127;
  --fc-line: #2e343c;
  --fc-text: #e3e6ea;
  --fc-muted: #9aa3ae;
  --fc-zebra: #232830;
  --fc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  --bs-body-bg: #1d2127;
  --bs-link-color: color-mix(in srgb, var(--fd-primary) 60%, #fff);
  --bs-link-hover-color: color-mix(in srgb, var(--fd-primary) 40%, #fff);
}
html { font-size: calc(16px * var(--fd-font-scale, 1)); }
body.fd-app { background: var(--fc-bg); color: var(--fc-text); }

/* ---------- Schaltflächen & Formulare ---------- */
.btn { --bs-btn-border-radius: 4px; font-weight: 500; }
.btn-primary {
  --bs-btn-bg: var(--fd-primary); --bs-btn-border-color: var(--fd-primary);
  --bs-btn-hover-bg: color-mix(in srgb, var(--fd-primary) 85%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--fd-primary) 85%, #000);
  --bs-btn-active-bg: color-mix(in srgb, var(--fd-primary) 75%, #000); --bs-btn-active-border-color: color-mix(in srgb, var(--fd-primary) 75%, #000);
  --bs-btn-disabled-bg: var(--fd-primary); --bs-btn-disabled-border-color: var(--fd-primary); --bs-btn-focus-shadow-rgb: var(--fd-primary-rgb);
  padding-inline: 1.4rem;
}
.btn-outline-primary {
  --bs-btn-color: var(--fd-primary); --bs-btn-border-color: var(--fd-primary);
  --bs-btn-hover-bg: var(--fd-primary); --bs-btn-hover-border-color: var(--fd-primary);
  --bs-btn-active-bg: var(--fd-primary); --bs-btn-active-border-color: var(--fd-primary); --bs-btn-focus-shadow-rgb: var(--fd-primary-rgb);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: color-mix(in srgb, var(--fd-primary) 60%, #fff); }
.form-control, .form-select { border-radius: 4px; border-color: #cfd4da; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { border-color: #3a414b; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--fd-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--fd-primary-rgb), .18); }
.form-check-input:checked { background-color: var(--fd-primary); border-color: var(--fd-primary); }
.form-label { font-weight: 500; color: var(--fc-text); }
.text-primary { color: var(--fd-primary) !important; }
.bg-primary { background-color: var(--fd-primary) !important; }
.progress-bar { background-color: var(--fd-primary); }
.progress-bar.bg-success { background-color: var(--bs-success) !important; }

/* ---------- Kopfzeile ---------- */
.fc-header {
  position: sticky; top: 0; z-index: 1030; height: var(--fc-header-h); display: flex; align-items: center; gap: 1.25rem;
  padding: 0 1.75rem; background: var(--fc-surface); box-shadow: 0 2px 10px rgba(16, 24, 40, .07);
}
.fc-brand { color: inherit; text-decoration: none; flex-shrink: 0; }
.fc-appname { flex: 1; text-align: center; line-height: 1.35; font-size: 1.05rem; letter-spacing: .02em; color: var(--fc-text); }
.fc-version { font-size: 1.05rem; }
.fc-school { align-items: center; gap: .7rem; max-width: 300px; margin-left: auto; color: var(--fc-text); }
.fc-appname + .fc-school { margin-left: 0; }
.fc-school > .bi { font-size: 1.7rem; color: var(--fc-muted); }
.fc-school-logo { max-height: 40px; max-width: 70px; object-fit: contain; }
.fc-school-name { font-size: 1.02rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fc-icon-btn { position: relative; border: 0; font-size: 1.5rem; color: var(--fc-muted); padding: .35rem .55rem; }
.fc-icon-btn:hover { color: var(--fd-primary); }
.fc-alerts .fc-icon-btn.has-alerts { color: #d6334a; }
.fc-alert-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: #d6334a; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; padding: 0 4px; }
.fc-alert-menu { width: 340px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; }
.fc-alert-item { display: flex; gap: .7rem; align-items: flex-start; white-space: normal; padding-block: .55rem; border-top: 1px solid var(--fc-line); }
.fc-alert-item > .bi { font-size: 1.1rem; margin-top: 1px; }
.fc-alert-item small { display: block; color: var(--fc-muted); }
.fc-user-btn { display: flex; align-items: center; gap: .55rem; border: 0; padding: .3rem .4rem; color: var(--fc-text); }
.fc-user-icon { font-size: 1.6rem; color: var(--fc-muted); }
.fc-user-name { font-size: 1.02rem; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-user-chev { font-size: 1rem; color: var(--fc-muted); margin-left: .35rem; }

/* Logo */
.fc-logo { display: inline-flex; align-items: center; gap: .6rem; color: var(--fd-primary); }
.fc-logo-mark { width: 46px; height: 46px; flex-shrink: 0; }
.fc-logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.fc-logo-name { font-weight: 800; font-size: 1.45rem; letter-spacing: .02em; color: var(--fc-text); }
.fc-logo-name::first-letter { color: var(--fd-primary); }
.fc-logo-tag { font-size: .85rem; color: var(--fc-muted); margin-top: 3px; }
.fc-logo-sm .fc-logo-mark { width: 34px; height: 34px; }
.fc-logo-sm .fc-logo-name { font-size: 1.15rem; }
.fc-logo-sm .fc-logo-tag { font-size: .75rem; }
.fc-logo-lg .fc-logo-mark { width: 64px; height: 64px; }
.fc-logo-lg .fc-logo-name { font-size: 2rem; }

/* ---------- Symbolleiste links ---------- */
.fc-shell { display: flex; min-height: calc(100vh - var(--fc-header-h)); }
.fc-rail { --bs-offcanvas-width: 270px; background: var(--fc-surface); }
.fc-rail-inner { display: flex; flex-direction: column; align-items: stretch; gap: .35rem; padding: 2.4rem .9rem 1.5rem; }
.fc-nav-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 72px; border-radius: 12px;
  color: var(--fd-primary); text-decoration: none; transition: background-color .15s;
}
.fc-nav-link .bi { font-size: 2rem; line-height: 1; }
.fc-nav-label { display: none; font-size: .72rem; line-height: 1.15; text-align: center; color: var(--fc-text); }
.fc-labels .fc-nav-label { display: block; }
.fc-labels .fc-nav-link .bi { font-size: 1.6rem; }
.fc-nav-link:hover { background: rgba(var(--fd-primary-rgb), .08); color: var(--fd-primary); }
.fc-nav-link.active { background: rgba(var(--fd-primary-rgb), .13); }
.fc-nav-link.active .fc-nav-label { color: var(--fd-primary); font-weight: 600; }
.fc-nav-sep { height: 1px; background: var(--fc-line); margin: .8rem .6rem; }
@media (min-width: 992px) {
  .fc-rail { position: sticky; top: var(--fc-header-h); height: calc(100vh - var(--fc-header-h)); width: var(--fc-rail-w); flex-shrink: 0;
    border-right: 1px solid var(--fc-line); overflow-y: auto; background: var(--fc-surface) !important; }
}
@media (max-width: 991.98px) {
  :root { --fc-header-h: 62px; }
  .fc-header { padding: 0 .6rem; gap: .5rem; }
  .fc-header .fc-logo-mark { width: 34px; height: 34px; }
  .fc-header .fc-logo-name { font-size: 1.15rem; }
  .fc-header .fc-logo-tag { display: none; }
  .fc-school { margin-left: auto; max-width: 200px; }
  .fc-school-name { font-size: .9rem; }
  .fc-alerts { margin-left: auto; }
  .fc-school + .fc-alerts { margin-left: 0; }
  .fc-rail-inner { padding: .5rem .75rem 1.5rem; gap: 2px; }
  .fc-nav-link { flex-direction: row; justify-content: flex-start; min-height: 48px; padding: 0 .9rem; gap: .9rem; border-radius: 8px; }
  .fc-nav-link .bi { font-size: 1.35rem; width: 1.6rem; }
  .fc-nav-label { display: block; font-size: 1rem; text-align: left; }
}

/* ---------- Arbeitsfläche ---------- */
.fc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fd-content { padding: 2.4rem 2.6rem 1.5rem; flex: 1; width: 100%; max-width: 1680px; }
.fd-footer { padding: .5rem 2.6rem 1.5rem; font-size: .85rem; color: var(--fc-muted); }
.fd-footer a { color: inherit; }
@media (max-width: 767.98px) { .fd-content { padding: 1.1rem .9rem; } .fd-footer { padding: .5rem .9rem 1.2rem; } }
.fd-compact .fd-content { padding: 1.2rem 1.4rem; }
.fd-compact .table > :not(caption) > * > * { padding: .4rem .55rem; }
.fd-compact .card-body { padding: .85rem; }

/* Titelleiste (wie „Prüfungen“) */
.fd-page-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1rem; margin-bottom: 1.4rem; padding: 1.15rem 1.6rem; min-height: 84px;
  background: var(--fc-surface); border-radius: var(--fc-radius); box-shadow: var(--fc-shadow);
}
.fd-page-head h1 { font-size: 1.55rem; font-weight: 600; margin: 0; color: var(--fc-text); letter-spacing: 0; }
.fd-page-head .small a, .fd-page-head > div > .small { font-size: .85rem; }
.fd-page-head .fd-actions { margin-left: auto; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
/* Werkzeug-Kacheln neben dem Titel (Liste, Kalender, Suche …) */
.fd-actions .btn-outline-secondary, .fd-actions .btn-outline-primary {
  --bs-btn-bg: var(--fc-surface); --bs-btn-border-color: var(--fc-line); --bs-btn-color: var(--fd-primary);
  --bs-btn-hover-bg: rgba(var(--fd-primary-rgb), .08); --bs-btn-hover-border-color: rgba(var(--fd-primary-rgb), .35); --bs-btn-hover-color: var(--fd-primary);
  --bs-btn-active-bg: rgba(var(--fd-primary-rgb), .14); --bs-btn-active-color: var(--fd-primary); --bs-btn-active-border-color: rgba(var(--fd-primary-rgb), .35);
  min-height: 46px; padding-inline: 1rem; box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.fd-actions .btn-primary { min-height: 46px; }
.fd-actions .btn .bi { font-size: 1.15rem; vertical-align: -2px; }

/* Karten */
.card { border: 0; border-radius: var(--fc-radius); box-shadow: var(--fc-shadow); background: var(--fc-surface); --bs-card-bg: var(--fc-surface); }
.card-header { background: transparent; font-weight: 600; font-size: 1.05rem; padding: .95rem 1.25rem; border-bottom: 1px solid var(--fc-line); }
.card-footer { background: transparent; border-top: 1px solid var(--fc-line); }
.card-body { padding: 1.1rem 1.25rem; }
.list-group { --bs-list-group-bg: transparent; }
.dropdown-menu { border: 0; border-radius: 8px; }

/* Reiter als Kartenleiste (wie „Praxis | Theorie | …“) */
.nav-tabs {
  display: inline-flex; max-width: 100%; gap: .4rem; border: 0; padding: .55rem 1rem; margin-bottom: 1.4rem !important;
  background: var(--fc-surface); border-radius: var(--fc-radius); box-shadow: var(--fc-shadow);
}
.nav-tabs .nav-link {
  border: 0; border-radius: 6px; color: var(--fc-text); font-size: 1.05rem; padding: .7rem 1rem; display: flex; align-items: center; gap: .45rem; white-space: nowrap;
}
.nav-tabs .nav-link .bi { font-size: 1.3rem; color: var(--fc-muted); }
.nav-tabs .nav-link:hover { background: rgba(var(--fd-primary-rgb), .06); color: var(--fd-primary); }
.nav-tabs .nav-link.active { background: transparent; color: var(--fd-primary); font-weight: 600; }
.nav-tabs .nav-link.active .bi { color: var(--fd-primary); }
.nav-pills .nav-link { border-radius: 6px; }
.nav-pills .nav-link.active, .page-item.active .page-link { background-color: var(--fd-primary); border-color: var(--fd-primary); }

/* Listen: fette Kopfzeile, Zebrastreifen, Farbbalken links */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .9rem .9rem; border-bottom-color: var(--fc-line); }
.table > thead > tr > th { font-weight: 600; color: var(--fc-text); border-bottom: 2px solid var(--fc-line); white-space: nowrap; background: transparent; }
.table-hover > tbody > tr:nth-child(even) > *, .fc-zebra > tbody > tr:nth-child(even) > * { background-color: var(--fc-zebra); }
.table-hover > tbody > tr > *, .fc-zebra > tbody > tr > * { border-bottom: 0; }
.table-hover > tbody > tr > td:first-child, .fc-bar > tbody > tr > td:first-child { position: relative; padding-left: 1.6rem; }
.table-hover > tbody > tr > td:first-child::before, .fc-bar > tbody > tr > td:first-child::before {
  content: ""; position: absolute; left: .55rem; top: .5rem; bottom: .5rem; width: 5px; border-radius: 1px; background: var(--fd-primary); z-index: 1;
}
.table-sm > :not(caption) > * > * { padding: .45rem .55rem; }
.table-hover tbody tr[data-href] { cursor: pointer; }

/* Status-Badges: helle Flächen mit dunkler Schrift */
.badge { font-weight: 500; border-radius: 4px; padding: .42em .75em; letter-spacing: 0; }
.badge.text-bg-primary { background: #c9dff3 !important; color: #1d3f66 !important; }
.badge.text-bg-success { background: #cfe9d6 !important; color: #1b5430 !important; }
.badge.text-bg-warning { background: #fae6b3 !important; color: #6b4900 !important; }
.badge.text-bg-danger { background: #f6cfd3 !important; color: #7d1a26 !important; }
.badge.text-bg-info { background: #cdecf3 !important; color: #0f4b5b !important; }
.badge.text-bg-secondary { background: #e2e5e9 !important; color: #39414c !important; }
.badge.text-bg-dark { background: #cfd5de !important; color: #1f2a37 !important; }
.badge.text-bg-light { background: #f0f2f4 !important; color: #39414c !important; border: 0 !important; }
[data-bs-theme="dark"] .badge.text-bg-primary { background: rgba(var(--fd-primary-rgb), .3) !important; color: #d6e6f7 !important; }
[data-bs-theme="dark"] .badge.text-bg-success { background: rgba(25, 135, 84, .3) !important; color: #c9ecd6 !important; }
[data-bs-theme="dark"] .badge.text-bg-warning { background: rgba(255, 193, 7, .25) !important; color: #fbe6ad !important; }
[data-bs-theme="dark"] .badge.text-bg-danger { background: rgba(220, 53, 69, .3) !important; color: #f7cdd2 !important; }
[data-bs-theme="dark"] .badge.text-bg-info { background: rgba(13, 202, 240, .22) !important; color: #c8eef6 !important; }
[data-bs-theme="dark"] .badge.text-bg-secondary, [data-bs-theme="dark"] .badge.text-bg-light { background: #2f353e !important; color: #d4d9df !important; }
.fs-6.badge, .badge.fs-6 { font-size: .9rem !important; }

/* Seitenwechsel wie im Portal */
.fc-pager { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: 1.1rem 1.25rem; }
.fc-pager-info { color: var(--fc-text); }
.fc-pager .pagination { margin: 0 0 0 auto; }
.fc-pager .page-link { min-width: 44px; height: 44px; display: grid; place-items: center; color: var(--fc-text); border-color: var(--fc-line); }
.fc-pager .page-item.active .page-link { background: var(--fc-surface); color: var(--fd-primary); border-color: var(--fd-primary); }
.fc-pager .form-select { width: auto; height: 44px; }

/* ---------- Bausteine ---------- */
.fd-stat { display: flex; align-items: center; gap: 1rem; }
.fd-stat-icon { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: rgba(var(--fd-primary-rgb), .1); color: var(--fd-primary); flex-shrink: 0; }
.fd-stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.fd-stat-label { font-size: .88rem; color: var(--fc-muted); }
.fd-empty { text-align: center; padding: 2.5rem 1rem; color: var(--fc-muted); }
.fd-empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .5; }
.fd-flash { border: 0; box-shadow: var(--fc-shadow); }
.fd-dl dt { font-weight: 500; color: var(--fc-muted); font-size: .85rem; }
.fd-dl dd { margin-bottom: .6rem; }
.fd-req::after { content: " *"; color: var(--bs-danger); }
.fd-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; }
.fd-avatar-initials { display: inline-grid; place-items: center; background: rgba(var(--fd-primary-rgb), .14); color: var(--fd-primary); font-weight: 700; }
.fd-brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--fd-primary); color: #fff; font-size: 1.2rem; }

/* Fortschritt Pflichtfahrten */
.fd-progress-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; gap: .75rem; align-items: center; margin-bottom: .55rem; }
.fd-progress-row .progress { height: .6rem; }
@media (max-width: 575.98px) { .fd-progress-row { grid-template-columns: 1fr auto; } .fd-progress-row .progress { grid-column: 1 / -1; order: 3; } }

/* Themenbewertung in der Fahrstunde */
.fd-topic { display: flex; align-items: center; gap: .5rem; padding: .45rem .25rem; border-bottom: 1px dashed var(--fc-line); }
.fd-topic:last-child { border-bottom: 0; }
.fd-topic-title { flex: 1; min-width: 0; }
.fd-rate .btn { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .8rem; }
.fd-rate .btn-check:checked + .btn.fd-r1 { background: var(--bs-warning); border-color: var(--bs-warning); color: #000; }
.fd-rate .btn-check:checked + .btn.fd-r2 { background: var(--bs-info); border-color: var(--bs-info); color: #000; }
.fd-rate .btn-check:checked + .btn.fd-r3 { background: var(--bs-success); border-color: var(--bs-success); color: #fff; }
@media (max-width: 575.98px) { .fd-topic { flex-wrap: wrap; } .fd-rate { width: 100%; } .fd-rate .btn { flex: 1; } }
.accordion { --bs-accordion-border-color: var(--fc-line); --bs-accordion-active-bg: rgba(var(--fd-primary-rgb), .07); --bs-accordion-active-color: var(--fd-primary); }

.fd-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); vertical-align: middle; }
.fd-dot.s1 { background: var(--bs-warning); border-color: var(--bs-warning); }
.fd-dot.s2 { background: var(--bs-info); border-color: var(--bs-info); }
.fd-dot.s3 { background: var(--bs-success); border-color: var(--bs-success); }

/* Unterschriftenfeld */
.fd-signature { position: relative; border: 2px dashed var(--bs-border-color); border-radius: 6px; background: #fff; touch-action: none; }
.fd-signature canvas { width: 100%; height: 160px; display: block; cursor: crosshair; }
.fd-signature .fd-sig-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #adb5bd; pointer-events: none; font-size: .9rem; }
.fd-signature.has-ink .fd-sig-hint { display: none; }
.fd-sig-img { max-height: 90px; max-width: 100%; background: #fff; border-radius: 4px; }
.sticky-bottom.bg-body-tertiary { background: var(--fc-bg) !important; }

/* Anmeldung / leere Seiten */
.fd-blank { min-height: 100vh; background: var(--fc-bg); }
.fd-blank-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; }
.fd-login-card { width: 100%; max-width: 440px; }

/* ---------- Tabellarische Ausbildungskarte & Druck ---------- */
.fd-card-grid { border-collapse: collapse; width: 100%; font-size: .78rem; }
.fd-card-grid th, .fd-card-grid td { border: 1px solid #9aa4b2; padding: 2px 4px; vertical-align: middle; }
.fd-card-grid thead th { background: #eef1f5; text-align: center; font-weight: 600; }
.fd-card-grid .fd-stage-row th { background: rgba(var(--fd-primary-rgb), .12); text-align: left; font-size: .8rem; }
.fd-card-grid td.fd-cell { width: 22px; min-width: 22px; text-align: center; padding: 0; height: 20px; }
.fd-card-grid td.fd-cell.r1 { background: #ffe08a; }
.fd-card-grid td.fd-cell.r2 { background: #9eeaf9; }
.fd-card-grid td.fd-cell.r3 { background: #75d39a; }
.fd-card-grid td.fd-status { width: 92px; text-align: center; }
.fd-card-grid .fd-status-btn { border: 0; background: transparent; width: 100%; padding: 2px; font-size: .75rem; cursor: pointer; border-radius: 4px; color: inherit; }
.fd-card-grid .fd-status-btn:hover { background: rgba(var(--fd-primary-rgb), .1); }
.fd-card-wrap { overflow-x: auto; }
.fd-print { background: #fff; color: #000; padding: 1rem; }
.fd-print-toolbar { position: sticky; top: 0; background: #fff; padding: .5rem 0 1rem; display: flex; gap: .5rem; z-index: 10; }
.fd-print-sheet { max-width: 1120px; margin: 0 auto; }
.fd-print-head { display: flex; gap: 1rem; align-items: flex-start; border-bottom: 2px solid #333; padding-bottom: .5rem; margin-bottom: .75rem; }
.fd-print-head img { max-height: 56px; max-width: 160px; }
.fd-sign-line { border-top: 1px solid #333; padding-top: 2px; font-size: .75rem; margin-top: 2.5rem; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  .fd-print { padding: 0; }
  .fd-card-grid td.fd-cell.r1, .fd-card-grid td.fd-cell.r2, .fd-card-grid td.fd-cell.r3, .fd-card-grid thead th, .fd-card-grid .fd-stage-row th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fd-card-grid { font-size: 9pt; }
  .fd-no-break { break-inside: avoid; }
  a[href]::after { content: none !important; }
}

/* Feinschliff: größere Status-Badges in Listen, kompakte Kacheln auf dem Smartphone */
.table .badge { font-size: .85rem; }
.table .badge.text-bg-light { font-size: .8rem; }
@media (max-width: 575.98px) {
  .fd-page-head { padding: 1rem; min-height: 0; }
  .fd-page-head h1 { font-size: 1.3rem; }
  .fd-page-head .fd-actions { margin-left: 0; width: 100%; }
  .fd-stat { gap: .7rem; }
  .fd-stat-icon { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 10px; }
  .fd-stat-value { font-size: 1.3rem; }
  .fd-stat-label { font-size: .8rem; }
  .nav-tabs { padding: .35rem .5rem; }
  .nav-tabs .nav-link { padding: .55rem .7rem; font-size: .95rem; }
}
@media (min-width: 992px) { .fc-shell { background: linear-gradient(to right, var(--fc-surface) var(--fc-rail-w), transparent 0); } }

/* Synchronisierungs-Status */
.fc-sync .fc-icon-btn.is-pending { color: #e08a00; }
.fc-sync .fc-icon-btn.is-offline { color: #d6334a; }
.fc-sync-count { background: #e08a00; }
.fc-sync .fc-icon-btn.is-offline .fc-sync-count { background: #d6334a; }
@media (max-width: 991.98px) { .fc-sync { margin-left: auto; } .fc-school + .fc-sync { margin-left: 0; } .fc-sync + .fc-alerts { margin-left: 0; } }

/* Update-Hinweis in der Übersicht */
.fc-update-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; padding: 1.1rem 1.4rem; background: var(--fc-surface);
  border-radius: var(--fc-radius); box-shadow: var(--fc-shadow); border-left: 5px solid var(--fd-primary); }
.fc-update-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: var(--fd-primary); flex-shrink: 0; }

/* 1.5: geteilte Fahrstunde */
.fd-split { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .75rem; }
.fd-part-no { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--fd-primary, #2f6db5); color: #fff; font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.fd-part .form-select { min-width: 0; }
.fd-part-min { flex: 0 0 7.5rem; }
.fd-signature-lg canvas { height: 220px; }
@media (max-width: 575.98px) { .fd-signature-lg canvas { height: 180px; } }

/* 1.5: Anforderungen je Klasse, Theorie, Fristen */
.fd-reqlist { list-style: none; padding: 0; margin: 0; }
.fd-reqlist li { display: flex; gap: .5rem; align-items: flex-start; padding: .35rem 0; border-bottom: 1px dashed var(--bs-border-color); }
.fd-reqlist li:last-child { border-bottom: 0; }
.fd-reqlist .bi { flex: 0 0 auto; margin-top: .1rem; }
.fd-reqlist .fd-req-val { margin-left: auto; white-space: nowrap; font-weight: 600; }
.fd-theory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.3rem, 1fr)); gap: .25rem; }
.fd-theory-cell { border: 1px solid var(--bs-border-color); border-radius: .35rem; text-align: center; font-size: .75rem; padding: .25rem 0; background: var(--bs-body-bg); }
.fd-theory-cell.done { background: var(--bs-success-bg-subtle); border-color: var(--bs-success-border-subtle); color: var(--bs-success-text-emphasis); font-weight: 600; }
.fd-faq .accordion-button { font-weight: 500; }
.fd-faq mark { padding: 0 .1em; }
.fd-cfg-card.ok { border-left: 4px solid var(--bs-success); }
.fd-cfg-card.later { border-left: 4px solid var(--bs-warning); }
.fd-cfg-card.no { border-left: 4px solid var(--bs-secondary-border-subtle); opacity: .85; }
.fd-doc-paper { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 2.5rem 3rem; box-shadow: 0 2px 12px rgba(0,0,0,.08); border-radius: .25rem; font-size: 11pt; line-height: 1.5; }
.fd-doc-paper table { width: 100%; border-collapse: collapse; margin: .5rem 0; font-size: 10pt; }
.fd-doc-paper th, .fd-doc-paper td { border: 1px solid #bbb; padding: .2rem .4rem; text-align: left; }
.fd-doc-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; font-size: 9pt; color: #444; }
.fd-doc-head img { max-height: 60px; max-width: 200px; }
@media print { .fd-doc-paper { box-shadow: none; padding: 0; max-width: none; } }
.fd-doc-paper .fd-addr { margin-bottom: 2rem; min-height: 4.5rem; }
.fd-doc-paper .fd-date { text-align: right; margin-bottom: 1.5rem; }
.fd-doc-paper h2 { font-size: 13pt; font-weight: 700; margin: 0 0 1rem; }
[hidden] { display: none !important; }
/* Symbolleiste kompakter, wenn viele Module aktiv sind und der Bildschirm niedrig ist */
@media (min-width: 992px) and (max-height: 1050px) {
  .fc-rail-inner { padding-top: 1rem; gap: .15rem; }
  .fc-nav-link { min-height: 58px; }
  .fc-nav-link .bi { font-size: 1.65rem; }
  .fc-nav-sep { margin: .4rem .6rem; }
}
@media (max-width: 575.98px) {
  .fd-part-min { flex-basis: 4.6rem; }
  .fd-part-min .input-group-text { display: none; }
  .fd-part { gap: .35rem !important; }
}
.fd-signlist td { height: 3.4rem; }
.fd-cert-sig { max-height: 60px; max-width: 100%; display: block; margin-bottom: 2px; }

/* ---------- Briefbogen (Letterhead) ---------- */
.lh-doc { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto 1.5rem; background: #fff; color: #111; box-shadow: 0 2px 14px rgba(0,0,0,.12);
  font-size: 10.5pt; line-height: 1.45; overflow: hidden; }
.lh-doc .lh-bg { position: absolute; left: 0; top: 0; width: 210mm; height: 297mm; object-fit: fill; z-index: 0; pointer-events: none; }
.lh-doc .lh-head { position: absolute; left: var(--lh-l); right: var(--lh-r); z-index: 1; font-size: 8.5pt; line-height: 1.35; color: #333; }
.lh-doc .lh-split { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; }
.lh-doc .lh-split .lh-right { text-align: right; }
.lh-doc .lh-stack { display: flex; flex-direction: column; gap: 2mm; }
.lh-doc .lh-stack.lh-center { align-items: center; text-align: center; }
.lh-doc .lh-stack.lh-right { align-items: flex-end; text-align: right; }
.lh-doc .lh-head-text b { color: var(--lh-c); font-size: 10pt; }
.lh-doc .lh-logo { max-width: 85mm; object-fit: contain; }
.lh-doc .lh-foot { position: absolute; left: var(--lh-l); right: var(--lh-r); bottom: 9mm; z-index: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6mm;
  font-size: 7pt; line-height: 1.35; color: #555; }
.lh-doc .lh-foot b { color: var(--lh-c); }
.lh-doc .lh-foot.lh-lined { border-top: .3mm solid var(--lh-c); padding-top: 2mm; }
.lh-doc .lh-flow { width: 100%; border-collapse: collapse; position: relative; z-index: 2; }
.lh-doc .lh-flow > thead td, .lh-doc .lh-flow > tfoot td { padding: 0; border: 0; }
.lh-doc .lh-body { padding: 0 var(--lh-r) 0 var(--lh-l); vertical-align: top; }
.lh-doc .lh-sender { font-size: 7pt; color: #555; text-decoration: underline; margin-bottom: 1.5mm; }
.lh-doc h1, .lh-doc h2 { color: var(--lh-c); }
.lh-doc h1 { font-size: 15pt; } .lh-doc h2 { font-size: 13pt; } .lh-doc h3 { font-size: 11pt; }
.lh-doc table.lh-grid { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 2mm 0 4mm; }
.lh-doc table.lh-grid th, .lh-doc table.lh-grid td { border: .25mm solid #999; padding: 1mm 1.5mm; text-align: left; vertical-align: top; }
.lh-doc table.lh-grid thead th { background: #f0f0f0; }
.lh-doc table.lh-grid tr { break-inside: avoid; }
.lh-doc .lh-sigs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6mm; margin-top: 10mm; font-size: 8pt; break-inside: avoid; }
.lh-doc .lh-sigs.lh-sigs2 { grid-template-columns: 1fr 1fr; gap: 14mm; margin-top: 16mm; }
.lh-doc .lh-sigs.lh-sigs2 .lh-sig { min-height: 26mm; }
.lh-doc .lh-sigs .lh-sig { min-height: 18mm; display: flex; align-items: flex-end; }
.lh-doc .lh-sigs img { max-height: 16mm; max-width: 100%; }
.lh-doc .lh-sigs .lh-line { border-top: .25mm solid #333; padding-top: 1mm; }
.lh-preview { transform-origin: top left; }
@media print {
  .lh-doc { box-shadow: none; margin: 0; width: auto; min-height: 0; overflow: visible; }
  .lh-doc .lh-bg, .lh-doc .lh-head, .lh-doc .lh-foot { position: fixed; }
  .lh-doc .lh-bg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.fd-print { padding: 0 !important; }
}
@media screen and (max-width: 900px) { .lh-doc:not(.lh-preview) { zoom: .45; } }
