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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.header {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: #2d3748;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.nav-link {
  padding: 8px 16px;
  text-decoration: none;
  color: #4a5568;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: block;
}

.nav-link:hover {
  background: #f7fafc;
  color: #2d3748;
}

.nav-link.active {
  background: #667eea;
  color: white;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-login {
  padding: 8px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

/* Header Icon Buttons */
.header-icon-btn {
  padding: 8px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #4a5568;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-icon-btn:hover {
  background: #f7fafc;
  color: #667eea;
}

.header-icon-btn svg {
  display: block;
}

/* User Menu Dropdown */
.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 200px;
  display: none;
  z-index: 1000;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.user-dropdown.active {
  display: block;
  animation: fadeInDown 0.2s ease;
}

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

.user-dropdown-header {
  padding: 12px 16px;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
}

.user-email {
  font-size: 13px;
  font-weight: 500;
  color: #2d3748;
  word-break: break-word;
}

.user-dropdown-divider {
  height: 1px;
  background: #e2e8f0;
}

.user-dropdown-item {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #4a5568;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
  font-family: inherit;
}

.user-dropdown-item:hover {
  background: #f7fafc;
  color: #2d3748;
}

.user-dropdown-item svg {
  flex-shrink: 0;
  color: #718096;
}

.user-dropdown-item.profile-menu-item {
  color: #667eea;
}

.user-dropdown-item.profile-menu-item:hover {
  background: #edf2f7;
  color: #5568d3;
}

.user-dropdown-item.profile-menu-item svg {
  color: #667eea;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px 15px;
  width: 100%;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
}

/* Legal Pages Styles */
.legal-page {
  max-width: 900px;
}

.legal-page h1 {
  font-size: 28px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 3px solid #667eea;
}

.legal-page h2 {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
  margin-top: 32px;
  margin-bottom: 16px;
}

.legal-page h3 {
  font-size: 16px;
  font-weight: 600;
  color: #4a5568;
  margin-top: 20px;
  margin-bottom: 12px;
}

.legal-section {
  margin-bottom: 32px;
}

.legal-section p {
  font-size: 14px;
  line-height: 1.8;
  color: #4a5568;
  margin-bottom: 16px;
}

.legal-section ul {
  margin-left: 24px;
  margin-bottom: 16px;
}

.legal-section li {
  font-size: 14px;
  line-height: 1.8;
  color: #4a5568;
  margin-bottom: 8px;
}

.legal-section a {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-section a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.legal-section strong {
  color: #2d3748;
  font-weight: 600;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0;
  color: #2d3748;
  letter-spacing: -0.3px;
  flex: 1;
}

.btn-clear-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: #718096;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  flex-shrink: 0;
}

.btn-clear-form:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
  color: #4a5568;
}

.btn-clear-form:active {
  background: #e2e8f0;
  transform: scale(0.98);
}

.btn-clear-form svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.btn-clear-form span {
  white-space: nowrap;
}

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

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

label {
  display: block;
  font-weight: 500;
  font-size: 12px;
  margin-bottom: 6px;
  color: #4a5568;
  letter-spacing: 0.1px;
}

input[type="text"],
input[type="email"],
input[type="date"] {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: #f7fafc;
  font-family: inherit;
  transition: all 0.25s ease;
  color: #2d3748;
}

input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
  cursor: pointer;
  accent-color: #667eea;
}

/* Rot nur wenn explizit als invalid markiert (beim Absenden) */
input.field-invalid {
  border-color: #fc8181;
  background: #fff5f5;
}

/* Grün wenn ausgefüllt/valid */
input.field-valid {
  border-color: #48bb78;
  background: #f0fff4;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
  color: #a0aec0;
}

.referees-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.referee-section {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 0;
  background: #f7fafc;
  transition: all 0.25s ease;
}

.referee-section:hover {
  border-color: #cbd5e0;
  background: #edf2f7;
}

.referee-section h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 0;
  color: #2d3748;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

.signature-group {
  margin-top: 12px;
}

.signature-group label {
  font-size: 11px;
  margin-bottom: 6px;
}

.signature-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.signature-preview-wrapper {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.signature-canvas {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  background: white;
  width: 100%;
  height: 90px;
  min-height: 90px;
  aspect-ratio: 280 / 90; /* Gleiches Seitenverhältnis wie im PDF */
  transition: all 0.25s ease;
  display: block;
}

.signature-canvas:hover {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.signature-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #a0aec0;
  font-size: 12px;
  pointer-events: all;
  text-align: center;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  width: calc(100% - 16px);
}

.signature-placeholder:hover {
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
}

.signature-canvas.signature-valid + .signature-placeholder {
  display: none;
}

.signature-canvas.signature-required {
  border-color: #fc8181;
  background: #fff5f5;
  animation: pulse-required 2s infinite;
}

.signature-canvas.signature-valid {
  border-color: #48bb78;
  background: #f0fff4;
}

@keyframes pulse-required {
  0%, 100% {
    border-color: #fc8181;
  }
  50% {
    border-color: #feb2b2;
  }
}

.btn-clear {
  padding: 8px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  color: #718096;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.btn-clear:hover {
  background: #fed7d7;
  border-color: #fc8181;
  color: #c53030;
}

.btn-clear svg {
  display: block;
}

.info-text {
  font-size: 10px;
  color: #718096;
  font-style: italic;
  margin-bottom: 16px;
  margin-top: -8px;
  padding-left: 4px;
}

.total-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #e2e8f0;
}

.total-group label {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
}

.total-input-wrapper {
  position: relative;
}

.total-group input {
  font-size: 15px;
  font-weight: 600;
}

.total-group input.field-valid {
  border-color: #48bb78;
  background: #f0fff4;
}

.total-group input.field-invalid {
  border-color: #fc8181;
  background: #fff5f5;
}

.auto-calc-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #718096;
  font-style: italic;
  pointer-events: none;
}


.button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

@media (min-width: 769px) {
  .button-group {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
  }
}

.button-group-inner {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto; /* Buttons nehmen nur den benötigten Platz ein */
}

.btn {
  padding: 11px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Deaktivierter Button ohne Login */
.btn.disabled-no-login {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.btn.disabled-no-login:hover {
  opacity: 0.7;
}

/* Tooltip Container */
.tooltip-container {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
  z-index: 1000;
}

.btn.disabled-no-login:hover .tooltip-container {
  opacity: 1;
  visibility: visible;
}

.tooltip-text {
  background: #2d3748;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  max-width: 300px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2d3748;
}

/* Searchable Dropdown Styles */
.searchable-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  user-select: none;
}

.dropdown-selected:hover {
  border-color: #667eea;
}

.dropdown-selected.active {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dropdown-placeholder {
  color: #a0aec0;
}

.dropdown-arrow {
  color: #718096;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.dropdown-selected.active .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dropdown-search {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.dropdown-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.dropdown-search input:focus {
  border-color: #667eea;
}

.dropdown-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.dropdown-option {
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: #2d3748;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dropdown-option:hover {
  background-color: #f7fafc;
}

.dropdown-option.selected {
  background-color: #ebf8ff;
  color: #667eea;
  font-weight: 500;
}

.dropdown-option.hidden {
  display: none;
}

.dropdown-option-name {
  flex: 1;
  min-width: 0;
}

.dropdown-option-role {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 8px;
  background: #e6fffa;
  color: #234e52;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.dropdown-no-results {
  padding: 16px;
  text-align: center;
  color: #718096;
  font-size: 14px;
}

.message {
  padding: 12px 16px;
  border-radius: 8px;
  display: none;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  text-align: center;
  order: -1; /* Auf Mobil oben */
  margin-bottom: 12px;
}

@media (min-width: 769px) {
  .message {
    width: 100%;
    text-align: center;
    order: -1; /* Immer oben */
    margin-bottom: 12px;
    margin-right: 0;
  }
}

.message.success {
  background: #c6f6d5;
  color: #22543d;
  display: block;
  border: 2px solid #9ae6b4;
}

.message.error {
  background: #fed7d7;
  color: #742a2a;
  display: block;
  border: 2px solid #fc8181;
}

/* Signature Modal */
.signature-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.signature-modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.signature-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.signature-modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.btn-close-modal {
  background: none;
  border: none;
  cursor: pointer;
  color: #718096;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: #f7fafc;
  color: #2d3748;
}

.signature-modal-body {
  flex: 1;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.signature-modal-canvas {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: crosshair;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  aspect-ratio: 280 / 90; /* Gleiches Seitenverhältnis wie Vorschau und PDF */
  min-height: 200px;
}

.signature-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 2px solid #e2e8f0;
  justify-content: flex-end;
}

.signature-modal-footer .btn {
  min-width: 100px;
}

.signature-modal-footer .btn-disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Confirm Modal */
.confirm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.confirm-modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-modal-header {
  padding: 24px 24px 16px 24px;
  border-bottom: 2px solid #e2e8f0;
}

.confirm-modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.confirm-modal-body {
  padding: 24px;
}

.confirm-modal-message {
  margin-bottom: 16px;
  display: none;
}

.confirm-modal-message .message {
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.confirm-modal-body p {
  font-size: 15px;
  line-height: 1.6;
  color: #4a5568;
  margin: 0;
}

.confirm-modal-question {
  margin-top: 16px;
}

.confirm-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px 24px 24px;
  border-top: 2px solid #e2e8f0;
  justify-content: flex-end;
}

.confirm-modal-footer .btn {
  min-width: 120px;
}

/* Footer Styles */
.footer {
  background: #2d3748;
  color: #e2e8f0;
  margin-top: auto;
  padding-top: 40px;
  padding-bottom: 20px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-bottom: 24px;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
}

.footer-text {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e0;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  color: #cbd5e0;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: white;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid #4a5568;
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: #a0aec0;
}

@media (max-width: 968px) {
  .referees-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 15px 10px;
  }
  
  .container {
    padding: 18px;
  }

  /* Header Mobile */
  .header-container {
    padding: 10px 15px;
    flex-wrap: nowrap;
  }

  .logo-link {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    order: 2;
  }

  .logo {
    height: 40px;
  }

  .nav {
    order: 1;
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .nav-toggle {
    display: flex;
    margin-right: auto;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    width: 100%;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    gap: 0;
    margin-top: 8px;
    padding: 8px 0;
    z-index: 99;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
    border-radius: 0;
  }

  .header-actions {
    order: 3;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .user-dropdown {
    right: 0;
    left: auto;
  }

  .btn-login {
    padding: 8px 16px;
    font-size: 13px;
  }

  /* Footer Mobile */
  .footer {
    padding-top: 32px;
    padding-bottom: 16px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 15px;
  }

  .footer-bottom {
    padding: 16px 15px;
  }

  /* Legal Pages Mobile */
  .legal-page h1 {
    font-size: 24px;
    margin-bottom: 24px;
  }

  .legal-page h2 {
    font-size: 18px;
    margin-top: 24px;
  }

  .legal-page h3 {
    font-size: 15px;
    margin-top: 16px;
  }

  .legal-section {
    margin-bottom: 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .button-group-inner {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
  }
  
  .btn-link {
    order: 2;
  }
  
  .btn-secondary {
    order: 1;
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  h1 {
    font-size: 20px;
    text-align: left;
  }

  .btn-clear-form {
    width: 100%;
    justify-content: center;
  }
  
  .signature-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .signature-placeholder {
    width: calc(100% - 20px);
    padding: 8px;
    font-size: 13px;
  }
  
  .btn-clear {
    align-self: flex-start;
    margin-top: 8px;
  }
  
  .auto-calc-hint {
    position: static;
    display: block;
    margin-top: 5px;
    transform: none;
  }
  
  /* Modal auf mobilen Geräten - quer, voller Bildschirm */
  .signature-modal {
    padding: 0;
  }
  
  .signature-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  .signature-modal-header {
    padding: 15px;
    flex-shrink: 0;
  }
  
  .signature-modal-body {
    flex: 1;
    padding: 15px;
    min-height: 0;
    overflow: hidden;
  }
  
  .signature-modal-canvas {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 280 / 90; /* Behalte das Seitenverhältnis bei - breit und flach wie ein normales Unterschriftsfeld */
    min-height: 100px;
    max-width: 100%;
  }
  
  .signature-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .signature-modal-footer {
    flex-direction: column;
    flex-shrink: 0;
    padding: 15px;
  }
  
  .signature-modal-footer .btn {
    width: 100%;
  }
  
  .confirm-modal {
    padding: 10px;
  }
  
  .confirm-modal-content {
    max-width: 100%;
  }
  
  .confirm-modal-header {
    padding: 20px 20px 12px 20px;
  }
  
  .confirm-modal-header h2 {
    font-size: 18px;
  }
  
  .confirm-modal-body {
    padding: 20px;
  }
  
  .confirm-modal-body p {
    font-size: 14px;
  }
  
  .confirm-modal-footer {
    flex-direction: column;
    padding: 12px 20px 20px 20px;
  }
  
  .confirm-modal-footer .btn {
    width: 100%;
    min-width: auto;
  }
}

/* Meine Belege Seite - Stats, Filter, Tabelle */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  padding: 20px;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.stat-card h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #4a5568;
  font-weight: normal;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #2d3748;
}

.stat-card.pending .stat-value {
  color: #e53e3e;
}

.stat-card.processed .stat-value {
  color: #38a169;
}

.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-weight: 500;
  color: #4a5568;
  font-size: 14px;
}

.filter-group select {
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  cursor: pointer;
}

.filter-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.bookings-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  min-width: 800px;
}

.bookings-table thead {
  background: #2d3748;
  color: white;
}

.bookings-table th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.bookings-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.bookings-table tbody tr {
  cursor: pointer;
  transition: background 0.2s;
}

.bookings-table tbody tr:hover {
  background: #f7fafc;
}

.bookings-table tbody tr.processed {
  opacity: 0.6;
  background: #f0fff4;
}

.status-cell {
  width: 150px;
}

.status-select {
  padding: 6px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
  min-width: 120px;
}

.status-select:hover {
  border-color: #cbd5e0;
}

.status-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.status-select.pending {
  background: #fff5f5;
  border-color: #fc8181;
  color: #c53030;
}

.status-select.in_progress {
  background: #ebf8ff;
  border-color: #4299e1;
  color: #2b6cb0;
}

.status-select.processed {
  background: #f0fff4;
  border-color: #48bb78;
  color: #22543d;
}

.status-select.rejected {
  background: #fff5f5;
  border-color: #f56565;
  color: #c53030;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Klickbare Zellen für Checkbox und Status */
.bookings-table td:first-child {
  cursor: pointer;
  user-select: none;
}

.bookings-table td:first-child:hover {
  background-color: #f7fafc;
}

.status-cell {
  cursor: pointer;
  user-select: none;
}

.status-cell:hover {
  background-color: #f7fafc;
}

.status-badge.pending {
  background: #fed7d7;
  color: #c53030;
}

.status-badge.in_progress {
  background: #bee3f8;
  color: #2b6cb0;
}

.status-badge.processed {
  background: #c6f6d5;
  color: #22543d;
}

.status-badge.rejected {
  background: #fed7d7;
  color: #c53030;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #718096;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.loading::before {
  content: '';
  border: 3px solid rgba(113, 128, 150, 0.3);
  border-top: 3px solid #718096;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Loading Spinner für Statistiken */
.loading-spinner-small {
  display: inline-block;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-top: 2px solid #667eea;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}

.stat-value .loading-spinner-small {
  margin: 0 auto;
  display: block;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
}

.empty-state h3 {
  margin-bottom: 10px;
  color: #4a5568;
}

/* Detail Modal */
.detail-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.detail-modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.detail-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.detail-modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #2d3748;
}

.btn-close-detail {
  background: none;
  border: none;
  cursor: pointer;
  color: #718096;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-close-detail:hover {
  background: #f7fafc;
  color: #2d3748;
}

.detail-modal-body {
  padding: 20px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.detail-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 15px;
  margin-bottom: 12px;
  align-items: start;
}

.detail-label {
  font-weight: 500;
  color: #4a5568;
  font-size: 13px;
}

.detail-value {
  color: #2d3748;
  font-size: 14px;
}

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

.detail-signature img {
  max-width: 200px;
  max-height: 65px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  margin-top: 5px;
}

.detail-status-select {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: white;
  transition: all 0.2s;
  min-width: 150px;
}

.detail-status-select:hover {
  border-color: #cbd5e0;
}

.detail-status-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.detail-status-select.pending {
  background: #fff5f5;
  border-color: #fc8181;
  color: #c53030;
}

.detail-status-select.in_progress {
  background: #ebf8ff;
  border-color: #4299e1;
  color: #2b6cb0;
}

.detail-status-select.processed {
  background: #f0fff4;
  border-color: #48bb78;
  color: #22543d;
}

.detail-status-select.rejected {
  background: #fff5f5;
  border-color: #f56565;
  color: #c53030;
}

/* Responsive Design für Meine Belege Seite */
@media (max-width: 768px) {
  .stats {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .stat-card .stat-value {
    font-size: 28px;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group select {
    width: 100%;
  }
  
  .table-wrapper {
    margin: 0 -10px;
  }
  
  .bookings-table {
    font-size: 12px;
    min-width: 600px;
  }
  
  .bookings-table th,
  .bookings-table td {
    padding: 8px;
  }
  
  .detail-modal {
    padding: 10px;
  }
  
  .detail-modal-content {
    max-height: 95vh;
    border-radius: 8px;
  }
  
  .detail-modal-header {
    padding: 15px;
  }
  
  .detail-modal-body {
    padding: 15px;
  }
  
  .detail-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .detail-label {
    font-weight: 600;
    margin-bottom: 4px;
  }
  
  .detail-status-select {
    width: 100%;
    min-width: auto;
  }
}

/* Tab System für Verein verwalten */
.tab-container {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.tab-button {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 600;
  color: #718096;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.tab-button:hover {
  color: #667eea;
  background: #f7fafc;
}

.tab-button.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* E-Mail-Felder Styles */
.email-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.email-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.email-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.email-input.field-valid {
  border-color: #48bb78;
}

.email-input.field-invalid {
  border-color: #f56565;
}

.btn-remove-email {
  padding: 6px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 6px;
  cursor: pointer;
  color: #c33;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remove-email:hover {
  background: #fcc;
  border-color: #f99;
  color: #a00;
}

#addEmailBtn,
#addMyEmailBtn {
  padding: 6px 12px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}