/* ============================================================
   AdminEventsPage – Messe-Events CRUD
   ============================================================ */

/* Page Header */
.pageHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.pageTitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.pageSubtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

/* Buttons */
.btnPrimary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btnPrimary:hover {
  opacity: 0.9;
}

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

.btnSecondary {
  padding: 0.5rem 1rem;
  background: none;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  cursor: pointer;
}

.btnSecondary:hover {
  background: var(--color-bg-hover);
}

.btnDanger {
  padding: 0.5rem 1rem;
  background: var(--color-error);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.btnDanger:hover {
  opacity: 0.9;
}

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

/* Table Card */
.tableCard {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

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

.table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

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

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

/* Name Cell */
.nameCell {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.eventName {
  font-weight: 600;
  color: var(--color-text);
}

.websiteLink {
  font-size: 0.6875rem;
  color: var(--color-primary);
  text-decoration: none;
}

.websiteLink:hover {
  text-decoration: underline;
}

/* Date Cell */
.dateCell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Location/Booth */
.locationText {
  display: block;
  color: var(--color-text);
}

.boothText {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

/* Status Badges */
.statusBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.status_upcoming {
  background: #dbeafe;
  color: #1e40af;
}

.status_ongoing {
  background: #dcfce7;
  color: #166534;
}

.status_ended {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
}

/* Active/Inactive Badge */
.activeBadge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.activeYes {
  background: #dcfce7;
  color: #166534;
}

.activeNo {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
}

/* Action Buttons */
.actionBtns {
  display: flex;
  gap: 0.25rem;
}

.iconBtn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
}

.iconBtn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.iconBtnDanger:hover {
  background: #fef2f2;
  color: var(--color-error);
  border-color: var(--color-error);
}

/* Empty State */
.emptyState {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-muted);
}

.emptyState p {
  margin: 0.75rem 0 1.25rem;
  font-size: 0.875rem;
}

/* Loading */
.loadingText {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  text-align: center;
  padding: 2rem;
}

/* ============================================================
   Modal
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.modalTitle {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.closeBtn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem;
}

.closeBtn:hover {
  color: var(--color-text);
}

/* Form */
.form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.formError {
  padding: 0.625rem 0.75rem;
  background: #fef2f2;
  color: var(--color-error);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
}

.fieldGroup {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.fieldRow {
  display: flex;
  gap: 1rem;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.textarea {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
  width: 100%;
  resize: vertical;
  font-family: inherit;
}

.textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.toggleLabel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  margin-top: 1.25rem;
}

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

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.5rem;
}

/* Delete confirmation */
.deleteText {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.deleteText strong {
  color: var(--color-text);
}

/* Dark Mode Overrides */
:global([data-theme='dark']) .status_upcoming {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

:global([data-theme='dark']) .status_ongoing {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

:global([data-theme='dark']) .activeYes {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

:global([data-theme='dark']) .formError {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

:global([data-theme='dark']) .iconBtnDanger:hover {
  background: rgba(239, 68, 68, 0.15);
}
