/* ═══════════════════════════════════════════════
   Salud – medicación, citas, renovaciones
   ═══════════════════════════════════════════════ */

.salud-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.salud-card-alerts {
  border-color: var(--warning);
}

.salud-alerts-list {
  margin: 0;
  padding-left: 1.25rem;
}

.salud-alerts-list li {
  margin-bottom: 0.25rem;
}

.salud-card h3 {
  margin-bottom: 0.75rem;
}

.salud-form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.salud-input {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
}

.salud-input:focus {
  outline: none;
  border-color: var(--accent);
}

.salud-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.salud-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.salud-item:last-child {
  border-bottom: none;
}

.salud-btn-del {
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.salud-btn-del:hover {
  color: var(--danger, #ef4444);
}

/* Edit row */
.salud-edit-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.4rem 0;
}

.salud-edit-row .salud-input {
  flex: 1;
  min-width: 80px;
}

/* ── Vitals chart ────────────────────────────── */
.salud-vitals-chart {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.salud-vitals-chart svg {
  display: block;
  width: 100%;
}

/* ── Adherencia calendar ─────────────────────── */
.salud-adherencia-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-top: 0.75rem;
}
.sal-adh-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--border);
  cursor: pointer;
  transition: opacity 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: transparent;
}
.sal-adh-cell.taken { background: #22c55e; }
.sal-adh-cell.missed { background: #ef4444; }
.sal-adh-cell:hover { opacity: 0.8; }

/* ── Adherencia calendar grid ────────────────── */
.sal-adh-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 0.25rem;
}

.sal-adh-weekday {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-bottom: 0.2rem;
}

.sal-adh-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.25rem 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.sal-adh-cell:hover:not(.sal-adh-future) {
  background: var(--accent-dim);
}

.sal-adh-future {
  opacity: 0.35;
  cursor: default;
}

.sal-adh-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sal-adh-green  { background: #22c55e; }
.sal-adh-red    { background: #ef4444; }
.sal-adh-gray   { background: var(--border); }

.sal-adh-day {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ── Vacunas / Documentos tables ─────────────── */
.salud-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.875rem;
}
.salud-table th {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: left;
}
.salud-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .salud-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .salud-tab-btn { flex-shrink: 0; }
  .salud-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .salud-table thead,
  .salud-table tbody,
  .salud-table tr { min-width: 0; }
  .sal-adh-grid { grid-template-columns: repeat(7, 1fr); font-size: 0.7rem; }
  .salud-vitals-chart { overflow-x: auto; }
}

@media (max-width: 480px) {
  .sal-adh-grid { font-size: 0.65rem; }
}
