/* Shared dropdown + modal components for /admin/dashboard and /admin/scenarios */

/* ── Click-to-toggle dropdown (per-row actions) ──────────────────────────── */
.admin-dropdown {
  position: relative;
  display: inline-block;
}

.admin-dropdown-trigger {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-family: inherit; /* buttons don't inherit font-family by default — without this, pages that lack a legacy `* { font-family }` reset fall back to the browser's default (Arial) instead of matching the page's Poppins body font */
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-dropdown-trigger:hover,
.admin-dropdown-trigger.is-active {
  background: #e2e8f0;
  color: #1e293b;
}

.admin-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.14);
  min-width: 200px;
  overflow: hidden;
  z-index: 150; /* above .admin-nav's z-index:100 — the menu is portaled to <body> on open, so it becomes a nav sibling */
  text-align: left;
}

.admin-dropdown-menu.is-open {
  display: block;
}

.admin-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #334155;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-dropdown-item:hover {
  background: #f1f5f9;
}

.admin-dropdown-item-danger {
  color: #dc2626;
}

.admin-dropdown-item-danger:hover {
  background: #fef2f2;
}

.admin-dropdown-divider {
  height: 1px;
  background: #edf1f7;
  margin: 4px 0;
}

/* ── Modal (confirmations + Reset Password / Change Email forms) ────────── */
.admin-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
}

.admin-modal-backdrop.is-open {
  display: flex;
}

.admin-modal-box {
  background: white;
  padding: 1.75rem;
  border-radius: 14px;
  width: 420px;
  max-width: 90%;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.admin-modal-box h3 {
  margin: 0 0 0.5rem;
  color: #1e293b;
  font-size: 1.1rem;
}

.admin-modal-box p {
  margin: 0 0 1.1rem;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-modal-field {
  margin-bottom: 1rem;
}

.admin-modal-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.admin-modal-field input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.admin-modal-field input:focus {
  outline: none;
  border-color: #6366f1;
}

.admin-modal-row {
  display: flex;
  gap: 0.5rem;
}

.admin-modal-row input {
  flex: 1;
}

.admin-modal-generate-btn {
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.admin-modal-generate-btn:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
}

.admin-modal-error {
  display: none;
  color: #dc2626;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.admin-modal-error.is-visible {
  display: block;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.admin-btn-danger,
.admin-btn-secondary,
.admin-btn-primary {
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.admin-btn-danger {
  background: #dc2626;
  color: white;
}

.admin-btn-danger:hover {
  background: #b91c1c;
}

.admin-btn-secondary {
  background: #f1f5f9;
  color: #334155;
}

.admin-btn-secondary:hover {
  background: #e2e8f0;
}

.admin-btn-primary {
  background: #4338ca;
  color: white;
}

.admin-btn-primary:hover {
  background: #3730a3;
}
