/* ============================================================
   area.css — Área privada + Historia clínica
   Salud Online · Verde muy clarito como en la original
   ============================================================ */

/* ══════════════════════════════════════════
   WELCOME BAND (área privada)
══════════════════════════════════════════ */
.welcome-band {
  background: linear-gradient(135deg, #d8f0e4 0%, #eaf8f0 100%);
  border-bottom: 1px solid #c0e0d0;
  padding: 28px 0;
}
.welcome-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.welcome-text h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 300;
  color: #1a4030;
  margin-bottom: 4px;
}
.welcome-text p { font-size: 14px; color: #4a7060; }
.welcome-patient {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid #c0e0d0;
  border-radius: 10px;
  padding: 12px 18px;
}
.patient-badge {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 15px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   ÁREA MAIN LAYOUT
══════════════════════════════════════════ */
.area-main {
  background: #fafafa;
  padding: 0 0 80px;
  min-height: 60vh;
}
.area-main .container {
  padding-top: 0;
}

/* ══════════════════════════════════════════
   NAV LATERAL (área privada)
══════════════════════════════════════════ */
.area-nav-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding-top: 32px;
  align-items: start;
}
.area-nav-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + var(--header-h) + 16px);
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  overflow: hidden;
}
.area-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  border-bottom: 1px solid #f0f8f4;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
}
.area-nav-link:hover,
.area-nav-link.active {
  background: #eaf8f0;
  color: var(--green);
}
.area-nav-link svg { flex-shrink: 0; opacity: .6; }
.area-nav-link.active svg { opacity: 1; }

/* ══════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════ */
.area-section { display: none; }
.area-section.active { display: block; }

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-top: 32px;
  flex-wrap: wrap;
}
.section-title-row h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 300;
  color: #1a4030;
}

/* ══════════════════════════════════════════
   BOTÓN FANTASMA
══════════════════════════════════════════ */
.btn--ghost {
  background: transparent;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
}
.btn--ghost:hover { border-color: #94a3b8; color: #334155; }

/* ══════════════════════════════════════════
   CITAS TABS
══════════════════════════════════════════ */
.citas-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #f0f8f4;
  border-radius: 8px;
  padding: 4px;
  width: fit-content;
}
.cita-tab {
  background: transparent;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #4a7060;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.cita-tab.active { background: white; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.cita-tab:hover:not(.active) { color: var(--green); }

/* ══════════════════════════════════════════
   CITA CARD
══════════════════════════════════════════ */
.cita-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 14px;
  transition: box-shadow 0.2s;
}
.cita-card:hover { box-shadow: 0 4px 16px rgba(74,158,122,.1); }
.cita-card--past { opacity: .75; }

.cita-date-col { flex-shrink: 0; }
.cita-date-box {
  width: 64px;
  text-align: center;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px 6px;
  border-top: 3px solid #ccc;
}
.cita-date-box--green { background: #eaf8f0; border-top-color: var(--green); }
.cita-day   { font-family: var(--font-serif); font-size: 28px; font-weight: 300; color: #1a4030; line-height: 1; }
.cita-month { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--green); text-transform: uppercase; margin-top: 2px; }
.cita-year  { font-size: 10px; color: #94a3b8; margin-top: 1px; }

.cita-info { flex: 1; min-width: 0; }
.cita-info h3 { font-size: 16px; font-weight: 700; color: #1a4030; margin: 6px 0 8px; }
.cita-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #64748b;
}
.cita-meta span { display: flex; align-items: center; gap: 5px; }

.cita-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 50px;
}
.cita-badge--upcoming { background: #d8f0e4; color: #2d7a56; }
.cita-badge--done     { background: #f1f5f9; color: #64748b; }

.cita-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   VITALS BAND
══════════════════════════════════════════ */
.vitals-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.vital-widget {
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vital-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.vital-icon--red   { background: #fee2e2; color: #ef4444; }
.vital-icon--blue  { background: #dbeafe; color: #3b82f6; }
.vital-icon--amber { background: #fef3c7; color: #f59e0b; }
.vital-icon--green { background: #d8f0e4; color: var(--green); }

.vital-val { font-family: var(--font-serif); font-size: 22px; font-weight: 300; color: #1a4030; line-height: 1.1; }
.vital-lbl { font-size: 12px; color: #64748b; margin-top: 2px; }
.vital-status { font-size: 11px; font-weight: 700; }
.vital-status.ok { color: var(--green); }
.vital-status.warn { color: #f59e0b; }
.vital-status.alert { color: #ef4444; }

/* ══════════════════════════════════════════
   TIMELINE
══════════════════════════════════════════ */
.timeline-list { display: flex; flex-direction: column; gap: 0; }

.tl-entry {
  display: flex;
  gap: 16px;
  padding-bottom: 28px;
  position: relative;
}
.tl-entry::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e0ede8;
}
.tl-entry:last-child::before { display: none; }

.tl-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  z-index: 1;
  border: 2px solid white;
  box-shadow: 0 0 0 2px currentColor;
}
.tl-dot--green { background: var(--green); color: var(--green); }
.tl-dot--blue  { background: #60a5fa; color: #60a5fa; }
.tl-dot--gray  { background: #94a3b8; color: #94a3b8; }

.tl-content { flex: 1; }
.tl-date { font-size: 12px; color: #94a3b8; margin-bottom: 4px; }
.tl-content h4 { font-size: 15px; font-weight: 700; color: #1a4030; margin-bottom: 6px; }
.tl-content p  { font-size: 14px; color: #64748b; line-height: 1.6; margin-bottom: 8px; }

.tl-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
}
.tl-badge--green { background: #d8f0e4; color: #2d7a56; }
.tl-badge--blue  { background: #dbeafe; color: #1d4ed8; }
.tl-badge--gray  { background: #f1f5f9; color: #64748b; }

/* ══════════════════════════════════════════
   DOCUMENTOS
══════════════════════════════════════════ */
.docs-grid { display: flex; flex-direction: column; gap: 12px; }

.doc-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 16px 20px;
  transition: box-shadow 0.2s;
}
.doc-card:hover { box-shadow: 0 4px 12px rgba(74,158,122,.1); }
.doc-card--new { border-left: 3px solid var(--green); }

.doc-icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.doc-icon--pdf    { background: #fee2e2; color: #ef4444; }
.doc-icon--receta { background: #d8f0e4; color: var(--green); }

.doc-body { flex: 1; min-width: 0; }
.doc-name { font-size: 14px; font-weight: 600; color: #1a4030; }
.doc-meta { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.doc-new-badge {
  display: inline-block;
  background: #d8f0e4;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ══════════════════════════════════════════
   MEDICACIÓN
══════════════════════════════════════════ */
.meds-table {
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.meds-header {
  display: grid;
  grid-template-columns: 2fr 2fr 1.5fr 1fr;
  gap: 12px;
  padding: 12px 20px;
  background: #f0f8f4;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #4a7060;
}
.med-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1.5fr 1fr;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #f0f8f4;
  font-size: 14px;
  color: #334155;
  align-items: center;
}
.med-name strong { display: block; font-weight: 700; color: #1a4030; }
.med-name span   { font-size: 12px; color: #94a3b8; }

.med-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.med-status--active { background: #d8f0e4; color: #2d7a56; }
.med-status--done   { background: #f1f5f9; color: #64748b; }

.alergias-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8e6;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: #7c5d00;
}
.alergias-box svg { flex-shrink: 0; color: #f59e0b; margin-top: 1px; }

/* ══════════════════════════════════════════
   MENSAJES
══════════════════════════════════════════ */
.messages-layout { display: flex; flex-direction: column; gap: 0; }

.msg-thread {
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 560px;
}

.thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #f0f8f4;
  border-bottom: 1px solid #e0ede8;
}
.thread-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.thread-name { font-weight: 700; font-size: 15px; color: #1a4030; }
.thread-spec { font-size: 12px; color: #64748b; }
.thread-online {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  margin-left: auto;
  box-shadow: 0 0 0 2px white, 0 0 0 3px var(--green);
}

.thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafcfa;
}
.msg-group--me  { align-self: flex-end; text-align: right; max-width: 75%; }
.msg-group--dr  { align-self: flex-start; max-width: 75%; }

.msg-bubble {
  display: inline-block;
  padding: 11px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
}
.msg-bubble--me { background: var(--green); color: white; border-bottom-right-radius: 4px; }
.msg-bubble--dr { background: white; color: #334155; border: 1px solid #e0ede8; border-bottom-left-radius: 4px; }

.msg-time { font-size: 11px; color: #94a3b8; margin-top: 4px; }

.thread-input {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid #e0ede8;
  background: white;
}
.thread-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e0ede8;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.thread-input input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(74,158,122,.1); }

/* ══════════════════════════════════════════
   HISTORIAL — SIDEBAR PACIENTE
══════════════════════════════════════════ */
.h-card {
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 14px;
}
.h-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #2d7a56);
  color: white;
  font-size: 18px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.h-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 300;
  color: #1a4030;
  text-align: center;
  margin-bottom: 4px;
}
.h-id {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 16px;
}
.h-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.h-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f8f4;
  color: #334155;
}
.h-meta-row span:first-child { color: #64748b; }

.h-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.h-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  letter-spacing: .04em;
}
.h-tag--warn { background: #fff8e6; color: #7c5d00; border: 1px solid #fde68a; }
.h-tag--info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.h-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--green);
  margin-bottom: 14px;
}

.h-vitals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.h-vital {
  background: #f0f8f4;
  border-radius: 8px;
  padding: 10px 12px;
}
.h-vital-val { font-family: var(--font-serif); font-size: 18px; font-weight: 300; color: #1a4030; line-height: 1.1; }
.h-vital-lbl { font-size: 11px; color: #64748b; margin-top: 2px; }

.h-updated { font-size: 11px; color: #94a3b8; text-align: right; }

.h-action-btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  margin-bottom: 8px;
  background: var(--green);
  color: white;
  transition: background 0.2s;
  border: none;
}
.h-action-btn:hover { background: #357a5c; }
.h-action-btn--outline {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.h-action-btn--outline:hover { background: #eaf8f0; }

/* ══════════════════════════════════════════
   HISTORIAL — TABS
══════════════════════════════════════════ */
.h-tabs {
  display: flex;
  gap: 4px;
  background: #f0f8f4;
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.h-tab {
  flex: 1;
  min-width: 100px;
  background: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #4a7060;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
  white-space: nowrap;
}
.h-tab.active { background: white; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.h-tab:hover:not(.active) { color: var(--green); }

/* ══════════════════════════════════════════
   HISTORIAL — ENTRADAS (consultas)
══════════════════════════════════════════ */
.h-entry {
  display: flex;
  gap: 16px;
  padding-bottom: 28px;
  position: relative;
}
.h-entry::before {
  content: '';
  position: absolute;
  left: 35px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e0ede8;
}
.h-entry:last-child::before { display: none; }

.h-entry-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 72px;
}
.h-entry-date {
  font-size: 12px;
  text-align: center;
  color: #64748b;
  line-height: 1.3;
  background: #f0f8f4;
  border-radius: 6px;
  padding: 6px 8px;
  width: 100%;
}
.h-entry-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px currentColor;
  position: relative;
  z-index: 1;
}
.h-entry-dot--green { background: var(--green); color: var(--green); }
.h-entry-dot--blue  { background: #60a5fa; color: #60a5fa; }
.h-entry-dot--gray  { background: #94a3b8; color: #94a3b8; }

.h-entry-body {
  flex: 1;
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 18px 20px;
}
.h-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.h-entry-header h3 { font-size: 16px; font-weight: 700; color: #1a4030; }
.h-entry-meta { font-size: 12px; color: #64748b; margin-bottom: 10px; }
.h-entry-body p { font-size: 14px; color: #334155; line-height: 1.65; margin-bottom: 12px; }
.h-entry-footer { display: flex; gap: 16px; flex-wrap: wrap; }
.h-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  transition: color 0.2s;
}
.h-link:hover { color: #357a5c; }

.h-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 4px 10px;
  border-radius: 50px;
  white-space: nowrap;
}
.h-badge--green { background: #d8f0e4; color: #2d7a56; }
.h-badge--blue  { background: #dbeafe; color: #1d4ed8; }
.h-badge--gray  { background: #f1f5f9; color: #64748b; }

/* ══════════════════════════════════════════
   ANALÍTICAS
══════════════════════════════════════════ */
.h-analisis-card {
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}
.h-analisis-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.h-analisis-header h3 { font-size: 17px; font-weight: 700; color: #1a4030; margin-bottom: 4px; }
.h-analisis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.h-analisis-item {
  background: #f8fbf8;
  border: 1px solid #e0ede8;
  border-radius: 8px;
  padding: 14px;
}
.h-analisis-item--ok { border-top: 2px solid var(--green); }
.h-analisis-name { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.h-analisis-val  { font-family: var(--font-serif); font-size: 20px; font-weight: 300; color: #1a4030; }
.h-analisis-ref  { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.h-analisis-status { font-size: 11px; font-weight: 700; margin-top: 6px; }
.h-analisis-status.ok { color: var(--green); }

/* ══════════════════════════════════════════
   RECETAS
══════════════════════════════════════════ */
.h-receta-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.h-receta-row--done { opacity: .6; }
.h-receta-icon {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: #d8f0e4;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.h-receta-body { flex: 1; }
.h-receta-body h3 { font-size: 16px; font-weight: 700; color: #1a4030; margin-bottom: 4px; }
.h-receta-body p  { font-size: 13px; color: #64748b; line-height: 1.5; margin-top: 6px; }
.h-receta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   VACUNAS
══════════════════════════════════════════ */
.h-vacuna-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border: 1px solid #e0ede8;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.h-vacuna-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.h-vacuna-body { flex: 1; }
.h-vacuna-body h3 { font-size: 15px; font-weight: 700; color: #1a4030; margin-bottom: 3px; }

/* ══════════════════════════════════════════
   HISTORIAL LAYOUT (sidebar + content)
══════════════════════════════════════════ */
.historial-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}
.historial-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + var(--header-h) + 16px);
}
.historial-content { min-width: 0; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Welcome */
  .welcome-inner { flex-direction: column; align-items: flex-start; }
  .welcome-patient { width: 100%; }

  /* Vitals */
  .vitals-band { grid-template-columns: repeat(2, 1fr); }

  /* Historial layout */
  .historial-layout { grid-template-columns: 1fr; }
  .historial-sidebar { position: static; }

  /* Analíticas */
  .h-analisis-grid { grid-template-columns: repeat(2, 1fr); }

  /* Medicación */
  .meds-header { display: none; }
  .med-row { grid-template-columns: 1fr; gap: 4px; border-top: 2px solid #f0f8f4; }

  /* Citas */
  .cita-card { flex-wrap: wrap; }
  .cita-actions { flex-direction: row; width: 100%; }
  .cita-actions .btn { flex: 1; text-align: center; justify-content: center; }

  /* Recetas */
  .h-receta-row { flex-wrap: wrap; }
  .h-receta-actions { flex-direction: row; width: 100%; align-items: center; justify-content: flex-start; }
}

@media (max-width: 640px) {
  .vitals-band { grid-template-columns: 1fr 1fr; }
  .h-analisis-grid { grid-template-columns: 1fr 1fr; }
  .h-tabs { gap: 2px; }
  .h-tab { font-size: 12px; padding: 8px 10px; min-width: 0; flex: 1; }
  .h-entry-aside { width: 56px; }
  .h-entry-date { font-size: 11px; padding: 4px 6px; }
  .h-entry-header { flex-direction: column; gap: 6px; }
  .section-title-row { flex-direction: column; align-items: flex-start; }
  .thread-messages { max-height: 300px; }

  /* Mensajes */
  .msg-group--me, .msg-group--dr { max-width: 90%; }
}

@media (max-width: 400px) {
  .vitals-band { grid-template-columns: 1fr; }
  .h-analisis-grid { grid-template-columns: 1fr; }
  .cita-card { flex-direction: column; }
  .cita-date-box { width: 100%; display: flex; gap: 8px; align-items: center; padding: 8px 12px; }
  .cita-day { font-size: 22px; }
}
