/*
 * DSB2 -- zentrales Design-System (EINZIGE Stelle für Farb-Tokens).
 *
 * Behebt bewusst den in thedigitalbook gefundenen Fehler: dort sind die Akzentfarben zwar als
 * CSS-Variablen in header.php definiert, werden aber in login.php trotzdem nochmal hartkodiert
 * dupliziert. Hier referenzieren AUSNAHMSLOS alle Seiten (Hauptschale, Login, Fehlerseiten) diese
 * eine Datei -- eine Farbänderung ist immer ein Ein-Zeilen-Edit hier, nie eine Suche-und-Ersetze-
 * Aktion über mehrere Dateien. Siehe DSB2_BAUPROMPT.md Abschnitt 5.
 *
 * Farbpalette 1:1 aus DSB (public/assets/css/app.css) übernommen, Vollflächen-Hintergrund
 * beibehalten (Nutzerentscheidung 2026-10-05, nicht der hellere thedigitalbook-Stil).
 */

:root {
  --dsb-bg:    #cf4a2c; /* Seitenhintergrund, Vollfläche -- DSBs markantestes Merkmal */
  --dsb-tile:  #5b1d12; /* Sidebar/Kachel-Hintergrund, entspricht thedigitalbooks --primary-dark */
  --dsb-tile2: #6a2416; /* Kachel-Hover/Navbar, entspricht thedigitalbooks --secondary-dark */
  --dsb-text:  #fff;
  --dsb-grau:  #777777; /* Sonderfarbe für hervorgehobene Spezial-Module, z.B. Arbeitszeit-Kachel */
}

body {
  min-height: 100vh;
  background: var(--dsb-bg);
  color: var(--dsb-text);
}

a { color: #ffd9c7; }
a:hover { color: #fff; }

/* ---------- Navbar ---------- */
.navbar {
  background: var(--dsb-tile2) !important;
  padding: 0.75rem 1rem;
}
.navbar-brand { font-weight: 700; font-size: 1.1rem; color: #fff !important; }
.navbar .nav-link, .navbar .dropdown-toggle { color: #fff !important; }

/* Blinkendes Sicherheits-Warnsymbol (nur sichtbar, wenn die Sicherheitscheck-Seite offene Funde
   meldet) -- Muster 1:1 aus thedigitalbook übernommen. */
@keyframes dsb2-blink { 50% { opacity: 0.25; } }
.dsb2-sicherheits-warnung { animation: dsb2-blink 1.2s infinite; color: #ffce54 !important; }
/* Wiederverwendung derselben Animation für andere blinkende Hinweis-Icons (z.B. Storch-Icon auf
   dem Dashboard) -- "dsb2-blink" ist nur der @keyframes-Name, keine eigenständige Klasse, daher
   eigene schlanke Klasse statt der thematisch unpassenden .dsb2-sicherheits-warnung. */
.dsb2-icon-blink { animation: dsb2-blink 1.2s infinite; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--dsb-tile);
  min-height: calc(100vh - 56px);
  padding-top: 1rem;
  transition: all 0.3s ease;
}
.sidebar .nav-link {
  color: rgba(255,255,255,0.75);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  margin: 0.25rem 0.75rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.sidebar-divider { border-color: rgba(255,255,255,0.2); margin: 1rem 0.75rem; }
.sidebar-heading {
  color: rgba(255,255,255,0.45);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem 0.25rem;
  margin-top: 0.25rem;
}

/* Mobil: Off-Canvas-Sidebar -- 1:1-Muster aus thedigitalbook (siehe Bauprompt Abschnitt 5), hier
   nur umgefärbt. Pflicht-Verhalten für DSB2, nicht optional. */
@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    top: 56px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 56px);
    z-index: 1040;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }
  .sidebar.show { left: 0; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1039;
  }
  .sidebar-backdrop.show { display: block; }
  .main-content { margin-left: 0 !important; width: 100% !important; }
}

/* ---------- Hauptbereich ---------- */
.main-content { padding: 1.5rem; min-height: calc(100vh - 56px); }
@media (max-width: 575.98px) { .main-content { padding: 1rem; } }

/* ---------- Karten ---------- */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  margin-bottom: 1rem;
  color: #212529;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  padding: 1rem 1.25rem;
}

/* Kachel-Hub-Muster (z.B. Einstellungen-Landingpage, Dashboard) -- 1:1 aus thedigitalbook. */
.dsb2-hub-kachel {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.dsb2-hub-kachel .dsb2-hub-icon { font-size: 2.2rem; }
.dsb2-hub-kachel .btn { margin-top: auto; }

/* Dashboard-Kacheln (DSB-Original-Optik: dunkle Vollflächen-Kacheln) */
.dsb-tile {
  background: var(--dsb-tile);
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background 0.15s ease;
}
.dsb-tile:hover { background: var(--dsb-tile2); color: #fff; }
.dsb-tile-arbeitszeit { background: var(--dsb-grau); }
.dsb-tile-arbeitszeit:hover { background: #666; }

/* ---------- Tabellen ---------- */
.table th { background: #f8f9fa; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-responsive { border-radius: 0 0 12px 12px; }

/* Globales a{color:#ffd9c7} (für den dunklen Vollflächen-Hintergrund gedacht) ist auf dem hellen
   Tabellenhintergrund praktisch unlesbar (z.B. "Name"-Spalte in epruefung-dashboard.php) -- hier
   stattdessen die Markenfarbe, die auf hellem Grund ausreichend Kontrast hat. */
.table a { color: var(--dsb-bg); text-decoration: underline; }
.table a:hover { color: var(--dsb-tile); }

/* Verpflichtendes Standard-Darstellungsmuster für JEDE Listen-/Auswertungs-Tabelle in DSB2 (siehe
   Bauprompt Abschnitt 5.1) -- Bootstraps bloßes .table-responsive (nur horizontales Scrollen)
   wird NICHT als alleiniges Muster akzeptiert, jede Tabelle bekommt zusätzlich diese Klasse. */
@media (max-width: 767.98px) {
  .table-mobile-stack td, .table-mobile-stack th { display: block; width: 100%; text-align: left !important; }
  .table-mobile-stack thead { display: none; }
  .table-mobile-stack tr { display: block; border: 1px solid #dee2e6; border-radius: 8px; margin-bottom: 1rem; padding: 0.5rem; background: #fff; }
  .table-mobile-stack td::before { content: attr(data-label); font-weight: 600; display: block; margin-bottom: 0.25rem; color: #6c757d; font-size: 0.85rem; }
  .table-mobile-stack td { border: none; padding: 0.5rem 0.75rem; }
}

/* ---------- Buttons ---------- */
.btn-action { padding: 0.375rem 0.75rem; font-size: 0.875rem; }
@media (max-width: 575.98px) {
  .btn-action { padding: 0.5rem; font-size: 0.8rem; }
  .btn-group-mobile { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .btn-group-mobile .btn { flex: 1 1 auto; }
  .page-header { flex-direction: column; align-items: stretch !important; }
  .page-header .btn { width: 100%; }
}
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ---------- Universeller Bulk-Bar (Muster 1:1 aus thedigitalbook) ---------- */
#bulkBar {
  position: sticky; bottom: 0; z-index: 30;
  background: var(--dsb-tile2); color: #fff;
  padding: 0.75rem 1.25rem; border-radius: 12px 12px 0 0;
  display: none; align-items: center; gap: 1rem; flex-wrap: wrap;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.25);
}
#bulkBar.show { display: flex; }
#bulkBar .btn { margin-right: 0.25rem; }

/* ---------- Tabs (nav-tabs) auf dem roten Vollflächen-Hintergrund ---------- */
/* Bootstraps Standardfarbe für Tab-Links ist blau (--bs-link-color) -- auf --dsb-bg praktisch
   unlesbar ("blaue Schrift auf rot"). Inaktive Tabs: weiß auf transparentem Weiß-Pill, aktiver
   Tab: dunkel auf weiß (nahtloser Übergang zur weißen Karte direkt darunter). */
.nav-tabs { border-bottom: none; gap: 0.25rem; }
.nav-tabs .nav-link {
  color: #fff;
  background: rgba(255,255,255,0.14);
  border: none;
  border-radius: 8px 8px 0 0;
}
.nav-tabs .nav-link:hover { background: rgba(255,255,255,0.26); color: #fff; }
.nav-tabs .nav-link.active {
  background: #fff;
  color: var(--dsb-tile2);
  font-weight: 600;
}

/* ---------- Pflichtfeld-Markierung ---------- */
.required::after { content: ' *'; color: #dc3545; }

/* ---------- Login ---------- */
.dsb2-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--dsb-bg);
}
.dsb2-login-box {
  background: #fff; color: #212529; border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  width: 360px; max-width: 92vw; padding: 2rem;
}
.dsb2-login-box .btn-login { width: 100%; }

/* Datei-Lightbox (Baustelle -> Dateien) nutzt die lokal vendorte GLightbox-Bibliothek
   (public/assets/vendor/glightbox/) statt eigenem CSS -- siehe dort für Anpassungen. */
