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

:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #34d399;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg-dark: #18181b;
  --bg-medium: #27272a;
  --bg-light: #fafafa;
  --card-bg: #ffffff;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-light: #a1a1aa;
  --border: #e4e4e7;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f4f5;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Loading Spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Inline Spinner für Tabellen */
.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
  gap: 12px;
}

.spinner-small {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 13px;
  margin-right: 12px;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-dots {
  color: var(--text-secondary);
  padding: 0 4px;
}

/* Statistik */
.statistik-total {
  margin-top: 16px;
  padding: 16px;
  background: #f4f4f5;
  border-radius: 8px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14px;
}

.statistik-total-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.statistik-total-label {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
}

.statistik-total-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.statistik-total-value.positive {
  color: var(--success);
}

.statistik-total-value.negative {
  color: var(--danger);
}

.btn-group {
  display: flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
  margin: 0;
}

.btn-group .btn:first-child {
  border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
  border-radius: 0 6px 6px 0;
}

.btn-group .btn.active {
  background: var(--primary);
  color: white;
}

.ueberstunden-positiv {
  color: var(--success);
  font-weight: 600;
}

.ueberstunden-negativ {
  color: var(--danger);
  font-weight: 600;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.login-card {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  text-decoration: none;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.logo-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.logo-login {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 16px;
  font-size: 32px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text small {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
}

/* Mandant Badge */
.mandant-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-dark);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.mandant-badge-login {
  margin: 16px auto 0;
  font-size: 0.7rem;
  padding: 5px 14px;
}

/* Navbar */
.navbar {
  background: var(--bg-dark);
  color: white;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  cursor: default;
  user-select: none;
}

.navbar * {
  cursor: inherit;
}

.navbar a,
.navbar button,
.navbar .btn {
  cursor: pointer;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user span {
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

.navbar-actions {
  display: flex;
  gap: 8px;
}

/* Typography */
h1, h2, h3 {
  color: var(--text-primary);
  font-weight: 700;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 20px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
  background: var(--card-bg);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 140px;
}

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.inline-form input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.inline-form input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

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

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

.btn-secondary {
  background: var(--bg-medium);
  color: white;
}

.btn-secondary:hover {
  background: #3f3f46;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-small {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-icon {
  padding: 8px 12px;
  font-size: 15px;
}

/* Navbar buttons */
.navbar .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.navbar .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Messages */
.message, .error {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.message:empty, .error:empty {
  display: none;
}

.message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.message.error, .error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.message.warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  background: #f4f4f5;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody tr {
  transition: background 0.1s;
}

tbody tr:hover {
  background: #fafafa;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Admin Zeiteinträge Tabelle - kompakte Spaltenbreiten */
#eintraege-table {
  font-size: 13px;
}
#eintraege-table th,
#eintraege-table td {
  padding: 10px 6px;
}
#eintraege-table th:nth-child(1),
#eintraege-table td:nth-child(1) { width: 80px; } /* Datum */
#eintraege-table th:nth-child(2),
#eintraege-table td:nth-child(2) { width: 110px; } /* Mitarbeiter */
#eintraege-table th:nth-child(3),
#eintraege-table td:nth-child(3) { width: 50px; } /* Beginn */
#eintraege-table th:nth-child(4),
#eintraege-table td:nth-child(4) { width: 50px; } /* Ende */
#eintraege-table th:nth-child(5),
#eintraege-table td:nth-child(5) { width: 45px; } /* Pause */
#eintraege-table th:nth-child(6),
#eintraege-table td:nth-child(6) { width: 50px; } /* Netto */
#eintraege-table th:nth-child(7),
#eintraege-table td:nth-child(7) { width: 140px; } /* Baustelle */
#eintraege-table th:nth-child(8),
#eintraege-table td:nth-child(8) { width: 120px; } /* Kunde */
#eintraege-table th:nth-child(9),
#eintraege-table td:nth-child(9) { width: 90px; overflow: visible; } /* Aktionen */

/* Tooltip für abgeschnittene Texte */
td[title] {
  cursor: default;
}

/* Admin Navigation - Grouped */
.admin-menu-toggle {
  display: none;
  width: 100%;
  padding: 14px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  text-align: left;
  align-items: center;
  gap: 10px;
}

.admin-menu-toggle .menu-icon {
  font-size: 18px;
}

.admin-menu-toggle .menu-label {
  flex: 1;
}

.admin-menu-toggle .menu-current {
  font-weight: 400;
  opacity: 0.9;
  font-size: 13px;
}

.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  cursor: default;
  user-select: none;
}

.nav-group {
  position: relative;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f4f4f5;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-group-header:hover {
  background: #e4e4e7;
  color: var(--text-primary);
}

.nav-group-header.active {
  background: var(--primary);
  color: white;
}

.nav-group-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-group-arrow {
  font-size: 12px;
  transition: transform 0.2s;
}

.nav-group-items {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px;
  margin-top: 4px;
  z-index: 100;
}

.nav-group-items.open {
  display: block;
}

.nav-group-items .tab {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 0.15s;
  text-align: left;
}

.nav-group-items .tab:hover {
  background: #f4f4f5;
  color: var(--text-primary);
}

.nav-group-items .tab.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.tab-content.hidden {
  display: none;
}

/* Filter Row */
.filter-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-row .form-group {
  margin-bottom: 0;
  min-width: 130px;
}

.filter-row .form-group label {
  font-size: 0.75rem;
}

.filter-row .form-group input,
.filter-row .form-group select {
  padding: 10px 12px;
  font-size: 14px;
}

/* History */
.history-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child {
  border-bottom: none;
}

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

.history-date {
  font-weight: 600;
  color: var(--text-primary);
}

.history-actions {
  display: flex;
  gap: 8px;
}

.history-time {
  color: var(--text-secondary);
  margin: 4px 0;
}

.history-detail {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1001;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Action Buttons in Table */
.action-btns {
  display: flex;
  gap: 6px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 1rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .card {
    padding: 20px;
    border-radius: 10px;
  }

  .form-row {
    flex-direction: column;
  }

  .navbar {
    padding: 12px 16px;
  }

  .navbar-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .logo-text span:not(small) {
    display: none;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-row .form-group {
    min-width: 100%;
  }

  .inline-form {
    flex-direction: column;
  }

  .inline-form input {
    width: 100%;
  }

  /* Mobile Admin Navigation */
  .admin-menu-toggle {
    display: flex;
  }

  .admin-nav {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
  }

  .admin-nav.open {
    display: flex;
  }

  .admin-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .admin-nav > .nav-group {
    position: relative;
    z-index: 1;
  }

  .nav-group {
    background: white;
    border-radius: 12px;
    overflow: hidden;
  }

  .nav-group:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }

  .nav-group:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
  }

  .nav-group + .nav-group {
    margin-top: 2px;
  }

  .nav-group-header {
    width: 100%;
    border-radius: 0;
    padding: 16px 20px;
    justify-content: flex-start;
  }

  .nav-group-header .nav-group-arrow {
    margin-left: auto;
  }

  .nav-group-items {
    position: static;
    box-shadow: none;
    margin-top: 0;
    padding: 0 8px 8px;
    border-radius: 0;
    background: #fafafa;
  }

  .nav-group-items .tab {
    padding: 12px 16px;
  }

  .admin-nav-close {
    display: block;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  th, td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .btn {
    padding: 10px 16px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.15rem;
  }
}

/* Export Preview */
.export-preview {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.export-preview h4 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.export-preview p {
  margin: 8px 0;
  font-size: 0.9rem;
}

.export-preview ul {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Verstöße Modal */
#verstoesse-modal .table-container {
  max-height: 400px;
  overflow-y: auto;
}

#verstoesse-modal table {
  font-size: 0.85rem;
}

#verstoesse-modal th,
#verstoesse-modal td {
  padding: 10px 12px;
}

/* Einstellungen-Seite */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 24px;
}

.settings-section {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.settings-section h3 {
  margin: 0 0 20px 0;
  font-size: 1.05rem;
  color: var(--text-primary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-unit input {
  flex: 1;
  max-width: 120px;
}

.input-with-unit .unit {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
}

.settings-section small {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.settings-info {
  background: var(--bg-secondary);
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.settings-info h4 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.settings-info ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.settings-info li {
  margin-bottom: 6px;
}

/* Statistik Stunden-Anzeige */
.stunden-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stunden-normal {
  color: var(--text-primary);
  font-weight: 500;
}

.stunden-ueber {
  color: var(--success);
  font-weight: 600;
  font-size: 0.85em;
}

.stunden-minder {
  color: var(--danger);
  font-weight: 500;
  font-size: 0.85em;
}

.stunden-detail {
  font-size: 0.8em;
  color: var(--text-secondary);
}

/* Audit-Log Styles */
.audit-integrity {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.audit-integrity.valid {
  background: var(--success-light, #d1fae5);
  border: 1px solid var(--success);
}

.audit-integrity.invalid {
  background: var(--danger-light, #fee2e2);
  border: 1px solid var(--danger);
}

.audit-integrity h4 {
  margin: 0 0 10px 0;
}

.audit-integrity p {
  margin: 5px 0;
  font-size: 0.9rem;
}

.audit-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.audit-badge.create {
  background: var(--success-light, #d1fae5);
  color: var(--success);
}

.audit-badge.update {
  background: #fef3c7;
  color: #d97706;
}

.audit-badge.delete {
  background: var(--danger-light, #fee2e2);
  color: var(--danger);
}

.audit-details-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
}

.audit-details-btn:hover {
  text-decoration: underline;
}

/* Audit Details Modal */
.audit-details {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 0.85rem;
}

.audit-details pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.8rem;
  background: var(--bg-primary);
  padding: 10px;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.audit-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.audit-diff-col h5 {
  margin: 0 0 8px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.audit-diff-col.old {
  border-right: 1px solid var(--border);
  padding-right: 10px;
}

.audit-hash {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* ==================== VERSTÖSSE STYLES ==================== */

.verstoesse-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.stat-card.stat-total .stat-value {
  color: var(--primary);
}

.stat-card.stat-kritisch {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #fecaca;
}

.stat-card.stat-kritisch .stat-value {
  color: var(--danger);
}

.stat-card.stat-warnung {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
}

.stat-card.stat-warnung .stat-value {
  color: var(--warning);
}

/* Schweregrad Badges */
.severity-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.severity-badge.kritisch {
  background: #fee2e2;
  color: #b91c1c;
}

.severity-badge.warnung {
  background: #fef3c7;
  color: #b45309;
}

/* Typ Badges */
.typ-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: #f3f4f6;
  color: var(--text-secondary);
}

.typ-badge.taeglich {
  background: #dbeafe;
  color: #1d4ed8;
}

.typ-badge.woechentlich {
  background: #e0e7ff;
  color: #4338ca;
}

.typ-badge.pause {
  background: #fae8ff;
  color: #a21caf;
}

/* Validation Messages (inline bei Erfassung) */
.validation-message {
  margin-top: 10px;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.validation-message.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.validation-message.violation {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.validation-summary {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.validation-summary span {
  display: flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 768px) {
  .verstoesse-stats {
    grid-template-columns: 1fr;
  }

  .stat-card .stat-value {
    font-size: 2rem;
  }
}

/* ==================== GLEITZEIT ==================== */

.gleitzeit-status {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.gleitzeit-status .stat-card {
  flex: 1;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.gleitzeit-status .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.gleitzeit-status .stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Status Badges für Gleitzeit */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-badge.ok {
  background: #d1fae5;
  color: #059669;
}

.status-badge.info {
  background: #dbeafe;
  color: #2563eb;
}

.status-badge.warning {
  background: #fef3c7;
  color: #b45309;
}

.status-badge.danger {
  background: #fee2e2;
  color: #dc2626;
}

/* Saldo-Farben */
.positive {
  color: var(--success) !important;
}

.negative {
  color: var(--danger) !important;
}

/* Gleitzeit-Tabelle */
#gleitzeit-table td,
#gleitzeit-table th {
  padding: 10px 12px;
}

#gleitzeit-table tbody tr:hover {
  background: var(--bg-light);
}

/* Gleitzeit-Saldo in Monatsabrechnung */
.gleitzeit-info {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 15px 20px;
  margin: 15px 0;
}

.gleitzeit-info h4 {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

.gleitzeit-info-grid {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.gleitzeit-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gleitzeit-info-item .label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.gleitzeit-info-item .value {
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .gleitzeit-status {
    flex-direction: column;
  }
}

/* ==================== LEISTUNGSNACHWEISE ==================== */

/* Checkbox-Gruppe für Mitarbeiterauswahl */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  background: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.checkbox-group label:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.checkbox-group input[type="checkbox"]:checked + span {
  color: var(--primary-dark);
  font-weight: 500;
}

/* Signature Pad */
.signature-section {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid var(--border);
}

.signature-section h3 {
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.signature-pad-container {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 15px;
  background: #fafafa;
  text-align: center;
}

#signature-canvas {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: crosshair;
  touch-action: none;
  max-width: 100%;
}

.signature-actions {
  margin-top: 10px;
}

/* Storno Section */
.storno-section {
  margin-top: 30px;
  padding: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

.storno-section h3 {
  color: #dc2626;
  margin: 0 0 15px;
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Leistungsnachweis Detail Content */
.ln-detail-content {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 20px;
}

.ln-detail-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.ln-detail-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.ln-detail-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 150px;
}

.ln-detail-value {
  color: var(--text-primary);
  flex: 1;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-entwurf {
  background: #fef3c7;
  color: #92400e;
}

.status-unterschrieben {
  background: #d1fae5;
  color: #065f46;
}

.status-storniert {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
}

/* Signature Display */
.signature-display {
  margin-top: 20px;
  padding: 15px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.signature-display img {
  max-width: 300px;
  max-height: 100px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.signature-info {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Large button */
.btn-lg {
  padding: 14px 24px;
  font-size: 1.1rem;
}

/* Mobile Responsive for Signature */
@media (max-width: 768px) {
  #signature-canvas {
    width: 100%;
    height: 120px;
  }
  
  .ln-detail-row {
    flex-direction: column;
    gap: 4px;
  }
  
  .ln-detail-label {
    min-width: auto;
  }
  
  .checkbox-group {
    flex-direction: column;
  }
  
  .checkbox-group label {
    width: 100%;
  }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover {
  background: var(--bg-light);
  border-color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Legal Footer */
.legal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  z-index: 100;
}

.legal-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-footer a:hover {
  color: var(--primary);
}

.footer-divider {
  margin: 0 12px;
  color: var(--border);
}

/* Ensure content doesn't get hidden behind footer */
body {
  padding-bottom: 50px;
}

/* Hide footer on login view (cleaner appearance) */
#login-view ~ .legal-footer,
.view:not(.hidden) ~ .legal-footer {
  display: block;
}

/* Mobile footer */
@media (max-width: 768px) {
  .legal-footer {
    padding: 8px 15px;
    font-size: 0.75rem;
  }

  .footer-divider {
    margin: 0 8px;
  }
}

/* BUAK Compliance Module Styles */
.buak-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: #92400e;
}

.buak-disclaimer svg {
  flex-shrink: 0;
  color: #f59e0b;
}

.buak-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.buak-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.buak-list-item:hover {
  border-color: var(--primary);
}

.buak-list-item.buak-active {
  background: #ecfdf5;
  border-color: var(--primary);
}

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

.buak-list-item-name {
  font-weight: 500;
}

.buak-list-item-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.buak-toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.buak-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.buak-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: 0.3s;
}

.buak-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.buak-toggle input:checked + .buak-toggle-slider {
  background-color: var(--primary);
}

.buak-toggle input:checked + .buak-toggle-slider:before {
  transform: translateX(20px);
}

.buak-report-actions {
  display: flex;
  gap: 10px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-label input[type="checkbox"] {
  width: 44px;
  height: 24px;
  appearance: none;
  background: #ccc;
  border-radius: 24px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.switch-label input[type="checkbox"]:checked {
  background: var(--primary);
}

.switch-label input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
}

.switch-label input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.grund-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.grund-regen { background: #dbeafe; color: #1e40af; }
.grund-schnee { background: #e0e7ff; color: #3730a3; }
.grund-frost { background: #cffafe; color: #0e7490; }
.grund-hitze { background: #fef3c7; color: #92400e; }
.grund-sturm { background: #fce7f3; color: #9d174d; }
.grund-sonstiges { background: #f3f4f6; color: #374151; }

@media (max-width: 768px) {
  .buak-disclaimer {
    flex-direction: column;
    gap: 8px;
  }

  .buak-report-actions {
    flex-direction: column;
  }
}

/* ==================== SEARCHABLE DROPDOWN ==================== */

.searchable-dropdown {
  position: relative;
  width: 100%;
}

.searchable-dropdown .sd-input {
  width: 100%;
  padding: 12px 36px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
  background: var(--card-bg);
  color: var(--text-primary);
  cursor: pointer;
}

.searchable-dropdown .sd-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.searchable-dropdown .sd-input::placeholder {
  color: var(--text-secondary);
}

.searchable-dropdown .sd-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.searchable-dropdown.open .sd-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.searchable-dropdown .sd-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  max-height: 320px;
  overflow: hidden;
}

.searchable-dropdown.open .sd-dropdown {
  display: block;
}

.searchable-dropdown .sd-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.searchable-dropdown .sd-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text-primary);
}

.searchable-dropdown .sd-search:focus {
  outline: none;
  border-color: var(--primary);
}

.searchable-dropdown .sd-options {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
}

.searchable-dropdown .sd-option {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  font-size: 14px;
}

.searchable-dropdown .sd-option:hover,
.searchable-dropdown .sd-option.highlighted {
  background: var(--bg);
}

.searchable-dropdown .sd-option.selected {
  background: rgba(5, 150, 105, 0.1);
  color: var(--primary);
  font-weight: 500;
}

.searchable-dropdown .sd-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.searchable-dropdown .sd-more {
  padding: 8px 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .searchable-dropdown .sd-dropdown {
    max-height: 280px;
  }

  .searchable-dropdown .sd-options {
    max-height: 220px;
  }

  .searchable-dropdown .sd-option {
    padding: 12px;
  }
}
