/* ─── Committee Management ─────────────────────────────────────────────── */

.committee-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ─── Sections ─────────────────────────────────────────────────────────── */

.committee-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.committee-section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.committee-count {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 1rem;
}

.committee-cache-note {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* ─── Role Overview Grid ───────────────────────────────────────────────── */

.committee-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.committee-role-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.committee-role-card:hover {
  border-color: var(--accent-color, #6366f1);
}

.committee-role-vacant {
  opacity: 0.6;
  border-style: dashed;
}

.committee-role-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.committee-role-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.committee-role-holder {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.committee-vacant {
  font-style: italic;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ─── Badges ───────────────────────────────────────────────────────────── */

.committee-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.committee-badge-role {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.committee-badge-admin {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.committee-badge-committee {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

/* ─── Member Table ─────────────────────────────────────────────────────── */

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

.committee-table thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

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

.committee-member-row {
  cursor: pointer;
  transition: background 0.15s;
}

.committee-member-row:hover {
  background: var(--hover-bg, rgba(255, 255, 255, 0.03));
}

.committee-member-name {
  font-weight: 500;
  color: var(--text-primary);
}

.committee-member-email {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.committee-status-active {
  color: #22c55e;
  font-weight: 500;
}

.committee-status-other {
  color: var(--text-secondary);
}

.committee-btn-manage {
  opacity: 0.5;
  transition: opacity 0.15s;
}

.committee-member-row:hover .committee-btn-manage {
  opacity: 1;
}

/* ─── Modal ────────────────────────────────────────────────────────────── */

.committee-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.committee-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.committee-modal-content {
  position: relative;
  background: var(--card-bg, #1e1e2e);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.committee-modal-wide {
  max-width: 600px;
}

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

.committee-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.committee-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.committee-modal-close:hover {
  color: var(--text-primary);
}

.committee-modal-body {
  padding: 1.5rem;
}

/* ─── Search ───────────────────────────────────────────────────────────── */

.committee-search-box {
  margin-bottom: 1rem;
}

.committee-search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}

.committee-search-box input:focus {
  border-color: var(--accent-color, #6366f1);
}

.committee-search-results {
  max-height: 300px;
  overflow-y: auto;
}

.committee-search-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.committee-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.committee-search-item:hover {
  background: var(--hover-bg, rgba(255, 255, 255, 0.03));
}

.committee-search-item-existing {
  opacity: 0.5;
}

.committee-search-item-name {
  font-weight: 500;
  color: var(--text-primary);
}

.committee-search-item-email {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Manage Modal ─────────────────────────────────────────────────────── */

.committee-manage-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.committee-manage-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.committee-manage-info-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.committee-manage-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.committee-manage-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.committee-manage-role-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.committee-manage-role-item:last-child {
  border-bottom: none;
}

.committee-role-option-name {
  font-weight: 500;
  color: var(--text-primary);
}

.committee-role-option-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.committee-manage-empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.5rem 0;
}

.committee-manage-danger {
  border-top: 1px solid rgba(239, 68, 68, 0.3);
  padding-top: 1.5rem;
}

.committee-manage-danger h4 {
  color: #ef4444;
}

.committee-manage-danger-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ─── Warning Banner ──────────────────────────────────────────────────── */

.committee-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.committee-warning small {
  color: var(--text-secondary);
}

/* ─── Header Actions ──────────────────────────────────────────────────── */

.committee-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ─── Admin Audit Panel ────────────────────────────────────────────────── */

.committee-audit-section {
  margin-bottom: 1.5rem;
}

.committee-audit-section .committee-section-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.audit-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: normal;
}

.audit-subtitle a {
  color: var(--primary);
  text-decoration: underline;
}

.audit-card {
  margin-top: 0.75rem;
}

.audit-table {
  font-size: 0.875rem;
}

.audit-table .audit-icon {
  width: 2rem;
  text-align: center;
  padding-right: 0;
}

.audit-member-name {
  font-weight: 500;
}

.audit-member-roles {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.audit-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 300px;
}

.audit-wa-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.audit-is-admin {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
}

.audit-not-admin {
  background: rgba(244, 67, 54, 0.15);
  color: #c62828;
}

.audit-severity-warning td {
  background: rgba(255, 152, 0, 0.06);
}

.audit-severity-info td {
  background: rgba(33, 150, 243, 0.04);
}

.audit-correct-details {
  margin-top: 0.75rem;
}

.audit-correct-summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  user-select: none;
}

.audit-correct-summary:hover {
  color: var(--text-primary);
}

.audit-correct-row td {
  opacity: 0.8;
}

/* Highlight the panel border when there are issues */
.audit-has-issues {
  border-left: 3px solid #ff9800;
  padding-left: 0.75rem;
}

.audit-all-clear {
  border-left: 3px solid #4caf50;
  padding-left: 0.75rem;
}

/* ─── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .committee-roles-grid {
    grid-template-columns: 1fr 1fr;
  }

  .committee-manage-info {
    grid-template-columns: 1fr;
  }

  .committee-table thead th:nth-child(3),
  .committee-table thead th:nth-child(4),
  .committee-table tbody td:nth-child(3),
  .committee-table tbody td:nth-child(4) {
    display: none;
  }
}

@media (max-width: 480px) {
  .committee-roles-grid {
    grid-template-columns: 1fr;
  }
}
