/* ==========================================================================
   AI-CEPH - Estilos de la Sección "Mi Cuenta y Gestión Clínica de Pacientes"
   ========================================================================== */

.account-page-body {
  background: #f8fafc;
  color: #1e293b;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.account-main-wrapper {
  flex: 1 0 auto;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) 20px;
  box-sizing: border-box;
}

/* Encabezado del Dashboard */
.account-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 28px 32px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  flex-wrap: wrap;
}

.account-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.account-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b5cab 0%, #0284c7 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(11, 92, 171, 0.4);
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.account-hero-info h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.account-hero-info p {
  font-size: 0.92rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-hero-analyzer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #0b5cab 0%, #0284c7 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(11, 92, 171, 0.35);
}

.btn-hero-analyzer:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 92, 171, 0.45);
}

/* Barra de Pestañas del Dashboard */
.account-nav-tabs {
  display: flex;
  gap: 8px;
  background: #ffffff;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.account-nav-tabs::-webkit-scrollbar {
  display: none;
}

.account-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: inherit;
}

.account-tab-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
}

.account-tab-link:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.account-tab-link.active {
  background: #0b5cab;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(11, 92, 171, 0.25);
}

.account-tab-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.account-tab-link.active .account-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Vistas de Contenido */
.account-view-section {
  display: none;
  animation: accountViewFade 0.2s ease forwards;
}

.account-view-section.active {
  display: block;
}

@keyframes accountViewFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tarjeta Estándar de Sección */
.account-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  padding: 32px;
  margin-bottom: 24px;
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.account-card-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-card-header p {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 4px;
}

/* Barra de Herramientas de Pacientes (Búsqueda y Botón Nuevo) */
.patients-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.patients-search-box {
  position: relative;
  flex: 1;
  max-width: 440px;
  min-width: 240px;
}

.patients-search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.patients-search-input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.92rem;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.patients-search-input:focus {
  outline: none;
  border-color: #0b5cab;
  box-shadow: 0 0 0 3px rgba(11, 92, 171, 0.15);
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: linear-gradient(135deg, #0b5cab 0%, #0284c7 100%);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(11, 92, 171, 0.28);
  font-family: inherit;
}

.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 92, 171, 0.38);
}

/* Grilla de Pacientes */
.patients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.patient-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.patient-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.patient-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.patient-avatar-chip {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0b5cab;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.patient-name-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 3px;
}

.patient-record-tag {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.patient-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.patient-badge {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.patient-notes-preview {
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 18px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  font-style: italic;
  max-height: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.patient-card-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.patient-action-btn {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.patient-action-btn.btn-analyze {
  background: #eff6ff;
  color: #0b5cab;
}

.patient-action-btn.btn-analyze:hover {
  background: #dbeafe;
}

.patient-action-btn.btn-outline {
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.patient-action-btn.btn-outline:hover {
  background: #f8fafc;
  color: #0f172a;
}

.patient-action-btn.btn-delete-icon {
  background: transparent;
  color: #94a3b8;
  padding: 7px;
}

.patient-action-btn.btn-delete-icon:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Grilla de Análisis Cefalométricos */
.analyses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.analysis-record-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.analysis-record-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.analysis-patient-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.analysis-date-badge {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.analysis-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0 18px;
}

.analysis-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.analysis-result-label {
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analysis-result-val {
  font-weight: 700;
  color: #0b5cab;
}

/* Estado Vacío (Empty State) */
.empty-state-box {
  text-align: center;
  padding: 48px 20px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  color: #64748b;
}

.empty-state-box svg {
  width: 48px;
  height: 48px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.empty-state-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.empty-state-box p {
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 auto 20px;
}

/* Modales para Pacientes */
.patient-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: all 0.2s ease;
}

.patient-modal-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.patient-modal-dialog {
  width: 100%;
  max-width: 540px;
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  position: relative;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.patient-modal-overlay.is-active .patient-modal-dialog {
  transform: scale(1);
}
