/**
 * MCP Gateway auth-web — healthcare login + User menu panel.
 */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  --teal:       #006d68;
  --teal-dark:  #005850;
  --beige:      #f4f1eb;
  --white:      #ffffff;
  --text:       #1a202c;
  --muted:      #6b7280;
  --border:     #e1e5e9;
  --success:    #10b981;
  --error:      #dc2626;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--beige);
}

/* ── Page shell ──────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── User menu (same pattern as webapp — no Dashboard / sidebar) ───── */
.login-user-panel {
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.login-user-panel .login-nav-group {
  gap: 2px;
}
.login-user-panel .login-nav-submenu {
  margin: 4px 0 0;
  padding: 4px 0 4px 6px;
  background: transparent;
  border-radius: 0;
}
.login-user-panel .login-nav-sub:hover {
  background: #f3f4f6;
}
.login-user-panel .login-nav-item--toggle {
  background: #eef0f4;
  border-radius: 10px;
}

.login-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  font-size: 14px;
  border: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}
.login-nav-item:hover:not(.login-nav-item--active) {
  background: #f3f4f6;
}
.login-nav-item--active {
  background: linear-gradient(90deg, #4f8fd9 0%, #6b7c96 100%);
  color: #fff;
  box-shadow: 0 1px 8px rgba(79, 143, 217, 0.25);
}
.login-nav-item--active .login-nav-icon {
  color: rgba(255, 255, 255, 0.95);
}
.login-nav-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
.login-nav-icon--amber { color: #b45309; }
.login-nav-icon--violet { color: #7c3aed; }
.login-nav-icon--slate { color: #475569; }
.login-nav-icon--muted { color: #9ca3af; }

.login-nav-label { flex: 1; min-width: 0; }
.login-nav-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  transition: transform 0.18s ease;
}
.login-nav-item--toggle[aria-expanded="true"] .login-nav-chevron {
  transform: rotate(0deg);   /* down arrow = open */
}
.login-nav-item--toggle[aria-expanded="false"] .login-nav-chevron {
  transform: rotate(-90deg); /* right arrow = closed */
}

.login-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.login-nav-submenu {
  margin: 2px 0 2px 4px;
  padding: 8px 6px 8px 8px;
  background: #eef1f6;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.login-nav-group--collapsed .login-nav-submenu {
  display: none;
}

.login-nav-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
}
button.login-nav-sub {
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.login-nav-sub:hover,
button.login-nav-sub:hover {
  background: #e2e8f0;
}

/* ── Top bar ─────────────────────────────────────────────────────── */
.top-bar {
  flex-shrink: 0;
  width: 100%;
  height: 72px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: relative;
  z-index: 10;
}
.top-logo {
  height: 60%;
  width: auto;
  margin-left: 28px;
  object-fit: contain;
}
.top-bar-link {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--teal);
  color: var(--teal);
  border-radius: 6px;
  cursor: pointer;
  font: 500 14px inherit;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.top-bar-link:hover { background: var(--teal); color: var(--white); }

/* ── Split: User panel | hero | login ───────────────────────────── */
.login-split-container {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(228px, 276px) minmax(0, 1.05fr) minmax(280px, 1fr);
  min-height: calc(100vh - 72px);
  overflow: hidden;
}

/* before login / non-admin: collapse nav column, show only image + form.
   Give the form side more room so the card doesn't look small in a big screen. */
.login-split-container.no-nav {
  grid-template-columns: minmax(0, 1fr) minmax(680px, 1fr);
}
.login-split-container.no-nav .login-left-nav-column {
  display: none;
}

.login-left-nav-column {
  background: var(--beige);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  padding: 36px 18px 48px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.login-left-nav-column .login-user-panel {
  margin-bottom: 0;
  max-width: none;
  width: 100%;
}

/* ── Center: hero image ──────────────────────────────────────────── */
.login-left-side {
  position: relative;
  overflow: hidden;
  background: #004d48;
}
.login-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
}

/* ── Right: beige panel ──────────────────────────────────────────── */
.login-right-side {
  background: var(--beige);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 40px;
  overflow-y: auto;
}

/* ── Card wrapper (centres the card inside the right column) ─────── */
.login-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Card ────────────────────────────────────────────────────────── */
.login-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  padding: 110px 60px;
  width: 100%;
  max-width: 680px;
  border: 1px solid rgba(0,0,0,0.06);
}

/* ── Card header (sign-in view) ──────────────────────────────────── */
.login-header--signin {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 34px;
}
.login-header-top-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--teal);
}
.login-bridge-icon--header {
  width: 60px;
  height: auto;
}
.login-title-main {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
}
.login-title-sub {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* ── Card header (loading / OTP views) ──────────────────────────── */
.login-header {
  text-align: center;
  margin-bottom: 24px;
}
.login-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.login-header p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* ── Form sections (sections use hidden attr — JS toggles them) ── */
section.login-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Form groups ─────────────────────────────────────────────────── */
.login-form-fields {
  display: flex;
  flex-direction: column;
}
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 38px;
}
.form-group label {
  font-size: 17px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 10px;
}
.form-group input {
  width: 100%;
  padding: 20px 22px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 19px;
  background: var(--white);
  color: #111;
  caret-color: #111;
  -webkit-text-fill-color: #111;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,109,104,0.12);
}
input:-webkit-autofill {
  -webkit-text-fill-color: #111 !important;
  box-shadow: 0 0 0 1000px white inset !important;
}

/* ── Input with left icon ────────────────────────────────────────── */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  display: flex;
  align-items: center;
}
.input-has-left-icon {
  padding-left: 50px !important;
}

/* ── Password toggle ─────────────────────────────────────────────── */
.password-input-container {
  position: relative;
  display: flex;
  align-items: center;
}
.password-input {
  width: 100%;
  padding-right: 52px;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.password-toggle:hover { color: #374151; }
.password-toggle svg { width: 20px; height: 20px; stroke-width: 2; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.login-button {
  width: 100%;
  padding: 16px;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font: 600 17px inherit;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.login-button:hover:not(:disabled) {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,109,104,0.22);
}
.login-button:disabled { opacity: 0.65; cursor: not-allowed; }

/* ── Social / divider ────────────────────────────────────────────── */
.social-login-section { margin-top: 24px; }
.divider {
  display: flex;
  align-items: center;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}
.divider span { padding: 0 14px; }

.google-signin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--white);
  color: #1f1f1f;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font: 500 16px inherit;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.google-signin-btn:hover:not(:disabled) {
  background: #f9fafb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.google-signin-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.error-message, .config-error {
  background: #fff5f5;
  color: #c53030;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid #fecaca;
  margin-bottom: 16px;
  line-height: 1.5;
}
.neutral-hint {
  background: #f0f9ff;
  color: #0c4a6e;
  border: 1px solid #bae6fd;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── OTP section ─────────────────────────────────────────────────── */
.otp-verification {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.otp-header { text-align: center; margin-bottom: 20px; }
.otp-header h2 { font-size: 22px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.otp-header p  { font-size: 14px; color: var(--muted); margin: 0; word-break: break-word; }
.otp-header strong { color: var(--text); }

.otp-input-full {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.35em;
}
.otp-input-full::placeholder {
  letter-spacing: normal;
  font-weight: 400;
  font-size: 15px;
}
.otp-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: var(--error);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  width: 100%;
  text-align: center;
  font-size: 14px;
}
.otp-verify-button {
  width: 100%;
  padding: 13px 24px;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font: 600 15px inherit;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.15s;
}
.otp-verify-button:hover:not(:disabled) { background: var(--teal-dark); }
.otp-verify-button:disabled { background: #9ca3af; cursor: not-allowed; }

.otp-footer { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.otp-resend-button, .otp-cancel-button {
  padding: 10px 20px;
  border-radius: 8px;
  font: 500 14px inherit;
  cursor: pointer;
  width: 100%;
  min-height: 42px;
  transition: all 0.15s;
}
.otp-resend-button {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
}
.otp-resend-button:hover:not(:disabled) { background: #f0fafa; }
.otp-resend-button:disabled { color: #9ca3af; border-color: #d1d5db; cursor: not-allowed; }

.otp-cancel-button {
  background: transparent;
  color: var(--muted);
  border: 1px solid #d1d5db;
}
.otp-cancel-button:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }

/* ── Done / success ──────────────────────────────────────────────── */
.otp-success {
  background: #d1fae5;
  border: 2px solid var(--success);
  color: #065f46;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.otp-success-icon {
  background: var(--success);
  color: var(--white);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: bold; flex-shrink: 0;
}
.otp-success-message { text-align: left; }
.otp-success-message strong { display: block; font-size: 15px; margin-bottom: 4px; color: #065f46; }
.otp-success-message p { margin: 0; font-size: 13px; color: #047857; }

/* ── Token box ───────────────────────────────────────────────────── */
.mcp-token-box {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  border-radius: 8px;
  max-height: 140px;
  overflow: auto;
  width: 100%;
  color: #111;
  margin: 0 0 10px;
}
.mcp-session-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }

/* ── Footer ──────────────────────────────────────────────────────── */
.mcp-page-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  max-width: 500px;
  margin: 20px auto 0;
  padding: 0 20px 24px;
  line-height: 1.5;
}

/* ── hidden attribute ────────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .login-split-container {
    grid-template-columns: 1fr;
  }
  .login-left-side { display: none; }
  .login-left-nav-column {
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 24px 20px;
    justify-content: center;
  }
  .login-left-nav-column .login-user-panel {
    max-width: 560px;
  }
  .login-right-side { padding: 28px 20px 40px; }
}
@media (max-width: 480px) {
  .login-card { padding: 36px 24px; }
  .login-title-main {
    font-size: 19px;
    white-space: normal;
  }
}

/* ── User Management Modals ───────────────────────────────────────────────── */
.um-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.um-modal[hidden] { display: none; }
.um-optional-hint {
  font-weight: 400;
  color: #6b7280;
  font-size: 0.9em;
}
.um-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.um-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.um-modal-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.um-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.um-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
}
.um-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.um-modal-close:hover { background: #f3f4f6; color: #374151; }

.um-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.um-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a2e;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.um-select:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12); }

/* Modal messages */
.um-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  background: #f9fafb;
  color: #374151;
  margin: 0;
}
.um-msg--error  { background: #fef2f2; color: #dc2626; }
.um-msg--success { background: #f0fdf4; color: #15803d; }

/* Team list (replaced by table) */
.um-empty-state {
  text-align: center;
  padding: 28px 16px;
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

/* ── Wide modal variant ──────────────────────────────────────────────────── */
.um-modal--wide .um-modal-box {
  width: min(1320px, calc(100vw - 24px));
  padding: 24px 24px 20px;
  gap: 14px;
  overflow-y: visible; /* table-wrap handles its own scroll */
}

/* ── Toolbar: search + filters  (exact webapp: team-filters-section-enhanced) */
.um-table-toolbar {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
/* search  (exact webapp: team-search-input-enhanced) */
.um-search {
  flex: 1;
  min-width: 180px;
  height: 32px;
  padding: 6px 10px 6px 32px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: #0f172a;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
  transition: all 0.2s ease;
  outline: none;
}
.um-search::placeholder { color: #94a3b8; }
.um-search:focus { border-color: #cbd5e1; box-shadow: 0 0 0 3px rgba(99,102,241,0.08); }

/* filter dropdowns  (exact webapp: team-status-filter-dropdown) */
.um-filter-select {
  height: 32px;
  padding: 6px 28px 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
  background-size: 12px;
  appearance: none;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  min-width: 120px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  outline: none;
}
.um-filter-select:hover { background-color: #f8fafc; border-color: #cbd5e1; }
.um-filter-select:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.10); }
.um-filter-select option { background: white; color: #475569; font-weight: 600; }

/* ── Table wrapper  (exact webapp: manager-table-container) ──────────────── */
.um-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  width: 100%;
  position: relative;
}
.um-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  table-layout: auto;
}
/* header  (exact webapp: gradient-primary + th styles) */
.um-table thead tr {
  background: linear-gradient(135deg, #2187bd 0%, #6e6f71 100%);
  color: white;
}
.um-table thead th {
  padding: 8px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: top;
  color: white;
  white-space: nowrap;
}
.um-table thead th:first-child { padding-left: 12px; }
/* rows  (exact webapp: manager-row + hover) */
.um-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}
.um-table tbody tr:hover { background-color: rgba(37,99,235,0.06); }
.um-table tbody tr:last-child td { border-bottom: none; }
/* cells  (exact webapp: manager-cell) */
.um-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.5;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.um-table td:first-child { padding-left: 12px; }
.um-table tbody tr:last-child td { border-bottom: none; }

/* name cell */
.um-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.um-table-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2187bd, #6e6f71);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.um-table-name { font-weight: 600; color: #1f2937; white-space: nowrap; }
.um-td-email   { color: #6b7280; font-size: 12.5px; white-space: nowrap; }
.um-td-meta    { color: #6b7280; font-size: 12.5px; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* role pills  (exact webapp: manager-role-pill-*) */
.um-role-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.um-role--admin    { background: #f0fdf4; color: #16a34a; }
.um-role--manager  { background: #fff7ed; color: #f97316; }
.um-role--recruiter{ background: #f0fdf4; color: #16a34a; }
.um-role--default  { background: #f3f4f6; color: #6b7280; }

/* status badges  (exact webapp: status-badge.*) */
.um-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.um-status--active    { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.um-status--inactive  { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.um-status--suspended { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.um-status--deleted   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Actions column  (exact webapp: ActionMenu.css) ──────────────────────── */
.um-td-actions { width: 44px; text-align: center; padding: 6px 4px !important; vertical-align: middle !important; }
.um-action-wrap { position: relative; display: inline-block; z-index: 1; }
/* trigger  (exact webapp: action-menu-trigger) */
.um-dots-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}
.um-dots-btn:hover  { background: #f9fafb; border-color: #d1d5db; color: #374151; }
.um-dots-btn:focus  { outline: 2px solid #3b82f6; outline-offset: 2px; }
/* dropdown  (exact webapp: action-menu-dropdown) */
.um-action-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  z-index: 10000;
  min-width: 180px;
  max-width: 250px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  padding: 4px;
  animation: um-menu-fade 0.15s ease-out;
  overflow: visible;
}
@keyframes um-menu-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* items  (exact webapp: action-menu-item) */
.um-action-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  text-align: left;
  transition: all 0.15s ease;
}
.um-action-item:hover    { background: #f3f4f6; color: #111827; }
.um-action-item:active   { transform: scale(0.98); }
.um-action-item--danger  { color: #dc2626; }
.um-action-item--danger:hover { background: #fef2f2; color: #b91c1c; }
/* icon  (exact webapp: action-menu-icon) */
.um-action-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

/* ── View User Modal ─────────────────────────────────────────────────────── */
.um-modal-box--view { width: min(460px, calc(100vw - 32px)); }
.um-view-body { display: flex; flex-direction: column; gap: 18px; }
.um-view-header {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 16px; border-bottom: 1px solid #e5e7eb;
}
.um-view-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #2187bd, #6e6f71);
  color: #fff; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.um-view-name  { font-size: 17px; font-weight: 700; color: #0f172a; }
.um-view-email { font-size: 13px; color: #6b7280; margin-top: 2px; }
.um-view-grid  { display: flex; flex-direction: column; gap: 10px; }
.um-view-field { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; }
.um-view-label { min-width: 100px; font-weight: 600; color: #94a3b8; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; }
.um-view-val   { color: #1f2937; }
.um-view-mono  { font-family: ui-monospace, monospace; font-size: 12px; color: #475569; }

/* ── Webapp-style modals (View, Modify, Suspend, Delete) ─────────────────── */
.um-modal-box--webapp {
  width: min(672px, calc(100vw - 32px));
  padding: 0;
  gap: 0;
  max-height: calc(100vh - 48px);
  /* flex column so header+footer stay fixed, content scrolls */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3), 0 10px 10px -5px rgba(0,0,0,0.1);
}
.um-modal-box--md { width: min(448px, calc(100vw - 32px)); }

/* fixed header (flex child, no sticky needed) */
.um-wb-header {
  flex-shrink: 0;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px 14px 0 0;
}
.um-wb-title { font-size: 20px; font-weight: 600; color: #111827; margin: 0; }
.um-wb-title--danger { color: #dc2626; }
.um-wb-close {
  background: none; border: none; cursor: pointer;
  color: #9ca3af; padding: 4px; border-radius: 4px;
  transition: color 0.15s;
  display: flex; align-items: center;
}
.um-wb-close:hover { color: #4b5563; }
.um-wb-close-icon { width: 24px; height: 24px; }

/* scrollable content area */
.um-wb-content { padding: 16px 24px; overflow-y: auto; flex: 1; }

/* 2-column grid (matches webapp grid grid-cols-2) */
.um-wb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.um-wb-field { display: flex; flex-direction: column; gap: 4px; }
.um-wb-field--full { grid-column: 1 / -1; }

.um-wb-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}
/* read-only display box (View modal) */
.um-wb-display {
  font-size: 14px;
  color: #111827;
  background: #f9fafb;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  min-height: 36px;
  display: flex;
  align-items: center;
}
/* editable inputs (Modify modal) */
.um-wb-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
  background: white;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.um-wb-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.25); }
.um-wb-input--readonly { color: #6b7280; background: #f9fafb; cursor: not-allowed; }
.um-wb-select { appearance: none; cursor: pointer; }
.um-wb-hint { margin: 4px 0 0; font-size: 12px; color: #6b7280; }

/* alerts */
.um-wb-alert {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid;
}
.um-wb-alert.um-wb-alert--error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.um-wb-alert.um-wb-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* body text in confirm modals */
.um-wb-body-text { font-size: 14px; color: #4b5563; line-height: 1.6; margin: 0 0 12px; }

/* info card (Suspend modal: name/email/role summary) */
.um-wb-info-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.um-wb-info-row { display: flex; gap: 8px; font-size: 14px; color: #111827; }
.um-wb-info-label { font-size: 12px; font-weight: 500; color: #6b7280; min-width: 48px; }

/* notice boxes */
.um-wb-notice {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid;
}
.um-wb-notice--yellow { background: #fefce8; border-color: #fde68a; color: #92400e; }
.um-wb-notice--blue   { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* fixed footer (flex child) */
.um-wb-footer {
  flex-shrink: 0;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-radius: 0 0 14px 14px;
}
.um-wb-footer--gray { background: #f9fafb; }

/* footer buttons */
.um-wb-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid;
}
.um-wb-btn--cancel  { background: white; border-color: #d1d5db; color: #374151; }
.um-wb-btn--cancel:hover { background: #f9fafb; }
.um-wb-btn--primary { background: #2563eb; border-color: #2563eb; color: white; }
.um-wb-btn--primary:hover:not(:disabled) { background: #1d4ed8; }
.um-wb-btn--warning { background: #d97706; border-color: #d97706; color: white; }
.um-wb-btn--warning:hover { background: #b45309; }
.um-wb-btn--success { background: #16a34a; border-color: #16a34a; color: white; }
.um-wb-btn--success:hover { background: #15803d; }
.um-wb-btn--danger  { background: #dc2626; border-color: #dc2626; color: white; }
.um-wb-btn--danger:hover:not(:disabled) { background: #b91c1c; }
.um-wb-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* form inside Modify modal must also be a flex column so footer stays pinned */
#form-modify-user {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.um-modal-box--sm { width: min(420px, calc(100vw - 32px)); }
.um-confirm-body {
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  margin: 0;
}
.um-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.um-btn-secondary {
  padding: 9px 20px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.um-btn-secondary:hover { background: #f9fafb; }
.um-btn-warning {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: #f59e0b;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.um-btn-warning:hover { background: #d97706; }
.um-btn-danger {
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.um-btn-danger:hover:not(:disabled) { background: #b91c1c; }
.um-btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }
.um-input-readonly {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #9ca3af;
  background: #f9fafb;
}
.um-readonly-note { font-size: 11px; color: #9ca3af; font-weight: 400; margin-left: 4px; }

/* ── Source Access / Role Features panel ─────────────────────────────── */
.um-modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: #64748b;
}
.um-msg--ok { background: #ecfdf5; color: #047857; }
.um-msg--warn { background: #fffbeb; color: #b45309; }
.um-perm-table th,
.um-perm-table td {
  text-align: center;
  vertical-align: middle;
}
.um-perm-table th:first-child,
.um-perm-table td.um-perm-source {
  text-align: left;
  font-weight: 600;
  color: #0f172a;
  min-width: 160px;
}
.um-perm-cell { min-width: 110px; }
.um-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.um-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.um-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}
.um-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.um-toggle-input:checked + .um-toggle-track {
  background: #2563eb;
}
.um-toggle-input:checked + .um-toggle-track::after {
  transform: translateX(20px);
}
.um-toggle-input:disabled + .um-toggle-track {
  opacity: 0.55;
}
.um-toggle-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  min-width: 28px;
}
.um-toggle-input:checked ~ .um-toggle-label {
  color: #2563eb;
}
.um-toggle--blocked .um-toggle-track {
  opacity: 0.75;
}

.um-modal--tall .um-modal-box {
  max-height: calc(100vh - 48px);
}
.um-modal--wide.um-modal--tall .um-modal-box {
  max-height: calc(100vh - 28px);
}
.um-table-wrap--scroll {
  max-height: min(58vh, 520px);
  overflow: auto;
}
.um-modal--wide.um-modal--tall .um-table-wrap--scroll {
  max-height: min(72vh, 700px);
}
.um-perm-group-row td {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  text-align: left !important;
  padding-top: 14px;
  padding-bottom: 8px;
  border-top: 1px solid #e2e8f0;
}
.um-perm-tool-row td.um-perm-tool {
  text-align: left;
  padding-left: 28px;
  color: #334155;
  max-width: 340px;
  min-width: 220px;
  vertical-align: middle;
}
.um-perm-tool-row--expandable {
  cursor: pointer;
}
.um-perm-tool-row--expandable:hover td.um-perm-tool {
  background: #f8fafc;
}
.um-perm-tool-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 13px;
  margin-bottom: 2px;
  text-transform: capitalize;
}
.um-perm-tool-text {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.um-perm-tool-row--expanded .um-perm-tool-text {
  -webkit-line-clamp: unset;
  overflow: visible;
  color: #334155;
}
.um-perm-tool-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}
.um-perm-tool-row--expanded .um-perm-tool-hint {
  color: #64748b;
}
.um-perm-count {
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748b;
  text-align: right;
}
.um-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}

