/* send-policy-admin.css — P6-03 send-on-behalf matrix admin UI */

.sp-admin {
  padding: 1.5rem;
  font-family: inherit;
}

.sp-admin-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sp-admin-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 1rem 0 0;
  color: var(--text-primary, #1a1a2e);
}

.sp-admin-subtitle {
  flex: 1 1 100%;
  font-size: 0.875rem;
  color: var(--text-secondary, #555);
  margin: 0.25rem 0 0.75rem;
}

.sp-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  background: var(--bg-surface, #fff);
  /* FIX 4: --bg-surface is now a DARK surface (alias -> --bg-card). With no
     explicit text colour the button inherited a dark colour -> dark-on-dark.
     Pin the text to the theme token so it stays legible on the dark surface. */
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
  transition: background 0.15s;
}

.sp-btn:hover {
  background: var(--bg-hover, #f0f0f5);
}

.sp-btn-refresh {
  margin-left: auto;
}

/* Loading / error / empty */
.sp-loading,
.sp-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary, #888);
  font-size: 0.95rem;
}

.sp-error {
  padding: 1rem;
  background: #fff0f0;
  border: 1px solid #ffaaaa;
  border-radius: 4px;
  color: #c00;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Matrix table */
.sp-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
}

.sp-matrix {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
}

.sp-matrix th,
.sp-matrix td {
  border: 1px solid var(--border-color, #e8e8e8);
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

.sp-matrix thead th {
  background: var(--bg-header, #f6f8fa);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.sp-col-user {
  text-align: left !important;
  min-width: 9rem;
}

.sp-col-mailbox {
  min-width: 8rem;
}

.sp-mbx-label {
  display: block;
  font-size: 0.85rem;
}

.sp-cell-user {
  white-space: nowrap;
}

.sp-email {
  font-size: 0.78rem;
  color: var(--text-secondary, #777);
}

.sp-cell-check {
  text-align: center;
}

.sp-cell-check input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  accent-color: var(--accent-color, #4a6cf7);
}

.sp-cell-check input[type="checkbox"]:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Badges */
.sp-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.sp-badge-team {
  background: #e3f0ff;
  color: #1a5caa;
}

.sp-badge-private {
  background: #fdf0e0;
  color: #996622;
}

.sp-badge-admin {
  background: #f0e8ff;
  color: #5a21bb;
}

/* Hover row highlight */
.sp-matrix tbody tr:hover {
  background: var(--bg-hover, #f8f9ff);
}
