/* ============================================================
   SISTEMA CLÍNICO - DR. BYRON CHACÓN
   Ginecología y Obstetricia
   ------------------------------------------------------------
   IDENTIDAD VISUAL PROVISIONAL.
   Cuando tengas los colores y logo reales del Dr. Byron,
   solo cambia las variables de :root y el logo en index/login.
   ============================================================ */

:root {
  /* --- PALETA DR. BYRON CHACÓN — azul marino con autoridad + calidez --- */
  --teal-900: #16243f;   /* azul marino profundo, más asentado */
  --teal-700: #1c2c4c;   /* azul marino del logo */
  --teal-600: #3a5d9f;   /* azul medio de marca (interacción) */
  --teal-500: #6b8fcc;
  --teal-100: #dce6f5;
  --teal-50:  #eef3fb;

  --coral-600: #d98bb8;  /* rosa de marca (acento puntual) */
  --coral-500: #e6a9cd;
  --coral-100: #f6e3ee;

  --ink:      #16243f;
  --muted:    #5d6a82;
  --line:     #e6e3dd;   /* línea cálida, no fría */
  --bg:       #f8f6f2;   /* crema muy sutil: calidez sin perder lo clínico */
  --bg-soft:  #fbfaf7;
  --white:    #ffffff;

  /* Estados de cita (colorcitos tipo Google Calendar) */
  --st-confirmada:    #3a5d9f;
  --st-pendiente:     #e0a020;
  --st-completada:    #4a8c5a;
  --st-pendcobro:     #d98bb8;
  --st-cancelada:     #9aa6b6;
  --st-reagendada:    #7b5ea7;

  --shadow-sm: 0 1px 3px rgba(22,36,63,.07);
  --shadow-md: 0 8px 28px rgba(22,36,63,.10);
  --shadow-lg: 0 24px 60px rgba(22,36,63,.16);
  --radius: 16px;
  --radius-sm: 10px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* ====================== BOTONES ====================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; transition: .18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-coral { background: var(--coral-600); color: #fff; }
.btn-coral:hover { background: #cf6a50; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--teal-700); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal-500); background: var(--teal-50); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ====================== LANDING PÚBLICA ====================== */
/* Rediseño v2 — lenguaje editorial tipo Daphne con identidad propia de
   Byron: azul marino protagonista, rosa de acento puntual, mucho aire,
   firma visual = lazo/curva rosa que evoca su logo. */

.public-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 7vw; background: rgba(246,248,252,.82);
  backdrop-filter: blur(14px); border-bottom: 1px solid rgba(224,230,240,.7);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo-box { width: 46px; height: 46px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.15); overflow: hidden; }
.brand-logo-box img { width: 34px; height: 34px; object-fit: contain; }
.brand-logo { height: 46px; width: auto; display: block; }
.brand-iso { height: 46px; width: auto; display: block; border-radius: 9px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-900));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: 20px;
}
.brand-text strong { font-family: var(--font-display); font-size: 18px; display: block; line-height: 1.1; color: var(--teal-900); }
.brand-text span { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { font-size: 14.5px; color: var(--teal-900); font-weight: 500; opacity: .72; transition: .15s; }
.nav-links a:hover { opacity: 1; }
.nav-toggle {
  display: none; background: #fff; border: 1.5px solid var(--line);
  width: 44px; height: 44px; border-radius: 11px; font-size: 20px; color: var(--teal-700);
  cursor: pointer; line-height: 1;
}

/* HERO — editorial, foto con presencia, credencial flotante */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px;
  align-items: center; padding: 80px 7vw 70px; position: relative;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal-600);
  margin-bottom: 26px;
}
.hero-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--coral-600); border-radius: 2px; }
.hero h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.05; margin-bottom: 22px; color: var(--teal-900); letter-spacing: -.02em; }
.hero h1 em { font-style: italic; color: var(--coral-600); font-weight: 500; }
.hero p.lead { font-size: 18.5px; color: var(--muted); max-width: 44ch; margin-bottom: 34px; line-height: 1.6; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* Barra de confianza: datos reales de trayectoria de Byron */
.hero-trust {
  display: flex; align-items: center; gap: 22px; margin-top: 38px;
  padding-top: 30px; border-top: 1px solid var(--line);
}
.ht-item { display: flex; flex-direction: column; gap: 2px; }
.ht-item strong {
  font-family: var(--font-display); font-size: 26px; font-weight: 600;
  color: var(--teal-700); line-height: 1;
}
.ht-item span { font-size: 12.5px; color: var(--muted); letter-spacing: .01em; }
.ht-sep { width: 1px; height: 38px; background: var(--line); }

.hero-visual {
  position: relative; aspect-ratio: 4/5; min-height: 460px; border-radius: 28px;
  overflow: hidden; box-shadow: var(--shadow-lg);
  background: linear-gradient(160deg, var(--teal-600), var(--teal-900));
}
.hero-visual::before {
  /* halo cálido detrás de la foto, da profundidad */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(120% 80% at 70% 10%, rgba(217,139,184,.22), transparent 60%);
}
.hero-visual::after {
  /* firma: arco rosa que evoca el lazo del logo */
  content: ""; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  border: 16px solid rgba(217,139,184,.30); z-index: 3; pointer-events: none;
}
.hero-visual .hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top; display: block; z-index: 2;
}
.hero-float {
  position: absolute; bottom: 24px; left: 24px;
  background: rgba(255,255,255,.97); border-radius: 16px; padding: 15px 20px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-md); z-index: 3;
}
.hero-float .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st-completada); box-shadow: 0 0 0 4px rgba(74,140,90,.15); }
.hero-float strong { display:block; font-size: 14px; color: var(--teal-900); }
.hero-float span { font-size: 12.5px; color: var(--muted); }

/* SECCIONES — más aire, encabezado con eyebrow de línea */
.section { padding: 80px 7vw; }
.section-head { text-align: center; max-width: 56ch; margin: 0 auto 56px; }
.section-head .eyebrow { color: var(--coral-600); font-weight:600; font-size:12px; letter-spacing:.14em; text-transform:uppercase; display:inline-block; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 44px); margin: 0 0 14px; color: var(--teal-900); letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 17px; line-height: 1.6; }

.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; max-width: 1140px; margin: 0 auto; }
.svc-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 32px 28px; transition: .22s ease; position: relative; overflow: hidden;
}
.svc-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--teal-600), var(--coral-500));
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.svc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: transparent; }
.svc-card:hover::before { transform: scaleX(1); }
.svc-ico {
  width: 54px; height: 54px; border-radius: 15px; background: var(--teal-50);
  color: var(--teal-600); display: grid; place-items: center; font-size: 26px; margin-bottom: 18px;
}
.svc-card h3 { font-size: 20px; margin-bottom: 9px; color: var(--teal-900); }
.svc-card p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* SOBRE EL DOCTOR — foto con marco, texto con credenciales */
.about-wrap { display:grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; max-width: 1140px; margin: 0 auto; }
.about-photo { position: relative; }
.about-photo img { border-radius: 24px; box-shadow: var(--shadow-lg); width: 100%; position: relative; z-index: 2; }
.about-photo::before {
  content: ""; position: absolute; inset: -16px -16px 16px 16px;
  border: 2px solid var(--coral-500); border-radius: 24px; z-index: 1; opacity: .5;
}
.about-text .eyebrow { color: var(--coral-600); font-weight:600; font-size:12px; letter-spacing:.14em; text-transform:uppercase; }
.about-text h2 { font-size: clamp(30px,4.2vw,42px); margin: 12px 0 18px; color: var(--teal-900); letter-spacing: -.02em; }
.about-text p { color: var(--muted); font-size: 16px; margin-bottom: 16px; line-height: 1.7; }
.about-text .about-role { color: var(--teal-600); font-weight: 600; font-size: 14px; letter-spacing: .02em; margin-bottom: 18px; }
.cred-list {
  list-style: none; display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 22px; margin: 22px 0 4px;
}
.cred-list li {
  position: relative; padding-left: 26px; font-size: 14.5px; color: var(--teal-900); line-height: 1.45;
}
.cred-list li::before {
  content: ""; position: absolute; left: 0; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--coral-100);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23d98bb8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.reel-card { margin-top: 26px; max-width: 340px; }
.reel-embed { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-md); background:#fff; }
.instagram-media { border-radius: 18px !important; }

/* BANDA DE UBICACIÓN — azul marino con detalle */
.info-band {
  background: var(--teal-900); color: #fff; border-radius: 32px;
  margin: 0 7vw; padding: 56px 6vw; position: relative; overflow: hidden;
  display: grid; grid-template-columns: repeat(3,1fr); gap: 40px;
}
.info-band-2 { grid-template-columns: 1fr 1fr; gap: 56px; max-width: 1000px; margin: 0 auto; }
.info-band::before {
  content: ""; position: absolute; top: -70px; right: -70px;
  width: 280px; height: 280px; border-radius: 50%;
  border: 22px solid rgba(217,139,184,.28);
}
.info-band::after {
  content: ""; position: absolute; bottom: -90px; left: 8%;
  width: 200px; height: 200px; border-radius: 50%;
  border: 16px solid rgba(107,143,204,.22);
}
.info-item { position: relative; z-index: 2; }
.info-item h4 { color: var(--coral-500); font-size: 12px; letter-spacing:.1em; text-transform: uppercase; margin-bottom: 12px; font-family: var(--font-body); font-weight: 700; }
.info-item p { font-size: 15px; color: rgba(255,255,255,.84); line-height: 1.7; }
.info-item p strong { color: #fff; }

.public-footer {
  text-align: center; padding: 64px 7vw 40px; color: var(--muted); font-size: 13.5px;
}
.public-footer .brand { justify-content: center; margin-bottom: 18px; }

/* Iconos de redes sociales */
.social-row { display: flex; gap: 12px; justify-content: center; margin: 22px 0; }
.social-row.in-nav { margin: 0; gap: 8px; }
.social-link {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--white); border: 1.5px solid var(--line);
  color: var(--teal-700); transition: .18s ease;
}
.social-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: transparent; }
.social-link svg { width: 19px; height: 19px; }
.social-link.fb:hover    { background: #1877f2; color: #fff; }
.social-link.ig:hover    { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.social-link.wa:hover    { background: #25d366; color: #fff; }
.social-link.tt:hover    { background: #000; color: #fff; }
.social-link.yt:hover    { background: #ff0000; color: #fff; }
.social-row.in-nav .social-link { width: 36px; height: 36px; }
.social-row.in-nav .social-link svg { width: 16px; height: 16px; }

/* ====================== LOGIN ====================== */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
}
.login-aside {
  background: linear-gradient(160deg, var(--teal-700), var(--teal-900));
  color: #fff; padding: 60px 5vw; display: flex; flex-direction: column; justify-content: space-between;
}
.login-aside .brand-mark { background: rgba(255,255,255,.14); }
.login-aside h2 { font-size: 32px; margin-bottom: 14px; max-width: 18ch; }
.login-aside p { color: rgba(255,255,255,.8); max-width: 40ch; }
.login-aside .badge-list { list-style: none; display: grid; gap: 12px; margin-top: 28px; }
.login-aside .badge-list li { display: flex; gap: 10px; align-items:center; font-size: 14.5px; color: rgba(255,255,255,.9); }
.login-aside .badge-list .chk { width:22px;height:22px;border-radius:50%;background:rgba(255,255,255,.18);display:grid;place-items:center;font-size:12px;}

.login-form-side { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 27px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; font-size: 14.5px; }
.field { margin-bottom: 16px; }
.field label { display:block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; background: #fff; transition: .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-50); }

.quick-roles { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.quick-roles .qr-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing:.06em; margin-bottom: 12px; }
.qr-btns { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.qr-btn {
  padding: 12px 8px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: #fff; text-align: center; transition: .15s; font-family: inherit;
}
.qr-btn:hover { border-color: var(--teal-500); background: var(--teal-50); }
.qr-btn .qr-ico { font-size: 20px; display:block; margin-bottom: 4px; }
.qr-btn .qr-name { font-size: 12.5px; font-weight: 600; }

/* ====================== APP SHELL ====================== */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--teal-900); color: #fff; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 6px 8px 20px; }
.sidebar .brand .brand-text strong { color: #fff; }
.sidebar .brand .brand-text span { color: rgba(255,255,255,.6); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: 10px; color: rgba(255,255,255,.75); font-size: 14.5px; font-weight: 500;
  transition: .15s; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--teal-600); color: #fff; }
.nav-item .ni-ico { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; }
.nav-item .ni-ico svg { width: 20px; height: 20px; opacity: .9; }
.nav-item.active .ni-ico svg { opacity: 1; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.user-chip { display:flex; align-items:center; gap:10px; padding: 10px 8px; }
.user-chip .avatar { width:36px;height:36px;border-radius:50%;background:var(--coral-600);display:grid;place-items:center;font-weight:700;font-size:14px; }
.user-chip .uc-name { font-size: 13.5px; font-weight: 600; }
.user-chip .uc-role { font-size: 12px; color: rgba(255,255,255,.6); text-transform: capitalize; }

.main { padding: 28px 34px; overflow-y: auto; max-height: 100vh; }
.topbar { display:flex; align-items:center; justify-content: space-between; margin-bottom: 26px; }
.topbar h1 { font-size: 26px; }
.topbar .tb-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.topbar-actions { display:flex; gap: 10px; align-items:center; }
.mobile-menu-btn { display: none; margin-bottom: 8px; }

/* KPIs */
.kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 26px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.kpi .kpi-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.kpi .kpi-val { font-size: 30px; font-family: var(--font-display); font-weight: 600; }
.kpi .kpi-meta { font-size: 12.5px; margin-top: 6px; color: var(--st-completada); font-weight: 600; }
.kpi.accent { background: var(--teal-900); color: #fff; border-color: transparent; }
.kpi.accent .kpi-label { color: rgba(255,255,255,.7); }
.kpi.accent .kpi-meta { color: var(--coral-500); }

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.panel-head { display:flex; align-items:center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { font-size: 18px; }
.panel-head .ph-actions { display:flex; gap: 8px; }

/* Tabla */
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing:.04em; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); }
tbody td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
tbody tr:hover { background: var(--teal-50); }

.badge {
  display:inline-flex; align-items:center; gap:6px; padding: 4px 11px;
  border-radius: 100px; font-size: 12px; font-weight: 600;
}
.badge .bd-dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.confirmada { background:#e3f1f1; color:#1a6a6e; }
.badge.pendiente { background:#fbf0d8; color:#9a6a0e; }
.badge.completada { background:#e2f0e6; color:#3a7048; }
.badge.pendiente_cobro { background:#fbe4d8; color:#a8431e; }
.badge.cancelada { background:#edf0f0; color:#6c7a7a; }
.badge.reagendada { background:#ece5f5; color:#5e438a; }

/* ====================== CALENDARIO (Google-like) ====================== */
.cal-toolbar {
  display:flex; align-items:center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.cal-nav { display:flex; align-items:center; gap: 8px; }
.cal-nav .cal-title { font-family: var(--font-display); font-size: 21px; min-width: 230px; text-transform: capitalize; }
.cal-icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--line);
  background:#fff; display:grid; place-items:center; font-size: 16px; transition: .15s;
}
.cal-icon-btn:hover { border-color: var(--teal-500); background: var(--teal-50); }
.cal-view-switch { display:flex; gap: 4px; background: var(--teal-50); padding: 4px; border-radius: 10px; }
.cal-view-switch button {
  padding: 7px 16px; border-radius: 7px; background: transparent; font-size: 13.5px;
  font-weight: 600; color: var(--muted); transition: .15s;
}
.cal-view-switch button.active { background: #fff; color: var(--teal-700); box-shadow: var(--shadow-sm); }

.cal-legend { display:flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-legend .lg { display:flex; align-items:center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.cal-legend .lg .sw { width: 12px; height: 12px; border-radius: 4px; }

/* Vista MES */
.cal-month {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background:#fff;
}
.cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); background: var(--teal-50); }
.cal-weekdays div { padding: 10px; text-align:center; font-size: 12px; font-weight:700; color: var(--teal-700); text-transform: uppercase; letter-spacing:.04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-cell {
  min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 7px 8px; position: relative; transition: .12s; cursor: pointer;
}
.cal-cell:hover { background: var(--teal-50); }
.cal-cell.other-month { background: #fafcfc; }
.cal-cell.other-month .cal-daynum { color: #c2d0d0; }
.cal-cell.today .cal-daynum {
  background: var(--coral-600); color:#fff; width: 26px; height: 26px;
  border-radius: 50%; display:grid; place-items:center;
}
.cal-daynum { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.cal-event {
  font-size: 11.5px; padding: 3px 7px; border-radius: 6px; margin-bottom: 3px;
  color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: .12s;
}
.cal-event:hover { filter: brightness(1.08); transform: translateX(1px); }
.cal-more { font-size: 11px; color: var(--teal-600); font-weight: 600; padding-left: 4px; }

/* Vista SEMANA / DÍA */
.cal-week { display:flex; border:1px solid var(--line); border-radius: var(--radius); overflow: hidden; background:#fff; }
.cal-timecol { width: 64px; flex-shrink:0; border-right:1px solid var(--line); }
.cal-timecol .th-spacer { height: 46px; border-bottom:1px solid var(--line); }
.cal-hour-label { height: 56px; font-size: 11px; color: var(--muted); text-align:right; padding: 2px 8px 0 0; position: relative; top: -7px; }
.cal-week-body { flex:1; display:flex; }
.cal-daycol { flex:1; border-right: 1px solid var(--line); position: relative; }
.cal-daycol:last-child { border-right:none; }
.cal-daycol-head { height:46px; border-bottom:1px solid var(--line); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.cal-daycol-head .dh-day { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.cal-daycol-head .dh-num { font-size: 17px; font-weight: 700; font-family: var(--font-display); }
.cal-daycol-head.today .dh-num { color: var(--coral-600); }
.cal-hourline { height: 56px; border-bottom: 1px solid var(--line); }
.cal-tevent {
  position: absolute; border-radius: 6px; padding: 3px 7px;
  color: #fff; font-size: 11px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm); border-left: 3px solid rgba(255,255,255,.5);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: filter .12s;
}
.cal-tevent:hover { filter: brightness(1.08); z-index: 5; }
.cal-tevent strong { font-size: 11px; flex-shrink: 0; }
.cal-tevent span { opacity: .92; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }

/* ====================== FORMULARIO AGENDAR ====================== */
.agendar-modal { max-width: 460px; }
.agendar-steps { display: flex; gap: 6px; margin-top: 8px; }
.ag-dot { width: 28px; height: 4px; border-radius: 100px; background: var(--line); transition: .2s; }
.ag-dot.on { background: var(--teal-500); }
.ag-dot.cur { background: var(--teal-600); }
.ag-label { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; display:flex; align-items:center; justify-content:space-between; }
.ag-sub { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.ag-input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; }
.ag-input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px var(--teal-50); }
.ag-nota { font-size: 12.5px; color: var(--muted); margin-top: 10px; background: var(--teal-50); padding: 10px 12px; border-radius: 8px; }

.ag-sedes { display: grid; gap: 10px; }
.ag-sede { text-align: left; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: .15s; }
.ag-sede:hover { border-color: var(--teal-500); background: var(--teal-50); }
.ag-sede.sel { border-color: var(--teal-600); background: var(--teal-50); box-shadow: 0 0 0 3px var(--teal-50); }
.ag-sede strong { display: block; font-size: 14.5px; color: var(--ink); }
.ag-sede span { font-size: 12.5px; color: var(--muted); }
.ag-sede-unica { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1.5px solid var(--teal-500); background: var(--teal-50); border-radius: var(--radius-sm); }
.ag-sede-unica .ag-pin { font-size: 20px; }
.ag-sede-unica strong { display: block; font-size: 15px; color: var(--ink); }
.ag-sede-unica span { font-size: 13px; color: var(--muted); }

.ag-resumen { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ag-resumen span { font-size: 13px; color: var(--teal-700); font-weight: 600; background: var(--teal-50); padding: 6px 11px; border-radius: 100px; }

.ag-libres { font-size: 12px; font-weight: 600; color: var(--st-completada); background: #e2f0e6; padding: 3px 10px; border-radius: 100px; }
.ag-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ag-slot { padding: 10px 4px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink); transition: .12s; }
.ag-slot:hover:not(:disabled) { border-color: var(--teal-500); background: var(--teal-50); }
.ag-slot.sel { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }
.ag-slot.ocupado { background: #f1f4f4; color: #c0cccc; border-color: transparent; cursor: not-allowed; text-decoration: line-through; }

.ag-leyenda { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.ag-leyenda span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ag-leyenda i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.ag-leyenda .lg-libre { background: #fff; border: 1.5px solid var(--line); }
.ag-leyenda .lg-ocup { background: #f1f4f4; }
.ag-leyenda .lg-sel { background: var(--teal-600); }

.ag-exito { text-align: center; padding: 10px 0; }
.ag-check { width: 64px; height: 64px; border-radius: 50%; background: #e2f0e6; color: var(--st-completada); font-size: 32px; display: grid; place-items: center; margin: 0 auto 16px; }
.ag-exito h3 { font-size: 22px; margin-bottom: 8px; }
.ag-exito > p { color: var(--muted); font-size: 14.5px; max-width: 36ch; margin: 0 auto 20px; }
.ag-ticket { background: var(--teal-50); border-radius: var(--radius-sm); padding: 16px 18px; text-align: left; }
.ag-trow { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--teal-100); font-size: 14px; }
.ag-trow:last-child { border: none; }
.ag-trow span { color: var(--muted); }
.ag-demo-badge { margin-top: 16px; font-size: 12px; color: var(--coral-600); background: var(--coral-100); padding: 10px 12px; border-radius: 8px; }
.ag-cargando { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }

@media (max-width: 560px) {
  .ag-slots { grid-template-columns: repeat(3, 1fr); }
}

/* ====================== BADGE NOTIFICACIÓN ====================== */
.nav-item { display: flex; align-items: center; gap: 10px; }
.ni-label { flex: 1; }
.nav-badge { background: var(--coral-600); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 100px; display: inline-flex; align-items: center; justify-content: center; }

.ag-sincupo { text-align: center; padding: 30px 20px; background: var(--coral-100); border-radius: var(--radius-sm); }
.ag-sincupo p { margin-bottom: 6px; color: var(--coral-600); font-weight: 600; }

/* ====================== CORRELACIÓN DE PACIENTES ====================== */
.corr-lista { display: flex; flex-direction: column; gap: 8px; }
.corr-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: .15s; text-align: left; background: #fff; }
.corr-item:hover { border-color: var(--teal-500); background: var(--teal-50); }
.corr-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--teal-600); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 18px; flex-shrink: 0; }
.corr-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.corr-info strong { font-size: 14.5px; color: var(--ink); }
.corr-info span { font-size: 12.5px; color: var(--muted); }
.corr-razon { color: var(--teal-700) !important; font-weight: 500; }
.corr-pick { font-size: 13px; color: var(--teal-700); font-weight: 600; flex-shrink: 0; }

/* ====================== SERVICIOS / CIERRE CONSULTA ====================== */
.serv-lista { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.serv-check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: .12s; }
.serv-check:hover { border-color: var(--teal-500); background: var(--teal-50); }
.serv-check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--teal-600); }
.serv-nombre { flex: 1; font-size: 14px; font-weight: 500; }
.serv-precio { font-size: 14px; font-weight: 700; color: var(--teal-700); }
.serv-total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--line); }
.serv-cortesia { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.serv-cortesia input { width: 16px; height: 16px; accent-color: var(--coral-600); }
.serv-total { font-size: 16px; }
.serv-total strong { font-size: 22px; color: var(--teal-700); font-family: var(--font-display); }

/* catálogo de servicios en config */
.cat-serv-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cat-serv-item input[type=text] { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.cat-serv-item input[type=number] { width: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
.cat-serv-item .cat-del { color: var(--coral-600); background: none; font-size: 18px; cursor: pointer; padding: 4px 8px; }

/* ====================== HERRAMIENTAS ====================== */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tool-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; cursor: pointer; transition: .18s; display: flex; flex-direction: column; gap: 6px; }
.tool-card:hover { border-color: var(--teal-500); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-ico { font-size: 30px; margin-bottom: 8px; }
.tool-card strong { font-size: 16px; color: var(--ink); }
.tool-card span { font-size: 13px; color: var(--muted); line-height: 1.45; }

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.calc-box { background: var(--teal-50); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.calc-box.big { grid-column: 1 / -1; background: var(--teal-600); }
.calc-box.big .calc-label { color: rgba(255,255,255,.8); }
.calc-box.big .calc-val { color: #fff; }
.calc-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.calc-val { font-size: 32px; font-weight: 700; color: var(--teal-700); font-family: var(--font-display); line-height: 1; }
.calc-val small { font-size: 15px; font-weight: 500; }
.calc-val2 { font-size: 17px; font-weight: 600; color: var(--teal-700); }
.calc-alerta { background: var(--coral-100); color: var(--coral-600); padding: 12px 14px; border-radius: 8px; font-size: 13.5px; margin-top: 16px; }

@media (max-width: 560px) { .calc-grid { grid-template-columns: 1fr; } }

/* ====================== PACIENTES NUEVOS ====================== */
.nuevos-lista { display: flex; flex-direction: column; gap: 10px; }
.nuevo-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); position: relative; transition: .15s; }
.nuevo-card:hover { border-color: var(--teal-100); background: var(--teal-50); }
.nuevo-badge { background: var(--st-completada); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 100px; letter-spacing: .04em; flex-shrink: 0; }
.nuevo-info { flex: 1; min-width: 0; }
.nuevo-info strong { display: block; font-size: 15px; }
.nuevo-info span { font-size: 13px; color: var(--muted); }
.nuevo-motivo { font-size: 13px; color: var(--teal-700); font-style: italic; margin-top: 4px; }
.nuevo-acc { display: flex; gap: 8px; flex-shrink: 0; }
.nuevo-vacio { color: var(--muted); font-size: 14px; text-align: center; padding: 30px; font-style: italic; }

@media (max-width: 560px) {
  .nuevo-card { flex-wrap: wrap; }
  .nuevo-acc { width: 100%; }
  .nuevo-acc .btn { flex: 1; }
}

/* ====================== GRÁFICA TENDENCIA ====================== */
.tend-chart { display: flex; align-items: flex-end; justify-content: space-around; gap: 12px; height: 190px; padding: 10px 0; }
.tend-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; }
.tend-bar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 160px; width: 100%; }
.tend-monto { font-size: 11px; color: var(--teal-700); font-weight: 600; margin-bottom: 4px; }
.tend-bar { width: 60%; max-width: 48px; background: linear-gradient(180deg, var(--teal-500), var(--teal-600)); border-radius: 6px 6px 0 0; transition: height .4s; min-height: 4px; }
.tend-mes { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ====================== BUSCADOR GLOBAL ====================== */
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.buscador-global { position: relative; }
.buscador-global .bg-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .6; }
.buscador-global input { padding: 9px 14px 9px 34px; border: 1.5px solid var(--line); border-radius: 100px; font-size: 13.5px; width: 220px; font-family: inherit; transition: .15s; }
.buscador-global input:focus { outline: none; border-color: var(--teal-500); width: 260px; box-shadow: 0 0 0 3px var(--teal-50); }
.bg-resultados { position: absolute; top: calc(100% + 6px); right: 0; width: 300px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; display: none; z-index: 50; }
.bg-resultados.show { display: block; }
.bg-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; background: none; border: none; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; transition: .12s; }
.bg-item:last-child { border-bottom: none; }
.bg-item:hover { background: var(--teal-50); }
.bg-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-600); color: #fff; display: grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.bg-item strong { display: block; font-size: 13.5px; color: var(--ink); }
.bg-item span { font-size: 12px; color: var(--muted); }
.bg-vacio { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 768px) {
  .buscador-global input { width: 130px; }
  .buscador-global input:focus { width: 160px; }
}

/* ====================== ALERTAS CLÍNICAS ====================== */
.alertas-panel { border-left: 3px solid var(--coral-600); }
.alertas-count { background: var(--coral-600); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 100px; }
.alertas-lista { display: flex; flex-direction: column; gap: 8px; }
.alerta-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.alerta-item.warn { background: #fdf6ec; border-color: #f5e0c0; }
.alerta-item.clinical { background: var(--teal-50); border-color: var(--teal-100); }
.alerta-item.new { background: #eaf4ee; border-color: #cfe6d8; }
.alerta-item.info { background: #eef3fb; border-color: #d6e2f3; }
.alerta-ico { font-size: 20px; flex-shrink: 0; }
.alerta-txt { flex: 1; min-width: 0; }
.alerta-txt strong { display: block; font-size: 14px; color: var(--ink); }
.alerta-txt span { font-size: 12.5px; color: var(--muted); }

@media (max-width: 560px) {
  .alerta-item { flex-wrap: wrap; }
  .alerta-item .btn { width: 100%; }
}

/* ====================== EMBARAZO (timeline) ====================== */
.emb-vacio { text-align: center; padding: 40px 20px; color: var(--ink); }
.emb-vacio p { margin-bottom: 8px; }
.emb-hero { display: flex; gap: 18px; align-items: center; background: var(--teal-50); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px; }
.emb-sem { text-align: center; flex-shrink: 0; }
.emb-num { font-size: 44px; font-weight: 700; color: var(--teal-600); font-family: var(--font-display); line-height: 1; display: block; }
.emb-sub { font-size: 12.5px; color: var(--muted); }
.emb-info { flex: 1; }
.emb-tri { font-size: 15px; font-weight: 600; color: var(--teal-700); margin-bottom: 8px; }
.emb-bar { height: 8px; background: #fff; border-radius: 100px; overflow: hidden; margin-bottom: 8px; }
.emb-bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); border-radius: 100px; }
.emb-fpp { font-size: 13px; color: var(--muted); }
.emb-timeline { display: flex; flex-direction: column; }
.emb-hito { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.emb-hito:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.emb-hito.done:not(:last-child)::before { background: var(--teal-500); }
.emb-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; border: 2px solid var(--line); background: #fff; z-index: 1; }
.emb-hito.done .emb-dot { background: var(--teal-600); border-color: var(--teal-600); }
.emb-hito.now .emb-dot { background: var(--coral-600); border-color: var(--coral-600); box-shadow: 0 0 0 4px var(--coral-100); }
.emb-hito-info strong { display: block; font-size: 14px; color: var(--ink); }
.emb-hito.next .emb-hito-info strong { color: var(--muted); }
.emb-hito-info span { font-size: 12.5px; color: var(--muted); }

/* ====================== EXPEDIENTE CLÍNICO ====================== */
.exp-modal { max-width: 1100px !important; width: 95%; max-height: 90vh; display: flex; flex-direction: column; }
.exp-header { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); position: relative; flex-shrink: 0; }
.exp-foto-wrap { position: relative; flex-shrink: 0; }
.exp-foto { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--teal-100); }
.exp-foto-ph { width: 96px; height: 96px; border-radius: 50%; background: var(--teal-600); color: #fff; display: grid; place-items: center; font-size: 38px; font-family: var(--font-display); font-weight: 600; }
.exp-foto-btn { position: absolute; bottom: 2px; right: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--coral-600); color: #fff; font-size: 13px; border: 2.5px solid #fff; cursor: pointer; display: grid; place-items: center; }
.exp-id h3 { font-size: 22px; margin-bottom: 3px; }
.exp-id span { font-size: 14px; color: var(--muted); }
.exp-header .m-close { position: absolute; top: 16px; right: 18px; font-size: 22px; color: var(--muted); background: none; line-height: 1; }

.exp-tabs { display: flex; gap: 2px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; flex-shrink: 0; }
.exp-tab { padding: 13px 16px; background: none; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; transition: .15s; }
.exp-tab:hover { color: var(--teal-700); }
.exp-tab.active { color: var(--teal-700); border-bottom-color: var(--teal-600); }

.exp-body { padding: 22px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.exp-seccion { margin-bottom: 24px; }
.exp-seccion h4 { font-size: 14px; color: var(--teal-700); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-family: var(--font-body); font-weight: 700; }
.exp-vacio { color: var(--muted); font-size: 13.5px; font-style: italic; padding: 8px 0; }
.exp-loading { text-align: center; padding: 40px; color: var(--muted); }
textarea.ag-input { resize: vertical; font-family: inherit; }

/* Archivos tipo Drive */
.arch-drop { border: 2px dashed var(--teal-100); border-radius: var(--radius); padding: 28px 20px; text-align: center; cursor: pointer; transition: .2s; background: var(--teal-50); margin-bottom: 16px; }
.arch-drop:hover, .arch-drop.over { border-color: var(--teal-600); background: #fff; }
.arch-drop-ic { font-size: 32px; margin-bottom: 8px; }
.arch-drop strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.arch-drop span { font-size: 12.5px; color: var(--muted); }
.arch-progress { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.arch-prog-row { font-size: 12.5px; }
.arch-prog-row span { display: block; margin-bottom: 4px; color: var(--muted); }
.arch-bar { height: 6px; background: var(--teal-50); border-radius: 100px; overflow: hidden; }
.arch-bar-fill { height: 100%; background: var(--teal-600); border-radius: 100px; transition: width .2s; }
.arch-lista { display: flex; flex-direction: column; gap: 8px; }
.arch-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: .15s; }
.arch-item:hover { border-color: var(--teal-100); background: var(--teal-50); }
.arch-ico { font-size: 22px; }
.arch-info { flex: 1; min-width: 0; }
.arch-info strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-info span { font-size: 12px; color: var(--muted); }
.arch-acc { display: flex; gap: 6px; }
.arch-btn { padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; background: var(--teal-50); color: var(--teal-700); border: none; cursor: pointer; }
.arch-btn.del { background: #fbe8e0; color: var(--st-pendcobro); }

/* Historial timeline */
.hist-timeline { display: flex; flex-direction: column; gap: 14px; }
.hist-item { display: flex; gap: 14px; }
.hist-fecha { flex-shrink: 0; width: 92px; font-size: 12.5px; color: var(--teal-700); font-weight: 600; padding-top: 12px; }
.hist-card { flex: 1; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--teal-500); border-radius: var(--radius-sm); padding: 12px 14px; }
.hist-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hist-top strong { font-size: 14px; }
.hist-del { background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.hist-card p { font-size: 13px; color: var(--ink); margin-top: 3px; }
.hist-card p b { color: var(--teal-700); }
.hist-form { background: var(--teal-50); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px; }

.campo-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 13.5px; }
.campo-row small { color: var(--muted); }

@media (max-width: 560px) {
  .exp-modal { max-width: 100%; max-height: 96vh; }
  .hist-item { flex-direction: column; gap: 4px; }
  .hist-fecha { width: auto; padding-top: 0; }
}

/* ====================== MODAL ====================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(12,40,42,.45); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 90vh; display:flex; flex-direction:column;
}
.modal-head { padding: 22px 24px; border-bottom: 1px solid var(--line); display:flex; justify-content:space-between; align-items:flex-start; }
.modal-head h3 { font-size: 20px; }
.modal-head .m-close { font-size: 22px; color: var(--muted); background:none; line-height:1; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display:flex; gap:10px; justify-content:flex-end; }
.detail-row { display:flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border:none; }
.detail-row .dr-label { width: 110px; color: var(--muted); font-size: 13px; flex-shrink:0; }
.detail-row .dr-val { font-size: 14px; font-weight: 500; }

.form-grid { display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1/-1; }
.form-grid .half { grid-column: span 1; }

/* Reportes */
.report-grid { display:grid; grid-template-columns: 2fr 1fr; gap: 22px; }
.bar-chart { display:flex; flex-direction:column; gap: 14px; }
.bar-row { display:grid; grid-template-columns: 130px 1fr 46px; align-items:center; gap: 12px; }
.bar-row .br-label { font-size: 13.5px; }
.bar-track { height: 12px; background: var(--teal-50); border-radius: 100px; overflow:hidden; }
.bar-fill { height:100%; border-radius: 100px; }
.bar-row .br-val { font-size: 13px; font-weight: 700; text-align:right; }

.donut-wrap { display:grid; place-items:center; }

/* Config */
.config-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.tag { display:inline-block; padding: 5px 12px; background: var(--teal-50); color: var(--teal-700); border-radius: 100px; font-size: 13px; margin: 3px; font-weight: 500; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 40px 6vw 50px; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .about-wrap { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { max-width: 380px; margin: 0 auto; }
  .reel-card { max-width: 100%; margin-left: auto; margin-right: auto; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .info-band { grid-template-columns: 1fr; gap: 24px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -260px; z-index: 60; transition: .25s; width: 248px;
  }
  .sidebar.open { left: 0; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .report-grid, .config-grid { grid-template-columns: 1fr; }

  /* NAV móvil: menú hamburguesa */
  .public-nav { padding: 12px 5vw; flex-wrap: wrap; }
  .nav-toggle { display: grid; place-items: center; }
  .brand-text strong { font-size: 15px; }
  .brand-text span { font-size: 11px; }
  .brand-iso { height: 40px; }
  .nav-links {
    display: none; flex-direction: column; align-items: stretch;
    width: 100%; gap: 6px; margin-top: 12px; order: 3;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; border-radius: 8px; font-size: 15px; }
  .nav-links a:hover { background: var(--teal-50); }
  .nav-links .social-row.in-nav { justify-content: flex-start; padding: 8px 0; }
  .nav-links .btn { justify-content: center; margin-top: 4px; }
}

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .kpi-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .main { padding: 16px 14px; }
  .services-grid { grid-template-columns: 1fr; }
  .hero { padding: 28px 6vw 40px; gap: 26px; }
  .hero h1 { font-size: 30px; line-height: 1.12; }
  .hero p.lead { font-size: 16px; }
  .hero-eyebrow { font-size: 10.5px; letter-spacing: .05em; padding: 6px 12px; }
  .hero-cta { gap: 10px; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-visual { max-width: 320px; aspect-ratio: 3/3.4; min-height: 340px; }
  .hero-float { padding: 12px 14px; bottom: 14px; left: 14px; right: 14px; }
  .hero-float strong { font-size: 13px; }
  .hero-float span { font-size: 11.5px; }
  .topbar h1 { font-size: 22px; }
  .panel { padding: 16px; }
  .section-head h2 { font-size: 26px; }
  .about-text h2 { font-size: 26px; }

  /* Calendario móvil: toolbar apilada */
  .cal-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .cal-nav { justify-content: center; flex-wrap: wrap; }
  .cal-nav .cal-title { min-width: auto; font-size: 18px; text-align: center; flex: 1; }
  .cal-toolbar > div:last-child { justify-content: space-between; }
  .cal-view-switch { flex: 1; }
  .cal-view-switch button { flex: 1; padding: 9px 6px; }

  /* Vista MES con scroll horizontal controlado */
  .cal-month, .cal-week { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cal-month .cal-weekdays, .cal-month .cal-grid { min-width: 560px; }
  .cal-week { min-width: 560px; }
  .cal-cell { min-height: 84px; }
  .cal-event { font-size: 10.5px; padding: 2px 5px; }

  /* Modales a pantalla casi completa */
  .modal { max-width: 100%; margin: 0 8px; }
  .modal-foot { flex-direction: column; }
  .modal-foot .btn { width: 100%; justify-content: center; }

  /* Tablas con scroll */
  .panel table { display: block; overflow-x: auto; white-space: nowrap; }

  .hero-eyebrow { font-size: 11px; }
  .section { padding: 44px 6vw; }
  .info-band { padding: 32px 6vw; margin: 0 4vw; }
  .mobile-menu-btn { display: inline-flex; }
}

/* Aviso de día no atendido (jueves/domingo) en el agendador público */
.ag-fecha-bloqueada {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--coral-600);
  background: var(--coral-100);
  padding: 10px 12px;
  border-radius: 8px;
}

/* ===== EXPEDIENTE — SECCIONES CLÍNICAS (estilo MedicalFile moderno) ===== */
.exp-seccion { padding: 4px 2px; }
.exp-seccion-tit {
  font-family: var(--font-display); font-size: 16px; color: var(--teal-700);
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--teal-50);
  display: flex; align-items: center; gap: 10px;
}
.exp-count {
  background: var(--teal-600); color: #fff; font-family: var(--font-body);
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
}
.exp-acciones { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Signos vitales en grid */
.ef-vitales-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ef-vital label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.ef-unidad { color: var(--teal-600); font-weight: 500; }
.ef-sistemas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Tabla de historial de evolución */
.exp-hist-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.exp-hist-tabla th {
  text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .04em; padding: 8px 10px; border-bottom: 1.5px solid var(--line);
}
.exp-hist-tabla td { padding: 11px 10px; border-bottom: 1px solid var(--line); color: var(--teal-900); }
.exp-hist-tabla tr:hover td { background: var(--teal-50); }
.exp-vacio { color: var(--muted); font-size: 13.5px; padding: 14px 0; font-style: italic; }

/* Vista de una nota */
.nota-vista .nota-campo { margin-bottom: 14px; }
.nota-label {
  display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--teal-600); font-weight: 700; margin-bottom: 4px;
}
.nota-campo p { font-size: 14.5px; color: var(--teal-900); line-height: 1.6; white-space: pre-wrap; }
.nota-editor { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .ef-vitales-grid { grid-template-columns: 1fr 1fr; }
  .ef-sistemas { grid-template-columns: 1fr; }
}

/* ===== EXPEDIENTE A PÁGINA COMPLETA (estilo MedicalFile moderno) ===== */
.exp-page { max-width: 1100px; margin: 0 auto; padding: 8px 4px 60px; }
.exp-topbar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px;
}
.exp-volver { font-weight: 600; }
.exp-page-header {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-900));
  border-radius: var(--radius); color: #fff; margin-bottom: 4px;
}
.exp-page-header .exp-id h2 {
  font-family: var(--font-display); font-size: 24px; color: #fff; margin: 0 0 2px;
}
.exp-page-header .exp-id span { color: rgba(255,255,255,.78); font-size: 14px; }
.exp-page-header .exp-foto, .exp-page-header .exp-foto-ph {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
}
.exp-page-header .exp-foto-ph {
  background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 30px; font-weight: 600;
}
.exp-page-header .exp-foto-wrap { position: relative; }
.exp-page-header .exp-foto-btn {
  position: absolute; bottom: -2px; right: -2px; width: 26px; height: 26px;
  border-radius: 50%; border: 2px solid var(--teal-900); background: var(--coral-500);
  cursor: pointer; font-size: 12px; display: grid; place-items: center;
}

/* Pestañas a página */
.exp-page .exp-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line);
  margin: 22px 0 0; padding: 0;
}
.exp-page .exp-tab {
  background: none; border: none; padding: 12px 18px; font-size: 14.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; font-family: var(--font-body); transition: color .15s;
}
.exp-page .exp-tab:hover { color: var(--teal-700); }
.exp-page .exp-tab.active { color: var(--teal-700); border-bottom-color: var(--teal-600); }

/* Cuerpo con MUCHO espacio para campos (Byron maneja mucho texto) */
.exp-page .exp-body { padding: 28px 4px; }
.exp-page .field { margin-bottom: 20px; }
.exp-page .field label {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--teal-900); margin-bottom: 7px;
}
.exp-page .field textarea.ag-input {
  min-height: 120px; line-height: 1.6; font-size: 15px; padding: 14px 16px; resize: vertical;
}
.exp-page .field input.ag-input { font-size: 15px; padding: 13px 16px; }
/* Campos SOAP de evolución: bien grandes */
.exp-page #soap-subjetivo, .exp-page #soap-objetivo,
.exp-page #soap-diagnostico, .exp-page #soap-tratamiento { min-height: 140px; }
.exp-page #pad-descripcion { min-height: 200px; }
/* Exploración por sistemas: textareas más altas */
.exp-page .ef-sistemas textarea.ag-input { min-height: 90px; }
.exp-page .exp-seccion-tit { font-size: 17px; margin-bottom: 18px; }

@media (max-width: 900px) {
  .exp-page .exp-tab { padding: 10px 12px; font-size: 13px; }
  .exp-page-header { flex-direction: row; padding: 18px; }
}
