/* ============================================================
   PS. Pablo Márquez — Sistema de Estilos
   Paleta: Teal/Turquesa del logo
   ============================================================ */

:root {
  --primary:       #1AAFA8;
  --primary-dark:  #0D8580;
  --primary-light: #E3F8F7;
  --primary-soft:  #B2E8E6;
  --secondary:     #5EC4C0;
  --accent:        #F0FAF9;
  --text:          #1C3B3A;
  --text-muted:    #5A7B79;
  --bg:            #F5FEFE;
  --bg2:           #EBF9F8;
  --white:         #FFFFFF;
  --border:        #C8E9E8;
  --border-light:  #E0F5F4;
  --success:       #28A745;
  --warning:       #FFC107;
  --danger:        #DC3545;
  --info:          #17A2B8;
  --shadow:        0 2px 12px rgba(26,175,168,0.10);
  --shadow-md:     0 4px 24px rgba(26,175,168,0.15);
  --radius:        10px;
  --radius-lg:     16px;
  --sidebar-w:     240px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
h1,h2,h3,h4,h5,h6 { margin: 0 0 .5rem; line-height: 1.3; }
p { margin: 0 0 1rem; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary-soft); border-radius: 3px; }

/* ============================================================
   UTLIDADES
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.text-muted { color: var(--text-muted); font-size: .875rem; }
.text-center { text-align: center; }
.text-sm { font-size: .85rem; }
.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }
.d-none { display: none !important; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: .2em .65em;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.3;
}
.badge-warning   { background: #FFF3CD; color: #856404; }
.badge-success   { background: #D4EDDA; color: #155724; }
.badge-danger    { background: #F8D7DA; color: #721C24; }
.badge-info      { background: #D1ECF1; color: #0C5460; }
.badge-primary   { background: var(--primary-light); color: var(--primary-dark); }
.badge-secondary { background: #E2E3E5; color: #383D41; }
.badge-light     { background: #F8F9FA; color: #495057; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-warning { background: var(--warning); color: #000; border-color: var(--warning); }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.8rem; font-size: 1rem; }
.btn-icon { padding: .5rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .875rem; }
.form-control {
  width: 100%;
  padding: .55rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: .875rem;
  transition: border-color .15s;
  outline: none;
  font-family: inherit;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,175,168,.12); }
.form-control::placeholder { color: #aec6c5; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-text { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--accent);
}

/* ---- Alerts ---- */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .875rem;
  margin-bottom: 1rem;
}
.alert-success { background: #D4EDDA; color: #155724; border-color: #C3E6CB; }
.alert-danger  { background: #F8D7DA; color: #721C24; border-color: #F5C6CB; }
.alert-warning { background: #FFF3CD; color: #856404; border-color: #FFEEBA; }
.alert-info    { background: #D1ECF1; color: #0C5460; border-color: #BEE5EB; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { background: var(--bg2); color: var(--text-muted); font-weight: 600; text-align: left; padding: .7rem 1rem; border-bottom: 2px solid var(--border); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
tr:hover td { background: var(--accent); }
tr:last-child td { border-bottom: none; }

/* ============================================================
   LAYOUT ADMIN / PATIENT — SIDEBAR
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #0D4D4A 0%, #0A3E3B 100%);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.4rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-align: center;
}
.sidebar-logo img { width: 130px; border-radius: 0; filter: brightness(0) invert(1); }
.sidebar-logo h2 { color: #fff; font-size: .9rem; margin-top: .5rem; margin-bottom: .1rem; }
.sidebar-logo p  { color: rgba(255,255,255,.5); font-size: .72rem; margin: 0; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-section {
  padding: .4rem 1rem .2rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  font-weight: 700;
  margin-top: .5rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1.2rem;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-link.active { background: rgba(26,175,168,.18); color: #5EC4C0; border-left-color: #1AAFA8; font-weight: 600; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.badge-count { background: var(--primary); color: #fff; border-radius: 999px; font-size: .68rem; padding: .1em .5em; margin-left: auto; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  padding: .9rem 1.8rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.topbar-title h1 { font-size: 1.15rem; color: var(--text); margin: 0; }
.topbar-title p  { font-size: .78rem; color: var(--text-muted); margin: 0; }

.page-body { padding: 1.8rem; flex: 1; }

/* ---- Stats Cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid var(--primary);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.stat-warning { border-left-color: var(--warning); }
.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-info    { border-left-color: var(--info); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; color: var(--primary); }
.stat-card.stat-warning .stat-icon { background: #FFF3CD; }
.stat-card.stat-warning .stat-icon svg { color: #856404; }
.stat-card.stat-success .stat-icon { background: #D4EDDA; }
.stat-card.stat-success .stat-icon svg { color: #155724; }
.stat-card.stat-info    .stat-icon { background: #D1ECF1; }
.stat-card.stat-info    .stat-icon svg { color: #0C5460; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ---- Content Grid ---- */
.content-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 900px) { .content-grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .content-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ---- Section Header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.section-header h2 { font-size: 1.05rem; }

/* ============================================================
   TIMER (Cronómetro de Sesión)
   ============================================================ */
.timer-card { border: 2px solid var(--primary-soft); }
.timer-display {
  font-size: 4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
  color: var(--primary-dark);
  text-align: center;
  padding: 1.5rem 0 1rem;
  line-height: 1;
}
.timer-controls { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.timer-bar { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; margin: .5rem 0 1rem; }
.timer-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 1s linear; }

/* ============================================================
   MESSAGES / CHAT
   ============================================================ */
.chat-wrap { display: flex; flex-direction: column; height: 420px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.msg { max-width: 78%; padding: .65rem 1rem; border-radius: 1rem; font-size: .875rem; line-height: 1.5; }
.msg-from-admin { background: var(--primary-light); border-radius: 1rem 1rem 1rem .2rem; align-self: flex-start; }
.msg-from-patient { background: var(--bg2); border-radius: 1rem 1rem .2rem 1rem; align-self: flex-end; }
.msg-meta { font-size: .7rem; color: var(--text-muted); margin-top: .25rem; }
.chat-input { border-top: 1px solid var(--border-light); padding: .8rem; display: flex; gap: .5rem; }
.chat-input textarea { flex: 1; resize: none; min-height: 42px; }
.chat-input textarea:focus { outline: none; border-color: var(--primary); }

/* ============================================================
   TASK CARDS
   ============================================================ */
.task-item {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: box-shadow .15s;
}
.task-item:hover { box-shadow: var(--shadow); }
.task-item.completed { opacity: .7; }
.task-checkbox { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 6px; cursor: pointer; flex-shrink: 0; margin-top: .15rem; appearance: none; background: var(--white); }
.task-checkbox:checked { background: var(--primary); border-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='white' d='M16 6l-8 8-4-4 1.5-1.5L8 11 14.5 4.5z'/%3E%3C/svg%3E"); background-size: 14px; background-repeat: no-repeat; background-position: center; }
.task-body { flex: 1; }
.task-title { font-weight: 600; margin-bottom: .2rem; }
.task-desc { font-size: .82rem; color: var(--text-muted); }
.task-meta { margin-top: .5rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* ============================================================
   PUBLIC PAGE (index.php)
   ============================================================ */
.public-nav {
  background: var(--white);
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 200;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: .75rem; }
.nav-brand img { width: 90px; }
.nav-brand span { font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: .5rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: .875rem; padding: .4rem .8rem; border-radius: var(--radius); }
.nav-links a:hover { background: var(--bg2); color: var(--text); }

/* Hamburguesa nav pública (oculto en escritorio) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: .45rem .55rem;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Hamburguesa sidebar admin/paciente (oculto en escritorio) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem .4rem;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  margin-right: .5rem;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 60%, var(--bg2) 100%);
  padding: 5rem 0 4rem;
}
.hero-inner { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
@media (min-width: 760px) { .hero-inner { grid-template-columns: 1.1fr 1fr; } }
.hero-title { font-size: 2.4rem; font-weight: 800; color: var(--text); margin-bottom: 1rem; line-height: 1.15; }
.hero-title span { color: var(--primary); }
.hero-subtitle { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 2rem; }
.hero-img { text-align: center; }
.hero-img img { max-width: 340px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.feature-card { background: var(--white); border-radius: var(--radius-lg); padding: 1.8rem 1.4rem; box-shadow: var(--shadow); text-align: center; transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon { width: 58px; height: 58px; background: var(--primary-light); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.feature-icon svg { width: 28px; height: 28px; color: var(--primary); }
.feature-card h3 { font-size: .95rem; margin-bottom: .5rem; }
.feature-card p  { font-size: .83rem; color: var(--text-muted); margin: 0; }

.section { padding: 4rem 0; }
.section-alt { background: var(--bg2); }
.section-title { font-size: 1.8rem; font-weight: 800; text-align: center; margin-bottom: .5rem; }
.section-sub  { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; }

/* Booking form */
.booking-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 2rem; max-width: 700px; margin: 0 auto; }
.time-slots { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.time-slot {
  padding: .45rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .85rem;
  background: var(--white);
  transition: all .15s;
  font-weight: 500;
}
.time-slot:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.time-slot.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.time-slot.unavailable { opacity: .4; cursor: not-allowed; border-style: dashed; }

.footer-public {
  background: linear-gradient(135deg, #0D4D4A 0%, #0A3E3B 100%);
  color: rgba(255,255,255,.7);
  padding: 3rem 0 1.5rem;
}
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-brand h3 { color: #fff; margin-bottom: .5rem; }
.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: .8rem; }
.footer-col p, .footer-col a { font-size: .83rem; color: rgba(255,255,255,.6); display: block; margin-bottom: .3rem; }
.footer-col a:hover { color: var(--secondary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.2rem; text-align: center; font-size: .78rem; color: rgba(255,255,255,.4); }

/* ============================================================
   AVAILABILITY PAGE (Admin)
   ============================================================ */
.schedule-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; }
.day-col { text-align: center; }
.day-name { font-size: .8rem; font-weight: 700; color: var(--text-muted); padding: .5rem; background: var(--bg2); border-radius: 6px; margin-bottom: .4rem; }
.slot-block { background: var(--primary-light); border: 1px solid var(--primary-soft); border-radius: 6px; padding: .4rem .2rem; margin-bottom: .3rem; font-size: .72rem; color: var(--primary-dark); text-align: center; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1rem; margin: 0; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-light); display: flex; gap: .75rem; justify-content: flex-end; }

/* ---- Misc ---- */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary-dark); font-size: .8rem; flex-shrink: 0; }
.divider { border: none; border-top: 1px solid var(--border-light); margin: 1.5rem 0; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state svg { width: 48px; height: 48px; opacity: .35; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1rem; margin-bottom: .4rem; }
.tag { display: inline-block; background: var(--bg2); border-radius: 999px; padding: .2em .7em; font-size: .75rem; color: var(--text-muted); }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
  .page-body { padding: .85rem; }

  /* Hamburguesa sidebar */
  .hamburger-btn { display: flex; }

  /* Topbar más compacto */
  .topbar { padding: .65rem 1rem; }
  .topbar-title h1 { font-size: 1rem; }

  /* Stats grid — 2 columnas en móvil */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .stat-card { padding: .85rem 1rem; }
  .stat-value { font-size: 1.4rem; }

  /* Navbar pública */
  .nav-toggle { display: flex; }
  .public-nav { position: relative; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-md);
    gap: .4rem;
    z-index: 300;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem .8rem; }
  .nav-links .btn { text-align: center; }

  /* Hero */
  .hero { padding: 3rem 0 2.5rem; }
  .hero-title { font-size: 1.8rem; }
  .hero-img { display: none; }

  /* Reserva */
  .booking-card { padding: 1.25rem; }

  /* Chat móvil */
  .patient-chat { height: calc(100svh - 130px) !important; }

  /* Tabla → scroll horizontal */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 520px; }

  /* Tarjetas de citas (vista móvil) */
  .appt-table-desktop { display: none; }
  .appt-cards-mobile  { display: flex; flex-direction: column; gap: .75rem; }

  /* Tareas */
  .card-body { padding: .9rem; }
}

/* ── Info Grid: etiquetas y valores alineados ── */
.info-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem .75rem;
  font-size: .875rem;
}
.info-grid dt {
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  padding-top: .05rem;
}
.info-grid dt::after {
  content: ":";
}
.info-grid dd {
  color: var(--text);
  margin: 0;
  word-break: break-word;
}

/* ── Indicador "está escribiendo" ─────────────────────── */
.typing-dots span {
  display: inline-block;
  animation: typingBounce 1.2s infinite;
  opacity: 0;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes typingBounce {
  0%, 60%, 100% { opacity: 0; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-3px); }
}

/* Offset para navegación con navbar sticky */
section[id] {
  scroll-margin-top: 80px;
}
.btn.btn-primary { color: #fff !important; }