/* La paleta cobalto y menta vale para toda la plataforma: inicio, ingreso, registro y la app */
body {
  --bg: #f2f6fc;
  --surface: #fff;
  --surface-2: #f6f8fd;
  --border: #dbe4f1;
  --border-strong: #adbcd3;
  --text: #112345;
  --text-2: #253b5d;
  --muted: #4c607c;
  --subtle: #5c6d85;
  --accent: #2048e0;
  --accent-2: #3b61f5;
  --accent-hover: #1635b4;
  --accent-soft: #e8eeff;
  --accent-ring: #2048e052;
  --ok: #006751;
  --ok-soft: #d8f8eb;
  --warn: #8a3a16;
  --warn-soft: #ffeadc;
  --danger: #aa2149;
  --danger-soft: #ffe8ee;
  --st-agendada: #103eaa;
  --st-agendada-bg: #c5dbff;
  --st-confirmada: #005344;
  --st-confirmada-bg: #9cf2d1;
  --st-atendida: #51259c;
  --st-atendida-bg: #dec4ff;
  --st-no_asistio: #783408;
  --st-no_asistio-bg: #ffcf92;
  --st-cancelada: #8b1742;
  --st-cancelada-bg: #ffb9ce;
  --radius: 17px;
  --radius-sm: 10px;
  --shadow: 0 3px 8px #13336108;
  --shadow-md: 0 8px 22px #1333611b;
  --shadow-lg: 0 16px 48px #14284830;
  --mint-action: #acffd6;
  --coral-fill: #ffe2d4;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15.5px;
}

.app { display: block; min-height: 100vh; background: var(--bg); }
.product-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(20px,4vw,55px);
  min-height: 72px;
  padding: 10px max(30px,calc((100vw - 1430px)/2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  /* Fija arriba: los menús quedan a mano al recorrer la agenda o una ficha larga */
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 0 var(--border), 0 6px 18px -14px rgba(15, 23, 42, .35);
}
.product-header .sidebar-brand { padding: 0; font-size: 24px; letter-spacing: -.045em; }
.product-header .logo {
  background: var(--accent); color: #fff; width: 36px; height: 36px;
  border-radius: 11px; font-size: 19px; box-shadow: 0 4px 8px #2048e031;
}
.product-header .nav { display: flex; flex-direction: row; gap: 6px; min-width: 0; flex-wrap: wrap; }
.product-header .nav-item {
  font-size: 15px; font-weight: 650; color: var(--muted); min-height: 42px;
  padding: 0 13px; white-space: nowrap; justify-content: flex-start;
}
.product-header .nav-item .icono { color: var(--muted); }
.product-header .nav-item:hover { background: var(--surface-2); color: var(--text); }
.product-header .nav-item[aria-current="page"] { color: #1836b2; background: var(--accent-soft); box-shadow: none; }
.product-header .nav-item[aria-current="page"] .icono { color: var(--accent); }
.product-account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-account .as-member { min-width: 0; }
.product-account select { width: min(250px,22vw); color: var(--text); font-size: 13px; }
.product-profile { position: relative; }
.product-profile-summary {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer; border-radius: 10px; padding: 4px;
}
.product-profile-text { min-width: 0; max-width: 160px; }
.product-profile-text > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-profile-text .small:first-child { font-weight: 650; }
.product-profile-text .muted { margin-top: 1px; }
.product-profile summary::-webkit-details-marker { display: none; }
.product-profile summary .avatar { background: #cff7e8; color: #045b49; }
.product-profile summary::after { content: '⌄'; color: var(--muted); }
.product-profile-actions {
  position: absolute; top: calc(100% + 7px); right: 0; min-width: 160px; display: grid;
  background: var(--surface); padding: 6px; box-shadow: var(--shadow-md);
  border: 1px solid var(--border); border-radius: 12px;
}
.product-profile-actions .btn { justify-content: flex-start; }
.product-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.app-main > .evo, .app-main > .pac-detalle {
  max-width: 1460px;
  padding: 24px 30px 52px;
  margin: 0 auto;
}
.app-main h1 { font-size: clamp(29px,3vw,39px); font-weight: 750; line-height: 1.08; letter-spacing: -.05em; }
.app-main .small { font-size: 13px; }
.app-main .btn, dialog.cd .btn { font-weight: 650; }
.app-main button:focus-visible, .product-header button:focus-visible, .product-header summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.schedule-hero {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  color: white; padding: clamp(18px,3vw,32px); border-radius: 24px;
  background: radial-gradient(ellipse at 86% -80%, #6283ff 12%, transparent 74%), linear-gradient(111deg,#1535bf,#2048e0 75%,#284fdf);
  box-shadow: 0 10px 26px #2048e027;
  margin-bottom: 16px;
}
.schedule-hero h1 { color: white; font-size: clamp(35px,4vw,49px); margin: 5px 0 4px; }
.schedule-hero p { margin: 0; color: #f3f5ff; font-weight: 600; font-size: 16px; text-transform: capitalize; }
.schedule-label { font-size: 13px; font-weight: 650; color: #f2f5ff; }
.schedule-overview { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.schedule-metric {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-left: 2px solid #84acee; color: white;
}
.schedule-metric strong { font-size: 33px; line-height: 1; font-variant-numeric: tabular-nums; }
.schedule-metric span { font-size: 14px; font-weight: 650; }
.schedule-hero .agenda-new { background: var(--mint-action); border-color: var(--mint-action); color: #084632; min-height: 44px; padding: 0 16px; }
.schedule-hero .agenda-new:hover { background: #d9ffeb; border-color: #d9ffeb; }
.schedule-hero .agenda-new:focus-visible { outline-color: #fff; }
.schedule-header .ag-barra {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 13px; gap: 10px;
}
.schedule-header .ag-nav, .schedule-header .ag-acciones { flex-wrap: wrap; }
.schedule-header .btn, .schedule-header .input, .schedule-header .seg button { min-height: 36px; font-size: 13px; }
.schedule-header .ag-ir { width: 144px; }
.schedule-header .ag-nav > .btn:first-child, .schedule-header .ag-nav > .btn:nth-child(3) { font-size: 19px; line-height: 1; }
.seg { background: var(--surface-2); }
.seg button[aria-pressed="true"] { color: #1737b5; background: var(--accent-soft); box-shadow: none; }
.ag-leyenda { gap: 7px; margin: 12px 0; }
.ag-leyenda .ag-estado-chip { font-size: 12px; }
.schedule-workspace { display: grid; grid-template-columns: minmax(0,1fr) 272px; align-items: start; gap: 16px; }
.schedule-calendar { min-width: 0; }
.ag-grilla { border-color: var(--border); box-shadow: var(--shadow); }
.ag-cab { background: #f9fbff; }
button.ag-dia { color: var(--muted); font-size: 12px; }
.ag-dia.hoy strong { background: var(--accent); }
.ag-col.hoy { background: #f1f5ff; }
.ag-linea { border-top-color: #dce5f2; }
.ag-linea.menor { border-top-color: #ecf1f8; }
.ag-col, button.ag-dia { border-left-color: var(--border); }
.ag-disp { background: #2050e003; }
.ag-hora { color: var(--muted); font-size: 12px; }
.ag-scroll { max-height: 600px; }
.ag-cita { border-radius: 8px; padding-inline: 6px; }
.ag-cita-hora, .ag-cita-svc, .ag-cita-prof { color: #314866; font-size: 12px; }
.ag-cita-pac { color: var(--text); font-size: 13px; font-weight: 750; }
/* El fondo identifica el estado y la franja conserva el color del profesional. */
.ag-cita .ag-cita-hora { font-weight: 750; }
.ag-cita .ag-estado-icono { font-weight: 800; }
.ag-cita.estado-cancelada {
  opacity: 1;
  background: repeating-linear-gradient(135deg, var(--st-bg), var(--st-bg) 5px,
    color-mix(in srgb, var(--st-bg) 68%, white) 5px,
    color-mix(in srgb, var(--st-bg) 68%, white) 10px);
}
.ag-lista-fila:not(.ag-lista-bloqueo) {
  background: color-mix(in srgb, var(--st-bg) 27%, white);
}
.ag-lista-fila:not(.ag-lista-bloqueo):hover,
.ag-lista-fila:not(.ag-lista-bloqueo):focus-visible {
  background: color-mix(in srgb, var(--st-bg) 46%, white);
}
.ag-lista-fila:not(.ag-lista-bloqueo):focus-visible {
  outline: 2px solid var(--st); outline-offset: 1px;
}
.app-main .card-titulo { color: var(--text); text-transform: none; letter-spacing: -.015em; font-size: 17px; font-weight: 720; margin: 0; }

dialog.cd {
  inset: 0 0 0 auto; margin: 0; width: min(500px,100vw); max-width: 100vw;
  height: 100dvh; max-height: 100dvh; overflow-y: auto; border: 0;
  border-radius: 22px 0 0 22px; color: var(--text);
}
dialog.cd::backdrop { background: #10234852; backdrop-filter: none; }
.cd-cab { padding-block: 25px; }
.cd-titulo h2 { font-size: 25px; font-weight: 750; text-transform: none; color: var(--text); }
.cd-etq { font-size: 12px; color: var(--muted); }
.cd-val { font-size: 15px; color: var(--text); }
.cd-ic { background: var(--accent-soft); color: var(--accent); }
.cd-wa { background: var(--ok-soft); color: var(--ok); }
.cd-pie { background: var(--surface-2); }

.pac-cabecera .pac-cab-fila {
  background: linear-gradient(120deg,#e1edff,#f9fbff 86%);
  border: 1px solid #cdddf6; border-radius: 22px; padding: 23px;
}
.pac-cab-fila .avatar { background: var(--accent); color: white; }
.pac-cab-fila .pac-contacto { margin-top: 4px; }
.pac-detalle .tabs { gap: 6px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.pac-detalle .tab { border: none; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.pac-detalle .tab[aria-selected="true"] { color: #1339b2; background: var(--accent-soft); }
.patient-summary { display: grid; grid-template-columns: minmax(0,5fr) minmax(0,7fr); gap: 16px; align-items: start; }
.patient-summary .resumen-tiles { grid-column: 1/-1; margin: 0; }
.patient-summary .tabla-card { margin: 0; padding: 12px; min-width: 0; }
.patient-summary .card-titulo { padding-block: 3px 9px; }
.patient-summary .evo-tile:nth-child(1) { background: var(--accent-soft); }
.patient-summary .evo-tile:nth-child(2) { background: #ffede1; }
.patient-summary .evo-tile:nth-child(3) { background: var(--ok-soft); }
.patient-summary .lista-simple li { display: grid; justify-items: start; gap: 3px; padding-block: 11px; }
.patient-summary .lista-simple li > .muted { font-size: 13px; }
.patient-summary .tabla-registros { font-size: 13px; }

.cash-header { padding: 4px 0 14px; }
.cash-header .ag-titulo { margin-left: 0; margin-right: 12px; }
.cj-kpis { gap: 14px; }
.cj-kpi { padding: 16px 18px; min-height: 112px; }
.cj-kpi:nth-child(1) { background: var(--accent); color: #fff; border-color: var(--accent); }
.cj-kpi:nth-child(1) .evo-tile-label, .cj-kpi:nth-child(1) .evo-tile-foot, .cj-kpi:nth-child(1) .cj-var b { color: #fff; }
.cj-kpi:nth-child(2) { background: var(--ok-soft); }
.cj-kpi:nth-child(3) { background: var(--coral-fill); }
.cj-kpi:nth-child(4) { background: #e4edff; }
.cj-kpi .evo-tile-value { font-weight: 750; }
.cj-card { padding: 16px 20px; }
.cj-card h3 { font-size: 17px; }
.cj-leyenda { color: var(--muted); }
.cj-lista { border-radius: var(--radius); }

@media (max-width: 1180px) {
  .product-header { gap: 18px; }
  .product-header .nav-item { padding-inline: 9px; }
}
@media (max-width: 1010px) {
  .schedule-workspace { grid-template-columns: minmax(0,1fr); }
  .patient-summary { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .product-header { grid-template-columns: minmax(0,1fr) auto; gap: 7px; padding: 10px 16px; }
  .product-header .nav { grid-column: 1/-1; grid-row: 2; }
  .product-account { grid-column: 2; grid-row: 1; }
  .product-account select { width: min(160px,42vw); }
  .product-header .nav-item { min-height: 44px; font-size: 14px; padding-inline: 9px; }
  .product-header .nav-item .icono { width: 16px; height: 16px; }
  .app-main > .evo, .app-main > .pac-detalle { padding: 15px 14px 36px; }
  .schedule-hero { border-radius: 18px; }
  .schedule-overview { gap: 8px; }
  .schedule-metric { padding-left: 8px; gap: 6px; }
  .schedule-metric strong { font-size: 25px; }
  .schedule-metric span { font-size: 13px; }
  .schedule-header .ag-barra, .pac-cabecera .pac-cab-fila { padding: 12px; }
  .patient-summary .resumen-tiles { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .patient-summary .evo-tile { padding: 8px; }
  .patient-summary .evo-tile-label { font-size: 12px; overflow-wrap: anywhere; }
  .patient-summary .evo-tile-value.chico { font-size: 15px; }
  .pac-detalle .tabs { flex-wrap: wrap; }
  .pac-detalle .tab { font-size: 13px; padding-inline: 7px; }
  dialog.cd { border-radius: 0; }
  .cj-kpi { padding: 10px; }
}
@media (max-width: 360px) {
  .product-header .nav-item { padding-inline: 6px; }
  .product-header .nav-item .icono { display: none; }
}

dialog.cd[open] { display: flex; flex-direction: column; }
dialog.cd .cd-pie { margin-top: auto; padding-block: 18px; }
dialog.cd .cd-cuerpo { padding-bottom: 24px; }
@media (max-width: 760px) {
  .product-profile-text { display: none; }
  .schedule-header .btn, .schedule-header .input, .schedule-header .seg button { min-height: 40px; }
  .schedule-metric { padding-right: 6px; }
}
@media (max-width: 760px) {
  .product-header .sidebar-brand { gap: 7px; font-size: 21px; }
  .product-header .nav-item { width: auto; gap: 6px; }
  .product-profile-summary { gap: 4px; }
  .product-account { gap: 5px; }
  .schedule-header .ag-ir { display: inline-block; }
  .schedule-header .ag-acciones > .btn.small { width: auto; gap: 5px; padding: 0 9px; font-size: 13px; }
  .ag-leyenda { flex-wrap: wrap; overflow: visible; }
  .ag-lista-pac { white-space: normal; overflow-wrap: anywhere; }
}
.schedule-hero p { text-transform: none; }
.schedule-hero p::first-letter { text-transform: uppercase; }
@media (max-width: 760px) {
  .product-account select { width: min(188px,49vw); }
}

/* =====================================================================
   Ajustes del rediseño (revisión)
   ===================================================================== */
/* el inicio y el ingreso usan la misma marca que la app */
.inicio { background: linear-gradient(180deg, #e8eeff 0, var(--bg) 560px); }
.inicio .btn.primary, .login-card .btn.primary { background: var(--accent); border-color: var(--accent); }
.inicio .btn.primary:hover, .login-card .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.inicio .logo, .login-card .logo { background: var(--accent); }
.login-card { border-radius: var(--radius); box-shadow: var(--shadow-md); }
.login { background: linear-gradient(180deg, #e8eeff 0, var(--bg) 480px); }

/* teléfono: el menú queda en una sola fila desplazable, nunca en tres */
@media (max-width: 760px) {
  .product-header .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .product-header .nav::-webkit-scrollbar { display: none; }
  .product-header .nav-item { flex-shrink: 0; }
  /* cabecera de la agenda más compacta para dejar espacio al calendario */
  .schedule-hero { padding: 16px 18px; gap: 12px; }
  .schedule-hero h1 { font-size: 30px; }
  .schedule-label { font-size: 12px; }
}
@media (max-width: 430px) {
  .product-header .nav-item .icono { display: none; }
  .product-header .nav-item { padding-inline: 10px; }
}

/* Elementos fijos dentro de la página: quedan bajo la barra superior */
.panel { top: calc(var(--alto-cabecera, 0px) + 20px); }
.adm-aviso { top: calc(var(--alto-cabecera, 0px) + 8px); }
.cfg-menu { top: calc(var(--alto-cabecera, 0px) + 16px); }
html { scroll-padding-top: calc(var(--alto-cabecera, 0px) + 12px); }

/* Avisos dentro de la cabecera de la agenda (el calendario usa todo el ancho) */
.schedule-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 16px; padding: 22px 26px; }
.schedule-hero h1 { font-size: clamp(32px, 3.4vw, 40px); margin: 2px 0; }
.schedule-workspace { grid-template-columns: minmax(0, 1fr); }
.hero-avisos { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.aviso {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff;
}
.aviso.clic { cursor: pointer; transition: background .15s; }
.aviso.clic:hover { background: rgba(255, 255, 255, .2); }
.aviso.clic:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.aviso.destacado { background: #fff; color: var(--text); border-color: #fff; }
.aviso.destacado.clic:hover { background: #f4f7ff; }
.aviso-ic { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.aviso.destacado .aviso-ic { background: var(--accent-soft); color: var(--accent); }
.aviso-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.aviso-etq { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.aviso.destacado .aviso-etq { color: var(--accent); opacity: 1; }
.aviso-txt strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aviso-txt small { font-size: 13px; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aviso-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 8px 12px;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none;
  background: rgba(255, 255, 255, .2); color: #fff;
}
.aviso-btn:hover { background: rgba(255, 255, 255, .3); }
.aviso.destacado .aviso-btn { background: var(--accent); color: #fff; }
.aviso.destacado .aviso-btn:hover { background: var(--accent-hover); }
.aviso-link { flex: none; font-size: 13px; font-weight: 700; text-decoration: underline; opacity: .92; }
.av-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.av-lista li { display: flex; align-items: center; gap: 8px; }
.av-lista-cita {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: start; gap: 2px; text-align: left; font: inherit; cursor: pointer;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.av-lista-cita:hover { border-color: var(--accent); background: var(--accent-soft); }
.av-lista-cita span { color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  .schedule-hero { grid-template-columns: 1fr; padding: 18px; }
  .hero-avisos { grid-template-columns: 1fr; }
}

/* Disponibilidad en el calendario: fuera del horario de atención se ve gris y
   rayado suave; los bloqueos (con motivo) se distinguen por su rayado más marcado */
.ag-col.con-horario { background: repeating-linear-gradient(-45deg, #eef1f6 0 6px, #e6eaf1 6px 12px); }
.ag-col.con-horario .ag-disp { background: var(--surface); }
.ag-col.hoy.con-horario .ag-disp { background: #f4f7ff; }
.ag-bloqueo {
  background: repeating-linear-gradient(45deg, #fde7e4, #fde7e4 6px, #f9d4cf 6px, #f9d4cf 12px);
  border-top: 2px solid #e8a49b; border-bottom: 1px solid #f0bdb6; color: #8f2f22;
}
.ag-chip-fuera-horario { --st: var(--text-2); --st-bg: #eef1f6; }
.ag-chip-fuera-horario i { width: 14px; height: 14px; border-radius: 4px; display: inline-block;
  background: repeating-linear-gradient(-45deg, #eef1f6 0 3px, #dfe4ec 3px 6px); border: 1px solid #d5dbe5; }
.ag-chip-bloqueo { --st: #8f2f22; --st-bg: #fde7e4; }

/* Horario de atención: un día por fila, con interruptor y horas de 15 en 15 minutos */
dialog.hz-dlg { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
dialog.hz-dlg[open] { display: flex; }
.hz { overflow-y: auto; min-height: 0; flex: 1; margin: 0 -4px; padding: 0 4px; }
.hz-cab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 8px; }
.hz-plantillas { display: grid; gap: 6px; }
.hz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hz-chips .chip { font-size: 13px; }
.hz-dias { display: flex; flex-direction: column; }
.hz-dia { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border); }
.hz-nombre { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 40px; }
.hz-nombre strong { font-size: 15px; }
.hz-dia.off .hz-nombre strong { color: var(--muted); font-weight: 600; }
.hz-tramos { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hz-tramo { display: flex; align-items: center; gap: 8px; }
.hz-hora { width: 104px; min-height: 40px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.hz-a { color: var(--muted); font-size: 14px; }
.hz-quitar { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; }
.hz-quitar:hover { background: var(--danger-soft); color: var(--danger); }
.hz-no { color: var(--muted); font-size: 14px; line-height: 40px; }
.hz-acciones { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.hz-acciones .link-btn { font-size: 13px; }
.hz-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--border); }
.hz-pie p { margin: 0; }
.hz-resumen { font-weight: 650; font-size: 14px; }
.hz-pie .login-error { flex-basis: 100%; order: -1; }
@media (max-width: 560px) {
  .hz-dia { grid-template-columns: 1fr; gap: 6px; }
  .hz-hora { width: 92px; }
  .hz-pie .btn { width: 100%; justify-content: center; }
}

/* Distintivo de pago en las citas */
.ag-pago {
  display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; padding: 1px 7px 1px 5px;
  font-size: 11px; font-weight: 750; line-height: 16px; white-space: nowrap; vertical-align: middle;
}
.ag-pago .icono { width: 11px; height: 11px; stroke-width: 3; }
.ag-pago.pagado { background: #0f8a5f; color: #fff; }
.ag-pago.parcial { background: #fff1c7; color: #8a5a00; box-shadow: inset 0 0 0 1px #f1cf6d; }
.ag-pago.pendiente { background: #ffe1dc; color: #a2321f; box-shadow: inset 0 0 0 1px #f5b1a6; }
.ag-cita .ag-pago { position: absolute; top: 3px; right: 4px; }
.ag-cita .ag-pago.compacto { padding: 0; width: 16px; height: 16px; justify-content: center; }
.ag-lista-pac .ag-pago { margin-left: 8px; }
.ag-cita:has(.ag-pago) .ag-cita-hora { padding-right: 70px; }
.ag-cita:has(.ag-pago.compacto) .ag-cita-hora { padding-right: 20px; }
.hz-tramo { flex-wrap: wrap; }
.hz-sede { width: auto; max-width: 190px; min-height: 40px; padding: 6px 10px; }
.ag-sede { width: auto; max-width: 200px; }
.ag-cita-sede { font-size: 11px; color: #314866; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Selector de fecha propio (vista/calendario.js) */
.cal { position: relative; width: 100%; }
.cal-campo { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.cal-campo.vacio .cal-texto { color: var(--muted); }
.cal-campo .icono { color: var(--accent); flex: none; }
.cal-campo:hover { border-color: var(--border-strong); }
.cal-campo[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.cal-texto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-panel { position: fixed; z-index: 80; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); }
.cal-panel[hidden] { display: none; }
.cal-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-titulo { font-weight: 650; font-size: 15px; color: var(--text); }
.cal-nav { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-size: 22px; line-height: 1; cursor: pointer; }
.cal-nav:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-semana, .cal-grilla { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-semana span { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-dia { height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.cal-dia.finde { color: var(--text-2); }
.cal-dia:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.cal-dia:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-dia.hoy { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 650; color: var(--accent); }
.cal-dia.elegido, .cal-dia.elegido:hover { background: var(--accent); color: #fff; font-weight: 650; box-shadow: none; }
.cal-dia:disabled { color: var(--border-strong); cursor: default; }
.cal-atajos { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cal-atajo { flex: 1; padding: 7px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; }
.cal-atajo:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cal-atajo:disabled { opacity: .4; cursor: default; }

/* Mensajes de WhatsApp: editor (Configuración) y envío desde la cita */
.msj-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.msj-cab h3 { margin: 0; }
.msj-lista { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.msj-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.msj-item-txt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.msj-item-txt p { flex-basis: 100%; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msj-item-bts { display: flex; gap: 6px; flex: none; }
.msj-editor { display: grid; gap: 16px; }
.msj-editor h3 { margin: 0; }
.msj-editor .field { display: grid; gap: 4px; }
.msj-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.msj-col { display: grid; gap: 6px; }
.msj-texto { min-height: 210px; resize: vertical; font: inherit; line-height: 1.5; }
.msj-datos { display: grid; gap: 12px; margin-top: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.msj-grupo-tit { display: block; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.msj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.msj-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.msj-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.msj-chip.enlace { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); color: var(--ok); background: var(--ok-soft); font-weight: 600; }
.msj-ayuda { margin: 4px 0 0; line-height: 1.5; }
@media (max-width: 860px) { .msj-cols { grid-template-columns: 1fr; } }

.wa-fondo { padding: 18px 16px; border-radius: 14px; background: #ece5dc radial-gradient(circle at 1px 1px, rgba(0,0,0,.05) 1px, transparent 0) 0 0 / 14px 14px; }
.wa-burbuja { position: relative; max-width: 92%; padding: 10px 12px 12px; border-radius: 4px 12px 12px 12px; background: #fff; color: #1f2933; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-burbuja b { font-weight: 650; }
.wa-envio { display: grid; gap: 12px; }
.wa-opciones { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-opcion { padding: 7px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13.5px; cursor: pointer; }
.wa-opcion:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.wa-opcion.activa { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }
.wa-opcion:disabled { opacity: .45; cursor: default; }
.wa-nota { margin: 0; }
.wa-nota:empty { display: none; }

.cd-cambio { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); font-size: 14px; }
.cd-cambio .icono { color: var(--warn); flex: none; margin-top: 2px; }
.cd-cambio p { margin: 4px 0 0; color: var(--text-2); }
.cd-cambio-bts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wa-envio a.btn { text-decoration: none; }

/* Marca Clivio: símbolo (la «C» que acoge al paciente) y nombre con los puntos de las «i» en menta */
.logo svg { display: block; width: 72%; height: 72%; }
.wm { display: inline-flex; align-items: baseline; font-weight: 760; letter-spacing: -.04em; color: var(--text); }
.wm-i { position: relative; display: inline-block; }
.wm-i::after { content: ""; position: absolute; left: 50%; top: .05em; width: .17em; height: .17em; border-radius: 50%; background: #12b76a; transform: translateX(-50%); }
