/* =====================================================================
   TIP Y CURSOS · HISTORIAL · ENVÍO DEL CUADRANTE
   ===================================================================== */

/* ---------- comunes ---------- */
.select-sm { width: auto; min-width: 180px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.chip-btn .ico { width: 15px; height: 15px; }
.chip-btn:hover { border-color: var(--border-strong); color: var(--text); }
.chip-btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.date-f { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.date-f input { width: auto; }

/* ---------- estados de documentos ---------- */
.doc-est { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.doc-caducado { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.doc-pronto { color: #d9480f; background: color-mix(in srgb, #fd7e14 14%, transparent); border-color: color-mix(in srgb, #fd7e14 35%, transparent); }
.doc-aviso { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.doc-ok { color: var(--ok); background: var(--ok-soft); }
.doc-sin { color: var(--muted); background: var(--surface-2); }
[data-tema="oscuro"] .doc-pronto { color: #ffa94d; }

.doc-dot { display: inline-grid; place-items: center; margin-left: 6px; width: 20px; height: 20px; border-radius: 50%; vertical-align: middle; }
.doc-dot .ico { width: 13px; height: 13px; }
.doc-dot.doc-caducado { animation: docLatido 2s ease-in-out infinite; }
@keyframes docLatido { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 18%, transparent); } }

.doc-ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.doc-ico .ico { width: 17px; height: 17px; }

/* Ficha del empleado */
.ficha-docs, .ficha-hist { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; }
.ficha-docs h3, .ficha-hist h3 { display: inline-flex; align-items: center; gap: 6px; }
.ficha-docs h3 .ico, .ficha-hist h3 .ico { width: 14px; height: 14px; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.doc-item.is-renovado { opacity: .6; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.doc-main small { color: var(--muted); font-size: 12px; }
.doc-acts { display: flex; gap: 2px; }

/* Formulario */
.doc-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.doc-file-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.doc-file .ico { width: 15px; height: 15px; }
.doc-tip { margin-top: 12px; }

/* Dashboard */
.doc-card .as-resumen { margin-bottom: 10px; }
.doc-pill-caducado { background: var(--danger-soft); border-color: var(--danger); }
.doc-pill-caducado b { color: var(--danger); }
.doc-pill-pronto b { color: #d9480f; }
[data-tema="oscuro"] .doc-pill-pronto b { color: #ffa94d; }
.doc-dash { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.doc-dash-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; background: var(--surface); transition: border-color .18s ease, transform .18s ease; }
.doc-dash-item:hover { border-color: var(--border-strong); transform: translateY(-1px); }

/* ---------- historial ---------- */
.hist-areas { display: flex; gap: 6px; flex-wrap: wrap; }
.hist-filtro-emp { font-size: 14px; color: var(--text-2); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist-dia { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 16px 0 6px; }
.hist-dia:first-child { padding-top: 0; }
.hist-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); position: relative; }
.hist-item:last-child { border-bottom: 0; }
.hist-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.hist-ico .ico { width: 15px; height: 15px; }
.hist-crear .hist-ico { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.hist-borrar .hist-ico { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.hist-turnos .hist-ico, .hist-editar .hist-ico, .hist-enlace .hist-ico { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hist-top b { font-weight: 550; overflow-wrap: anywhere; }
.hist-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hist-user { color: var(--text-2); font-weight: 600; }
.hist-acc { margin-left: 4px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.hist-det { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); }
ul.hist-det li, .hist-det ul li { padding: 2px 0 2px 12px; position: relative; font-variant-numeric: tabular-nums; }
ul.hist-det li::before, .hist-det ul li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.hist-det summary { cursor: pointer; color: var(--primary); font-size: 12.5px; font-weight: 550; width: fit-content; }
.hist-det ul { list-style: none; margin: 4px 0 0; padding: 0; max-height: 260px; overflow: auto; }
.hist-mas, .hist-fin { text-align: center; padding-top: 12px; }
.hist-compacta .hist-item { padding: 8px 0; }
.hist-compacta .hist-ico { width: 28px; height: 28px; }

/* ---------- enviar cuadrante ---------- */
.env-intro { margin: 0 0 12px; }
.env-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.env-aviso .ico { flex: none; width: 18px; height: 18px; color: var(--warn); margin-top: 1px; }
.env-todos { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.env-lista { list-style: none; margin: 0; padding: 0; }
.env-fila { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.env-fila:last-child { border-bottom: 0; }
.env-quien { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.env-quien small { font-size: 12px; color: var(--muted); }
.env-ok { color: var(--ok); display: inline-flex; align-items: center; gap: 3px; }
.env-ok .ico { width: 12px; height: 12px; }
.env-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn-wa { color: #128c4b; border-color: color-mix(in srgb, #25d366 45%, transparent); }
.btn-wa:hover:not(:disabled) { background: color-mix(in srgb, #25d366 12%, transparent); }
[data-tema="oscuro"] .btn-wa { color: #4ade80; }

@media (max-width: 720px) {
  .env-fila { flex-wrap: wrap; }
  .env-btns { width: 100%; justify-content: flex-start; }
  .doc-item { flex-wrap: wrap; }
  .doc-dash { grid-template-columns: 1fr; }
}

/* ---------- ficha: TIP y cursos ---------- */
.tip-box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.tip-box.tip-caducado { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.tip-box.tip-pronto { border-color: color-mix(in srgb, #fd7e14 45%, transparent); }
.cursos-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.cursos-head .muted { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; font-size: 11px; }
@media (max-width: 720px) { .tip-box { flex-wrap: wrap; } }

/* Dashboard: caducidad del TIP */
.as-pill.is-cero { opacity: .5; background: var(--surface-2); border-color: var(--border); }
.as-pill.is-cero b { color: var(--muted); }
.tip-sin { margin-top: 12px; }
.tip-sin summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 550; width: fit-content; }
.tip-sin summary:hover { color: var(--text); }
.tip-sin-lista { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tip-sin-lista .chip-btn { text-decoration: none !important; }
