/* ═══════════════════════════════════════════════════════════
   members.css — Mitgliederverwaltung
   ═══════════════════════════════════════════════════════════ */

/* ── Layout ────────────────────────────────────────────── */
.members-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  align-items: start;
}

@media(max-width: 800px) {
  .members-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Toolbar ───────────────────────────────────────────── */
.members-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.members-toolbar input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}

.members-toolbar input:focus {
  outline: none;
  border-color: #1e3a5f;
}

.members-toolbar select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 12px;
  background: #fff;
  color: #111;
}

.member-count {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

/* ── Mitglied-Liste ────────────────────────────────────── */
.member-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 75vh;
  overflow-y: auto;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.12s;
}

.member-item:hover {
  border-color: #1e3a5f;
  box-shadow: 0 1px 5px rgba(30, 58, 95, 0.07);
}

.member-item.active {
  border-color: #1e3a5f;
  background: #f0f5ff;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

.member-item.inactive {
  opacity: 0.55;
}

.member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.avatar-m {
  background: #dbeafe;
  color: #1e40af;
}

.avatar-w {
  background: #fce7f3;
  color: #9d174d;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-meta {
  font-size: 10px;
  color: #888;
}

.member-badges {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: wrap;
}

/* ── Formular-Panel ────────────────────────────────────── */
.form-panel {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 70px;
}

.form-panel-header {
  background: #1e3a5f;
  color: #fff;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-panel-body {
  padding: 18px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

/* ── Formular-Felder ───────────────────────────────────── */
.form-section {
  margin-bottom: 18px;
}

.form-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #f0f0f0;
}

.form-row {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.form-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.form-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-row.cols-1 {
  grid-template-columns: 1fr;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 10px;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field-label .req {
  color: #dc2626;
  margin-left: 2px;
}

.field-input,
.field-select,
.field-textarea {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  color: #111;
  transition: border-color 0.15s;
  font-family: inherit;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.08);
}

.field-input:disabled,
.field-select:disabled {
  background: #f9f9f9;
  color: #aaa;
}

.field-textarea {
  resize: vertical;
  min-height: 70px;
}

/* ── Toggle ────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.toggle-label {
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 22px;
  cursor: pointer;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked+.toggle-slider {
  background: #1e3a5f;
}

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

/* ── Formular-Aktionen ─────────────────────────────────── */
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn-save {
  background: #1e3a5f;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover {
  background: #16304f;
}

.btn-cancel {
  background: #f5f5f5;
  color: #555;
  border: 1px solid #ddd;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.btn-delete {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  margin-right: auto;
}

.btn-delete:hover {
  background: #fecaca;
}

/* ── Detail-Ansicht (read-only) ────────────────────────── */
.detail-panel {
  padding: 0;
}

.detail-section {
  padding: 12px 18px;
  border-bottom: 1px solid #f5f5f5;
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-field-label {
  font-size: 10px;
  color: #aaa;
}

.detail-field-value {
  font-size: 13px;
  color: #111;
}

.detail-field-value.empty {
  color: #ccc;
  font-style: italic;
}

/* ── Gruppen-Chips ─────────────────────────────────────── */
.group-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.group-chip {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: #ede9fe;
  color: #5b21b6;
}

/* ── Status-Pill ───────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}

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

.status-inactive {
  background: #f3f4f6;
  color: #6b7280;
}
/* ── Gruppen-Bearbeitung ───────────────────────────────── */
.group-edit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
}

.group-edit-table th {
  text-align: left;
  font-size: 10px;
  color: #aaa;
  font-weight: 600;
  padding: 4px 6px;
  border-bottom: 1px solid #f0f0f0;
}

.group-edit-table td {
  padding: 5px 6px;
  vertical-align: middle;
  border-bottom: 1px solid #f9f9f9;
}

.group-row-past td {
  opacity: 0.5;
}

.group-past-header {
  font-size: 10px;
  color: #bbb;
  font-weight: 600;
  padding-top: 8px !important;
}

.field-input-sm {
  padding: 3px 6px;
  font-size: 11px;
  height: 28px;
}

.btn-icon-danger {
  background: none;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-icon-danger:hover {
  background: #fee2e2;
}

.group-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

/* ── Tab-Navigation ────────────────────────────────────── */
.member-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 14px 0;
  background: #f8f9fa;
  border-bottom: 2px solid #e5e7eb;
}

.member-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.member-tab:hover {
  color: #1e3a5f;
  background: #fff;
}

.member-tab.active {
  color: #1e3a5f;
  background: #fff;
  border-bottom-color: #1e3a5f;
}

.member-tab-content {
  /* Inhalt sichtbar */
}

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