/* Fhellow — email allow and block lists dialog (fhellow-admin.js). Palette tokens come from fhellow-tone.css. */

.fh-adm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  background: rgba(20, 17, 13, 0.45);
  overflow: hidden;
}
/* The dialog fits the screen and only the list scrolls, so the tabs and the search stay in view. */
.fh-adm-dialog {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  width: min(1200px, 100%);
  padding: 20px 22px 18px;
  font-family: var(--fh-sans);
  font-size: 0.9rem;
  color: var(--fh-ink, #14110d);
  background: var(--fh-paper, #f1e9d9);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(20, 17, 13, 0.35);
}
.fh-adm-dialog > * { flex: none; }
.fh-adm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fh-adm-title { margin: 0; font-size: 1.1rem; font-weight: 700; }

.fh-adm-btn {
  padding: 0.38rem 0.8rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(20, 17, 13, 0.25);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.fh-adm-btn:hover:not(:disabled) { background: rgba(20, 17, 13, 0.06); }
.fh-adm-btn:focus-visible, .fh-adm-input:focus-visible { outline: 2px solid var(--fh-celadon, #5e7e6e); outline-offset: 1px; }
.fh-adm-btn:disabled { opacity: 0.45; cursor: default; }
.fh-adm-primary { color: var(--fh-paper, #f1e9d9); background: var(--fh-celadon, #5e7e6e); border-color: transparent; }
.fh-adm-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--fh-celadon, #5e7e6e) 88%, #000); }
.fh-adm-danger { color: #8a2c22; border-color: rgba(138, 44, 34, 0.35); }
.fh-adm-x { border-color: transparent; }
.fh-adm-link { padding: 0 0.3rem; border: none; text-decoration: underline; }

.fh-adm-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid rgba(20, 17, 13, 0.15); }
.fh-adm-tab { border: none; border-bottom: 2px solid transparent; border-radius: 0; }
.fh-adm-tab[aria-selected="true"] { font-weight: 700; border-bottom-color: var(--fh-celadon, #5e7e6e); }

.fh-adm-switch[hidden], .fh-adm-note[hidden], .fh-adm-link[hidden], .fh-adm-add[hidden] { display: none; }
.fh-adm-switch-row { display: flex; align-items: center; gap: 10px; }
.fh-adm-switch-label { font-weight: 600; }
.fh-adm-toggle { min-width: 4.5rem; }
.fh-adm-toggle.fh-adm-on { color: var(--fh-paper, #f1e9d9); background: var(--fh-celadon, #5e7e6e); border-color: transparent; }
.fh-adm-note { margin: 8px 0; line-height: 1.5; color: rgba(20, 17, 13, 0.75); }

.fh-adm-add, .fh-adm-bar, .fh-adm-actions, .fh-adm-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fh-adm-add { margin: 14px 0 8px; }
.fh-adm-input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.42rem 0.6rem;
  font: inherit;
  color: inherit;
  background: #fffdf8;
  border: 1px solid rgba(20, 17, 13, 0.25);
  border-radius: 8px;
}
.fh-adm-preview-host { max-height: 32vh; overflow-y: auto; }
.fh-adm-preview {
  margin: 8px 0;
  padding: 10px 12px;
  background: rgba(94, 126, 110, 0.1);
  border: 1px solid rgba(94, 126, 110, 0.35);
  border-radius: 10px;
}
.fh-adm-preview p { margin: 0 0 8px; line-height: 1.5; word-break: break-all; }
.fh-adm-preview-invalid { color: #8a2c22; }
.fh-adm-status { min-height: 1.3em; margin: 6px 0; font-weight: 600; }
.fh-adm-bar { justify-content: space-between; margin-top: 10px; }
.fh-adm-filters { display: flex; gap: 8px; margin-top: 8px; }
.fh-adm-filters[hidden] { display: none; }
.fh-adm-chip { border-radius: 999px; }
.fh-adm-chip[aria-pressed="true"] { color: var(--fh-paper, #f1e9d9); background: var(--fh-celadon, #5e7e6e); border-color: transparent; }
.fh-adm-total { color: rgba(20, 17, 13, 0.7); }

.fh-adm-dialog > .fh-adm-list {
  flex: 1 1 auto;
  min-height: 7rem;
  overflow-y: auto;
  margin: 8px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(20, 17, 13, 0.12);
}
/* One grid for the header and the rows, so the columns line up. */
.fh-adm-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(14rem, 2fr) minmax(5rem, 1fr) 5rem 7.6rem 7.6rem 7.6rem 10rem;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid rgba(20, 17, 13, 0.12);
}
.fh-adm-outside .fh-adm-row { grid-template-columns: 3.2rem minmax(12rem, 2fr) minmax(5rem, 1fr) 5rem 7.6rem 7.6rem 8rem; }
.fh-adm-editing { display: flex; }
.fh-adm-colhead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--fh-paper, #f1e9d9);
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(20, 17, 13, 0.62);
}
.fh-adm-cell { min-width: 0; font-size: 0.8rem; overflow-wrap: anywhere; }
.fh-adm-sort { padding: 0; font: inherit; font-weight: 700; color: inherit; background: none; border: none; cursor: pointer; text-align: left; }
.fh-adm-sort:hover { text-decoration: underline; }
.fh-adm-c-dot { display: flex; justify-content: center; }
.fh-adm-c-email { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 0.88rem; }
.fh-adm-c-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fh-adm-email { min-width: 0; overflow-wrap: anywhere; }
.fh-adm-faint { color: rgba(20, 17, 13, 0.5); }
.fh-adm-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.fh-adm-dot { flex: none; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #b9b3a8; }
.fh-adm-dot-on { background: #3f9b5c; }
.fh-adm-badge {
  padding: 0.05rem 0.45rem;
  font-size: 0.75rem;
  color: #8a2c22;
  border: 1px solid rgba(138, 44, 34, 0.4);
  border-radius: 999px;
}
.fh-adm-admin { color: var(--fh-celadon, #5e7e6e); border-color: rgba(94, 126, 110, 0.5); }
.fh-adm-muted { color: rgba(20, 17, 13, 0.6); border-color: rgba(20, 17, 13, 0.25); }
.fh-adm-empty { padding: 14px 2px; color: rgba(20, 17, 13, 0.6); }
.fh-adm-pager { justify-content: center; }
.fh-adm-page { min-width: 4rem; text-align: center; }

@media (max-width: 900px) {
  .fh-adm-row, .fh-adm-outside .fh-adm-row { grid-template-columns: 1.4rem 1fr auto; }
  .fh-adm-row > .fh-adm-cell:not(.fh-adm-c-dot):not(.fh-adm-c-email):not(.fh-adm-row-actions) { display: none; }
}
