/* ============================================================
   STYLES.CSS — Dashboard Modules  |  Portal Médico
   ============================================================ */

/* ── Utility ─────────────────────────────────────────────── */
.bg-gradient, .bg-noise, .search-section { display: none !important; }
.results-section { padding: 4px 0; }
.text-right  { text-align: right; }
.text-center { text-align: center; }

/* ── Loading ─────────────────────────────────────────────── */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 40px; gap: 18px; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid #e8f0f9; border-top-color: #0071e3; border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: #8aa3be; font-size: 0.88rem; font-weight: 500; }

/* ── Empty / Error states ────────────────────────────────── */
.no-results { text-align: center; padding: 80px 40px; }
.no-results-icon { font-size: 3rem; margin-bottom: 16px; }
.no-results h3 { font-size: 1.2rem; color: #0f1f35; margin-bottom: 8px; font-weight: 700; }
.no-results p  { color: #8aa3be; font-size: 0.9rem; line-height: 1.6; }

.modulo-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 40px; background: white; border-radius: 24px;
  border: 1.5px dashed #c5d4e4; text-align: center;
}
.mes-icon { font-size: 3rem; margin-bottom: 22px; }
.modulo-empty-state h3 { font-size: 1.1rem; color: #0f1f35; margin-bottom: 8px; font-weight: 700; }
.modulo-empty-state p  { color: #8aa3be; font-size: 0.88rem; max-width: 260px; line-height: 1.65; }

/* ── Card base ───────────────────────────────────────────── */
.section-card {
  background: white;
  border-radius: 20px;
  border: 1px solid #e8f0f9;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(6,14,30,0.05), 0 1px 2px rgba(6,14,30,0.04);
}

.section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 24px 16px;
  border-bottom: 1px solid #f4f8fd;
  background: linear-gradient(135deg, #f8faff 0%, white 100%);
}
.section-header h3 { font-size: 0.97rem; font-weight: 700; color: #060e1e; flex: 1; margin: 0; }
.section-header span:first-child { font-size: 1rem; }
.section-badge {
  background: #eff6ff; color: #1a5fb4;
  font-size: 0.7rem; font-weight: 700;
  padding: 4px 11px; border-radius: 100px;
  letter-spacing: 0.05em; text-transform: uppercase;
  border: 1px solid #bfdbfe;
}

/* ── Profile hero card ───────────────────────────────────── */
.profile-card {
  background: linear-gradient(150deg, var(--blue-900, #020d1f) 0%, #061830 50%, #0a2347 100%);
  border-radius: 22px;
  padding: 30px 34px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(2,13,31,0.2), 0 2px 8px rgba(2,13,31,0.12);
}
.profile-card::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}
.profile-card::after {
  content: '';
  position: absolute; bottom: -80px; right: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(0,113,227,0.12) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; position: relative; z-index: 1; }
.profile-avatar {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(0,113,227,0.45), rgba(0,64,140,0.3));
  border-radius: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
  border: 1px solid rgba(0,113,227,0.35);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.profile-info h2 { color: white; font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.profile-info p  { color: rgba(255,255,255,0.4); font-size: 0.82rem; }

.profile-details { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; position: relative; z-index: 1; }
.detail-item {
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 13px 16px;
  transition: background 0.2s;
}
.detail-item:hover { background: rgba(255,255,255,0.09); }
.detail-item .label {
  color: rgba(255,255,255,0.3);
  font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  margin-bottom: 8px;
}
.detail-item .value { color: rgba(255,255,255,0.78); font-size: 0.87rem; font-weight: 500; }
.detail-item .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  background: rgba(0,113,227,0.28); color: #93c5fd;
  padding: 3px 10px; border-radius: 100px;
  font-size: 0.73rem; font-weight: 600;
  border: 1px solid rgba(0,113,227,0.22);
  white-space: nowrap;
}

/* ── Stats grid ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 22px; }

.stat-card {
  background: white; border-radius: 18px;
  padding: 24px 26px;
  border: 1px solid #e8f0f9;
  box-shadow: 0 2px 8px rgba(6,14,30,0.05);
  transition: all 0.24s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  border-radius: 18px 18px 0 0;
}
.stat-card.registros::before { background: linear-gradient(90deg, #0071e3, #38bdf8); }
.stat-card.unidades::before  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.stat-card.total::before     { background: linear-gradient(90deg, #d97706, #fbbf24); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(6,14,30,0.1); border-color: #c5d4e4; }

.stat-icon { font-size: 1.6rem; margin-bottom: 14px; display: block; }
.stat-card h3 {
  color: #8aa3be; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.stat-card .number {
  font-size: 2.1rem; font-weight: 800; color: #060e1e;
  line-height: 1; letter-spacing: -0.04em;
}

/* ── Summary table ───────────────────────────────────────── */
.zona-resumen-table-wrap { overflow-x: auto; }
.zona-resumen-table { width: 100%; border-collapse: collapse; }

.zona-resumen-table thead tr { background: #f8faff; }
.zona-resumen-table th {
  padding: 13px 20px;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #8aa3be; text-align: left;
  border-bottom: 1px solid #e8f0f9;
  white-space: nowrap;
}

.zona-resumen-table tbody tr { border-bottom: 1px solid #f4f8fd; transition: background 0.15s; }
.zona-resumen-table tbody tr:last-child { border-bottom: none; }
.zona-resumen-table tbody tr:hover { background: #f8faff; }
.zona-resumen-table td { padding: 15px 20px; font-size: 0.9rem; color: #1a2f4a; vertical-align: middle; }

.zona-resumen-table tfoot tr { background: #f4f8fd; border-top: 2px solid #e8f0f9; }
.zona-resumen-table tfoot td { padding: 14px 20px; font-size: 0.9rem; font-weight: 700; }

.zona-resumen-nombre { font-weight: 700; color: #060e1e; display: flex; align-items: center; gap: 10px; }
.zona-dot { width: 8px; height: 8px; background: #0071e3; border-radius: 50%; flex-shrink: 0; }
.zona-resumen-ciudad { font-size: 0.77rem; color: #8aa3be; margin-top: 3px; padding-left: 18px; }
.badge-productos {
  background: #eff6ff; color: #1a5fb4;
  padding: 4px 12px; border-radius: 100px;
  font-size: 0.76rem; font-weight: 700;
  border: 1px solid #bfdbfe;
}
.valor-zona { color: #15803d; font-weight: 700; font-size: 0.94rem; }
.valor-total-general { color: #0071e3; font-size: 0.97rem; font-weight: 800; }

/* ── Zona cards — Detalle ────────────────────────────────── */
.zona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px,1fr)); gap: 18px; padding: 20px 24px; }

.zona-card { background: #fafbff; border: 1px solid #e8f0f9; border-radius: 18px; overflow: hidden; transition: box-shadow 0.2s; }
.zona-card:hover { box-shadow: 0 8px 28px rgba(6,14,30,0.08); }

.zona-card-header { padding: 18px 22px 14px; background: white; border-bottom: 1px solid #f4f8fd; }
.zona-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.97rem; color: #060e1e; margin-bottom: 4px; }
.zona-icon  { font-size: 1rem; }
.zona-ciudad { font-size: 0.79rem; color: #8aa3be; padding-left: 26px; }

.zona-stats-row { display: flex; border-bottom: 1px solid #f4f8fd; background: white; }
.zona-stat { flex: 1; padding: 12px 22px; border-right: 1px solid #f4f8fd; }
.zona-stat:last-child { border-right: none; }
.zona-stat-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #8aa3be; margin-bottom: 4px; }
.zona-stat-value { font-size: 1.06rem; font-weight: 800; color: #060e1e; letter-spacing: -0.02em; }
.zona-stat-valor .zona-stat-value { color: #15803d; }

.zona-card-body { display: flex; gap: 0; padding: 16px 22px; }
.zona-chart-container { flex: 1; min-height: 160px; max-height: 220px; margin-right: 16px; }
.zona-table { min-width: 210px; font-size: 0.82rem; border-collapse: collapse; }
.zona-table th { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #8aa3be; padding: 6px 8px; border-bottom: 1px solid #e8f0f9; text-align: left; white-space: nowrap; }
.zona-table td { padding: 7px 8px; color: #1a2f4a; border-bottom: 1px solid #f4f8fd; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zona-subtotal td { background: #f8faff; font-weight: 700; border-top: 1.5px solid #e8f0f9; border-bottom: none; }

/* ── Mis Zonas ───────────────────────────────────────────── */
.zonas-impact-header {
  display: flex; align-items: center; justify-content: center; gap: 52px;
  background: linear-gradient(150deg, #020d1f 0%, #061830 50%, #0a2347 100%);
  border-radius: 22px; padding: 34px 44px; margin-bottom: 22px;
  box-shadow: 0 12px 40px rgba(2,13,31,0.2);
  position: relative; overflow: hidden;
}
.zonas-impact-header::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 30px 30px; pointer-events: none;
}
.zia-stat { text-align: center; position: relative; }
.zia-number { font-size: 2.6rem; font-weight: 800; color: white; letter-spacing: -0.05em; line-height: 1; margin-bottom: 6px; }
.zia-label  { font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.09em; }
.zia-divider { width: 1px; height: 52px; background: rgba(255,255,255,0.1); }

.zonas-impact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; padding: 20px 24px; }

.zona-impact-card {
  background: white; border-radius: 16px; padding: 18px 20px;
  border: 1px solid #e8f0f9; border-left: 3px solid var(--zona-color, #0071e3);
  transition: all 0.22s; cursor: default;
}
.zona-impact-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(6,14,30,0.1); }

.zic-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.zic-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.zic-info { flex: 1; min-width: 0; }
.zic-nombre { display: block; font-weight: 700; font-size: 0.9rem; color: #060e1e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zic-ciudad { display: block; font-size: 0.75rem; color: #8aa3be; margin-top: 2px; }
.zic-badge { background: #f4f8fd; color: #5c7699; font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 100px; white-space: nowrap; border: 1px solid #e8f0f9; }
.zic-valor { font-size: 1.45rem; font-weight: 800; color: #15803d; letter-spacing: -0.03em; }

.ciudades-impact-wrap { display: flex; flex-wrap: wrap; gap: 10px; padding: 20px 24px; }
.ciudad-impact-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; background: white;
  border: 1.5px solid #e8f0f9; border-radius: 100px;
  font-size: 0.85rem; font-weight: 600; color: #1a2f4a;
  transition: all 0.18s; cursor: default;
}
.ciudad-impact-chip:hover { background: #eff6ff; border-color: #bfdbfe; color: #0071e3; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,88,176,0.15); }

/* ── Mi Perfil ───────────────────────────────────────────── */
.perfil-layout { display: grid; grid-template-columns: 310px 1fr; gap: 22px; align-items: start; }
.perfil-col-left { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 90px; }

.perfil-foto-card {
  background: white; border-radius: 22px;
  border: 1px solid #e8f0f9; padding: 30px 26px 22px;
  text-align: center; box-shadow: 0 2px 8px rgba(6,14,30,0.05);
}
.perfil-foto-wrap { margin-bottom: 20px; }
.perfil-foto-inner {
  width: 128px; height: 128px; border-radius: 50%;
  margin: 0 auto; position: relative;
  background: #f4f8fd;
  border: 3px solid #e8f0f9;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(6,14,30,0.1);
  transition: border-color 0.2s;
}
.perfil-foto-inner:hover { border-color: #0071e3; }
.perfil-foto-placeholder { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.perfil-foto-placeholder span { font-size: 0.7rem; color: #8aa3be; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.perfil-foto-actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; flex-wrap: wrap; }

.btn-foto-upload {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #0071e3, #1a5fb4);
  color: white; border-radius: 11px;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.22s; border: none;
}
.btn-foto-upload:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,88,176,0.4); }

.btn-foto-remove {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px; background: white; color: #dc2626;
  border: 1.5px solid #fca5a5; border-radius: 11px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-foto-remove:hover { background: #fff0f0; }
.perfil-foto-hint { font-size: 0.72rem; color: #8aa3be; letter-spacing: 0.02em; }

.perfil-consig-card {
  background: white; border-radius: 22px;
  border: 1px solid #e8f0f9; overflow: hidden;
  box-shadow: 0 2px 8px rgba(6,14,30,0.05);
}
.consig-card-header {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  background: linear-gradient(150deg, #020d1f 0%, #061830 100%);
}
.consig-header-icon { font-size: 1.35rem; }
.consig-card-header h4 { color: white; font-size: 0.93rem; font-weight: 700; margin: 0 0 3px; }
.consig-card-header p  { color: rgba(255,255,255,0.35); font-size: 0.74rem; margin: 0; }
.consig-card-body { padding: 18px 20px; }

.consig-empty-state { text-align: center; padding: 24px 16px; }
.consig-empty-state svg { opacity: 0.35; margin-bottom: 10px; }
.consig-empty-state p { color: #8aa3be; font-size: 0.82rem; line-height: 1.6; margin: 0; }

.consig-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0; }
.consig-fila:first-child { padding-top: 0; }
.consig-fila + .consig-fila { border-top: 1px solid #f4f8fd; }
.consig-fila-item { background: #f8faff; border: 1px solid #e8f0f9; border-radius: 11px; padding: 12px 14px; }
.consig-fila-item.full-width { grid-column: 1 / -1; }
.consig-data-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: #8aa3be; margin-bottom: 5px; }
.consig-data-value { font-size: 0.88rem; font-weight: 600; color: #060e1e; }
.consig-data-value.banco { font-size: 0.93rem; font-weight: 700; }
.cuenta-num { font-family: 'Courier New', monospace; font-size: 0.97rem; font-weight: 700; color: #060e1e; letter-spacing: 0.08em; }

/* Perfil right col */
.perfil-col-right { display: flex; flex-direction: column; gap: 18px; }
.perfil-section-card {
  background: white; border-radius: 22px;
  border: 1px solid #e8f0f9; overflow: hidden;
  box-shadow: 0 2px 8px rgba(6,14,30,0.05);
}
.perfil-section-header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 26px; border-bottom: 1px solid #f4f8fd;
  background: linear-gradient(135deg, #f8faff 0%, white 100%);
}
.perfil-section-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-blue   { background: #eff6ff; color: #0071e3; border: 1px solid #bfdbfe; }
.icon-green  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.icon-orange { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.perfil-section-header h3 { font-size: 1rem; font-weight: 700; color: #060e1e; margin: 0 0 3px; }
.perfil-section-header p  { font-size: 0.77rem; color: #8aa3be; margin: 0; }

.perfil-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 22px 26px; }

.perfil-field label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #8aa3be; display: block; margin-bottom: 8px; }

.pf-value {
  padding: 12px 15px; background: #f8faff;
  border: 1.5px solid #e8f0f9; border-radius: 12px;
  font-size: 0.9rem; color: #1a2f4a; font-weight: 500;
  min-height: 44px; display: flex; align-items: center;
}

.pf-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; background: #f8faff;
  border: 1.5px solid #e8f0f9; border-radius: 12px;
  transition: all 0.22s;
}
.pf-input-wrap:focus-within { border-color: #0071e3; background: white; box-shadow: 0 0 0 3px rgba(0,113,227,0.15); }
.pf-input-wrap input { flex: 1; border: none; outline: none; background: transparent; font-family: inherit; font-size: 0.9rem; color: #1a2f4a; }
.pf-input-wrap input::placeholder { color: #8aa3be; }

.pf-editable-tag {
  background: #eff6ff; color: #0071e3;
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 9px; border-radius: 100px;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; border: 1px solid #bfdbfe;
}

.perfil-actions { padding: 0 26px 22px; }

.btn-perfil-save {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #0071e3, #1a5fb4);
  color: white; border: none; border-radius: 12px;
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.22s;
}
.btn-perfil-save:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,88,176,0.4); }

.btn-secondary-save {
  background: linear-gradient(135deg, #374151, #1f2937) !important;
}
.btn-secondary-save:hover { box-shadow: 0 10px 28px rgba(0,0,0,0.25) !important; }

.perfilPassAlert, #perfilUpdateAlert { margin: 0 26px 8px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .profile-details { grid-template-columns: 1fr 1fr; }
  .perfil-layout { grid-template-columns: 280px 1fr; }
  .zona-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .profile-details { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; text-align: center; }
  .perfil-layout { grid-template-columns: 1fr; }
  .perfil-col-left { position: static; }
  .perfil-fields-grid { grid-template-columns: 1fr; gap: 14px; }
  .zona-card-body { flex-direction: column; }
  .zona-chart-container { width: 100%; min-height: 180px; margin-right: 0; margin-bottom: 16px; }
  .zonas-impact-header { gap: 24px; padding: 24px 28px; flex-wrap: wrap; }
  .zia-number { font-size: 2rem; }
  .zonas-impact-grid { grid-template-columns: 1fr; }
  .consig-fila { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-card .number { font-size: 1.75rem; }
  .section-card { border-radius: 16px; }
  .zona-resumen-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .zona-resumen-table { min-width: 340px; }
  .zonas-impact-header { flex-direction: column; gap: 20px; }
  .zia-divider { width: 60px; height: 1px; }
  .perfil-foto-inner { width: 108px; height: 108px; }
  .perfil-section-header, .perfil-fields-grid, .perfil-actions { padding-left: 18px; padding-right: 18px; }
}
