/* ============================================================
   KAISER CLINICAL — INTRANET
   Extiende el sistema "Molécula" (kaiser.css) con los módulos
   de la intranet. No modifica kaiser.css: ambos sistemas comparten base.
   ============================================================ */

/* ---- Ajustes de layout ---- */
.main{ max-width:1200px; width:100%; }
.sidebar{ overflow-y:auto; }
.sidebar .brand{ color:#fff; }
.sidebar .brand img{ height:40px; width:40px; padding:4px; border-radius:12px; object-fit:contain; }
.sidebar .brand span{ line-height:1.1; }
.userchip{ color:#fff; border-radius:var(--r-sm); margin-top:6px; }
.userchip:hover{ background:rgba(143,217,238,.08); }
img.avatar{ object-fit:cover; padding:0; }

.moremenu{ display:grid; gap:6px; margin-top:12px; }
.moremenu a{ display:flex; gap:12px; align-items:center; padding:14px; border-radius:var(--r-md); color:var(--ink); font-weight:600; background:var(--cloud); }
.moremenu a.active{ background:var(--ink); color:var(--sky); }
.moremenu svg{ width:22px; height:22px; }

.alert{ background:var(--ice); color:var(--ink-soft); padding:12px 16px; border-radius:12px; margin-bottom:16px; font-weight:600; font-size:.9rem; }
.alert.err{ background:#FCE9EE; color:var(--danger); }
.flash{ background:var(--ink); color:var(--sky); padding:12px 18px; border-radius:999px; font-weight:600; font-size:.9rem;
  margin-bottom:20px; display:inline-flex; animation:rise .4s; }

/* ---- Login ---- */
.netstatus{ display:flex; align-items:center; gap:8px; margin-top:18px; font-size:.8rem; color:var(--muted); }
.netstatus i{ width:9px; height:9px; border-radius:50%; background:var(--warn); flex:none; }
.netstatus.on i{ background:var(--ok); box-shadow:0 0 0 4px rgba(35,165,124,.18); }
.hero-molecule{ display:flex; align-items:center; margin-top:34px; }
.hero-molecule i{ width:14px; height:14px; border-radius:50%; background:var(--sky); opacity:.8; }
.hero-molecule i.big{ width:26px; height:26px; background:#fff; opacity:1; }
.hero-molecule s{ width:36px; height:2px; background:rgba(143,217,238,.45); }

/* ---- Hero de bienvenida (dashboard) ---- */
.welcome{
  background:var(--ink); color:#fff; border-radius:var(--r-lg); padding:clamp(22px,4vw,34px);
  position:relative; overflow:hidden; margin-bottom:20px; display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; align-items:center;
}
.welcome::after{ content:''; position:absolute; width:380px; height:380px; right:-120px; top:-160px; border-radius:50%;
  background:radial-gradient(circle, rgba(143,217,238,.35), transparent 65%); pointer-events:none; }
.welcome h1{ color:#fff; font-size:clamp(1.4rem,3.4vw,2rem); }
.welcome p{ color:#AEBCD4; }
.welcome .clock{ font-family:var(--font-d); font-size:clamp(2rem,6vw,3rem); font-weight:700; color:var(--sky); line-height:1; position:relative; z-index:1; }

/* ---- Tarjeta de asistencia ---- */
.punch{ display:flex; flex-direction:column; gap:14px; }
.punch .times{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.punch .times div{ background:var(--cloud); border-radius:var(--r-md); padding:12px 14px; }
.punch .times small{ color:var(--muted); font-size:.74rem; text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
.punch .times b{ display:block; font-family:var(--font-d); font-size:1.4rem; color:var(--ink); }
.netpill{ display:inline-flex; align-items:center; gap:8px; font-size:.78rem; font-weight:600; border-radius:999px; padding:6px 12px; background:#FBF1DF; color:#B47B1E; }
.netpill i{ width:8px; height:8px; border-radius:50%; background:currentColor; }
.netpill.on{ background:#E4F6EF; color:var(--ok); }

/* ---- Grids ---- */
.grid.cols-2{ grid-template-columns:repeat(2,1fr); }
.dash{ display:grid; gap:16px; grid-template-columns:1.1fr .9fr; }
@media (max-width:900px){ .dash, .grid.cols-2{ grid-template-columns:1fr; } }
.card h3{ font-size:1.02rem; margin-bottom:12px; display:flex; justify-content:space-between; align-items:center; gap:10px; }
.card h3 a{ font-family:var(--font-b); font-size:.8rem; font-weight:600; }

/* ---- Anuncios (bulletin board) ---- */
.board{ display:grid; gap:16px; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); }
.post{ background:#fff; border:1px solid var(--line); border-radius:var(--r-lg); padding:20px; box-shadow:var(--shadow);
  display:flex; flex-direction:column; gap:10px; position:relative; transition:.2s; }
.post:hover{ transform:translateY(-2px); box-shadow:var(--shadow-lift); }
.post.pinned{ border-color:var(--sky); background:linear-gradient(180deg, var(--ice), #fff 70%); }
.post .cat{ align-self:flex-start; }
.post h4{ font-family:var(--font-d); color:var(--ink); font-size:1.08rem; line-height:1.3; }
.post p{ color:var(--text); white-space:pre-wrap; font-size:.93rem; }
.post footer{ margin-top:auto; padding-top:10px; border-top:1px dashed var(--line); display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:.78rem; color:var(--muted); flex-wrap:wrap; }
.post .pin{ position:absolute; top:16px; right:16px; color:var(--sky-deep); font-size:.72rem; font-weight:700; letter-spacing:.1em; }
.badge.danger{ background:#FCE9EE; color:var(--danger); }
.badge.cat-rrhh{ background:#EEE9FC; color:#6A4FC9; }
.badge.cat-evento{ background:#E4F6EF; color:var(--ok); }
.badge.cat-urgente{ background:#FCE9EE; color:var(--danger); }
.minilist{ display:flex; flex-direction:column; }
.minilist > div{ padding:11px 0; border-bottom:1px solid var(--line); display:flex; gap:12px; align-items:flex-start; }
.minilist > div:last-child{ border-bottom:none; }
.minilist b{ color:var(--ink); font-size:.92rem; display:block; }
.minilist small{ color:var(--muted); font-size:.78rem; }

/* ---- Agenda ---- */
.slots{ display:flex; flex-wrap:wrap; gap:8px; }
.slot{ background:#E4F6EF; color:var(--ok); border-radius:10px; padding:8px 12px; font-weight:700; font-size:.85rem; font-family:var(--font-d); }
.agenda{ position:relative; padding-left:74px; }
.ev{ position:relative; background:#fff; border:1px solid var(--line); border-left:4px solid var(--ink); border-radius:var(--r-md); padding:12px 16px; margin-bottom:10px; }
.ev.now{ border-left-color:var(--sky-deep); box-shadow:0 0 0 3px rgba(143,217,238,.35); }
.ev.past{ opacity:.55; }
.ev .h{ position:absolute; left:-74px; top:12px; width:62px; text-align:right; font-family:var(--font-d); font-weight:700; color:var(--ink); font-size:.9rem; }
.ev b{ color:var(--ink); display:block; }
.ev small{ color:var(--muted); }
.daypick{ display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; margin-bottom:18px; }
.daypick button{ border:1.5px solid var(--line); background:#fff; border-radius:16px; padding:10px 14px; cursor:pointer; min-width:66px; text-align:center; font-family:var(--font-d); color:var(--ink); }
.daypick button small{ display:block; font-family:var(--font-b); color:var(--muted); font-size:.7rem; text-transform:uppercase; }
.daypick button b{ font-size:1.2rem; }
.daypick button.active{ background:var(--ink); border-color:var(--ink); color:var(--sky); }
.daypick button.active small{ color:#AEBCD4; }

/* ---- Tickets ---- */
.tk-state{ font-size:.72rem; }
.badge.st-abierto{ background:var(--ice); color:var(--sky-deep); }
.badge.st-en_proceso{ background:#FBF1DF; color:#B47B1E; }
.badge.st-resuelto{ background:#E4F6EF; color:var(--ok); }
.badge.st-cerrado{ background:#EEF1F5; color:var(--muted); }
.prio{ width:10px; height:10px; border-radius:50%; flex:none; margin-top:6px; }
.prio.baja{ background:var(--sky); } .prio.media{ background:var(--warn); } .prio.alta{ background:var(--danger); } .prio.critica{ background:var(--danger); box-shadow:0 0 0 4px rgba(223,85,112,.25); }
.thread{ display:flex; flex-direction:column; gap:10px; margin:14px 0; max-height:40dvh; overflow-y:auto; }
.msg{ background:var(--cloud); border-radius:14px; padding:10px 14px; font-size:.9rem; }
.msg.mine{ background:var(--ice); align-self:flex-end; max-width:90%; }
.msg small{ display:block; color:var(--muted); font-size:.72rem; margin-bottom:2px; }

/* ---- Perfil ---- */
.profile-head{ display:flex; gap:22px; align-items:center; flex-wrap:wrap; }
.bigavatar{ width:110px; height:110px; border-radius:32px; background:var(--ice); color:var(--sky-deep); display:grid; place-items:center;
  font-family:var(--font-d); font-weight:800; font-size:2.2rem; object-fit:cover; position:relative; overflow:hidden; flex:none; }
.photo-btn{ position:relative; cursor:pointer; }
.photo-btn::after{ content:'Cambiar'; position:absolute; inset:auto 0 0 0; background:rgba(14,22,48,.7); color:#fff; font-size:.7rem; text-align:center; padding:4px; border-radius:0 0 32px 32px; font-weight:600; opacity:0; transition:.2s; }
.photo-btn:hover::after{ opacity:1; }
.kv{ display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:14px 20px; }
.kv label{ display:block; color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
.kv span{ color:var(--ink); font-weight:600; word-break:break-word; }
.formgrid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:0 14px; }

/* ---- Tabla responsiva ---- */
.tablewrap{ overflow-x:auto; }
@media (max-width:640px){
  table.tbl.stack thead{ display:none; }
  table.tbl.stack tr{ display:block; border-bottom:1px solid var(--line); padding:8px 0; }
  table.tbl.stack td{ display:flex; justify-content:space-between; gap:12px; border:none; padding:5px 4px; }
  table.tbl.stack td::before{ content:attr(data-l); color:var(--muted); font-size:.74rem; font-weight:600; text-transform:uppercase; }
}

.toolbar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.toolbar .input{ width:auto; padding:10px 14px; }
.drop{ border:2px dashed var(--line); border-radius:var(--r-md); padding:22px; text-align:center; color:var(--muted); cursor:pointer; transition:.2s; }
.drop:hover, .drop.over{ border-color:var(--sky-deep); background:var(--ice); color:var(--ink); }
.muted{ color:var(--muted); }
.right{ text-align:right; }

/* ---- Ajustes v1.2 ---- */
select.input{ background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2367748F' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; background-size:16px; padding-right:40px; }
.filelist{ grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); }
.filecard{ align-items:flex-start; padding:16px; }
.filecard b{ white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }

/* ---- Agenda con detalle de citas (v1.3) ---- */
.btn svg{ width:17px; height:17px; flex:none; }
.ev.clickable{ cursor:pointer; transition:.18s; }
.ev.clickable:hover{ border-color:var(--sky); box-shadow:var(--shadow); }
.evline{ display:flex; gap:8px; align-items:flex-start; font-size:.86rem; margin-top:6px; color:var(--text); }
.evline svg{ width:16px; height:16px; color:var(--sky-deep); flex:none; margin-top:3px; }
.evact{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:10px; }
.evact .more{ margin-left:auto; font-size:.78rem; font-weight:600; color:var(--sky-deep); }
.ev.past .evact{ display:none; }
.dlist{ display:grid; gap:12px; margin-bottom:6px; }
.drow{ display:flex; gap:12px; align-items:flex-start; }
.drow svg{ width:34px; height:34px; padding:7px; border-radius:10px; background:var(--ice); color:var(--sky-deep); flex:none; }
.drow label{ display:block; font-size:.7rem; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
.drow span{ color:var(--ink); font-weight:600; white-space:pre-wrap; }
.mapa{ width:100%; height:220px; border:0; border-radius:var(--r-md); margin-top:14px; background:var(--cloud); }
.card.conf{ background:#FFF8F0; border-color:#F6E2C6; box-shadow:none; }
