.guest-list-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--color-background);
  color: var(--color-text);
}

.guest-list-loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.guest-list-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

[dir="rtl"] .guest-list-header-top {
  flex-direction: row-reverse;
}

[dir="rtl"] .guest-list-header-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .btn-group {
  flex-direction: row-reverse;
}

/* ═══════════════════════════════════════════════════
   HEADER — two-row layout
   Row 1: back button  +  title block
   Row 2: secondary tools  |  primary actions
═══════════════════════════════════════════════════ */
.guest-list-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* Row 1 */
.guest-list-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.header-event-title {
  margin: 0;
  color: var(--color-text);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.header-event-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Row 2 */
.guest-list-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── shared button base ── */
.btn-back,
.btn-tool,
.btn-add-guest,
.btn-whatsapp,
.btn-delete-selected,
.btn-export,
.btn-duplicate {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  height: 38px;
  padding: 0 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

/* back */
.btn-back {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-back:hover {
  background: var(--color-background-tertiary);
  color: var(--color-text);
}

/* secondary tool buttons */
.btn-tool,
.btn-export,
.btn-duplicate {
  background: var(--color-background-tertiary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-tool:hover,
.btn-export:hover,
.btn-duplicate:hover {
  background: var(--color-border);
  border-color: var(--color-text-secondary);
}

/* primary: add guest */
.btn-add-guest {
  background: var(--color-success);
  color: #fff;
}
.btn-add-guest:hover {
  background: var(--color-success-hover);
}

/* whatsapp */
.btn-whatsapp {
  background: #25d366;
  color: #fff;
}
.btn-whatsapp:hover {
  background: #1eba58;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}
.btn-whatsapp:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* delete selected */
.btn-delete-selected {
  background: var(--color-danger, #e53e3e);
  color: #fff;
}
.btn-delete-selected:hover {
  background: #c53030;
  box-shadow: 0 2px 8px rgba(229, 62, 62, 0.35);
}

/* ── legacy class aliases kept for any remaining refs ── */
.header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-members { display: none; }


.pagination-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px;
  background: var(--color-background-secondary);
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
}

.pagination-controls label {
  color: var(--color-text);
  font-weight: 500;
  white-space: nowrap;
}

.pagination-controls select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-background);
  color: var(--color-text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination-controls select:hover {
  border-color: var(--color-primary);
}

.pagination-controls select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
  padding: 1rem;
  background: var(--color-error-bg);
  color: var(--color-danger);
  border-radius: 4px;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--color-danger);
}

[dir="rtl"] .error-message {
  border-left: none;
  border-right: 4px solid var(--color-danger);
}

.guest-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-background-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--color-border);
}

.stat-label {
  display: block;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--color-text);
}

.selection-bar {
  background: var(--color-info-bg);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--color-primary);
}

[dir="rtl"] .selection-bar {
  border-left: none;
  border-right: 4px solid var(--color-primary);
}

.selection-text {
  font-weight: 500;
  color: var(--color-text);
}

.guest-filters {
  margin-bottom: 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

[dir="rtl"] .guest-filters {
  flex-direction: row-reverse;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guest-filters label {
  font-weight: 500;
  color: var(--color-text);
}

.guest-filters select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--color-background-secondary);
  color: var(--color-text);
  cursor: pointer;
  min-width: 200px;
  transition: border-color 0.3s ease;
}

.guest-filters select:hover,
.guest-filters select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-secondary);
  background: var(--color-background-secondary);
  border-radius: 8px;
  border: 1px dashed var(--color-border);
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.btn-add-guest-large {
  padding: 1rem 2rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.btn-add-guest-large:hover {
  background: var(--color-primary-hover);
}

.guests-table {
  background: var(--color-background-secondary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--color-border);
}

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

thead {
  background: var(--color-background-tertiary);
  border-bottom: 2px solid var(--color-border);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.95rem;
  vertical-align: middle;
}

[dir="rtl"] th {
  text-align: right;
}

.checkbox-cell {
  width: 50px;
  text-align: center;
  padding: 1rem 0;
}

[dir="rtl"] .checkbox-cell {
  text-align: center;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

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

tbody tr.selected {
  background: var(--color-info-bg);
}

td {
  padding: 1rem;
  vertical-align: middle;
  color: var(--color-text);
}

[dir="rtl"] td {
  text-align: right;
}

.guest-name {
  font-weight: 500;
  color: var(--color-text);
}

.rsvp-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  min-width: 100px;
}

.rsvp-confirmed {
  background: var(--color-success);
  color: white;
}

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

.rsvp-invited {
  background: var(--color-warning);
  color: white;
}

.guest-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
}

[dir="rtl"] .guest-actions {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.btn-edit-small,
.btn-delete-small {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

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

.btn-edit-small:hover {
  background: var(--color-primary-hover);
}

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

.btn-delete-small:hover {
  background: var(--color-danger-hover);
}

@media (max-width: 768px) {
  .guest-list-header-top {
    flex-wrap: wrap;
  }

  .btn-back {
    width: 100%;
  }

  .header-title {
    width: 100%;
  }

  .guest-list-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group {
    justify-content: stretch;
  }

  .btn-group > * {
    flex: 1;
  }

  .guest-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.75rem;
  }

  .guest-actions {
    flex-direction: column;
  }

  .btn-edit-small,
  .btn-delete-small {
    width: 100%;
  }

  .guest-filters {
    flex-direction: column;
    gap: 1rem;
  }

  [dir="rtl"] .guest-filters {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .guest-filters select {
    width: 100%;
    min-width: unset;
  }
}

/* ── Column visibility settings panel ── */
.column-settings-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.column-settings-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.column-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-text);
  user-select: none;
}

.column-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ── Sortable column header ── */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  background: var(--color-background);
  color: var(--color-primary);
}

.sort-icon {
  opacity: 0.6;
  font-size: 0.8em;
  margin-inline-start: 4px;
}

/* ── Consideration panel ── */
.consideration-panel {
  background: var(--color-background-secondary);
  border: 1px solid var(--color-warning, #e8a838);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.consideration-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(232, 168, 56, 0.1);
  border-bottom: 1px solid var(--color-warning, #e8a838);
}

.consideration-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

.consideration-count {
  color: var(--color-warning, #e8a838);
  font-weight: 700;
}

.btn-consideration-toggle {
  background: transparent;
  border: 1px solid var(--color-warning, #e8a838);
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--color-text);
  transition: background 0.15s;
}

.btn-consideration-toggle:hover {
  background: rgba(232, 168, 56, 0.15);
}

.consideration-list {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.consideration-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--color-background);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.consideration-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.consideration-phone {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.btn-remove-consideration {
  background: transparent;
  border: 1px solid var(--color-danger);
  border-radius: 4px;
  color: var(--color-danger);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-remove-consideration:hover {
  background: var(--color-danger);
  color: #fff;
}

.consideration-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-consideration-invite,
.btn-consideration-decline {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.btn-consideration-invite {
  background: var(--color-success, #38a169);
  color: #fff;
}

.btn-consideration-invite:hover {
  opacity: 0.85;
  box-shadow: 0 2px 6px rgba(56, 161, 105, 0.4);
}

.btn-consideration-decline {
  background: var(--color-danger, #e53e3e);
  color: #fff;
}

.btn-consideration-decline:hover {
  opacity: 0.85;
  box-shadow: 0 2px 6px rgba(229, 62, 62, 0.4);
}

/* ── Sticky action bar ── */
.sticky-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-background-secondary);
  border-top: 2px solid var(--color-primary);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sticky-selection-count {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.sticky-action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-consideration {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
  background: var(--color-warning, #e8a838);
  color: #fff;
}

.btn-consideration:hover {
  background: #cf8f20;
  box-shadow: 0 2px 8px rgba(232, 168, 56, 0.4);
}

@media (max-width: 768px) {
  .sticky-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .sticky-action-buttons {
    justify-content: stretch;
  }

  .sticky-action-buttons > * {
    flex: 1;
  }
}
