/* ============================================================
   FOCUSIA — Dashboard Clinico
   Paleta: negro + blanco (principal), morado IA (secundario)
   ============================================================ */

:root{
  --bg:        #f4f3f7;
  --surface:   #ffffff;
  --surface-2: #ecebf2;
  --ink:       #16141c;
  --ink-soft:  #6b6878;
  --line:      #e4e2ec;
  --black:     #0b0b10;
  --black-2:   #15141c;
  --purple:    #7c4dff;
  --purple-2:  #6a3df0;
  --purple-soft:#efe9ff;
  --danger:    #c0392b;
  --ok:        #2e9e63;
  --radius:    14px;
  --shadow:    0 10px 30px rgba(20,18,28,.07);
}

*{ box-sizing:border-box; margin:0; padding:0; }
html,body,#root{ height:100%; }
body{
  font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','SF Pro Text','Hanken Grotesk',system-ui,sans-serif;
  background:var(--bg); color:var(--ink);
  font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.serif{ font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','SF Pro Text','Hanken Grotesk',system-ui,sans-serif; font-weight:600; letter-spacing:-.01em; }

/* ---------- LOGIN ---------- */
.login-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background:
    radial-gradient(80% 60% at 50% 12%, rgba(124,77,255,.30) 0%, rgba(124,77,255,0) 60%),
    linear-gradient(180deg,#0d0c12,#070709);
}
.login-card{
  background:var(--black-2); width:100%; max-width:400px; border:1px solid #221f2c;
  border-radius:20px; padding:40px 36px; box-shadow:0 30px 70px rgba(0,0,0,.5); text-align:center;
}
.login-logo{ width:170px; margin:0 auto 22px; display:block; }
.login-card .tag{ color:#8e8a9c; font-size:11px; margin-bottom:26px; letter-spacing:.18em; text-transform:uppercase; }
.login-card label{ text-align:left; color:#a7a3b6; }
.login-card input{ background:#201d2a; border:1px solid #322e3f; color:#fff; }
.login-card input:focus{ border-color:var(--purple); box-shadow:0 0 0 3px rgba(124,77,255,.25); }

/* ---------- LAYOUT ---------- */
.app{ display:grid; grid-template-columns:248px 1fr; min-height:100vh; }
.sidebar{
  background:linear-gradient(180deg,#0d0c12,#060608); color:#cfccda;
  padding:26px 18px; display:flex; flex-direction:column;
}
.side-logo{ width:75px; display:block; margin:6px auto 22px; }
.side-sub{ font-size:10.5px; letter-spacing:.22em; text-transform:uppercase; color:#7a7689; text-align:center; padding-bottom:26px; }
.nav-item{
  display:flex; align-items:center; gap:12px; padding:12px 16px; border-radius:100px;
  color:#b6b2c4; cursor:pointer; font-weight:500; font-size:14.5px; transition:.2s; margin-bottom:4px;
  border:1px solid transparent;
}
.nav-item:hover{ background:rgba(255,255,255,.05); color:#fff; border-color:rgba(255,255,255,.12); transform:translateX(2px); }
.nav-item.active{ background:linear-gradient(135deg,var(--purple),#6a3ff0); color:#fff; font-weight:600; box-shadow:0 10px 26px rgba(124,77,255,.45); border-color:transparent; }
.nav-item .ic{ width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; opacity:.95; flex:0 0 auto; }
.nav-item .ic svg{ width:19px; height:19px; display:block; }
.nav-spacer{ flex:1; }
.nav-user{ border-top:1px solid rgba(255,255,255,.1); padding-top:16px; font-size:13px; color:#9a96a9; }
.nav-user b{ color:#fff; display:block; font-weight:600; }
.logout{ margin-top:10px; background:none; border:1px solid rgba(255,255,255,.18); color:#c3bfd1;
  padding:7px 12px; border-radius:8px; cursor:pointer; font-size:12.5px; width:100%; }
.logout:hover{ background:rgba(255,255,255,.07); }

.main{ padding:34px 40px; overflow:auto; }
.page-head{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:26px; gap:16px; flex-wrap:wrap; }
.page-head h1{ font-size:28px; color:var(--ink); }
.page-head p{ color:var(--ink-soft); font-size:13.5px; }

/* ---------- CARDS / STATS ---------- */
.stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; margin-bottom:30px; }
.stat{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow); }
.stat .label{ font-size:12px; text-transform:uppercase; letter-spacing:.1em; color:var(--ink-soft); }
.stat .value{ font-family:inherit; font-weight:700; font-size:28px; letter-spacing:-.02em; color:var(--ink); margin-top:6px; }
.stat.gold{ background:linear-gradient(140deg,#2a1d4d,#1b1530); border-color:#3a2d63; }
.stat.gold .label{ color:#c9bdf0; } .stat.gold .value{ color:#fff; }

.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:24px; margin-bottom:20px; }

/* ---------- TABLES ---------- */
table{ width:100%; border-collapse:collapse; }
th{ text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--ink-soft); padding:10px 12px; border-bottom:2px solid var(--line); }
td{ padding:13px 12px; border-bottom:1px solid var(--line); font-size:14px; }
tr:hover td{ background:rgba(124,77,255,.04); }
.row-click{ cursor:pointer; }

/* ---------- FORMS ---------- */
label{ display:block; font-size:12.5px; font-weight:600; color:var(--ink-soft); margin-bottom:5px; }
input,select,textarea{ width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:var(--surface); font:inherit; color:var(--ink); margin-bottom:14px; }
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--purple); box-shadow:0 0 0 3px rgba(124,77,255,.14); }
textarea{ resize:vertical; min-height:70px; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.grid-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:0 16px; }
.char-count{ font-size:11px; color:var(--ink-soft); margin-top:-10px; margin-bottom:12px; text-align:right; }

/* ---------- BUTTONS ---------- */
.btn{ background:var(--ink); color:#fff; border:none; padding:11px 20px; border-radius:9px; font:inherit; font-weight:600; cursor:pointer; transition:.15s; }
.btn:hover{ background:#2c2838; }
.btn.gold{ background:var(--purple); color:#fff; }
.btn.gold:hover{ background:var(--purple-2); }
.btn.ghost{ background:transparent; color:var(--ink); border:1px solid var(--line); }
.btn.ghost:hover{ background:var(--surface-2); }
.btn.sm{ padding:7px 14px; font-size:13px; }
.btn.danger{ background:var(--danger); }

/* ---------- BADGES / PILLS ---------- */
.pill{ display:inline-block; padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:600; }
.pill.cat{ background:var(--purple-soft); color:var(--purple-2); }
.pill.facial{ background:#e7eef0; color:#2c5a66; }
.pill.corporal{ background:var(--purple-soft); color:var(--purple-2); }
.pill.clinica{ background:#efe9ff; color:#6a3df0; }
.pill.green{ background:#e1efe6; color:var(--ok); }
.pill.red{ background:#f6e3e1; color:var(--danger); }

/* ---------- MODAL ---------- */
.modal-bg{ position:fixed; inset:0; background:rgba(12,10,18,.6); display:flex; align-items:flex-start; justify-content:center; padding:40px 20px; z-index:50; overflow:auto; }
.modal{ background:var(--surface); border-radius:18px; width:100%; max-width:680px; padding:30px 32px; box-shadow:0 30px 70px rgba(0,0,0,.3); }
.modal h2{ color:var(--ink); margin-bottom:18px; font-size:23px; }
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:8px; }
.close-x{ float:right; background:none; border:none; font-size:22px; cursor:pointer; color:var(--ink-soft); }

/* ---------- MISC ---------- */
.empty{ text-align:center; padding:50px 20px; color:var(--ink-soft); }
.empty .ic{ font-size:40px; opacity:.35; display:block; margin-bottom:10px; }
.toolbar{ display:flex; gap:12px; margin-bottom:18px; align-items:center; flex-wrap:wrap; }
.toolbar input{ margin-bottom:0; max-width:280px; }
.section-title{ font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','SF Pro Text','Hanken Grotesk',system-ui,sans-serif; color:var(--ink); font-size:18px; margin:20px 0 10px; }
.treatment-line{ display:grid; grid-template-columns:2fr 1fr 90px 36px; gap:10px; align-items:center; margin-bottom:8px; }
.treatment-line input,.treatment-line select{ margin-bottom:0; }
.x-btn{ background:#f6e3e1; color:var(--danger); border:none; border-radius:8px; cursor:pointer; padding:8px; font-weight:700; }
.muted{ color:var(--ink-soft); font-size:13px; }
.hint{ font-size:12px; color:var(--purple-2); margin-top:-8px; margin-bottom:12px; }
.soon{ background:var(--surface-2); border:1px dashed var(--purple); border-radius:var(--radius); padding:40px; text-align:center; }
.soon h3{ color:var(--ink); font-size:20px; margin-bottom:8px; }

/* ---------- Barra superior móvil + cajón ---------- */
.topbar{ display:none; }
.burger{ background:none; border:none; cursor:pointer; padding:8px; display:flex; flex-direction:column; gap:5px; }
.burger span{ width:22px; height:2px; background:#fff; border-radius:2px; display:block; }
.topbar-logo{ height:30px; width:auto; }
.topbar-logo[src*="horizontal"]{ height:26px; }
.topbar-name{ font-weight:600; font-size:15px; color:#fff; letter-spacing:.02em; }
.drawer-ov{ display:none; }

@media(max-width:820px){
  .app{ grid-template-columns:1fr; }
  /* Barra superior fija */
  .topbar{ display:flex; align-items:center; gap:12px; position:fixed; top:0; left:0; right:0; height:56px;
    padding:0 16px; background:linear-gradient(180deg,#0d0c12,#0a090f); z-index:60; border-bottom:1px solid rgba(255,255,255,.08); }
  /* Sidebar se vuelve cajón deslizante */
  .sidebar{ position:fixed; top:0; left:0; bottom:0; width:80%; max-width:300px; z-index:70;
    transform:translateX(-100%); transition:transform .28s cubic-bezier(.4,0,.2,1); overflow-y:auto; box-shadow:0 0 40px rgba(0,0,0,.5); }
  .app.menu-open .sidebar{ transform:translateX(0); }
  .drawer-ov{ display:block; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:65; }
  .side-logo{ width:64px; margin-top:10px; }
  .nav-spacer{ flex:1; } .nav-user{ display:block; }
  /* Contenido empujado bajo la barra */
  .main{ padding:74px 16px 40px; overflow-x:hidden; }
  .grid-2,.grid-3{ grid-template-columns:1fr; }
  .card{ overflow-x:auto; }
  .page-head h1{ font-size:23px; }
  .stats{ grid-template-columns:1fr 1fr; gap:11px; }
  .stat .value{ font-size:22px; }
  table{ font-size:13px; }
  .modal-bg{ padding:74px 12px 24px; }
  .modal{ padding:22px 18px; }
}
@media(max-width:430px){
  .stats{ grid-template-columns:1fr; }
}

/* checkbox alineado */
.check-row{ display:flex; align-items:center; gap:9px; margin-bottom:14px; cursor:pointer; }
.check-row input{ width:auto; margin:0; }
.check-row span{ font-weight:500; color:var(--ink); }

/* ---------- Segmented control (Lista / Calendario) ---------- */
.seg{ display:inline-flex; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:3px; }
.seg button{ border:none; background:none; padding:7px 16px; border-radius:8px; cursor:pointer; font:inherit; font-weight:600; color:var(--ink-soft); }
.seg button.on{ background:var(--ink); color:#fff; }

/* ---------- Configuración: filas de horario ---------- */
.hours-row{ display:flex; align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid var(--line); }
.hours-row:last-child{ border-bottom:none; }

/* ---------- Calendario en grilla ---------- */
.cal-nav{ display:flex; align-items:center; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.cal-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:10px; }
.cal-grid{ display:grid; grid-template-columns:60px repeat(7,minmax(120px,1fr)); border:1px solid var(--line); border-radius:10px; overflow:hidden; min-width:760px; }
.cal-corner{ background:var(--surface-2); border-bottom:1px solid var(--line); }
.cal-head{ background:var(--surface-2); padding:8px 6px; text-align:center; font-weight:600; font-size:13px; border-bottom:1px solid var(--line); border-left:1px solid var(--line); }
.cal-head.today{ background:var(--purple-soft); color:var(--purple-2); }
.cal-time{ padding:6px; font-size:11.5px; color:var(--ink-soft); text-align:right; border-bottom:1px solid var(--line); background:var(--surface); }
.cal-cell{ min-height:46px; border-bottom:1px solid var(--line); border-left:1px solid var(--line); padding:3px; cursor:pointer; transition:.1s; }
.cal-cell:hover{ background:rgba(124,77,255,.05); }
.cal-appt{ color:#fff; border-radius:7px; padding:4px 7px; font-size:11.5px; margin-bottom:3px; line-height:1.25; box-shadow:0 2px 6px rgba(0,0,0,.12); }
.cal-appt b{ font-weight:700; }
.cal-dot{ display:inline-block; width:7px; height:7px; border-radius:50%; background:#ffd36b; margin-left:5px; vertical-align:middle; }

/* embudo de conversión (Mensajes) */
.funnel{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.funnel-col{ background:var(--surface-2); border:1px solid var(--line); border-radius:12px; padding:10px; min-height:120px; }
.funnel-head{ font-weight:700; font-size:13px; color:var(--ink); padding:4px 6px 10px; }
.lead-card{ background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:10px 11px; margin-bottom:9px; box-shadow:0 2px 6px rgba(20,18,28,.05); }
.lead-move{ margin:8px 0 0; padding:6px 8px; font-size:12px; }
@media(max-width:820px){ .funnel{ grid-template-columns:1fr 1fr; } }

/* barras de informes */
.bar{ background:var(--surface-2); border-radius:6px; height:10px; overflow:hidden; }
.bar-fill{ height:100%; background:linear-gradient(90deg,var(--purple),var(--purple-2)); border-radius:6px; }


/* ============== LOGIN estilo Apple ============== */
.applogin{ position:fixed; inset:0; overflow:hidden; color:#fff; z-index:50; padding:24px;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(70% 50% at 50% 8%,rgba(124,77,255,.28),rgba(124,77,255,0) 60%),linear-gradient(180deg,#0d0c14,#07070b); }
.applogin::before,.applogin::after{ content:''; position:absolute; border-radius:50%; filter:blur(120px); pointer-events:none; }
.applogin::before{ width:480px; height:480px; background:#5b34d6; top:-160px; left:-120px; opacity:.5; }
.applogin::after{ width:420px; height:420px; background:#7c4dff; bottom:-180px; right:-130px; opacity:.35; }
.applogin .inner{ position:relative; z-index:2; width:100%; max-width:400px; text-align:center; animation:appfade .9s ease both;
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.02)); border:1px solid rgba(255,255,255,.1);
  border-radius:26px; padding:40px 34px; box-shadow:0 40px 100px rgba(0,0,0,.5); backdrop-filter:blur(14px); }
.applogin img{ height:46px; width:auto; opacity:.98; margin-bottom:22px; animation:appfade 1.1s ease both; }
.applogin h1{ font-weight:700; font-size:34px; letter-spacing:-.025em; margin:0 0 8px; }
.applogin .sub{ color:#a7a3b8; font-size:15px; margin-bottom:28px; min-height:20px; }
.applogin .fld{ text-align:left; margin-bottom:14px; }
.applogin label{ color:#8b8794; font-size:12px; letter-spacing:.02em; }
.applogin input{ width:100%; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.14); color:#fff;
  border-radius:12px; padding:13px 14px; font-size:16px; margin-top:5px; outline:none; transition:.18s; }
.applogin input:focus{ border-color:var(--purple); background:rgba(255,255,255,.1); box-shadow:0 0 0 3px rgba(124,77,255,.22); }
.applogin .go{ width:100%; background:linear-gradient(135deg,var(--purple),#6a3ff0); color:#fff; border:none; border-radius:100px;
  padding:15px; font-size:16px; font-weight:600; margin-top:12px; cursor:pointer; transition:.2s; box-shadow:0 14px 36px rgba(124,77,255,.45); }
.applogin .go:hover{ transform:translateY(-2px); box-shadow:0 18px 46px rgba(124,77,255,.6); }
.applogin .err{ color:#ff8a80; font-size:13px; margin-bottom:10px; }
@keyframes appfade{ from{ opacity:0; transform:translateY(14px); } to{ opacity:1; transform:none; } }

/* ============== Bienvenida difuminada diaria ============== */
.welcome{ position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center;
  background:rgba(8,7,12,.55); backdrop-filter:blur(26px); -webkit-backdrop-filter:blur(26px);
  animation:wfadein .6s ease both; }
.welcome.out{ animation:wfadeout .8s ease both; }
.welcome .c{ text-align:center; color:#fff; padding:24px; }
.welcome .hi{ color:#b9b4cc; font-size:20px; font-weight:500; opacity:0; animation:wword .9s .15s ease both; }
.welcome .name{ font-family:inherit; font-weight:600; font-size:54px; letter-spacing:-.02em; margin:6px 0 16px;
  opacity:0; filter:blur(16px); animation:wname 1.1s .35s cubic-bezier(.2,.7,.2,1) both; }
.welcome .ph{ color:#cfcbe0; font-size:18px; max-width:520px; margin:auto; opacity:0; filter:blur(10px);
  animation:wname 1.1s .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes wname{ from{ opacity:0; filter:blur(16px); transform:translateY(16px); } to{ opacity:1; filter:blur(0); transform:none; } }
@keyframes wword{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
@keyframes wfadein{ from{ opacity:0; } to{ opacity:1; } }
@keyframes wfadeout{ from{ opacity:1; } to{ opacity:0; visibility:hidden; } }

/* ============== Visita guiada ============== */
.tour{ position:fixed; inset:0; z-index:70; background:rgba(8,7,12,.6); backdrop-filter:blur(3px);
  display:flex; align-items:center; justify-content:center; padding:24px; }
.tour .box{ background:#fff; border-radius:18px; max-width:420px; padding:26px; box-shadow:0 30px 80px rgba(0,0,0,.5); text-align:center; }
.tour .ic{ font-size:34px; }
.tour h3{ font-family:-apple-system,BlinkMacSystemFont,'SF Pro Display','SF Pro Text','Hanken Grotesk',system-ui,sans-serif; margin:10px 0 6px; color:var(--ink); }
.tour p{ color:#6b6680; font-size:15px; }
.tour .dots{ display:flex; gap:6px; justify-content:center; margin:16px 0; }
.tour .dot{ width:7px; height:7px; border-radius:50%; background:#dcd8ea; }
.tour .dot.on{ background:var(--purple); }
.tour .row{ display:flex; gap:10px; justify-content:center; }

/* Paginación */
.pager{ display:flex; gap:8px; align-items:center; justify-content:center; margin:16px 0; flex-wrap:wrap; }
.pager .muted{ margin:0 6px; }

/* Ticks de confirmación en agenda (estilo WhatsApp) */
.tick{ font-size:11px; margin-left:4px; }
.tick.conf{ color:#34b7f1; }        /* doble check azul = confirmada */
.tick.pend{ color:rgba(255,255,255,.7); } /* check simple = agendada */
.appt.cancel{ opacity:.5; text-decoration:line-through; }

/* Detalle de cita */
.appt-detail .row{ display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid var(--line); }
.appt-detail .row b{ color:var(--ink); }

/* ---------- Orbe 3D de Zairi ---------- */
.orb3d-wrap{ position:relative; display:flex; align-items:center; justify-content:center; }
.orb3d-glow{ position:absolute; inset:-6% ; border-radius:50%; z-index:0;
  background:radial-gradient(circle at 50% 45%, rgba(124,77,255,.65), rgba(124,77,255,.18) 45%, transparent 72%);
  filter:blur(26px); animation:orbglow 4s ease-in-out infinite; }
@keyframes orbglow{ 0%,100%{ transform:scale(1); opacity:.85 } 50%{ transform:scale(1.08); opacity:1 } }

/* ---------- Orbe de Zairi (CSS, fallback / mini) ---------- */
.zairi-orb{ position:relative; width:160px; height:160px; margin:0 auto;
  -webkit-mask:url(/logo.png) center/contain no-repeat; mask:url(/logo.png) center/contain no-repeat;
  filter:drop-shadow(0 0 26px rgba(124,77,255,.95)) saturate(1.5) brightness(1.15);
  animation:zairi-rot 7s linear infinite; }
.zairi-orb span{ position:absolute; inset:0; mix-blend-mode:screen; animation:zairi-pulse 3.5s ease-in-out infinite; }
.zairi-orb span:nth-child(1){ background:radial-gradient(circle at 30% 30%, #b79bff, transparent 60%); }
.zairi-orb span:nth-child(2){ background:radial-gradient(circle at 70% 40%, #7c4dff, transparent 62%); animation-delay:-1.2s; }
.zairi-orb span:nth-child(3){ background:radial-gradient(circle at 50% 78%, #e3d8ff, transparent 58%); animation-delay:-2.4s; }
.zairi-orb::after{ content:''; position:absolute; inset:0;
  background:conic-gradient(from 0deg, #9d7bff, #7c4dff, #d7c9ff, #7c4dff, #9d7bff); opacity:.55; mix-blend-mode:screen;
  animation:zairi-rot 5s linear infinite reverse; }
@keyframes zairi-rot{ to{ transform:rotate(360deg); } }
@keyframes zairi-pulse{ 0%,100%{ transform:scale(1); opacity:.9; } 50%{ transform:scale(1.08); opacity:1; } }

/* ---------- Tarjetas de estado clicleables (panel Hoy) ---------- */
.stat.clickable{ cursor:pointer; transition:.18s; position:relative; }
.stat.clickable:hover{ transform:translateY(-2px); box-shadow:0 10px 26px rgba(0,0,0,.1); }
.stat.clickable .mini{ font-size:12px; color:var(--purple); margin-top:6px; font-weight:600; opacity:.85; }
.stat.clickable.sel{ outline:2px solid var(--purple); outline-offset:0; }
.badge.ok{ background:rgba(31,138,91,.14); color:#1f8a5b; padding:3px 9px; border-radius:100px; font-size:12px; font-weight:600; }
.badge.wait{ background:rgba(214,158,46,.16); color:#a9791b; padding:3px 9px; border-radius:100px; font-size:12px; font-weight:600; }

/* ---------- Orbe de ayuda flotante ---------- */
.help-orb{ position:fixed; right:22px; bottom:22px; width:62px; height:62px; cursor:pointer; z-index:55;
  border-radius:50%; filter:drop-shadow(0 8px 24px rgba(124,77,255,.5)); transition:transform .2s; }
.help-orb:hover{ transform:scale(1.08); }
.help-bubble{ position:absolute; bottom:74px; right:0; white-space:nowrap; background:#15141c; color:#fff;
  border:1px solid #2a2636; padding:10px 14px; border-radius:12px; font-size:13.5px; font-weight:500;
  box-shadow:0 12px 30px rgba(0,0,0,.35); animation:appfade .2s ease both; }
@media(max-width:820px){ .help-orb{ right:14px; bottom:14px; width:54px; height:54px; } }

/* ---------- Agenda vista de un día (móvil) ---------- */
.day-grid{ display:flex; flex-direction:column; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.day-row{ display:grid; grid-template-columns:58px 1fr; min-height:60px; border-bottom:1px solid var(--line); }
.day-row:last-child{ border-bottom:none; }
.day-time{ padding:8px 6px; font-size:12px; color:var(--muted); border-right:1px solid var(--line); display:flex; align-items:flex-start; justify-content:center; }
.day-cell{ padding:6px; cursor:pointer; display:flex; flex-direction:column; gap:6px; }
.day-cell:active{ background:rgba(124,77,255,.06); }
.day-cell .cal-appt{ position:relative; padding:9px 11px; border-radius:9px; font-size:14px; }

/* ---------- Mensajes: ver conversación ---------- */
.lead-chat{ width:100%; margin-top:8px; background:none; border:1px solid var(--line); color:var(--purple-2);
  border-radius:8px; padding:6px; font-size:12.5px; cursor:pointer; transition:.15s; }
.lead-chat:hover{ background:rgba(124,77,255,.08); border-color:var(--purple); }
.chat-thread{ max-height:60vh; overflow-y:auto; display:flex; flex-direction:column; gap:10px; padding:6px 2px; }
.chat-msg{ display:flex; flex-direction:column; max-width:78%; }
.chat-msg.in{ align-self:flex-start; align-items:flex-start; }
.chat-msg.out{ align-self:flex-end; align-items:flex-end; }
.chat-bubble{ padding:9px 13px; border-radius:14px; font-size:14px; line-height:1.45; white-space:pre-wrap; word-break:break-word; }
.chat-msg.in .chat-bubble{ background:var(--surface-2); color:var(--ink); border-bottom-left-radius:4px; }
.chat-msg.out .chat-bubble{ background:linear-gradient(135deg,var(--purple),var(--purple-2)); color:#fff; border-bottom-right-radius:4px; }
.chat-time{ font-size:10.5px; color:var(--muted); margin-top:3px; }

/* ---------- Informes: tarjetas clickeables ---------- */
.stat.clickable{ cursor:pointer; transition:transform .12s, box-shadow .12s, border-color .12s; }
.stat.clickable:hover{ transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,.08); border-color:var(--purple); }
.stat.active-stat{ border-color:var(--purple); box-shadow:0 0 0 2px rgba(124,77,255,.25); }
