﻿/* ══════════════════════════════════════════════════════════════
   Licit GO — Modals, chat panel, toasts, calendar, checklists
══════════════════════════════════════════════════════════════ */

/* ── MODAL ── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:500;display:flex;align-items:center;justify-content:center;padding:20px;opacity:0;pointer-events:none;transition:opacity .2s}
.modal-overlay.open{opacity:1;pointer-events:all}
.modal-box{background:var(--white);border-radius:var(--r20);box-shadow:0 20px 60px rgba(0,0,0,.2);width:100%;max-width:520px;max-height:90vh;overflow-y:auto;padding:28px}
.modal-title{font-size:18px;font-weight:700;color:var(--g1);margin-bottom:18px}
.modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:20px}

/* Task modal: contract context and readable contractual operations. */
.mt-licit-context{display:flex;align-items:center;gap:7px;min-height:20px;margin-top:6px;font-size:12px;font-weight:600;line-height:1.35;color:var(--g3);overflow-wrap:anywhere}
.mt-licit-context.is-empty{font-weight:500;color:var(--g5)}
.mt-licit-dot{width:9px;height:9px;border-radius:50%;background:var(--mt-licit-color,#9ca3af);box-shadow:0 0 0 2px rgba(0,0,0,.08);flex:0 0 auto}
.mt-licit-sep{color:var(--g6)}
.mt-ck-item{display:grid;grid-template-columns:22px minmax(0,1fr) 122px 38px;align-items:start;gap:8px;padding:6px 0;border-bottom:1px solid var(--g9)}
.mt-ck-item:last-child{border-bottom:0}
.mt-ck-check{width:18px;height:18px;margin-top:12px}
.mt-ck-reader,.mt-notes-reader{min-width:0}
.mt-ck-summary,.mt-notes-summary{min-height:44px;display:flex;align-items:center;padding:8px 10px;border:1px solid var(--g8);border-radius:var(--r8);background:var(--white);cursor:pointer;font-size:13px;line-height:1.45;color:var(--g1);overflow-wrap:anywhere}
.mt-ck-summary span,.mt-notes-summary span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.mt-notes-summary span{-webkit-line-clamp:3}
.mt-ck-reader[open] .mt-ck-summary span,.mt-notes-reader[open] .mt-notes-summary span{display:block;overflow:visible}
.mt-ck-reader[open] .mt-ck-summary,.mt-notes-reader[open] .mt-notes-summary{background:var(--g10);border-color:var(--blue)}
.mt-ck-full,.mt-notes-full{display:none;margin:6px 0;padding:10px 12px;border-radius:var(--r8);background:#111827;color:#fff;font-size:13px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:var(--sh-m)}
.mt-ck-reader:not([open]):hover .mt-ck-full,
.mt-ck-reader:not([open]):focus-within .mt-ck-full,
.mt-notes-reader:not([open]):hover .mt-notes-full,
.mt-notes-reader:not([open]):focus-within .mt-notes-full{display:block}
.mt-ck-edit-label,.mt-notes-edit-label{display:block;margin:8px 0 4px;font-size:11px;font-weight:700;color:var(--g4)}
.mt-ck-edit,.mt-notes-edit{resize:vertical;white-space:pre-wrap;line-height:1.45}
.mt-ck-edit{min-height:86px;font-size:13px}
.mt-notes-edit{min-height:118px}
.mt-ck-reader:not([open]) .mt-ck-edit-label,
.mt-ck-reader:not([open]) .mt-ck-edit,
.mt-notes-reader:not([open]) .mt-notes-edit-label,
.mt-notes-reader:not([open]) .mt-notes-edit{display:none}
.mt-ck-type{width:122px}
.mt-ck-delete{width:38px;height:38px;padding:0;justify-content:center}
.mt-ck-item.is-done .mt-ck-summary{text-decoration:line-through;color:var(--g4)}

/* ════════════════════════════════════════════════════
   CHATBOT PANEL
════════════════════════════════════════════════════ */
#chat-fab{
  position:fixed;bottom:24px;right:24px;z-index:999;
  width:52px;height:52px;border-radius:16px;border:none;cursor:pointer;
  background:#374151;color:#fff;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  box-shadow:0 4px 20px rgba(55,65,81,.28),0 2px 8px rgba(0,0,0,.15);
  transition:transform var(--t),box-shadow var(--t),right var(--t),bottom var(--t);
}
#chat-fab.chat-is-open{right:416px;bottom:16px;}
#chat-fab:hover{transform:scale(1.06);box-shadow:0 6px 28px rgba(55,65,81,.38)}
#chat-fab .fab-img{width:50px;height:auto;display:block;filter:none}

#chat-panel{
  position:fixed;bottom:0;right:0;z-index:998;
  width:400px;height:100vh;max-height:100vh;
  background:var(--g10);
  border-left:1px solid var(--g8);
  display:flex;flex-direction:column;
  transform:translateX(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow:-6px 0 32px rgba(0,0,0,.1);
  pointer-events:none;
}
#chat-panel.open{transform:translateX(0);pointer-events:all;}
#chat-header{
  padding:14px 18px 13px;border-bottom:1px solid var(--g8);
  display:flex;align-items:center;gap:10px;flex-shrink:0;
  background:rgba(255,255,255,.9);backdrop-filter:blur(12px);
}
.chat-avatar-hd{width:34px;height:34px;border-radius:10px;
  background:#E9ECEF;
  display:flex;align-items:center;justify-content:center;
  color:#374151;font-size:13px;font-weight:900;letter-spacing:-.5px;flex-shrink:0}
.chat-hd-info{flex:1}
.chat-hd-name{font-size:14px;font-weight:700;color:var(--g1)}
.chat-hd-sub{font-size:11px;color:var(--g4)}
.chat-status{width:8px;height:8px;border-radius:50%;background:#34C759;box-shadow:0 0 0 2px rgba(52,199,89,.25)}
#chat-close{background:var(--g9);border:none;cursor:pointer;color:var(--g3);
  font-size:15px;width:28px;height:28px;border-radius:7px;display:flex;align-items:center;
  justify-content:center;transition:all var(--t);font-family:inherit;line-height:1}
#chat-close:hover{background:var(--g8);color:var(--g1)}

/* API KEY BAR */
#api-key-bar{padding:9px 16px;background:#FFF9F0;border-bottom:1px solid #FFE5B0;
  display:flex;align-items:center;gap:8px;flex-shrink:0}
#api-key-bar.hidden{display:none}
.api-key-label{font-size:11px;font-weight:600;color:#B45309;white-space:nowrap}
#api-key-input{flex:1;padding:5px 10px;border:1px solid #FFD599;border-radius:6px;
  font-size:12px;font-family:inherit;outline:none;background:#fff;color:var(--g1)}
#api-key-input::placeholder{color:var(--g5)}
#api-key-input:focus{border-color:#FF9500;box-shadow:0 0 0 2px rgba(255,149,0,.15)}
#api-key-save{padding:5px 12px;background:#FF9500;color:#fff;border:none;
  border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;
  transition:background var(--t);white-space:nowrap}
#api-key-save:hover{background:#E08800}

/* MESSAGES */
#chat-messages{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:12px}
#chat-messages::-webkit-scrollbar{width:4px}
#chat-messages::-webkit-scrollbar-thumb{background:var(--g7);border-radius:2px}
.msg{display:flex;flex-direction:column;max-width:88%}
.msg.user{align-self:flex-end;align-items:flex-end}
.msg.ai{align-self:flex-start;align-items:flex-start}
.msg-bubble{padding:10px 14px;border-radius:18px;font-size:13px;line-height:1.55;word-break:break-word}
.msg.user .msg-bubble{background:var(--blue);color:#fff;border-bottom-right-radius:5px}
.msg.ai .msg-bubble{background:var(--white);color:var(--g1);border-bottom-left-radius:5px;border:1px solid var(--g8);box-shadow:var(--sh-s)}
.msg-time{font-size:10px;color:var(--g5);margin-top:3px;padding:0 4px}
.msg-img{max-width:100%;border-radius:12px;margin-bottom:6px;cursor:pointer;max-height:200px;object-fit:cover;display:block}

/* TYPING INDICATOR */
.typing-indicator{display:flex;align-items:center;gap:4px;padding:11px 15px;
  background:var(--white);border-radius:18px;border-bottom-left-radius:5px;width:fit-content;
  border:1px solid var(--g8);box-shadow:var(--sh-s)}
.typing-indicator span{width:6px;height:6px;border-radius:50%;background:var(--g5);animation:typing 1.2s infinite}
.typing-indicator span:nth-child(2){animation-delay:.2s}
.typing-indicator span:nth-child(3){animation-delay:.4s}
@keyframes typing{0%,80%,100%{transform:scale(.8);opacity:.5}40%{transform:scale(1);opacity:1}}

/* SUGGESTED PROMPTS */
#chat-suggestions{padding:0 16px 12px;flex-shrink:0;position:relative}
#sug-toggle{display:flex;align-items:center;gap:6px;width:100%;padding:8px 14px;
  border-radius:var(--r8);border:1px solid var(--g8);background:var(--white);
  color:var(--g2);font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit;
  box-shadow:var(--sh-s);transition:all var(--t);justify-content:space-between}
#sug-toggle:hover{background:var(--g9);border-color:var(--blue)}
#sug-arrow{transition:transform .2s;font-size:10px;color:var(--g4)}
#sug-list{display:none;position:absolute;bottom:calc(100% - 4px);left:16px;right:16px;
  background:var(--white);border:1px solid var(--g8);border-radius:var(--r12);
  box-shadow:0 8px 32px rgba(0,0,0,.12);overflow:hidden;z-index:10}
#sug-list.open{display:block}
.sug{display:flex;align-items:center;gap:8px;padding:10px 14px;
  border-bottom:1px solid var(--g9);font-size:12.5px;font-weight:500;
  color:var(--g2);cursor:pointer;transition:background var(--t);
  background:transparent;border-radius:0;width:100%;text-align:left;
  font-family:inherit;border-left:none;border-right:none;border-top:none}
.sug:last-child{border-bottom:none}
.sug:hover{background:var(--g9);color:var(--blue)}

/* UPLOAD PREVIEW */
#upload-preview{padding:8px 16px;border-top:1px solid var(--g9);display:none;flex-wrap:wrap;gap:8px;flex-shrink:0}
.up-thumb{position:relative;width:56px;height:56px;border-radius:8px;overflow:hidden;border:1px solid var(--g7)}
.up-thumb img{width:100%;height:100%;object-fit:cover}
.up-thumb-doc{width:56px;height:56px;border-radius:8px;background:var(--g9);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  border:1px solid var(--g7);font-size:20px;position:relative}
.up-thumb-doc span{font-size:9px;color:var(--g4);margin-top:2px;text-align:center;max-width:50px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.up-remove{position:absolute;top:-5px;right:-5px;width:17px;height:17px;border-radius:50%;
  background:#FF3B30;color:#fff;font-size:9px;font-weight:700;
  display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;z-index:1}

/* INPUT ROW */
#chat-input-row{padding:10px 16px 14px;border-top:1px solid var(--g8);
  display:flex;align-items:flex-end;gap:8px;flex-shrink:0;background:rgba(255,255,255,.9)}
#chat-attach{background:var(--g9);border:1px solid var(--g8);cursor:pointer;
  color:var(--g3);font-size:17px;padding:7px 9px;border-radius:10px;
  transition:all var(--t);flex-shrink:0;line-height:1}
#chat-attach:hover{background:var(--g8);color:var(--blue)}
#file-input{display:none}
#chat-in{flex:1;padding:9px 14px;border:1px solid var(--g8);border-radius:20px;
  font-size:13px;font-family:inherit;color:var(--g1);outline:none;
  min-height:38px;max-height:120px;line-height:1.4;
  background:var(--white);transition:all var(--t);overflow-y:auto}
#chat-in:focus{border-color:var(--blue);background:var(--white);
  box-shadow:0 0 0 3px rgba(184,92,16,.1)}
#chat-send{background:var(--blue);border:none;cursor:pointer;color:#fff;
  width:36px;height:36px;border-radius:50%;font-size:16px;font-weight:700;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all var(--t)}
#chat-send:hover{background:var(--blue-d);transform:scale(1.05)}
#chat-send:disabled{background:var(--g7);color:var(--g5);cursor:default;transform:none}

/* MEDIA MODAL */
#media-modal{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.85);
  display:flex;align-items:center;justify-content:center;
  opacity:0;pointer-events:none;transition:opacity .2s}
#media-modal.open{opacity:1;pointer-events:all}
#media-modal img{max-width:90vw;max-height:90vh;border-radius:12px;
  box-shadow:0 20px 60px rgba(0,0,0,.5)}
#media-modal-close{position:absolute;top:20px;right:20px;background:rgba(255,255,255,.2);
  border:none;color:#fff;width:36px;height:36px;border-radius:50%;
  cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center}

/* ── TOAST ── */
#toast{position:fixed;bottom:90px;right:24px;z-index:9999;
  background:var(--g1);color:#fff;padding:11px 18px;border-radius:var(--r12);
  font-size:13px;font-weight:500;
  transform:translateY(20px);opacity:0;pointer-events:none;
  transition:all .25s cubic-bezier(.4,0,.2,1);max-width:320px;line-height:1.4}
#toast.show{transform:translateY(0);opacity:1}

/* ── CALENDAR ── */
.cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;flex-wrap:wrap;gap:10px}
.cal-nav{display:flex;align-items:center;gap:8px}
.cal-nav-btn{background:var(--white);border:1px solid var(--g8);border-radius:var(--r8);padding:6px 12px;cursor:pointer;font-size:14px;font-family:inherit;transition:all var(--t);color:var(--g2)}
.cal-nav-btn:hover{background:var(--g9);border-color:var(--blue);color:var(--blue)}
.cal-title{font-size:18px;font-weight:700;color:var(--g1);min-width:200px;text-align:center}
.cal-views{display:flex;gap:2px;padding:3px;background:var(--g9);border-radius:var(--r8)}
.cal-vbtn{border:none;background:transparent;border-radius:6px;padding:6px 14px;cursor:pointer;font-size:12px;font-weight:600;color:var(--g4);font-family:inherit;transition:all var(--t)}
.cal-vbtn:hover{background:var(--g8);color:var(--g2)}
.cal-vbtn.active{background:var(--white);color:var(--g1);box-shadow:0 1px 3px rgba(0,0,0,.1)}
.cal-month-dow{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--g8);border-radius:var(--r12) var(--r12) 0 0;overflow:hidden;box-sizing:border-box;padding-right:var(--cal-scrollbar-w,0px)}
.cal-month-scroll{max-height:660px;overflow-y:auto;overflow-x:hidden;border-radius:0 0 var(--r12) var(--r12);background:var(--g8);scroll-behavior:auto;scrollbar-gutter:stable}
.cal-month{display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:110px;gap:1px;background:var(--g8)}
.cal-dow{padding:8px;text-align:center;font-size:10px;font-weight:700;color:var(--g4);background:var(--g9);letter-spacing:.8px;text-transform:uppercase}
.cal-day{height:110px;padding:6px 8px;background:var(--white);cursor:default;transition:background var(--t);position:relative;overflow:hidden}
.cal-day:hover{background:var(--g10)}
.cal-day.today{background:#F1F3F5}
.cal-month-divider{margin:-6px -8px 4px -8px;padding:3px 8px 2px;font-size:9px;font-weight:800;color:#374151;background:#EFF6FF;border-bottom:1px solid #DBEAFE;text-transform:uppercase;letter-spacing:.4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-day.today .cal-dn{color:#374151;font-weight:800}
/* 2026-08-05: dias festivos de la empresa (se configuran en Configuracion). Rayado
   suave para distinguirlos de "hoy" sin gritar, con el motivo encima del numero. */
.cal-day.cal-festivo{background:repeating-linear-gradient(45deg,#FFF7ED,#FFF7ED 6px,#FFEDD5 6px,#FFEDD5 12px)}
.cal-day.cal-festivo .cal-dn{color:#9A3412}
.cal-festivo-tag{font-size:9px;font-weight:700;color:#9A3412;text-transform:uppercase;letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px}
.cal-dn{font-size:12px;font-weight:600;color:var(--g2);margin-bottom:4px}
.cal-evt{font-size:10px;padding:2px 6px;border-radius:4px;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:default;font-weight:500}
.cal-evt:hover{opacity:.8}
.cal-evt.prev{background:#E0F2FE;color:#0369A1}
.cal-evt.rite{background:#F1F3F5;color:#374151}
.cal-evt.rebt{background:#FEF3C7;color:#92400E}
.cal-evt.corr{background:#FEE2E2;color:#991B1B}
/* 2026-07-07 (v3): CLAVE de la desalineacion de Semana con texto largo. Las
   columnas eran repeat(7,1fr), y 1fr == minmax(auto,1fr): el minimo "auto" deja
   que una columna CREZCA para caber el texto del evento (que va en
   white-space:nowrap), asi que las columnas dejan de ser iguales y se separan
   de la cabecera. minmax(0,1fr) fija el minimo en 0 -> la columna NO crece con
   el contenido, el chip se recorta con ellipsis y las 7 columnas quedan siempre
   iguales y cuadradas con la cabecera. (El comentario v2 "1fr encoge sin
   minmax" era erroneo.) Las celdas necesitan min-width:0 + overflow:hidden para
   poder encoger por debajo del contenido dentro de un grid.
   Cabecera fija fuera del scroll + cuerpo con scroll (mismo patron que Mes);
   navegacion entre dias/semanas con los botones ← → (el auto-scroll que
   cambiaba de dia se ha quitado: hijackeaba el scroll y saltaba hacia atras). */
.cal-week-dow{display:grid;grid-template-columns:60px repeat(7,minmax(0,1fr));gap:1px;background:var(--g8);border-radius:var(--r12) var(--r12) 0 0;overflow:hidden;box-sizing:border-box;padding-right:var(--cal-scrollbar-w,0px)}
.cal-week-dow .cal-dow{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px 2px}
.cal-wh-corner{background:var(--g9)}
.cal-week-scroll{max-height:660px;overflow-y:auto;overflow-x:hidden;border-radius:0 0 var(--r12) var(--r12);background:var(--g8);scroll-behavior:auto}
.cal-week{display:grid;grid-template-columns:60px repeat(7,minmax(0,1fr));gap:1px;background:var(--g8)}
.cal-wh{padding:6px 4px;font-size:10px;color:var(--g4);background:var(--g9);text-align:right;font-weight:600}
.cal-wc{min-height:48px;min-width:0;overflow:hidden;background:var(--white);padding:2px 4px;cursor:default;transition:background var(--t);position:relative}
.cal-wc .cal-evt{max-width:100%}
.cal-wc:hover{background:var(--g10)}
.cal-wc.today-col{background:#F8F9FA}
.cal-day-scroll{max-height:660px;overflow-y:auto;overflow-x:hidden;border-radius:var(--r12);background:var(--white)}
.cal-dh{display:grid;grid-template-columns:60px minmax(0,1fr);gap:1px;background:var(--g8)}
.cal-dh-time{padding:8px 6px;font-size:11px;color:var(--g4);background:var(--g9);text-align:right;font-weight:500}
.cal-dh-slot{min-width:0;overflow:hidden;min-height:52px;background:var(--white);padding:4px 8px;cursor:default;transition:background var(--t);border-bottom:1px solid var(--g9)}
.cal-dh-slot .cal-evt{white-space:normal;overflow:visible;text-overflow:clip}
.cal-dh-slot:hover{background:var(--g10)}
/* Timeline Dia/Semana (2026-07-16): eventos como BLOQUES sobre la franja horaria real */
.cal-tl{display:grid;gap:1px;background:var(--g8)}
.cal-tl-hours{display:flex;flex-direction:column;background:var(--g9)}
.cal-tl-hh{font-size:11px;color:var(--g4);text-align:right;padding:1px 6px;box-sizing:border-box;border-bottom:1px solid var(--g8)}
.cal-tl-day{position:relative;background:var(--white);min-width:0}
.cal-tl-day.today-col{background:#F1F3F5}
.cal-tl-slot{box-sizing:border-box;border-bottom:1px solid var(--g9)}
.cal-tl-slot:hover{background:var(--g10)}
.cal-evt-block{box-sizing:border-box;padding:2px 5px;font-size:10px;line-height:1.12;z-index:2;box-shadow:0 1px 2px rgba(0,0,0,.15);border-radius:4px;white-space:normal;overflow:hidden;cursor:pointer}

/* ── CHECKLIST BUILDER ── */
.ck-section{background:var(--white);border:1px solid var(--g8);border-radius:var(--r12);margin-bottom:14px;overflow:hidden}
.ck-section-hd{padding:12px 16px;background:var(--g10);display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--g9)}
.ck-section-name{flex:1;font-size:14px;font-weight:700;color:var(--g1);border:none;background:transparent;outline:none;font-family:inherit}
.ck-section-name:focus{background:var(--white);padding:4px 8px;border-radius:6px;border:1px solid var(--blue)}
.ck-item{display:flex;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid var(--g9);transition:background var(--t)}
.ck-item:hover{background:var(--g10)}
.ck-item:last-child{border-bottom:none}
.ck-item-text{flex:1;font-size:13px;border:none;background:transparent;outline:none;color:var(--g1);font-family:inherit}
.ck-item-text:focus{background:var(--white);padding:4px 8px;border-radius:6px;border:1px solid var(--blue)}
.ck-item-type{font-size:10px;padding:2px 8px;border-radius:10px;background:var(--g9);color:var(--g3);font-weight:600;cursor:pointer;border:none;font-family:inherit}
.ck-add-btn{display:flex;align-items:center;gap:6px;padding:8px 16px;border:none;background:transparent;color:var(--blue);font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:all var(--t);width:100%}
.ck-add-btn:hover{background:#FDF0E4}
.ck-del{background:none;border:none;cursor:pointer;color:var(--g6);font-size:14px;padding:2px 6px;border-radius:4px;transition:all var(--t)}
.ck-del:hover{color:var(--red);background:#FEE2E2}

@media(max-width:600px){
  .modal-box{padding:18px}
  .mt-ck-item{grid-template-columns:24px minmax(0,1fr) 42px;gap:7px}
  .mt-ck-check{grid-column:1;grid-row:1;margin-top:12px}
  .mt-ck-reader{grid-column:2/4;grid-row:1}
  .mt-ck-type{grid-column:2;grid-row:2;width:100%}
  .mt-ck-delete{grid-column:3;grid-row:2;width:42px;height:42px}
  .mt-ck-summary,.mt-notes-summary{min-height:48px;padding:10px}
  /* LICITGO-CHAT-FAB-REDONDO-20260815 (Jose, movil): era un cuadrado redondeado de 40px
     con la palabra "Licit GO" metida a la fuerza en 38px de ancho, asi que se leia
     apretada y no pegaba con nada. Jose lo quiere igual que el avatar de su login:
     circulo del MISMO diametro (30px) y solo "GO".
     Se toca sin gatear por usuario a proposito: `auth.js` oculta este boton para operario,
     planner, supervisor y cliente_view, asi que el unico que lo ve es admin. Jarque y
     Alfonso no lo tienen en pantalla.
     El `top` sube 5px para que el CENTRO del boton quede donde estaba con 40px y no se
     desalinee de la fila. */
  #chat-fab{
    top:calc(env(safe-area-inset-top,0px) + 11px);
    right:calc(env(safe-area-inset-right,0px) + 54px);
    /* z-index 1000 lo ponia POR DELANTE del overlay de los modales, que esta en 500:
       al abrir "Nueva Tarea" el boton del chat flotaba sobre el modal. Debajo de 500 y
       por encima de todo lo normal (el maximo del resto es 101). */
    bottom:auto;z-index:499;
    /* Medida forzada: con width/height a secas seguia saliendo ovalado en el iPhone.
       Se fija por los cuatro costados para que nada pueda estirarlo, y se anula el
       relleno propio del <button>, que en Safari suma ~6px por lado. */
    width:30px!important;height:30px!important;
    min-width:30px;max-width:30px;min-height:30px;max-height:30px;
    border-radius:50%!important;
    overflow:hidden;
    /* Sin esto NO sale un circulo, sale un ovalo: el <button> lleva relleno lateral
       propio del navegador (Safari ~6px por lado) y, con box-sizing por defecto, se
       SUMA a los 30px de ancho. Resultado: 42x32. Hay que anular el relleno y contar
       el borde dentro de la medida. */
    box-sizing:border-box;
    padding:0!important;
    min-width:0;
    flex:0 0 auto;
    gap:0;
  }
  #chat-fab.chat-is-open{display:none}
  #chat-fab .fab-img{display:none!important}
  #chat-fab::after{
    content:"GO";
    font-size:11px;font-weight:700;letter-spacing:-.2px;line-height:1;color:#fff;
  }
  #tb-alert-wrap{margin-right:0}
  #topbar #lg-salud-badge{margin-right:46px}
  #chat-panel{height:100dvh;max-height:100dvh}
}

@media(hover:none){
  .mt-ck-reader:not([open]):hover .mt-ck-full,
  .mt-notes-reader:not([open]):hover .mt-notes-full{display:none}
}

/* Solicitudes de cambio de dia: propuesta del planner, resolucion del admin. */
.day-change-alert{display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:7px 10px;border:1px solid var(--g8);border-radius:7px;background:var(--white);color:var(--g2);font:600 12px/1 inherit;cursor:pointer}
.day-change-alert:hover{background:var(--g10)}
.day-change-alert.is-pending{border-color:#f2bd55;background:#fff8e8;color:#7a4b00}
.day-change-alert b{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#b45309;color:#fff;font-size:11px}
.mt-day-locked{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:5px;color:var(--g4);font-size:11px}
.day-change-request-form{margin-top:10px;padding:12px;border:1px solid #c7d7ea;border-radius:7px;background:#f5f9fd}
.day-change-request-title{margin-bottom:9px;color:var(--g1);font-size:13px;font-weight:700}
.day-change-form-actions{display:flex;justify-content:flex-end;gap:8px}
.day-change-sent{margin-top:9px;padding:10px;border:1px solid #9ad5b0;border-radius:7px;background:#effaf3;color:#166534;font-size:12px;font-weight:600}
.day-change-modal{width:min(720px,calc(100vw - 32px));max-width:720px}
.day-change-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.day-change-list{display:grid;gap:10px;max-height:min(62vh,620px);overflow:auto;margin:14px -4px 0;padding:0 4px}
.day-change-row{padding:12px;border:1px solid var(--g8);border-radius:7px;background:var(--white)}
.day-change-row-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.day-change-requester{margin-top:3px;color:var(--g4);font-size:11px}
.day-change-status{flex:0 0 auto;padding:3px 7px;border-radius:10px;background:var(--g9);color:var(--g3);font-size:10px;font-weight:700}
.day-change-status.is-pending{background:#fff3cd;color:#76520a}
.day-change-status.is-accepted{background:#dcfce7;color:#166534}
.day-change-status.is-rejected,.day-change-status.is-expired{background:#fee2e2;color:#991b1b}
.day-change-dates{display:flex;align-items:center;gap:9px;margin-top:10px;font-size:14px;font-weight:700;color:var(--g1)}
.day-change-reason{margin-top:8px;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--g2);font-size:13px;line-height:1.45}
.day-change-resolution{margin-top:8px;padding-top:8px;border-top:1px solid var(--g9);color:var(--g3);font-size:12px}
.day-change-resolve{display:grid;grid-template-columns:minmax(160px,1fr) auto auto;gap:8px;align-items:center;margin-top:11px;padding-top:11px;border-top:1px solid var(--g9)}
.day-change-empty{padding:24px 12px;text-align:center;color:var(--g4);font-size:13px}
.incident-alert{border-color:#d97706;color:#92400e;background:#fffbeb}
.incident-alert.has-grave{border-color:#dc2626;color:#991b1b;background:#fef2f2}
.incident-alert em{font-style:normal;font-size:10px;font-weight:800;padding:2px 5px;border-radius:4px;background:#dc2626;color:#fff}
.incident-modal-sub{margin-top:4px;color:var(--g4);font-size:12px;line-height:1.4}
.incident-row{border-left:4px solid #d97706}
.incident-row.is-grave{border-left-color:#dc2626;background:#fef2f2}
.incident-gravity{display:inline-flex;padding:3px 8px;border:1px solid #d97706;border-radius:6px;color:#92400e;background:#fffbeb;font-size:11px;font-weight:800}
.incident-gravity.is-grave{border-color:#dc2626;color:#991b1b;background:#fff}
.incident-context{margin:8px 0;color:var(--g2);font-size:12px;font-weight:700}
.incident-readonly{margin-top:10px;padding:8px 10px;border-radius:6px;background:var(--g10);color:var(--g4);font-size:12px}
