/* Allgemeine Styles */
.nav-btn.active {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 600;
  border-color: #2563eb;
}
.nav-btn:not(.active):hover {
  background-color: #f9fafb;
  color: #1e40af;
}

/* Status-Farben */
.paid-status-Bezahlt {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.paid-status-Unbezahlt {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.paid-status-Ausstehend {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Animationen */
.refresh-btn {
  transition: all 0.3s ease;
}
.refresh-btn:active {
  transform: rotate(180deg);
}

/* Abteilungs-Badge */
.department-badge {
  background-color: #e0e7ff;
  color: #3730a3;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Interaktive Elemente */
.clickable-card {
  transition: all 0.2s ease;
  cursor: pointer;
}
.clickable-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.clickable-card:active {
  transform: translateY(0);
}

/* QR Scanner */
#video {
  width: 100%;
  max-width: 500px;
  height: auto;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background-color: #000;
}
#canvas {
  display: none;
}
.scanner-container {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 500px;
}
.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  pointer-events: none;
  display: none;
}
.scanner-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px solid #10b981;
  border-radius: 8px;
}
.scanning-active .scanner-overlay {
  display: block;
}

/* Responsive Design */
.member-card {
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
}
.member-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.mobile-member-view .member-field {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.mobile-member-view .member-field:last-child {
  border-bottom: none;
}
.mobile-member-view .field-label {
  font-weight: 600;
  color: #374151;
  min-width: 120px;
}
.mobile-member-view .field-value {
  color: #6b7280;
  text-align: right;
  flex: 1;
}

/* Popup-Styles */
.popup-container {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.popup-content {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  max-width: 28rem;
  width: 100%;
  margin: 0 1rem;
}
.success-icon, .error-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.success-icon {
  background-color: #dcfce7;
}
.error-icon {
  background-color: #fee2e2;
}
.popup-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}
.popup-details {
  background-color: #f9fafb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.popup-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
  text-align: left;
}
@media (min-width: 640px) {
  .popup-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.popup-grid .label {
  font-size: 0.875rem;
  color: #6b7280;
}
.popup-grid .value {
  font-weight: 600;
}
.popup-grid .col-span-2 {
  grid-column: span 2;
}
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.popup-button {
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
  width: 100%;
}
@media (min-width: 640px) {
  .popup-button {
    width: auto;
  }
}
.error-popup {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
}
.error-message {
  background-color: #fee2e2;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Checkins Popup */
.checkins-popup {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  max-width: 56rem;
  max-height: 80vh;
  width: 100%;
  margin: 0 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.checkins-table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}
.checkins-table {
  width: 100%;
  border-collapse: collapse;
}
.checkins-table thead {
  background-color: #f3f4f6;
  position: sticky;
  top: 0;
}
.checkins-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}
.checkins-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}
.checkins-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}
.stats-popup-list {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  max-height: 55vh;
  overflow-y: auto;
}

.stats-popup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.stats-popup-item:last-child {
  border-bottom: none;
}

.stats-popup-item h4 {
  font-weight: 600;
  color: #111827;
}

.stats-popup-item p {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.15rem;
}
.no-checkins {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
}

/* Dashboard-Styles */
.info-banner {
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}
.coach-restricted {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}
.head-coach-info {
  background-color: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
.dashboard-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}
.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .dashboard-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.dashboard-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}
.refresh-button {
  background-color: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  transition: background-color 0.2s;
  width: 100%;
}
@media (min-width: 640px) {
  .refresh-button {
    width: auto;
  }
}
.refresh-button:hover {
  background-color: #2563eb;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.stat-card {
  padding: 1rem;
  border-radius: 0.375rem;
}
.enhanced-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e0e7ff;
  box-shadow: 0 10px 15px -15px rgba(79, 70, 229, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
}

.enhanced-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -15px rgba(79, 70, 229, 0.6);
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon svg {
  width: 24px;
  height: 24px;
}

.stat-card-label {
  font-size: 0.9rem;
  color: #4c1d95;
  font-weight: 600;
}

.stat-card-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.stat-card-action {
  font-size: 0.85rem;
  color: #4f46e5;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-card-action::after {
  content: '→';
  font-size: 0.9rem;
}
.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
}
.stat-subtext {
  font-size: 0.875rem;
  color: #6b7280;
}
.last-update {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 1rem;
}

/* Scanner-Styles */
.scanner-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.scanner-video {
  width: 100%;
  max-width: 500px;
  height: auto;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: #000;
  margin: 0 auto 1rem;
  display: block;
}
.scanner-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
@media (min-width: 640px) {
  .scanner-buttons {
    justify-content: flex-start;
  }
}
.scanner-btn {
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
  width: 100%;
}
@media (min-width: 640px) {
  .scanner-btn {
    width: auto;
  }
}
.scanner-hint {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
  text-align: center;
}
@media (min-width: 640px) {
  .scanner-hint {
    text-align: left;
  }
}
.manual-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) {
  .manual-form {
    flex-direction: row;
  }
}
.manual-input {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  flex: 1;
}
.manual-submit {
  background-color: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
  width: 100%;
}
@media (min-width: 640px) {
  .manual-submit {
    width: auto;
  }
}
.manual-submit:hover {
  background-color: #2563eb;
}
.scan-result {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  display: none;
}

.manual-attendance-card {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.manual-members-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.manual-secondary-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 0.375rem;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  background-color: white;
  font-size: 0.85rem;
  transition: background-color 0.2s ease;
}

.manual-secondary-btn:hover {
  background-color: #eef2ff;
}

.manual-members-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  background-color: white;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.manual-member-item {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background-color: #fdfdfd;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.manual-member-item:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08);
}

.manual-member-item.active {
  border-color: #4f46e5;
  background-color: #eef2ff;
  box-shadow: 0 0 0 1px #4f46e5 inset;
}

.manual-member-info {
  flex: 1;
}

.manual-member-info h4 {
  font-weight: 600;
  color: #111827;
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
}

.manual-member-info p {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.1rem;
}

.manual-member-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.manual-member-checkbox {
  margin-top: 0.2rem;
}

.manual-popup-list {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.manual-popup-item {
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.manual-popup-item h4 {
  font-weight: 600;
  color: #111827;
}

.manual-popup-item p {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

.manual-popup-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

/* Formular-Styles */
.management-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.form-title {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.member-form {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}
@media (min-width: 768px) {
  .member-form {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .member-form {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1280px) {
  .member-form {
    grid-template-columns: repeat(6, 1fr);
  }
}
.form-input {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
}
.notes-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .notes-container {
    flex-direction: row;
    grid-column: span 2;
  }
}
@media (min-width: 1024px) {
  .notes-container {
    grid-column: span 3;
  }
}
@media (min-width: 1280px) {
  .notes-container {
    grid-column: span 1;
  }
}
.notes-input {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  flex: 1;
}
.submit-button {
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
  width: 100%;
}
@media (min-width: 768px) {
  .submit-button {
    width: auto;
  }
}
.form-result {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}
.toggle-button {
  background-color: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  transition: background-color 0.2s;
  width: 100%;
}
@media (min-width: 640px) {
  .toggle-button {
    width: auto;
  }
}
.toggle-button:hover {
  background-color: #2563eb;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
  .container {
    padding: 0.5rem;
  }
  .nav-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  .nav-btn svg {
    width: 1rem;
    height: 1rem;
  }
}
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
  .desktop-only {
    display: block !important;
  }
}

/* Action Buttons */
.action-btn {
  padding: 0.375rem 0.75rem;
  margin: 0.125rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}
.action-btn:hover {
  transform: translateY(-1px);
}

/* Department Info */
.department-info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}
/* Desktop members table improvements */
.desktop-table-wrapper {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.desktop-table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.desktop-table-wrapper::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 999px;
}

.desktop-table-wrapper::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 999px;
}

.members-table {
  min-width: 1200px;
  border-spacing: 0;
}

.members-table thead th {
  position: sticky;
  top: 0;
  background-color: #f8fafc;
  z-index: 1;
  box-shadow: inset 0 -1px 0 #e5e7eb;
}

.members-table th,
.members-table td {
  white-space: nowrap;
  font-size: 0.9rem;
}

.members-table td:nth-child(6),
.members-table td:nth-child(10) {
  white-space: normal;
  max-width: 260px;
}

.members-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.members-table tbody tr:hover {
  background-color: #eef2ff;
}

.table-scroll-hint {
  font-style: italic;
}

.table-scroll-hint span:first-child {
  font-size: 1.1rem;
}

/* Better date input styling */
input[type="date"] {
  font-family: inherit;
}

/* Address field styling */
.member-field .field-value {
  word-break: break-word;
}

/* Form grid adjustments for new fields */
.member-form {
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .member-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .member-form {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .member-form {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Popup grid adjustments */
.popup-grid {
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
  .popup-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Status badge colors */
.paid-status-Bezahlt {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.paid-status-Unbezahlt {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.paid-status-Ausstehend {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}