/* =========================================================================
 * Taris FM Custom Checkliste Viewer · Styles
 * ====================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --dark-stage: #1e293b;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button { font-family: inherit; cursor: pointer; }

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------- */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: #f1f5f9; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary.active { background: var(--danger); border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(0.92); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { filter: brightness(0.92); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.btn-block { width: 100%; }
.icon-btn { padding: 8px 10px; }

/* ---------------------------------------------------------------------------
 * Notifications
 * ------------------------------------------------------------------------- */
.notifications {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notification {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.3s ease;
}
.notification.show { opacity: 1; transform: translateX(0); }
.notification.success { background: var(--success); }
.notification.error { background: var(--danger); }
.notification.info { background: #0ea5e9; }

/* ---------------------------------------------------------------------------
 * Login-Seite
 * ------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: pop 0.35s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-subtitle { color: var(--text-muted); margin: 0 0 26px; font-size: 14px; }
.field { text-align: left; margin-bottom: 18px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); }
.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: border 0.15s;
}
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }

/* ---------------------------------------------------------------------------
 * Dashboard-Layout
 * ------------------------------------------------------------------------- */
.dashboard-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.current-info { font-size: 13px; color: var(--text-muted); }

.layout { flex: 1; display: flex; min-height: 0; }

/* Sidebar */
.sidebar {
  width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.search-box { padding: 16px; border-bottom: 1px solid var(--border); }
.search-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.list-meta { padding: 10px 16px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); }

.pdf-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.pdf-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.12s;
  position: relative;
}
.pdf-item:hover { background: #f1f5f9; }
.pdf-item.active { background: rgba(79,70,229,0.12); border-left: 3px solid var(--primary); }
.pdf-id { font-weight: 600; font-size: 14px; }
.pdf-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--warning); color: #fff;
  font-size: 10px; padding: 2px 6px; border-radius: 10px;
}
.badge-insp { background: var(--primary, #1761a0); }
.inspection-item { border-left: 3px solid var(--primary, #1761a0); }

/* --- Dashboard-Filter-Panel --- */
.dash-filter { border-bottom: 1px solid var(--border); }
.dash-filter-toggle {
  width: 100%; text-align: left; background: none; border: none;
  padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.dash-filter-toggle:hover { background: var(--hover, #f3f4f6); }
.dash-filter-body { padding: 4px 14px 14px; max-height: 50vh; overflow-y: auto; }
.df-block { margin-bottom: 12px; }
.df-block h4 { margin: 0 0 5px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.df-block label { display: block; font-size: 13px; margin: 2px 0; cursor: pointer; }
.df-block .fluegel-row label { display: inline-flex; }
#dfHersteller, #dfRaum { width: 100%; }
.df-actions { display: flex; gap: 8px; margin-top: 4px; }
.df-actions .btn { flex: 1; }
.list-meta { display: flex; align-items: center; }
.filter-active {
  background: var(--warning, #e67e22); color: #fff; border: none;
  border-radius: 10px; font-size: 11px; padding: 2px 8px; cursor: pointer; margin-left: 8px;
}
.pdf-list .empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Viewer-Bereich */
.viewer-area { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }

.controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.control-group { display: flex; align-items: center; gap: 8px; }
.page-indicator, .zoom-level { font-size: 14px; min-width: 60px; text-align: center; }

/* Editor-Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: #eef2ff;
  border-bottom: 1px solid var(--border);
}
.editor-toolbar.hidden { display: none; }
.tool-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 18px;
  line-height: 1;
  transition: all 0.12s;
}
.tool-btn:hover { background: #f1f5f9; }
.tool-btn.active { background: var(--primary); border-color: var(--primary); transform: scale(1.05); }
.divider { width: 1px; height: 26px; background: var(--border); }
.tool-field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.tool-field input[type="color"] { width: 38px; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; cursor: pointer; background: #fff; }
.slider-field input[type="range"] { width: 110px; }

/* PDF-Stage (dark) */
.pdf-stage {
  flex: 1;
  min-height: 420px;
  background: var(--dark-stage);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow: auto;
}
.pdf-placeholder { color: #94a3b8; text-align: center; margin: auto; }
.pdf-placeholder .big-icon { font-size: 64px; display: block; margin-bottom: 12px; }

.canvas-wrapper { position: relative; line-height: 0; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.canvas-wrapper canvas { display: block; }
#pdfCanvas { background: #fff; }
.annotation-layer { position: absolute; top: 0; left: 0; }
.annotation-layer.editing { cursor: crosshair; }

/* Metadaten (ausklappbare Box unter dem PDF) */
.metadata-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.metadata-body {
  max-height: 300px;          /* sonst scrollbar */
  overflow-y: auto;
  padding: 18px;
  opacity: 1;
  transition: max-height 0.32s ease, padding 0.32s ease, opacity 0.25s ease;
}
.metadata-section.collapsed { border-top-color: transparent; }
.metadata-section.collapsed .metadata-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

/* Toggle-Button aktiver Zustand + Hover */
#metaToggle { transition: all 0.15s ease; }
#metaToggle:hover { background: #eef2ff; border-color: var(--primary); color: var(--primary); }
#metaToggle.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.metadata-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.metadata-table th, .metadata-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.metadata-table th { width: 180px; color: var(--text-muted); font-weight: 600; }
.muted { color: var(--text-muted); font-size: 14px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 900;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin: 0 0 14px; }
.modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* Modal mit Schließen-Button */
.modal { position: relative; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal-close:hover { background: var(--danger); color: #fff; transform: rotate(90deg); }

/* QR-Scanner Modal */
.scan-modal { max-width: 460px; text-align: center; }
.scan-viewport {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 12px auto;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
}
#qrReader { width: 100%; }
#qrReader video { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
/* roter Rahmen / Scan-Overlay */
.scan-frame {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(239, 68, 68, 0.9);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  animation: scanPulse 1.6s ease-in-out infinite;
}
.scan-frame.detected {
  border-color: #22c55e;
  box-shadow: 0 0 0 9999px rgba(34, 197, 94, 0.18);
  animation: none;
}
@keyframes scanPulse {
  0%, 100% { border-color: rgba(239, 68, 68, 0.9); }
  50% { border-color: rgba(239, 68, 68, 0.35); }
}
.scan-status { font-weight: 600; margin: 10px 0 4px; }
.scan-hint { margin: 0; }

/* QR-Generator Modal */
.qr-modal { max-width: 340px; text-align: center; }
.qr-id-label { font-weight: 600; font-size: 14px; margin: 4px 0 14px; color: var(--text-muted); word-break: break-all; }
.qr-canvas-wrap {
  display: inline-flex;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.qr-canvas-wrap img, .qr-canvas-wrap canvas { display: block; }

/* ---------------------------------------------------------------------------
 * User-Dropdown im Header
 * ------------------------------------------------------------------------- */
.user-menu { position: relative; }
.user-menu-toggle { display: flex; align-items: center; gap: 6px; }
.caret { font-size: 11px; opacity: 0.7; }
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.dropdown-item:hover { background: #f1f5f9; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------------------------------------------------------------------------
 * Admin-Panel
 * ------------------------------------------------------------------------- */
.admin-sidebar { width: 240px; }
.admin-nav { display: flex; flex-direction: column; padding: 12px; gap: 4px; }
.admin-nav-item {
  text-align: left;
  padding: 12px 14px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
}
.admin-nav-item:hover { background: #f1f5f9; }
.admin-nav-item.active { background: rgba(79,70,229,0.12); color: var(--primary); font-weight: 600; }

.admin-content { padding: 24px; background: var(--bg); }
.admin-view-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.admin-view-header h2 { margin: 0; font-size: 20px; }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-toolbar select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: var(--surface);
}

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead th { background: #f8fafc; font-weight: 600; color: var(--text-muted); position: sticky; top: 0; }
.data-table tbody tr:hover { background: #f8fafc; }
.row-actions { display: flex; gap: 6px; }

.role-badge { padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.role-admin { background: #ede9fe; color: #6d28d9; }
.role-user { background: #e0f2fe; color: #0369a1; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: #94a3b8; }

.settings-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 560px; }
.settings-list { line-height: 1.9; }

.activity-modal { max-width: 640px; }

/* Daten-Management */
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.data-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.data-card-wide { margin-top: 20px; }
.data-card h3 { margin: 0 0 10px; font-size: 17px; }
.data-card h4 { margin: 18px 0 8px; font-size: 14px; color: var(--text-muted); }
.data-stats { margin-bottom: 14px; font-size: 14px; color: var(--text); }

/* Upload-Modal & Dropzone */
.upload-modal { max-width: 520px; }
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #f8fafc;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: #eef2ff; }
.dropzone .big-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.dropzone p { margin: 0; color: var(--text-muted); }
.upload-hint { margin: 10px 0 14px; font-size: 12px; }

.upload-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.upload-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.upload-item-name { font-size: 13px; margin-bottom: 6px; word-break: break-all; }
.upload-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.upload-status { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.upload-status.err { color: var(--danger); }

.progress { height: 8px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width 0.2s ease; }
.progress-bar.done { background: var(--success); }
.progress-bar.fail { background: var(--danger); }

/* --- Inspektions-Management --- */
.role-badge.warn { background: #fdecea; color: #b3261e; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border-radius: 16px; padding: 5px 12px; font-size: 13px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}
.filter-block { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.filter-block h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); }
.filter-block label { display: block; font-size: 13px; margin: 3px 0; cursor: pointer; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stats-grid h4 { margin: 0 0 6px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; }
.stats-big { font-size: 28px; font-weight: 700; margin: 0; }
.stats-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.stats-list li { margin: 2px 0; }
.range-row { display: flex; align-items: center; gap: 6px; }
.range-row .panel-input { width: 80px; }
.fluegel-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fluegel-row label { display: inline-flex; align-items: center; gap: 3px; }

/* CSV-Vorschau */
.csv-preview { margin: 14px 0; padding: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; line-height: 1.7; }
.csv-preview-rows { margin-top: 8px; }
.csv-row { font-family: monospace; font-size: 12px; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; margin-top: 4px; overflow-x: auto; white-space: nowrap; }
.csv-confirm { margin-top: 10px; font-weight: 600; color: var(--success); }

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

/* Feld-Analyse */
.analyze-bar { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.analyze-bar .panel-input { flex: 1; min-width: 200px; }
.analyze-modal { max-width: 820px; width: 92%; }
.analyze-summary { margin-bottom: 12px; font-size: 14px; }
.analyze-tablewrap { max-height: 50vh; overflow-y: auto; }

/* ---------------------------------------------------------------------------
 * Formular-Editor (Split-View)
 * ------------------------------------------------------------------------- */
.editor-split { display: flex; height: calc(100vh - 57px); min-height: 0; }
.editor-pdf {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--dark-stage);
}
.form-stage { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 20px; }
.form-stage .canvas-wrapper { position: relative; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
#formCanvas { display: block; background: #fff; }
.field-overlay { position: absolute; top: 0; left: 0; }
.field-overlay > * { position: absolute; box-sizing: border-box; }

/* Overlay-Steuerelemente */
.ov-text {
  border: 1px solid rgba(79,70,229,0.6);
  background: rgba(255,255,235,0.85);
  font-size: 11px; padding: 1px 3px; resize: none; border-radius: 2px;
}
.ov-text:focus { outline: 2px solid var(--primary); background: #fffef0; }
.ov-radio {
  border: 2px solid rgba(79,70,229,0.7);
  background: rgba(255,255,255,0.4);
  border-radius: 3px; cursor: pointer;
}
.ov-radio:hover { background: rgba(79,70,229,0.25); }
.ov-radio.selected { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,0.4); }

.form-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px; background: var(--surface); border-top: 1px solid var(--border);
}

/* Formular-Panel */
.editor-panel {
  width: 380px; background: var(--surface); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 18px;
}
.editor-panel h2 { margin: 0 0 12px; font-size: 18px; }
.panel-meta-box { background: #f1f5f9; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.panel-section { margin-bottom: 22px; }
.panel-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.panel-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; font-family: inherit; box-sizing: border-box;
}
textarea.panel-input { min-height: 60px; resize: vertical; }

.insp-row { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.insp-num { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.insp-opts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.opt-btn {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.opt-btn:hover { background: #f1f5f9; }
.opt-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.opt-btn.opt-ok.selected { background: var(--success); border-color: var(--success); }
.opt-btn.opt-mangel.selected { background: var(--danger); border-color: var(--danger); }
.opt-btn.opt-nicht_pruefbar.selected { background: var(--warning); border-color: var(--warning); }

.field-row { margin-bottom: 14px; }
.field-label { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.cb-label { font-size: 13px; display: flex; align-items: center; gap: 6px; }

@media (max-width: 820px) {
  .editor-split { flex-direction: column; height: auto; }
  .editor-panel { width: 100%; border-left: none; border-top: 1px solid var(--border); }
}

/* Felder in Modals (Admin/Profil) */
.modal .field { text-align: left; margin-bottom: 14px; }
.modal .field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); }
.modal .field input, .modal .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
}

.hidden { display: none !important; }

/* Scanner-/QR-Modal responsiv */
@media (max-width: 560px) {
  .scan-viewport { max-width: 100%; }
}

/* ---------------------------------------------------------------------------
 * Responsive (Tablets)
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    max-height: 38vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .viewer-area { min-height: 0; }
  .controls { gap: 12px; }
  .metadata-table th { width: 120px; }
}

@media (max-width: 560px) {
  .controls, .editor-toolbar { padding: 10px; gap: 8px; }
  .brand { font-size: 16px; }
  .slider-field input[type="range"] { width: 70px; }
}
