.admin-account-access-panel {
  --access-ink: #102a4f;
  --access-muted: #526982;
  --access-line: #c9d9ea;
  --access-blue: #1262d6;
  --access-green: #087f5b;
  --access-mint: #e8f8f1;
  --access-sky: #edf6ff;
  --access-lilac: #f3efff;
  --access-rose: #fff0f2;
  color: var(--access-ink);
  padding: clamp(18px, 3vw, 34px);
}

.admin-account-access-heading,
.admin-account-access-heading > div,
.admin-account-directory > header,
.admin-account-create-card > header,
.admin-account-row-heading,
.admin-account-row-state,
.admin-account-row-actions,
.admin-account-link-result > div {
  display: flex;
  align-items: center;
}

.admin-account-access-heading {
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--access-line);
}

.admin-account-access-heading > div {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.admin-account-access-heading h2,
.admin-account-create-card h3,
.admin-account-directory h3,
.admin-account-link-result h3 {
  margin: 0;
  color: var(--access-ink);
  letter-spacing: 0;
}

.admin-account-access-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.admin-account-access-heading p,
.admin-account-create-card p,
.admin-account-directory p,
.admin-account-link-result p {
  margin: 0;
}

.admin-account-access-heading > div > p:last-child {
  max-width: 680px;
  color: var(--access-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.admin-account-access-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid #a9dbc7;
  border-left: 5px solid var(--access-green);
  border-radius: 8px;
  background: var(--access-mint);
}

.admin-account-access-notice span {
  color: #355b50;
  line-height: 1.45;
}

.admin-account-access-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-account-access-summary article {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--access-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(19, 52, 89, 0.07);
}

.admin-account-access-summary article:nth-child(1) { border-top: 4px solid #19a974; background: var(--access-mint); }
.admin-account-access-summary article:nth-child(2) { border-top: 4px solid #2474df; background: var(--access-sky); }
.admin-account-access-summary article:nth-child(3) { border-top: 4px solid #d65a6f; background: var(--access-rose); }
.admin-account-access-summary article:nth-child(4) { border-top: 4px solid #7757c5; background: var(--access-lilac); }

.admin-account-access-summary span,
.admin-account-access-summary small {
  display: block;
  color: var(--access-muted);
}

.admin-account-access-summary span {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.admin-account-access-summary b {
  display: block;
  margin: 6px 0 4px;
  color: var(--access-ink);
  font-size: 1.9rem;
  line-height: 1;
}

.admin-account-access-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.7fr);
  gap: 18px;
  align-items: start;
}

.admin-account-create-card,
.admin-account-directory {
  border: 1px solid var(--access-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(19, 52, 89, 0.08);
}

.admin-account-create-card {
  position: sticky;
  top: 108px;
  overflow: hidden;
}

.admin-account-create-card > header {
  gap: 12px;
  padding: 18px;
  color: #fff;
  background: #103e73;
}

.admin-account-create-card > header > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.5rem;
}

.admin-account-create-card > header p,
.admin-account-create-card > header h3 {
  color: #fff;
}

.admin-account-create-card > header p,
.admin-account-directory > header p,
.admin-account-link-result p {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-account-create-card form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-account-create-card label,
.admin-account-directory-tools label,
.admin-account-role-field {
  display: grid;
  gap: 6px;
  color: var(--access-ink);
  font-weight: 800;
}

.admin-account-create-card input,
.admin-account-create-card select,
.admin-account-directory-tools input,
.admin-account-directory-tools select,
.admin-account-role-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #adc4dc;
  border-radius: 7px;
  background: #fff;
  color: var(--access-ink);
  font: inherit;
  padding: 10px 12px;
}

.admin-account-create-card input:focus,
.admin-account-create-card select:focus,
.admin-account-directory-tools input:focus,
.admin-account-directory-tools select:focus,
.admin-account-role-field select:focus {
  outline: 3px solid rgba(18, 98, 214, 0.2);
  border-color: var(--access-blue);
}

.admin-account-role-help {
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 7px;
  background: var(--access-sky);
  color: #385c7e;
  font-size: 0.84rem;
  line-height: 1.4;
}

.admin-account-form-status {
  min-height: 20px;
  color: var(--access-muted);
  font-size: 0.85rem;
}

.admin-account-form-status[data-state="error"] { color: #a92842; }
.admin-account-form-status[data-state="success"] { color: #08714f; }

.admin-account-directory > header {
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--access-line);
}

.admin-account-directory > header > span {
  color: var(--access-muted);
  font-size: 0.86rem;
  text-align: right;
}

.admin-account-directory-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(170px, 0.6fr);
  gap: 12px;
  padding: 14px 18px;
  background: #f5f9fd;
  border-bottom: 1px solid var(--access-line);
}

.admin-account-list {
  display: grid;
  gap: 0;
}

.admin-account-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(180px, 0.8fr) minmax(200px, 1fr);
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #dce6f0;
}

.admin-account-row:last-child { border-bottom: 0; }
.admin-account-row[data-account-disabled="true"] { background: #fff8f9; }
.admin-account-row[data-account-owner="true"] { background: #f1f8ff; }

.admin-account-row-heading {
  gap: 12px;
  align-items: flex-start;
}

.admin-account-avatar {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #dcecff;
  color: #0e55b0;
  font-weight: 900;
}

.admin-account-row-heading b,
.admin-account-row-heading span,
.admin-account-row-heading small {
  display: block;
  overflow-wrap: anywhere;
}

.admin-account-row-heading span {
  margin: 3px 0 5px;
  color: var(--access-muted);
  font-size: 0.86rem;
}

.admin-account-row-heading small,
.admin-account-row-state small {
  color: var(--access-muted);
  line-height: 1.4;
}

.admin-account-owner-mark,
.admin-account-state-pill {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.admin-account-owner-mark { background: #dcecff; color: #0d55b1; }
.admin-account-state-pill.is-active { background: #dff6eb; color: #08714f; }
.admin-account-state-pill.is-disabled { background: #ffe1e6; color: #9e263e; }
.admin-account-state-pill.is-unverified { background: #fff0c7; color: #7e5700; }

.admin-account-row-state {
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
}

.admin-account-row-actions {
  align-items: stretch;
  flex-direction: column;
  gap: 9px;
}

.admin-account-row-actions .btn {
  min-height: 39px;
  width: 100%;
}

.admin-account-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.admin-account-secondary-actions .btn {
  padding-inline: 8px;
  font-size: 0.78rem;
}

.admin-account-empty {
  display: grid;
  gap: 5px;
  padding: 34px 18px;
  text-align: center;
  color: var(--access-muted);
}

.admin-account-empty b { color: var(--access-ink); }

.admin-account-link-result {
  position: sticky;
  z-index: 20;
  bottom: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(260px, 1.25fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #83c9b0;
  border-radius: 8px;
  background: #effcf6;
  box-shadow: 0 18px 40px rgba(16, 42, 79, 0.18);
}

.admin-account-link-result[hidden] { display: none; }

.admin-account-link-result > div:first-child {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.admin-account-link-result input {
  min-width: 0;
  height: 44px;
  border: 1px solid #88bda9;
  border-radius: 7px;
  background: #fff;
  color: #234a3d;
  padding: 9px 11px;
}

.admin-account-link-result > div:last-child {
  gap: 8px;
}

.admin-account-link-result .btn {
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .admin-account-access-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-account-access-workspace { grid-template-columns: 1fr; }
  .admin-account-create-card { position: static; }
  .admin-account-row { grid-template-columns: minmax(200px, 1.2fr) minmax(170px, 0.8fr); }
  .admin-account-row-actions { grid-column: 1 / -1; }
  .admin-account-link-result { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .admin-account-access-panel { padding: 16px; }
  .admin-account-access-heading { align-items: stretch; flex-direction: column; }
  .admin-account-access-heading .btn { width: 100%; }
  .admin-account-access-notice { grid-template-columns: 1fr; }
  .admin-account-access-summary { grid-template-columns: 1fr 1fr; }
  .admin-account-access-summary article { min-height: 96px; }
  .admin-account-directory-tools,
  .admin-account-row { grid-template-columns: 1fr; }
  .admin-account-row-actions { grid-column: auto; }
  .admin-account-secondary-actions { grid-template-columns: 1fr; }
  .admin-account-link-result > div:last-child { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .admin-account-access-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  .admin-account-row,
  .admin-account-access-summary article {
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  }

  .admin-account-row:hover {
    border-color: #a8c5e2;
    box-shadow: inset 4px 0 0 #4a8de1;
  }

  .admin-account-access-summary article:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(19, 52, 89, 0.11);
  }
}
