/* =============================================
   STARTUP ADMIN — Management Dashboard
   ============================================= */

.sa-page {
  padding: 32px 0 64px;
  min-height: 80vh;
}

.sa-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.sa-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #2D2926;
  margin: 0;
}

.sa-count {
  font-size: 0.85rem;
  color: #B1ADA1;
  font-weight: 600;
}

.sa-filters {
  margin-bottom: 20px;
}

.sa-loading,
.sa-empty {
  text-align: center;
  color: #6B6560;
  padding: 48px 0;
}

/* ── Table ── */
.sa-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(177, 173, 161, 0.2);
  background: #fff;
}

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

.sa-table th {
  text-align: left;
  font-weight: 700;
  color: #6B6560;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  border-bottom: 2px solid rgba(177, 173, 161, 0.15);
  white-space: nowrap;
}

.sa-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(177, 173, 161, 0.1);
  vertical-align: middle;
}

.sa-table tbody tr:hover {
  background: rgba(193, 95, 60, 0.02);
}

.sa-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sa-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.sa-slug {
  font-size: 0.75rem;
  color: #B1ADA1;
}

.sa-plan {
  font-size: 0.8rem;
  font-weight: 600;
}

.sa-owner {
  font-family: monospace;
  font-size: 0.78rem;
  color: #B1ADA1;
}

.sa-actions {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
}

.sa-load-more {
  text-align: center;
  margin-top: 24px;
}

/* ── Edit Dialog ── */
.sa-edit-form {
  padding: 0 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 768px) {
  .sa-table {
    font-size: 0.8rem;
  }

  .sa-table th,
  .sa-table td {
    padding: 8px 8px;
  }
}

.sa-loading-state,
.sa-access-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
}

.sa-loading-card,
.sa-access-card {
  width: min(420px, calc(100vw - 32px));
  background: #FFFFFF;
  border: 1px solid rgba(177, 173, 161, 0.2);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  text-align: center;
}

.sa-loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.sa-loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(193, 95, 60, 0.18);
  border-top-color: #C15F3C;
  animation: sa-spin 0.8s linear infinite;
}

@keyframes sa-spin {
  to { transform: rotate(360deg); }
}

.sa-access-card h2 {
  margin: 0 0 10px;
  color: #2D2926;
}

.sa-access-card p {
  margin: 0 0 20px;
  color: #6B6560;
  line-height: 1.5;
}

.sa-dashboard {
  max-width: 1120px;
  margin: 0 auto;
}

.sa-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(177, 173, 161, 0.2);
  border-radius: 14px;
  margin-bottom: 24px;
}

.sa-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #6B6560;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.sa-tab.is-active {
  background: linear-gradient(135deg, rgba(193, 95, 60, 0.12), rgba(193, 95, 60, 0.06));
  color: #C15F3C;
}

.sa-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(45, 41, 38, 0.08);
  color: inherit;
  font-size: 0.75rem;
}

.sa-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.sa-filter,
.sa-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.sa-filter span,
.sa-field span {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6B6560;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sa-select,
.sa-input {
  width: 100%;
  border: 1px solid rgba(177, 173, 161, 0.3);
  border-radius: 10px;
  background: #FFFFFF;
  color: #2D2926;
  font: inherit;
  line-height: 1.45;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sa-select:focus,
.sa-input:focus {
  outline: none;
  border-color: #C15F3C;
  box-shadow: 0 0 0 3px rgba(193, 95, 60, 0.12);
}

.sa-select {
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, #B1ADA1 50%),
    linear-gradient(135deg, #B1ADA1 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.sa-textarea {
  resize: vertical;
  min-height: 96px;
}

.sa-primary-button,
.sa-secondary-button,
.sa-danger-button,
.sa-inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.sa-primary-button {
  padding: 12px 18px;
  background: linear-gradient(135deg, #C15F3C, #d4795a);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(193, 95, 60, 0.24);
}

.sa-secondary-button {
  padding: 12px 18px;
  background: #FFFFFF;
  color: #2D2926;
  border: 1px solid rgba(177, 173, 161, 0.3);
}

.sa-danger-button {
  padding: 12px 18px;
  background: #b42318;
  color: #FFFFFF;
}

.sa-inline-button {
  padding: 7px 10px;
  background: rgba(193, 95, 60, 0.08);
  color: #C15F3C;
  font-size: 0.75rem;
}

.sa-inline-button.warn {
  background: rgba(180, 83, 9, 0.10);
  color: #b45309;
}

.sa-inline-button.danger {
  background: rgba(180, 35, 24, 0.10);
  color: #b42318;
}

.sa-inline-button.ghost {
  background: rgba(45, 41, 38, 0.06);
  color: #2D2926;
}

.sa-checkbox-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #6B6560;
}

.sa-checkbox-cell input,
.sa-toggle-row input {
  accent-color: #C15F3C;
}

.sa-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid rgba(177, 173, 161, 0.24);
  background: rgba(255, 255, 255, 0.7);
  color: #6B6560;
}

.sa-chip.approved,
.sa-chip.completed,
.sa-chip.passed {
  background: rgba(74, 163, 99, 0.10);
  border-color: rgba(74, 163, 99, 0.22);
  color: #2f7a45;
}

.sa-chip.pending_review,
.sa-chip.pending_payment,
.sa-chip.paid {
  background: rgba(180, 83, 9, 0.08);
  border-color: rgba(180, 83, 9, 0.2);
  color: #b45309;
}

.sa-chip.details_submitted,
.sa-chip.in_progress {
  background: rgba(29, 78, 216, 0.08);
  border-color: rgba(29, 78, 216, 0.18);
  color: #1d4ed8;
}

.sa-chip.rejected,
.sa-chip.failed {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.18);
  color: #b42318;
}

.sa-link {
  color: #C15F3C;
  text-decoration: none;
}

.sa-link:hover {
  text-decoration: underline;
}

.sa-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.sa-modal[hidden] {
  display: none;
}

.sa-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(3px);
  z-index: 45;
}

.sa-modal-card {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #FFFFFF;
  border-radius: 18px;
  border: 1px solid rgba(177, 173, 161, 0.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  padding: 24px;
}

.sa-modal-card-small {
  width: min(420px, calc(100vw - 32px));
}

.sa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sa-modal-head h2 {
  margin: 0;
  color: #2D2926;
  font-size: 1.2rem;
}

.sa-modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(45, 41, 38, 0.06);
  color: #2D2926;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.sa-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.sa-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #2D2926;
  font-weight: 600;
}

.sa-delete-copy {
  margin: 0;
  color: #6B6560;
  line-height: 1.6;
}

.sa-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 32px));
  background: rgba(45, 41, 38, 0.94);
  color: #FFFFFF;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
}

.sa-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .sa-page {
    padding: 24px 0 48px;
  }

  .sa-tabs {
    width: 100%;
  }

  .sa-tab {
    flex: 1;
    justify-content: center;
  }

  .sa-toolbar {
    align-items: stretch;
  }

  .sa-filter {
    width: 100%;
  }

  .sa-modal {
    padding: 16px;
  }

  .sa-modal-card {
    width: calc(100vw - 32px);
    padding: 20px;
  }

  .sa-modal-actions {
    flex-direction: column-reverse;
  }
}
