/* Authentication Overlay, Password Change Modal & Header User Controls */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand h1 { font-size: 1.32rem; font-weight: 800; color: #0f172a; }
.auth-brand p { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}
.auth-tab-btn {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.auth-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.auth-msg {
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  margin-bottom: 12px;
  display: none;
  line-height: 1.45;
}
.auth-msg.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; display: block; }
.auth-msg.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; display: block; }
.auth-footnote {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}
input[type="password"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 0.88rem;
  background-color: #f8fafc;
  color: var(--text-main);
  font-family: inherit;
}
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}
.modal-card h3 { font-size: 1rem; margin-bottom: 12px; color: #0f172a; }

.header-user-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.user-chip {
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}
.user-chip-btn {
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.user-chip-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.sidebar-mobile-actions {
  display: none;
}

@media (max-width: 900px) {
  .header-brand-right h1 { display: none; }
  .header-desktop-action { display: none; }
  .header-user-bar {
    border-left: none;
    padding-left: 0;
    gap: 4px;
    min-width: 0;
  }
  .user-chip {
    font-size: 0.72rem;
    padding: 4px 8px;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sidebar-mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
  }
}
