/**
 * PrüfDoku - Hauptstylesheet
 *
 * Farbschema:
 * - Primary (Blau): #1a4fa0
 * - Success (Grün): #28a745
 * - Danger (Rot): #dc3545
 * - Warning (Gelb): #f0ad4e
 * - Orange: #ff9800
 */

/* ─── CSS Custom Properties ─────────────────────────────────────────────── */

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --orange: #ea580c;
}

/* ─── Reset & Basis ─────────────────────────────────────────────────────── */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    background: #f1f5f9;
}

a {
    color: var(--primary);
}

/* ─── Header / Navigation ───────────────────────────────────────────────── */

.header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, var(--primary) 100%);
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
}

.header .subtitle {
    font-size: 12px;
    opacity: 0.85;
}

.header .logo {
    height: 36px;
    border-radius: 6px;
}

.nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
    align-items: center;
}

.nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav a:hover,
.nav a.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.nav-sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    padding: 0 2px;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 24px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 12px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-orange {
    background: var(--orange);
}

.card-body {
    padding: 18px;
}

.card-header-danger { background: linear-gradient(135deg, #991b1b, var(--danger)); }
.card-header-orange { background: linear-gradient(135deg, #c2410c, var(--orange)); }
.card-header-gradient { background: linear-gradient(135deg, #0f172a, var(--primary)); }

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

/* ─── Info-Grid ─────────────────────────────────────────────────────────── */

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

/* ─── Badges ────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success); }
.badge-danger  { background: var(--danger); }
.badge-warning { background: var(--warning); color: #333; }
.badge-gray    { background: var(--gray); }
.badge-orange  { background: var(--orange); }
.badge-primary { background: var(--primary); }
.badge-info    { background: #0ea5e9; }
.badge-dark    { background: #1e293b; }
.badge-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

.filter-btn { opacity: 0.6; }
.filter-btn.active { opacity: 1; font-weight: 700; }

/* Dropdown-Menü */
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; z-index: 100;
    background: white; border: 1px solid #e2e8f0; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 240px; margin-top: 4px;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a, .dropdown-menu span {
    display: block; padding: 10px 16px; text-decoration: none; color: #1e293b;
    border-bottom: 1px solid #f1f5f9; font-size: 14px;
}
.dropdown-menu a:hover { background: #f1f5f9; }
.dropdown-menu a small, .dropdown-menu span small {
    display: block; font-size: 11px; color: #94a3b8; margin-top: 2px;
}
.dropdown-menu .disabled { opacity: 0.4; cursor: default; }

/* ─── Ergebnis-Banner ───────────────────────────────────────────────────── */

.result-banner {
    padding: 16px;
    text-align: center;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
}
.result-warn {
    background: #fef3c7;
    color: #92400e;
}

.result-ok   { background: var(--success); }
.result-fail { background: var(--danger); }

/* ─── Detail-Grid ──────────────────────────────────────────────────────── */

.detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px;
}
.detail-item { padding: 4px 0; }
.detail-label {
    display: block; font-size: 0.75rem; color: var(--gray);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.detail-value { font-weight: 600; font-size: 0.95rem; }

@media (max-width: 600px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* ─── Check-Icons ──────────────────────────────────────────────────────── */

.check-cell { text-align: center; width: 60px; }
.check-ok { color: var(--success); font-weight: 700; font-size: 1.1rem; }
.check-fail { color: var(--danger); font-weight: 700; font-size: 1.1rem; }
.check-na { color: var(--gray); }

/* ─── Tabellen ──────────────────────────────────────────────────────────── */

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

.table th {
    background: linear-gradient(135deg, #0f2b5e, var(--primary));
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.table tr:nth-child(even) { background: #f8fafc; }
.table tr:hover            { background: #eff6ff; transition: background 0.15s; }
.table-orange th           { background: var(--orange); }

/* ─── Buttons ───────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary       { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-success       { background: var(--success); color: white; }
.btn-danger        { background: var(--danger); color: white; }
.btn-orange        { background: var(--orange); color: white; }
.btn-outline       { background: white; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm            { padding: 4px 10px; font-size: 12px; }

/* ─── Status-Dots ───────────────────────────────────────────────────────── */

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-green  { background: var(--success); }
.status-yellow { background: var(--warning); }
.status-red    { background: var(--danger); }
.status-gray   { background: var(--gray); }

/* ─── Suche ─────────────────────────────────────────────────────────────── */

.search-box {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-box:focus {
    border-color: var(--primary);
}

/* ─── Statistik-Kacheln ─────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-top: 4px;
}

/* ─── Formulare ─────────────────────────────────────────────────────────── */

.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin: 18px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.form-section-title:first-child { margin-top: 0; }

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: #f0f5ff;
}

/* ─── GBU Kategorie-Farben ─────────────────────────────────────────────── */

.gbu-kat-allgemein { background: #6b7280; }
.gbu-kat-werkzeug { background: #3b82f6; }
.gbu-kat-messgeraet { background: #10b981; }
.gbu-kat-maschine { background: #f59e0b; }
.gbu-kat-leiter { background: #8b5cf6; }
.gbu-kat-taetigkeit { background: #ef4444; }
.gbu-kat-grunddaten { background: #1a4fa0; }

.gbu-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.gbu-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.gbu-card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

/* ─── GBU / Unterweisungen ─────────────────────────────────────────────── */

.gbu-entry {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.gbu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.gbu-zuweisen {
    margin-top: 12px;
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
}

.gbu-zuweisen form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.gbu-offen-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── Fortschrittsbalken ───────────────────────────────────────────────── */

.progress-bar {
    margin-bottom: 8px;
}

.progress-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 2px;
}

.progress-track {
    background: #e2e8f0;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-track-lg {
    height: 24px;
}

.progress-fill-label {
    display: inline-block;
    text-align: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 24px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-green { background: var(--success); }
.progress-yellow { background: var(--warning); }
.progress-red { background: var(--danger); }

/* ─── Unterschrift-Canvas ──────────────────────────────────────────────── */

.sig-canvas {
    width: 100%;
    height: 150px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
    background: #fff;
}

.sig-canvas-small {
    width: 100%;
    height: 120px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
    background: #fff;
}

.sig-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.sig-hint {
    font-size: 12px;
    color: var(--gray);
    align-self: center;
}

/* ─── Inline-Edit Felder (Prüfer-Verwaltung) ──────────────────────────── */

.inline-edit {
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 4px;
    border-radius: 4px;
    width: auto;
    font-size: 14px;
}

.inline-edit:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
}

.inline-edit-bold { font-weight: 600; }
.inline { display: inline; }

/* ─── Unterschrift-Vorschau ────────────────────────────────────────────── */

.sig-preview {
    max-width: 120px;
    max-height: 40px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* ─── Foto-Vorschau ───────────────────────────────────────────────────── */

.foto-thumb {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    width: 150px;
}

.foto-thumb img {
    width: 150px;
    height: 100px;
    object-fit: cover;
}

.foto-thumb-info {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.foto-thumb-delete {
    color: var(--danger);
    float: right;
}

.foto-grid-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.foto-upload-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* ─── Ergebnis-Anzeige in Formularen ──────────────────────────────────── */

.result-display {
    margin-top: 12px;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

/* ─── Allgemeine Hilfsklassen ──────────────────────────────────────────── */

/* ─── Radio/Toggle Gruppen ──────────────────────────────────────────────── */

.radio-group { display: flex; gap: 20px; margin-top: 4px; }
.radio-inline { display: flex; gap: 12px; margin-top: 4px; }
.radio-label-ok { padding: 4px 12px; border-radius: 6px; background: #d4edda; cursor: pointer; }
.radio-label-fail { padding: 4px 12px; border-radius: 6px; background: #f8d7da; cursor: pointer; }
.radio-label-ok-lg { padding: 8px 20px; border-radius: 6px; background: #d4edda; cursor: pointer; font-weight: 600; }
.radio-label-fail-lg { padding: 8px 20px; border-radius: 6px; background: #f8d7da; cursor: pointer; font-weight: 600; }

/* ─── Messungs-Sektion ─────────────────────────────────────────────────── */

.messung-section {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.messung-section h4 {
    margin-bottom: 8px;
    color: var(--primary);
}

/* ─── Ergebnis-Display (Geräteprüfung) ─────────────────────────────────── */

.ergebnis-display {
    margin-top: 8px;
    padding: 16px;
    border-radius: 8px;
    background: #d4edda;
    color: #155724;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
}

.ergebnis-label { font-size: 16px; font-weight: 700; }
.input-readonly { background: #f0f0f0; }
.select-narrow { max-width: 200px; }

/* ─── Submit-Bereich ───────────────────────────────────────────────────── */

.submit-area { text-align: center; margin: 20px 0; }
.submit-area .btn { font-size: 16px; padding: 12px 30px; }
.submit-area .btn-success { font-size: 18px; padding: 14px 40px; }

.text-center { text-align: center; }
.hidden { display: none; }
.mr-16 { margin-right: 16px; }
.ml-4 { margin-left: 4px; }
.info-box { margin-top: 8px; padding: 8px; background: #f0f5ff; border-radius: 6px; font-size: 13px; }

/* ─── Kundendetail ─────────────────────────────────────────────────────── */

.edit-link { color: white; opacity: 0.7; font-size: 12px; margin-left: 8px; }
.edit-link:hover { opacity: 1; }
.portal-box { margin-top: 16px; padding: 12px 16px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.portal-title { font-size: 13px; }
.dropdown-wrapper { position: relative; display: inline-block; }
.card-header-gray { background: var(--gray); }
.danger-zone { margin-top: 16px; padding: 12px; border: 2px solid #fee2e2; border-radius: 8px; }
.nowrap { white-space: nowrap; }
.text-gray { color: var(--gray); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-orange { color: var(--orange); }
.card-header-gradient { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.gap-8 { gap: 8px; }
.fw-600 { font-weight: 600; }
.bg-light { background: var(--light); }
.rounded { border-radius: 8px; }

/* ─── Stromkreis-Tabelle (E-CHECK) ─────────────────────────────────────── */

.sk-input-xs { width: 40px; }
.sk-input-sm { width: 60px; }
.sk-input-md { width: 90px; }
.sk-input-lg { width: 150px; }

.sk-table { overflow-x: auto; }
.sk-table input, .sk-table select { font-size: 13px; padding: 4px; }

/* ─── Kalender ─────────────────────────────────────────────────────────── */

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-header {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
}

.cal-day {
    min-height: 80px;
    background: white;
    border: 1px solid var(--border);
    padding: 4px;
    font-size: 11px;
    position: relative;
}

.cal-day-nr {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 2px;
}

.cal-day.today { border: 2px solid var(--primary); }
.cal-day.other-month { background: #f8fafc; }
.cal-day.other-month .cal-day-nr { color: #cbd5e1; }

.cal-event {
    display: block;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;
    margin-bottom: 1px;
    text-decoration: none;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cal-event-danger { background: var(--danger); }
.cal-event-warning { background: var(--warning); color: #333; }
.cal-event-success { background: var(--success); }
.cal-event-primary { background: var(--primary); }

.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cal-nav h3 { margin: 0; }

@media (max-width: 600px) {
    .cal-day { min-height: 50px; font-size: 9px; }
    .cal-day-nr { font-size: 11px; }
    .cal-event { font-size: 8px; padding: 1px 2px; }
}

/* ─── Messwerte ─────────────────────────────────────────────────────────── */

.messwerte-group {
    margin-bottom: 12px;
}

.messwerte-group h4 {
    color: var(--primary);
    font-size: 13px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.messwerte-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
}

.messwerte-item .label { color: var(--gray); }
.messwerte-item .value { font-weight: 600; }

/* ─── Prüfhistorie (klappbare Liste) ─────────────────────────────────────── */
.card-body-compact { padding: 8px 12px; }

.historie-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.historie-list li + li { margin-top: 6px; }

.historie-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.historie-item[open] { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }

.historie-summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    user-select: none;
}

.historie-summary::-webkit-details-marker { display: none; }
.historie-summary::marker { content: ''; }

.historie-summary::before {
    content: '+';
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.historie-item[open] > .historie-summary::before { content: '−'; }

.historie-datum {
    font-weight: 600;
    min-width: 95px;
}

.historie-pruefer {
    color: var(--gray);
    flex: 1;
    font-size: 14px;
    min-width: 120px;
}

.historie-pdf { margin-left: auto; }

.historie-body {
    padding: 12px 14px 14px 46px;
    border-top: 1px solid var(--border);
}

@media (max-width: 540px) {
    .historie-summary { gap: 8px; padding: 10px; }
    .historie-pruefer { flex-basis: 100%; order: 5; }
    .historie-body { padding: 12px; }
}

/* ─── Alerts ────────────────────────────────────────────────────────────── */

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

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ─── Foto-Grid / Lightbox ──────────────────────────────────────────────── */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.photo-grid img {
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-grid img:hover {
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--gray);
    transition: all 0.2s;
}

.tab:hover           { color: var(--primary); }
.tab.active          { color: var(--primary); border-bottom-color: var(--primary); }
.tab.active-orange   { color: var(--orange); border-bottom-color: var(--orange); }
.tab-content         { display: none; }
.tab-content.active  { display: block; }

/* ─── Sonstiges ─────────────────────────────────────────────────────────── */

.deaktiviert {
    opacity: 0.5;
    text-decoration: line-through;
}

.toggle-btn {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    border: none;
    font-weight: 600;
}

.toggle-active   { background: #d4edda; color: #155724; }
.toggle-inactive { background: #f8d7da; color: #721c24; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    opacity: 0.85;
    padding: 6px 12px;
    border-radius: 6px;
}

.back-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Prüfarten-Grid (Dashboard) ───────────────────────────────────────── */

.pruef-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 16px;
}

.pruef-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pruef-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.pruef-tile.btn-danger { background: var(--danger); }
.pruef-tile.btn-outline { color: var(--primary); border: 1px solid var(--primary); background: white; }
.pruef-tile.btn-outline:hover { background: var(--primary); color: white; }
.pruef-icon { font-size: 1.2rem; }
.pruef-name { font-size: 0.85rem; font-weight: 600; }
.pruef-norm { font-size: 0.7rem; opacity: 0.8; }

/* ─── Filter-Bar ───────────────────────────────────────────────────────── */

.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* ─── Suchfeld-Wrap ────────────────────────────────────────────────────── */

.search-wrap { margin-bottom: 12px; }

/* ─── Mobile-Hidden Spalten ────────────────────────────────────────────── */

.hide-mobile { /* Sichtbar auf Desktop */ }

/* ─── Scanner-Button ───────────────────────────────────────────────────── */

.scan-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    margin-left: auto;
    line-height: 1;
    transition: background 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.scan-btn:hover, .scan-btn:active { background: rgba(255,255,255,0.3); }

.offline-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    margin-left: 4px;
    line-height: 1;
    transition: background 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.offline-btn:hover, .offline-btn:active { background: rgba(255,255,255,0.3); }
.offline-btn.synced { border-color: #28a745; background: rgba(40,167,69,0.3); }

.sync-btn {
    background: #dc3545;
    border: 2px solid rgba(255,255,255,0.4);
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    margin-left: 4px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    animation: pulse-sync 2s infinite;
}
/* Offline-Banner unten */
.offline-banner {
    display: none;
    background: #fef3c7;
    color: #92400e;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
}

.sync-badge {
    background: #fff;
    color: #dc3545;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 12px;
    font-weight: 700;
}
@keyframes pulse-sync {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ─── Action-Buttons (Detailansicht) ───────────────────────────────────── */

.action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ─── Hamburger-Menü ───────────────────────────────────────────────────── */

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    line-height: 1;
}

/* ─── Tabellen-Wrapper (horizontal scrollbar) ──────────────────────────── */

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
    .info-grid   { grid-template-columns: 1fr 1fr; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .header      { flex-wrap: wrap; }
    .nav         { gap: 4px; flex-wrap: wrap; }
    .nav a       { font-size: 12px; padding: 4px 8px; }
}

/* Mobile */
@media (max-width: 600px) {
    /* Header: Hamburger-Menü */
    .menu-toggle { display: block; }
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: rgba(0,0,0,0.2);
        border-radius: 8px;
        margin-top: 8px;
        padding: 4px;
    }
    .nav.open { display: flex; }
    .nav a {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 6px;
        opacity: 1;
    }
    .nav a:hover, .nav a:active { background: rgba(255,255,255,0.2); }
    .nav-sep { display: none; }

    /* Layout */
    .header      { padding: 10px 14px; flex-wrap: wrap; }
    .header h1   { font-size: 16px; }
    .container   { padding: 10px; }

    /* Grids einspaltig */
    .info-grid   { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .stats-grid  { grid-template-columns: 1fr 1fr; }

    /* Karten */
    .card { border-radius: 8px; margin-bottom: 12px; }
    .card-header { padding: 10px 14px; font-size: 14px; }
    .card-body   { padding: 12px; }

    /* Tabellen horizontal scrollbar */
    .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 500px; }
    .table th, .table td { padding: 6px 8px; font-size: 12px; }

    /* Tabs */
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab  { padding: 8px 12px; font-size: 12px; white-space: nowrap; }

    /* Buttons: Touch-freundlich (min 44px Höhe) */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .btn-sm { padding: 8px 12px; font-size: 13px; min-height: 40px; }

    /* Filter-Buttons (Dashboard) */
    .filter-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
        min-height: 36px;
    }

    /* Dropdown-Menü responsive */
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        overflow-y: auto;
        min-width: 100%;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    }
    .dropdown-menu a, .dropdown-menu span {
        padding: 14px 20px;
        font-size: 15px;
    }

    /* Dropdown Overlay (Hintergrund abdunkeln) */
    .dropdown-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99;
    }
    .dropdown-overlay.show { display: block; }

    /* Ergebnis-Banner */
    .result-banner { font-size: 16px; padding: 12px; }

    /* Formulare */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Verhindert iOS Zoom beim Focus */
        padding: 10px 12px;
    }

    /* Suche */
    .search-box { font-size: 16px; padding: 12px 14px; }

    /* Foto-Upload Section */
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }

    /* Messung-Sections */
    .messung-section { padding: 10px !important; }
    .messung-section h4 { font-size: 14px; }

    /* Prüfarten-Grid: 3 Spalten auf Mobile */
    .pruef-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 10px;
    }
    .pruef-tile { padding: 10px 4px; }
    .pruef-icon { font-size: 1rem; }
    .pruef-name { font-size: 0.75rem; }
    .pruef-norm { font-size: 0.6rem; }

    /* Filter-Bar: kleinere Buttons, scrollbar */
    .filter-bar {
        gap: 4px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .filter-bar .btn { white-space: nowrap; flex-shrink: 0; }

    /* Spalten auf Mobile ausblenden */
    .hide-mobile { display: none !important; }

    /* Tabellen auf Mobile: kein min-width, kleinere Schrift */
    .table { min-width: auto; }
    .table th, .table td { padding: 6px 6px; font-size: 11px; }
    .table .badge { font-size: 10px; padding: 2px 6px; }

    /* Aktions-Buttons in Detailansicht */
    .action-buttons {
        flex-direction: column;
    }
    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }

    /* Stat-Cards kompakter */
    .stat-card { padding: 10px; }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 10px; }

    /* Header kompakter */
    .header .logo { height: 28px; }
    .header h1 { font-size: 14px; }
    .header .subtitle { font-size: 10px; }
}

/* ─── Einstellungen-Seite Hilfsklassen ─────────────────────────────────── */

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-plz-ort { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.grid-user-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.preview-box { padding: 20px; background: #f8fafc; border-radius: 8px; text-align: center; border: 1px solid #e2e8f0; }
.preview-img { max-height: 80px; max-width: 300px; }
.sig-canvas-wrap { border: 2px solid #e2e8f0; border-radius: 8px; background: white; }
.sig-image { max-width: 300px; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; }
.status-box-success { padding: 12px; background: #dcfce7; border-radius: 8px; margin-bottom: 12px; }
.status-box-warning { padding: 12px; background: #fef3c7; border-radius: 8px; margin-bottom: 12px; }
.flex-row { display: flex; gap: 8px; }
.flex-wrap-center { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.checkbox-label { font-size: 0.8rem; display: flex; align-items: center; gap: 2px; }
.zuweisen-box { background: #f8fafc; padding: 12px; border-radius: 8px; }
.card-danger-border { border: 2px solid #fee2e2; }
.card-header-success { background: var(--success); }
.items-end { align-items: end; }
.mt-4 { margin-top: 4px; }
.p-12 { padding: 12px; }
.ml-auto { margin-left: auto; }
.opacity-70 { opacity: 0.7; }
.card-header-purple { background: #6366f1; }
.card-header-teal { background: #0891b2; }
.card-header-green { background: #059669; }
.centered { text-align: center; }
.centered-lg { text-align: center; padding: 40px; }
.upload-hint { font-size: 14px; color: var(--gray); }
.upload-filename { font-weight: 600; margin-top: 8px; }
.max-w-sm { max-width: 500px; margin: 0 auto; }
.flex-gap-8 { display: flex; gap: 8px; }
.hint-box { padding: 16px; background: var(--light); border-radius: 8px; border-left: 4px solid var(--primary); }
.emoji-lg { font-size: 48px; margin-bottom: 16px; }
.hint-box-success { padding: 16px; background: var(--light); border-radius: 8px; border-left: 4px solid var(--success); }
.hint-box-info { padding: 12px; background: #eff6ff; border-radius: 8px; border: 1px solid #bfdbfe; }
.hint-box-info p { color: #1e40af; font-size: 0.9rem; }
.hint-box-info a { color: #2563eb; }
.form-group-inline { margin: 0; }
.input-narrow { width: 100px; }
.qr-preview { text-align: center; padding: 16px; background: #f8fafc; border-radius: 8px; }
.qr-preview img { max-width: 200px; }
.totp-manual { font-size: 0.85rem; color: var(--gray); }
.totp-manual code { user-select: all; }
.pb-16 { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.credentials-box { background: #f8fafc; padding: 16px; border-radius: 8px; border: 1px solid #e2e8f0; }
.credentials-label { font-size: 13px; color: var(--gray); }
.credentials-value { font-weight: 600; word-break: break-all; }
.credentials-pw { font-size: 1.5rem; font-weight: 700; letter-spacing: 3px; font-family: monospace; }
.text-left { text-align: left; }
.text-uppercase { text-transform: uppercase; }
.inline { display: inline; }

/* Sync-Queue Overlay (JS-generiert) */
.sync-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.95); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.sync-title { color: #fff; font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.sync-ok { color: #28a745; font-size: 16px; }
.sync-pending { color: #fef3c7; font-size: 14px; margin-bottom: 16px; }
.sync-list { width: 100%; max-width: 500px; max-height: 60vh; overflow-y: auto; }
.sync-item { background: rgba(255,255,255,0.1); padding: 12px; border-radius: 8px; margin-bottom: 8px; }
.sync-item-type { color: #fff; font-weight: 600; }
.sync-item-time { color: #94a3b8; font-size: 12px; }
.sync-item-path { color: #64748b; font-size: 11px; word-break: break-all; }
.sync-btn-go { margin-top: 16px; padding: 12px 24px; background: #28a745; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; font-weight: 600; }
.sync-btn-close { margin-top: 12px; padding: 10px 24px; background: #64748b; color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.sync-offline-msg { margin-top: 16px; color: #fef3c7; font-size: 14px; }

@media (max-width: 600px) {
    .grid-2col { grid-template-columns: 1fr; }
    .grid-plz-ort { grid-template-columns: 1fr; }
    .grid-user-form { grid-template-columns: 1fr; }
}

/* ─── Login ────────────────────────────────────────────────────────────── */

.login-card { max-width: 420px; margin: 40px auto; }
.login-logo { height: 32px; margin-right: 8px; vertical-align: middle; }
.login-demo-info { max-width: 420px; margin: 16px auto; text-align: center; }
.login-link { text-align: center; margin-top: 12px; font-size: 0.85rem; }
.login-subtext { text-align: center; margin-top: 8px; font-size: 0.8rem; color: #cbd5e1; }
.btn-block { width: 100%; }
.totp-input { text-align: center; letter-spacing: 3px; font-size: 1.1em; }
.text-muted { color: #94a3b8; }
.text-primary { color: var(--primary); }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-lg { font-size: 18px; padding: 16px 32px; }
.justify-center { justify-content: center; }

/* ─── Gerätebilder ─────────────────────────────────────────────────────── */

.device-image-wrap {
    text-align: center;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.device-image {
    max-width: 280px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}
.device-image-sm-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}
.device-image-sm {
    max-width: 120px;
    max-height: 90px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.device-image-label {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 6px;
    text-align: center;
}
.device-image-label-sm {
    font-size: 9px;
    color: #94a3b8;
    font-style: italic;
    margin-top: 4px;
    text-align: center;
}

/* ─── NFC Overlay ──────────────────────────────────────────────────────── */

.nfc-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.nfc-modal {
    text-align: center; padding: 32px; max-width: 340px;
}
.nfc-icon {
    font-size: 64px; margin-bottom: 16px;
}
.nfc-title {
    color: #fff; font-size: 22px; font-weight: 700; margin-bottom: 12px;
}
.nfc-msg {
    color: #94a3b8; font-size: 15px; margin-bottom: 24px;
    white-space: pre-line; line-height: 1.5;
}
.nfc-pulse {
    width: 80px; height: 80px; margin: 0 auto 24px;
    border-radius: 50%; border: 3px solid var(--primary);
    animation: nfc-pulse 1.5s ease-in-out infinite;
}
@keyframes nfc-pulse {
    0%, 100% { transform: scale(0.9); opacity: 0.5; border-color: var(--primary); }
    50% { transform: scale(1.15); opacity: 1; border-color: #60a5fa; }
}
.nfc-cancel {
    color: #94a3b8 !important; border-color: #475569 !important;
}

/* ─── Dashboard Widgets ────────────────────────────────────────────────── */

.dashboard-widgets {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 768px) {
    .dashboard-widgets { grid-template-columns: 1fr; }
}

/* Letzte Aktivitäten */
.activity-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0;
}
.dot-success { background: var(--success); }
.dot-danger { background: var(--danger); }
.activity-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.activity-meta { font-size: 11px; color: var(--gray); margin-top: 2px; }

/* Prüfer-Statistik */
.pruefer-row {
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.pruefer-row:last-child { border-bottom: none; }
.pruefer-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.pruefer-bar-wrap {
    height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.pruefer-bar {
    height: 100%; background: var(--success); border-radius: 3px;
    transition: width 0.5s ease;
}
.pruefer-meta { font-size: 11px; color: var(--gray); margin-top: 4px; }

/* Chart (Prüfungen pro Monat) */
.chart-bar-group {
    display: flex; align-items: flex-end; justify-content: space-around;
    height: 140px; gap: 8px;
}
.chart-bar-col { text-align: center; flex: 1; }
.chart-bar-stack {
    display: flex; flex-direction: column; justify-content: flex-end;
    margin: 0 auto; width: 32px; min-height: 4px; border-radius: 4px 4px 0 0;
    overflow: hidden;
}
.chart-bar-segment { width: 100%; }
.chart-bar-pass { background: var(--success); }
.chart-bar-fail { background: var(--danger); }
.chart-bar-val { font-size: 12px; font-weight: 700; margin-top: 4px; color: #1e293b; }
.chart-bar-label { font-size: 10px; color: var(--gray); }
.chart-legend {
    display: flex; justify-content: center; gap: 16px; margin-top: 12px;
}
.chart-legend-item { font-size: 11px; color: var(--gray); display: flex; align-items: center; gap: 4px; }
.chart-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-dot-pass { background: var(--success); }
.chart-dot-fail { background: var(--danger); }

/* ─── Kundenportal ─────────────────────────────────────────────────────── */

.portal-geraete-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px;
}
.portal-geraet-card {
    border: 1px solid var(--border); border-radius: 10px;
    overflow: hidden; background: #fff; transition: box-shadow 0.2s;
}
.portal-geraet-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.portal-geraet-header {
    padding: 10px 12px; background: var(--light); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.portal-geraet-img {
    text-align: center; padding: 8px; background: #f8fafc;
}
.portal-geraet-img img {
    max-width: 100%; max-height: 100px; object-fit: contain;
}
.portal-geraet-body { padding: 10px 12px; }
.portal-geraet-name { font-weight: 600; font-size: 14px; }
.portal-geraet-info { font-size: 12px; color: var(--gray); }
.portal-geraet-dates {
    display: flex; justify-content: space-between; font-size: 11px;
    color: var(--gray); margin-top: 6px;
}
.portal-geraet-actions {
    padding: 8px 12px; border-top: 1px solid var(--border);
    display: flex; gap: 6px;
}
.text-red { color: var(--danger); }
.text-yellow { color: var(--warning); }
.text-green { color: var(--success); }
.text-gray { color: var(--gray); }

/* ─── Hilfe-Seite ──────────────────────────────────────────────────────── */

.hilfe-steps { display: flex; flex-direction: column; gap: 12px; }
.hilfe-step {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px; background: var(--light); border-radius: 8px;
}
.hilfe-step-nr {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--primary); color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.faq-item {
    margin: 6px 0; border: 1px solid var(--border); border-radius: 6px; padding: 12px;
}
.faq-question { cursor: pointer; font-weight: 600; font-size: 14px; }
.faq-answer { margin-top: 8px; color: var(--gray); font-size: 13px; line-height: 1.5; }

/* ─── Code-Blöcke (JSON / Shell) ───────────────────────────────────────── */

.code-block {
    background: #1e293b; color: #e2e8f0;
    border-radius: 8px; padding: 14px 16px;
    font-family: 'Courier New', Courier, monospace; font-size: 13px;
    line-height: 1.6; overflow-x: auto; margin: 8px 0;
    white-space: pre;
}
.code-block .json-key   { color: #93c5fd; }
.code-block .json-str   { color: #86efac; }
.code-block .json-num   { color: #fca5a5; }
.code-block .json-bool  { color: #fbbf24; }
.code-block .json-null  { color: #94a3b8; }

/* ─── Footer-Links + Cookie-Banner ─────────────────────────────────────── */

.footer-links {
    display: flex; justify-content: center; gap: 16px; margin-top: 8px;
    font-size: 12px;
}
.footer-links a { color: var(--gray); text-decoration: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.lang-link { margin: 0 4px; }
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
    background: #1e293b; color: #e2e8f0; padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; font-size: 13px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 200px; }
.cookie-actions { display: flex; align-items: center; gap: 12px; }

/* ─── Spaltenfilter (Excel-Style) ───────────────────────────────────────── */
.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sortable:hover { background: #f1f5f9; }
.sort-icon { margin-left: 4px; font-size: 11px; color: #bbb; display: inline-block; }
.th-sortable.sort-active .sort-icon { color: var(--primary); font-weight: 700; }
.geraete-filter-row td { padding: 2px 4px !important; background: #f8fafc; border-bottom: 2px solid #e2e8f0; }
.col-fi {
    width: 100%; padding: 3px 6px; font-size: 12px;
    border: 1px solid #dde1e7; border-radius: 4px;
    background: #fff; box-sizing: border-box; color: #374151;
}
.col-fi:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.1); }
.col-fi::placeholder { color: #aaa; }
.col-fi-date-cell { white-space: nowrap; }
.col-fi-date { width: calc(50% - 2px); min-width: 0; padding: 3px 4px; }
.col-dd-wrap { position: relative; display: block; }
.col-dd-btn { width: 100%; padding: 3px 6px; font-size: 12px; border: 1px solid #dde1e7; border-radius: 4px; background: #fff; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; color: #374151; }
.col-dd-btn.active { border-color: var(--primary); background: #eff6ff; color: var(--primary); font-weight: 600; }
.col-dd-list { display: none; position: absolute; top: calc(100% + 2px); left: 0; z-index: 300; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.13); min-width: 180px; max-height: 220px; overflow-y: auto; padding: 4px 0; }
.col-dd-list.open { display: block; }
.col-dd-item { display: flex; align-items: center; gap: 7px; padding: 5px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.col-dd-item:hover { background: #f8fafc; }
.col-dd-item input[type=checkbox] { cursor: pointer; flex-shrink: 0; }
.col-dd-sep { height: 1px; background: #e2e8f0; margin: 3px 0; }

/* ─── Messwerte-Detail in Geräte-Protokoll ──────────────────────────────── */
.messwerte-wrap { display: flex; flex-wrap: wrap; gap: 16px; padding: 8px 0; }
.messwerte-group { min-width: 200px; }
.messwerte-group strong { display: block; margin-bottom: 6px; font-size: 13px; color: var(--primary); }
.messwerte-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-size: 13px; }
.mw-label { color: var(--gray); }
.mw-value { font-weight: 600; }

/* ─── Geräte-Aktionsleiste (fixiert unten) ──────────────────────────────── */
.geraete-bulk-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.geraete-bulk-actions .btn { font-size: 12px; padding: 3px 8px; }
.geraete-action-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 400;
    background: var(--primary); color: #fff; padding: 10px 20px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.18);
}
.geraete-action-bar .action-bar-count { font-weight: 600; margin-right: 8px; }
.geraete-action-bar .btn { border-color: rgba(255,255,255,0.4); color: #fff; }
.geraete-action-bar .btn:hover { background: rgba(255,255,255,0.15); }
.geraete-action-bar .btn-white { background: #fff; color: var(--primary); border-color: #fff; }

.cookie-link { color: #93c5fd; font-size: 12px; }
