/* ==========================================================================
   Aqua Mota — Design System & Styles
   Konzipiert für Untertage-Einsatz, Handschuhtauglichkeit & High-Contrast
   KEINE Emojis — Rein sachliche, professionelle Vektor-Ikonographie
   ========================================================================== */

:root {
  --bg-main: #0B132B;
  --bg-card: #1C2541;
  --bg-card-hover: #233154;
  --bg-surface: #151E36;
  --border-color: #2F3E66;
  --border-focus: #3A86FF;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --primary: #0284C7;
  --primary-hover: #0369A1;
  --primary-glow: rgba(2, 132, 199, 0.25);

  --status-ok: #16A34A;
  --status-ok-bg: rgba(22, 163, 74, 0.15);
  --status-ok-border: #15803D;

  --status-warning: #D97706;
  --status-warning-bg: rgba(217, 119, 6, 0.15);
  --status-warning-border: #B45309;

  --status-danger: #DC2626;
  --status-danger-bg: rgba(220, 38, 38, 0.15);
  --status-danger-border: #B91C1C;

  --status-offline: #475569;
  --status-offline-bg: rgba(71, 85, 105, 0.3);

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* Light / High-Contrast Mode (automatisch oder umschaltbar) */
body.light-mode {
  --bg-main: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-surface: #E2E8F0;
  --border-color: #CBD5E1;
  --border-focus: #0284C7;

  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;

  --status-ok-bg: rgba(22, 163, 74, 0.1);
  --status-warning-bg: rgba(217, 119, 6, 0.1);
  --status-danger-bg: rgba(220, 38, 38, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 1. KOPFZEILE & NAVIGATION */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.brand-info h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Offline / Online Badge & Toggle */
.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  min-height: 36px;
}

.offline-badge.is-online {
  background-color: var(--status-ok-bg);
  color: #4ADE80;
  border-color: var(--status-ok-border);
}

.offline-badge.is-offline {
  background-color: var(--status-warning-bg);
  color: #FBBF24;
  border-color: var(--status-warning-border);
}

.offline-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.nav-tabs {
  display: flex;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 0 8px;
  overflow-x: auto;
}

.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  min-height: 48px; /* Handschuhtauglich */
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nav-tab .badge {
  background-color: var(--border-color);
  color: var(--text-main);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
}

.nav-tab.active .badge {
  background-color: var(--primary);
  color: #FFFFFF;
}

/* 2. HAUPTBEREICH */
.app-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* 3. SCHNELL-SCANNER BAR (Immer präsent im Feld) */
.scan-bar {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 640px) {
  .scan-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.scan-lead {
  display: flex;
  align-items: center;
  gap: 12px;
}

.scan-lead-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-lead-text h2 {
  font-size: 1rem;
  font-weight: 700;
}

.scan-lead-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scan-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 4. BUTTONS (Handschuhtauglich, min 48px Höhe) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-success {
  background-color: var(--status-ok);
  color: #FFFFFF;
}

.btn-danger {
  background-color: var(--status-danger);
  color: #FFFFFF;
}

.btn-sm {
  padding: 8px 14px;
  min-height: 38px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.icon-svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
}

/* 5. FILTER- & SUCHELEISTE */
.toolbar-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .toolbar-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  min-height: 48px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-dim);
}

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  padding: 8px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 38px;
}

.chip.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* 6. ANLAGEN-GRID */
.assets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .assets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .assets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.asset-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.asset-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-code {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-glow);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.status-OK {
  background-color: var(--status-ok-bg);
  color: #4ADE80;
  border: 1px solid var(--status-ok-border);
}

.status-WARNUNG {
  background-color: var(--status-warning-bg);
  color: #FBBF24;
  border: 1px solid var(--status-warning-border);
}

.status-MANGEL {
  background-color: var(--status-danger-bg);
  color: #F87171;
  border: 1px solid var(--status-danger-border);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-type {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-meta {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

/* 7. MODALS (Prüfformular, Scanner, QR-Code) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 19, 43, 0.85);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 8. FORMULARE & CHECKLISTEN (K.Überwachung) */
.form-section {
  margin-bottom: 24px;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.check-desc {
  font-size: 0.9rem;
  flex: 1;
}

.check-actions {
  display: flex;
  gap: 6px;
}

.btn-toggle-check {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  min-height: 42px;
}

.btn-toggle-check.active-ok {
  background-color: var(--status-ok-bg);
  color: #4ADE80;
  border-color: var(--status-ok-border);
}

.btn-toggle-check.active-defect {
  background-color: var(--status-danger-bg);
  color: #F87171;
  border-color: var(--status-danger-border);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 480px) {
  .input-row {
    grid-template-columns: 1fr 1fr;
  }
}

.input-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-field input, .input-field textarea {
  width: 100%;
  padding: 12px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  min-height: 48px;
}

.input-field input:focus, .input-field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* 9. FOTO-VORSCHAU */
.photo-upload-wrap {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-surface);
}

.photo-upload-wrap:hover {
  border-color: var(--primary);
}

.photo-preview {
  margin-top: 10px;
  max-height: 200px;
  border-radius: var(--radius-md);
  display: none;
  object-fit: cover;
  width: 100%;
}

/* 10. SYNC QUEUE TABELLE */
.sync-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.sync-table th, .sync-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.sync-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* 11. SCAN SIMULATOR LISTE */
.simulator-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.sim-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  min-height: 48px;
}

.sim-item:hover {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
}

/* 12. TOAST BENACHRICHTIGUNG */
.toast-msg {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 300;
  display: none;
  align-items: center;
  gap: 10px;
}

.toast-msg.show {
  display: flex;
}

/* 13. EINSTIEGS-SPLASH SCREEN (AQUA MOTA LOGO) */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: radial-gradient(circle at center, #1E293B 0%, #0B132B 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: manipulation;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.splash-screen.fade-out {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.splash-content {
  text-align: center;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  animation: splashAppear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.splash-logo-wrap {
  position: relative;
  width: 100%;
  max-width: min(50vw, 50vh, 260px);
  height: auto;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo-img {
  width: 100%;
  max-width: min(50vw, 50vh, 260px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 20px;
  background: #FFFFFF;
  padding: 12px;
  box-sizing: border-box;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(2, 132, 199, 0.35);
  display: block;
  margin: 0 auto;
}

@keyframes splashAppear {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.splash-title-wg {
  font-size: 1.35rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 6px 0;
  letter-spacing: 0.02em;
  text-align: center;
}

.splash-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.splash-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.splash-norm {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* 14. OBMANN-COCKPIT & WARTUNGSJOURNAL */
.obmann-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .obmann-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.obmann-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-box:hover {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.stat-box:active {
  transform: translateY(0);
}

.stat-box-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-box-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-box-val {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 4px;
  color: var(--text-main);
}

.journal-table-wrap {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 24px;
}

.journal-table {
  width: 100%;
  border-collapse: collapse;
}

.journal-table th, .journal-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.journal-table th {
  background-color: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.journal-table tr:hover {
  background-color: var(--bg-surface);
}

.sign-seal-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--status-ok-bg);
  color: #4ADE80;
  border: 1px solid var(--status-ok-border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.sign-seal-pending {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--status-warning-bg);
  color: #FBBF24;
  border: 1px solid var(--status-warning-border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

/* 15. PERSONEN-KARTEN */
.persons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.person-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.person-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.person-role {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-glow);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.person-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.person-contact {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.person-contact a:hover {
  text-decoration: underline;
}

/* 15. SYSUP (System-Update) STYLES */
.header-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sysup-guarantee-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background-color: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.sysup-guarantee-banner strong {
  display: block;
  font-size: 0.88rem;
  color: #34D399;
  margin-bottom: 2px;
}

.sysup-guarantee-banner p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.sysup-guarantee-banner code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.75rem;
}

.sysup-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 480px) {
  .sysup-status-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.sysup-stat-cell {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sysup-stat-cell .lbl {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sysup-stat-cell strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

.sysup-stat-cell .text-ok {
  color: #4ADE80;
}

.sysup-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sysup-dropzone:hover, .sysup-dropzone.dragover {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
}

.sysup-log-console {
  background-color: #050B14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sysup-log-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  word-break: break-all;
}

.sysup-log-line.log-ok { color: #4ADE80; }
.sysup-log-line.log-skip { color: #FBBF24; }
.sysup-log-line.log-info { color: #60A5FA; }
.sysup-log-line.log-err { color: #F87171; }

/* ==========================================================================
   16. OBMANN-JOURNAL MULTI-FILTERLEISTE & MÄNGEL-HERVORHEBUNG
   ========================================================================== */

/* Multi-Filterleiste im Obmann-Cockpit */
.journal-filter-bar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.filter-item label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-item select,
.filter-item input {
  height: 38px;
  padding: 6px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-item select:focus,
.filter-item input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.filter-item.search-item {
  flex: 1;
  min-width: 200px;
}

.filter-item-action {
  display: flex;
  align-items: flex-end;
  height: 38px;
}

.filter-item-action .btn {
  height: 38px;
  white-space: nowrap;
}

/* Mängel-Hervorhebung auf Anlagenkarten (Geräteübergreifend) */
.asset-card.has-defect-card {
  border-color: var(--status-danger) !important;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.09) 0%, var(--bg-card) 100%) !important;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.4), 0 4px 14px rgba(220, 38, 38, 0.2) !important;
  position: relative;
}

.asset-card.has-defect-card::before {
  content: "MANGEL GEMELDET";
  position: absolute;
  top: -10px;
  right: 12px;
  background-color: var(--status-danger);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.asset-card.has-warning-card {
  border-color: var(--status-warning) !important;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.06) 0%, var(--bg-card) 100%) !important;
}

/* Ausstehende Signatur: Aufforderung & sanftes Pulsieren */
.btn-pulse-sign {
  position: relative;
  animation: pulseSignGlow 2.4s infinite ease-in-out;
}

@keyframes pulseSignGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* ==========================================================================
   17. FOTO-UPLOADBOX & DIGITALE UNTERSCHRIFTENFELDER (CANVAS)
   ========================================================================== */

/* Saubere, responsiv formatierte Fotobox ohne Zeilenumbruch */
.photo-section-box {
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.photo-section-box:hover {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
}

.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  transition: background-color 0.2s ease, transform 0.1s ease;
  white-space: nowrap;
}

.photo-upload-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.photo-upload-btn .icon-svg {
  width: 18px;
  height: 18px;
}

.photo-upload-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Prüfer-Bestätigungsbox */
.signature-confirm-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Digitales Unterschriftenfeld (Touch / Stylus / Maus) */
.signature-canvas-wrap {
  position: relative;
  background-color: #060D1A;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.signature-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.signature-pad-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.82rem;
  color: var(--text-dim);
  pointer-events: none;
  font-style: italic;
  white-space: nowrap;
  user-select: none;
}

/* Visuelle Fehler- und Fokus-Hervorhebungen */
.confirm-error-highlight {
  border-color: var(--status-danger) !important;
  background-color: rgba(220, 38, 38, 0.15) !important;
  animation: shakeAlert 0.4s ease;
}

.canvas-error-highlight {
  border-color: var(--status-danger) !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.5) !important;
  animation: shakeAlert 0.4s ease;
}

.section-highlight {
  animation: sectionPulse 1.8s ease-out;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

@keyframes sectionPulse {
  0% { outline: 2px solid var(--primary); outline-offset: 4px; }
  100% { outline: 2px solid transparent; outline-offset: 4px; }
}

/* 17. AKTIVER MANGEL WARNHINWEIS IM INSPEKTIONS-MODAL */
.active-defect-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-left: 4px solid var(--status-danger);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.active-defect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.active-defect-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-defect-icon {
  width: 24px;
  height: 24px;
  color: var(--status-danger);
  flex-shrink: 0;
}

.active-defect-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #F87171;
}

.active-defect-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.active-defect-list {
  margin: 8px 0;
  padding-left: 20px;
  font-size: 0.84rem;
  color: var(--text-main);
  line-height: 1.5;
}

.active-defect-list li {
  margin-bottom: 4px;
}

.active-defect-detail-txt {
  color: #FCA5A5;
  font-style: italic;
  font-weight: 600;
}

.active-defect-notes {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.active-defect-resolve-wrap {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-defect-resolve-wrap label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #34D399;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-defect-resolve-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #10B981;
  cursor: pointer;
}

/* 18. CHECKLISTEN PFLICHT-INFOFELDER BEI MÄNGELN */
.checklist-item-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.checklist-item-row.has-defect {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.04);
}

.checklist-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
}

.checklist-defect-box {
  border-top: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  padding: 10px 14px 12px;
  animation: fadeInDown 0.25s ease;
}

.defect-box-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.defect-box-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #F87171;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.defect-detail-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.defect-detail-input:focus {
  border-color: #EF4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.defect-input-error {
  border-color: #EF4444 !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4) !important;
  animation: shakeAlert 0.4s ease;
}

/* 19. MESSWERT-STATISTIK & KENNZAHLEN */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-metric-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-metric-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 2px 6px;
  border-radius: 4px;
}

.stat-metric-latest {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.stat-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.stat-metric-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-metric-subval {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.stats-table th, .stats-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.stats-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stats-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.defect-detail-pill {
  font-size: 0.78rem;
  color: #F87171;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 4px;
  padding: 4px 8px;
  margin-top: 4px;
  display: inline-block;
  line-height: 1.3;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 18. CHECKLISTEN-EDITOR (K.ÜBERWACHUNG) */
.checklist-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: border-color 0.15s;
}

.checklist-editor-row:hover {
  border-color: var(--primary);
}

.checklist-editor-row input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 10px;
  font-size: 0.85rem;
}

.checklist-editor-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-remove-check {
  background: transparent;
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-remove-check:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* 16. WARTUNGSKALENDER */
.cal-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

@media (min-width: 768px) {
  .cal-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cal-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cal-kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-kpi-value {
  font-size: 1.7rem;
  font-weight: 800;
  margin-top: 4px;
}

.cal-month-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-month-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  min-width: 170px;
  text-align: center;
}

.cal-grid-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 10px 0;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--border-color);
  gap: 1px;
}

.cal-day-cell {
  background: var(--bg-card);
  min-height: 80px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.15s ease;
  position: relative;
  cursor: pointer;
}

.cal-day-cell:hover {
  background: var(--bg-card-hover);
}

.cal-day-cell.other-month {
  background: rgba(11, 19, 43, 0.4);
  opacity: 0.35;
}

.cal-day-cell.is-today {
  background: rgba(2, 132, 199, 0.08);
}

.cal-day-cell.is-today .cal-day-num {
  color: #FFFFFF;
  font-weight: 800;
  background: var(--primary);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-day-cell.is-selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: rgba(2, 132, 199, 0.12);
}

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  align-self: flex-start;
}

.cal-events-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.cal-event-pill {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.1s, box-shadow 0.1s;
}

.cal-event-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cal-event-pill.overdue {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #EF4444;
  color: #FCA5A5;
}

.cal-event-pill.due-soon {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid #F59E0B;
  color: #FCD34D;
}

.cal-event-pill.due-normal {
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid #0284C7;
  color: #7DD3FC;
}

.cal-due-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-due-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.cal-due-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.cal-due-card.is-overdue {
  border-left: 4px solid var(--status-danger);
}

.cal-due-card.is-due-soon {
  border-left: 4px solid #F59E0B;
}

.cal-due-card.is-due-ok {
  border-left: 4px solid var(--primary);
}

.cal-due-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cal-due-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cal-due-badge.badge-overdue {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.cal-due-badge.badge-soon {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.cal-due-badge.badge-future {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.cal-due-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
}

.cal-due-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}

.cal-due-card-meta strong {
  color: var(--text-main);
}

.cal-due-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}



