/* ============================================================
   Stylesheet fuer das Login-System
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #1a202c;
}

.box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

/* Breitere Box fuer Profil und Admin */
.box-breit {
    max-width: 800px;
}

h1 {
    font-size: 24px;
    margin-bottom: 6px;
    color: #1e3a5f;
}

h2 {
    font-size: 17px;
    color: #1e3a5f;
    margin-bottom: 14px;
}

.untertitel {
    font-size: 14px;
    color: #718096;
    margin-bottom: 28px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 16px;
    color: #2d3748;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.15s;
}

input:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.12);
}

button {
    width: 100%;
    margin-top: 24px;
    padding: 12px;
    background: #2c5282;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

button:hover { background: #1e3a5f; }

.hinweis {
    margin-top: 22px;
    font-size: 14px;
    text-align: center;
    color: #718096;
}

.hinweis a {
    color: #2c5282;
    text-decoration: none;
    font-weight: 600;
}

.hinweis a:hover { text-decoration: underline; }

.meldung {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.meldung.fehler {
    background: #fed7d7;
    color: #822727;
    border: 1px solid #fc8181;
}

.meldung.erfolg {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #68d391;
}

/* ===== Geschuetzter Bereich ===== */
.willkommen {
    text-align: center;
}

.willkommen .avatar {
    width: 64px;
    height: 64px;
    background: #2c5282;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.willkommen .info {
    background: #f7fafc;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    font-size: 14px;
    text-align: left;
}

.willkommen .info div {
    padding: 4px 0;
    color: #4a5568;
}

.willkommen .info strong { color: #1a202c; }

/* ===== Navigations-Links (Buttons) ===== */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.btn-link {
    display: block;
    padding: 12px;
    background: #edf2f7;
    color: #2c5282;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}

.btn-link:hover { background: #e2e8f0; }

.btn-link-admin {
    background: #2c5282;
    color: #fff;
}
.btn-link-admin:hover { background: #1e3a5f; }

/* ===== Profil-Abschnitte ===== */
.abschnitt {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    margin-top: 24px;
}

.abschnitt:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.info-text {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 12px;
    line-height: 1.5;
}

.info-text.status-aktiv {
    background: #c6f6d5;
    color: #22543d;
    padding: 10px 12px;
    border-radius: 8px;
}

.form-abstand { margin-top: 8px; }

/* ===== 2FA QR-Bereich ===== */
.qr-bereich {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: #f7fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.qr-bereich img {
    background: #fff;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.secret-anzeige {
    font-size: 13px;
    color: #4a5568;
}

.secret-anzeige code {
    display: inline-block;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 15px;
    letter-spacing: 2px;
    color: #1a202c;
    word-break: break-all;
}

/* ===== Button-Varianten ===== */
.btn-warnung { background: #c53030; }
.btn-warnung:hover { background: #9b2c2c; }

.btn-grau { background: #718096; }
.btn-grau:hover { background: #4a5568; }

/* ===== Admin-Tabelle ===== */
.tabelle-wrap {
    overflow-x: auto;
}

.benutzer-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.benutzer-tabelle th,
.benutzer-tabelle td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.benutzer-tabelle th {
    color: #718096;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.benutzer-tabelle tr.zeile-wartend {
    background: #fffbeb;
}

.email-klein {
    color: #a0aec0;
    font-size: 12px;
}

.ich-marker {
    color: #2c5282;
    font-size: 12px;
    font-weight: 600;
}

/* Status-Badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.status-wartend     { background: #feebc8; color: #7b341e; }
.status-freigegeben { background: #c6f6d5; color: #22543d; }
.status-gesperrt    { background: #fed7d7; color: #822727; }

/* Aktions-Buttons in der Tabelle */
.aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.mini-btn {
    width: auto;
    margin: 0;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    color: #fff !important;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    cursor: pointer;
}
.mini-btn:hover { color: #fff !important; }

.btn-gruen  { background: #2f855a; }
.btn-gruen:hover  { background: #276749; }
.btn-orange { background: #c05621; }
.btn-orange:hover { background: #9c4221; }
.btn-blau   { background: #2b6cb0; }
.btn-blau:hover   { background: #2c5282; }
.btn-rot    { background: #c53030; }
.btn-rot:hover    { background: #9b2c2c; }

/* ===== 2FA-Methodenwahl ===== */
.unter-h {
    font-size: 15px;
    color: #2d3748;
    margin-bottom: 8px;
}

.methoden-wahl {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.methode-karte {
    flex: 1;
    min-width: 240px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
}

.methode-karte h3 { margin-bottom: 6px; }
.methode-karte button { margin-top: 12px; }

/* ===== Dashboard ===== */
.dashboard-kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.kachel {
    display: block;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: #1a202c;
    transition: all 0.15s;
}

.kachel-aktiv {
    border-color: #2c5282;
    background: #fff;
}
.kachel-aktiv:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44,82,130,0.15);
    background: #ebf4ff;
}

.kachel-gesperrt {
    opacity: 0.5;
    cursor: not-allowed;
}

.kachel-icon {
    font-size: 36px;
    font-weight: 700;
    color: #2c5282;
    margin-bottom: 8px;
}
.kachel-gesperrt .kachel-icon { color: #a0aec0; }

.kachel-titel {
    font-size: 17px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 6px;
}

.kachel-text {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.5;
}

.dashboard-aktionen {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}
.dashboard-aktionen .btn-link {
    flex: 0 0 auto;
    padding: 10px 22px;
}

/* ===== Brotkrumen-Navigation ===== */
.brotkrumen {
    font-size: 13px;
    color: #718096;
    margin-bottom: 8px;
}
.brotkrumen a {
    color: #2c5282;
    text-decoration: none;
}
.brotkrumen a:hover { text-decoration: underline; }
.brotkrumen strong { color: #1a2744; }

/* ===== Such-Leiste ===== */
.suchleiste {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}
.suchleiste input {
    flex: 1;
    margin: 0;
}
.suchleiste button {
    width: auto;
    margin: 0;
    padding: 11px 22px;
}

/* ===== FSA: Feld-Gruppen ===== */
.feld-gruppe {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    background: #fafbfc;
}
.feld-gruppe h2 {
    font-size: 15px;
    margin-bottom: 12px;
}

.zwei-spalten {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.drei-spalten {
display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
@media (max-width: 540px) {
    .zwei-spalten { grid-template-columns: 1fr; }
    .drei-spalten { grid-template-columns: 1fr; }
}

.checkbox-gruppe {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.cb-zeile {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
    font-weight: normal;
}
.cb-zeile input[type="checkbox"] {
    width: auto;
    margin: 0;
}

textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}
textarea:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.12);
}

select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}
select:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.12);
}

/* ===== Seiten-Kopf mit Logo und Abmelden ===== */
.seiten-kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.kopf-logo {
    display: block;
    line-height: 0;
}
.kopf-logo img {
    height: 38px;
    width: auto;
    max-width: 100%;
}
.kopf-rechts {
    display: flex;
    align-items: center;
    gap: 12px;
}
.kopf-name {
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
}
.kopf-logout {
    width: auto;
    padding: 6px 14px;
    margin: 0;
    background: #e2e8f0;
    color: #2d3748;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #cbd5e0;
}
.kopf-logout:hover {
    background: #cbd5e0;
}

/* Login-Logo (auf der Anmeldeseite, mittig oben) */
.login-logo {
    text-align: center;
    margin-bottom: 24px;
}
.login-logo img {
    max-width: 260px;
    width: 100%;
    height: auto;
}

/* ===== Prüfungs-Tabelle ===== */
.pruef-tabelle {
    width: 100%;
    border-collapse: collapse;
}
.pruef-tabelle th {
    background: #edf2f7;
    color: #4a5568;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 8px;
    font-weight: 600;
}
.pruef-tabelle td {
    border-bottom: 1px solid #e2e8f0;
    padding: 8px;
    vertical-align: top;
}
.pruef-tabelle .punkt-name {
    font-weight: 600;
    color: #1a202c;
    min-width: 180px;
}
.pruef-tabelle .punkt-bewertung { min-width: 280px; }
.pruef-tabelle .punkt-bemerkung { min-width: 180px; }
.pruef-tabelle .punkt-bemerkung textarea {
    margin: 0;
    padding: 6px 8px;
    font-size: 13px;
    min-height: 38px;
}
.pruef-tabelle .punkt-fotos { width: 220px; }

/* Bewertungs-Optionen */
.bw-option {
    display: inline-block;
    padding: 4px 10px;
    margin: 2px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.1s;
    user-select: none;
}
.bw-option input { display: none; }
.bw-option:hover { background: #f7fafc; }
.bw-option.gewaehlt { color: #fff; border-color: transparent; }

.bw-iO.gewaehlt          { background: #2f855a; }
.bw-einstellung.gewaehlt { background: #d69e2e; }
.bw-nicht_erf.gewaehlt   { background: #718096; }
.bw-maengel.gewaehlt     { background: #c53030; }

/* Leiter: "nicht zutreffend" - orange, aber nur wenn gewählt */
/* Im nicht-gewählten Zustand: gleicher Rahmen wie i.O./Mangel */
label.bw-option.bw-nz:not(.gewaehlt),
label.bw-option.bw-nz:not(.gewaehlt):hover {
    border: 1px solid #cbd5e0 !important;
    color: #4a5568 !important;
    background: #fff !important;
}
label.bw-option.bw-nz:not(.gewaehlt):hover {
    background: #f7fafc !important;
}
label.bw-option.bw-nz.gewaehlt {
    background: #ed8936 !important;
    color: #fff !important;
    border: 2px solid #c05621 !important;
}

/* Foto-Thumbnails */
.foto-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.foto-thumb {
    position: relative;
    display: inline-block;
}
.foto-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}
.foto-loeschen {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #c53030;
    color: #fff;
    border: 2px solid #fff;
    font-size: 12px;
    line-height: 14px;
    cursor: pointer;
}

/* Foto-Upload-Button */
.foto-upload-btn {
    display: inline-block;
    padding: 5px 10px;
    background: #2b6cb0;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.foto-upload-btn:hover { background: #2c5282; }
.foto-upload-btn input { display: none; }

/* Foto-Bereich (z.B. bei der allgemeinen Bemerkung) */
.foto-bereich {
    margin-top: 6px;
}

/* Signatur */
.signatur-bereich {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 4px;
    background: #fff;
    margin-top: 4px;
}
.signatur-canvas {
    display: block;
    width: 100%;
    max-width: 500px;
    height: 180px;
    cursor: crosshair;
    touch-action: none;
    border-radius: 6px;
    background: #fafafa;
}
.signatur-bereich .mini-btn { margin-top: 6px; }

/* Aktions-Leiste */
.aktions-leiste {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}
.aktions-leiste button {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

/* Responsive: Prüf-Tabelle auf schmalen Geräten als Karten */
@media (max-width: 768px) {
    .pruef-tabelle thead { display: none; }
    .pruef-tabelle tr {
        display: block;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px;
        background: #fff;
    }
    .pruef-tabelle td {
        display: block;
        border: none;
        padding: 6px 0;
    }
    .pruef-tabelle .punkt-name {
        font-size: 15px;
        padding-bottom: 8px;
        border-bottom: 1px solid #f1f5f9;
    }
}

/* ============================================================ */
/* RWA-Prüfung                                                  */
/* ============================================================ */

/* Stammdaten-Tabelle */
.info-tabelle {
    width: 100%;
    border-collapse: collapse;
}
.info-tabelle td {
    padding: 4px 8px;
    font-size: 14px;
    vertical-align: top;
}
.info-tabelle td:first-child {
    color: #4a5568;
    width: 150px;
    white-space: nowrap;
}

/* Eine Prüfpunkt-Zeile als Karte */
.pruef-zeile {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fafbfc;
}
.pruef-titel {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a2744;
}

/* Bewertungs-Optionen (RWA nutzt dieselbe Optik wie FSA) */
.bw-optionen {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.bw-option.bw-mangel.gewaehlt { background: #c53030; }

/* Anzahl + Bemerkung nebeneinander */
.pruef-zusatz {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.zusatz-feld {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: #4a5568;
    flex: 0 0 auto;
}
.zusatz-feld .zusatz-label {
    white-space: nowrap;
    line-height: 38px;
}
.anzahl-input {
    width: 70px;
    height: 38px;
    margin: 0;
    box-sizing: border-box;
    vertical-align: top;
}
.bemerkung-input {
    flex: 1;
    min-width: 0;
    height: 56px;
    margin: 0;
    resize: vertical;
    box-sizing: border-box;
    vertical-align: top;
}
.pruef-zusatz.ohne-anzahl .bemerkung-input {
    width: 100%;
}

/* Unterschriften-Canvas */
.sig-wrap {
    border: 1px dashed #cbd5e0;
    border-radius: 8px;
    background: #fff;
    margin: 6px 0;
}
.sig-canvas {
    display: block;
    width: 100%;
    height: 140px;
    cursor: crosshair;
    touch-action: none;
}