/* ==========================================================================
   PMS - Auth screens, sidebar profile & account management styles.
   ========================================================================== */

/* ---------- Login / setup overlay ---------- */
#auth-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background:
    radial-gradient(1200px 500px at 30% -10%, var(--primary-soft), transparent 60%),
    radial-gradient(900px 400px at 110% 110%, var(--info-soft), transparent 55%),
    var(--bg);
}

.shell-min {
  width: min(430px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

/* The wordmark is sized by height and given its width by the aspect ratio,
   so it scales cleanly and never distorts. `max-width: 100%` keeps it inside
   the card on a narrow screen. */
.auth-logo {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.auth-logo img {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.auth-card {
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
}

.auth-title {
  margin-block-start: 0;
  margin-block-end: var(--space-2);
}

.auth-actions {
  margin-block-start: var(--space-3);
}

.auth-error {
  margin-block-start: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.85rem;
}

/* ---------- shared form helpers ---------- */
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-block-end: 6px;
}

.input-block {
  box-sizing: border-box;
  width: 100%;
}

/* ---------- sidebar profile (current user + logout) ---------- */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-block-start: 1px solid var(--border);
}

.sidebar-profile .sp-info {
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}

.sidebar-profile .sp-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile .sp-role {
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* ---------- account management (settings > accounts) ---------- */
.account-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-block-end: 1px solid var(--border);
}

.account-row:last-child { border-block-end: none; }

.account-row .ar-main { flex: 1; min-width: 0; }

.account-row .ar-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-row .ar-meta {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.role-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.role-badge.admin { background: var(--danger-soft); color: var(--danger); }
.role-badge.manager { background: var(--primary-soft); color: var(--primary); }
.role-badge.member { background: var(--success-soft); color: var(--success); }