/* ==========================================================================
   TalenTI — Sistema Integral de RH
   Hoja de estilos base del shell (layout, sidebar, componentes de RH).
   Independiente de framework: convive con Bootstrap 5 (formularios, modales)
   sin pisar sus clases, porque todo va con el prefijo .tl-
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --tl-primary: #16367f;          /* azul marino del logotipo */
  --tl-primary-strong: #0e2766;
  --tl-accent-ink: #16367f;       /* texto de enlaces y elementos activos */
  --tl-teal: #4fb3a0;             /* verde azulado del logotipo */
  --tl-teal-strong: #23806f;
  --tl-teal-soft: #e2f3ef;

  --tl-bg: #f2f5fa;
  --tl-surface: #ffffff;
  --tl-surface-2: #f6f8fc;
  --tl-ink: #172036;
  --tl-muted: #5b6680;
  --tl-line: #dfe5ef;

  --tl-amber: #8a5800;  --tl-amber-soft: #fff1d1;
  --tl-blue: #2b50bd;   --tl-blue-soft: #e5ecff;
  --tl-red: #b42318;    --tl-red-soft: #fdeceb;
  --tl-gray: #5b6680;   --tl-gray-soft: #edf0f5;

  /* Master / modo ghost: identidad visual propia, nunca se confunde con el negocio */
  --tl-ghost: #6a58d1;  --tl-ghost-soft: #efecff;  --tl-ghost-ink: #2b2263;
  --tl-on-danger: #ffffff; --tl-on-ghost: #ffffff; --tl-on-teal: #0b2c26;

  --tl-radius-lg: 18px;
  --tl-radius: 12px;
  --tl-radius-sm: 8px;
  --tl-shadow: 0 1px 2px rgba(23, 32, 54, .05), 0 10px 28px -16px rgba(22, 54, 127, .22);

  --tl-font-display: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --tl-font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --tl-sidebar-w: 272px;

  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tl-primary: #3a62cc; --tl-primary-strong: #2c50b0; --tl-accent-ink: #a9c1ff;
    --tl-teal: #5cc2ae; --tl-teal-strong: #7fd6c4; --tl-teal-soft: #163c36;
    --tl-bg: #0e1422; --tl-surface: #151d2f; --tl-surface-2: #1a2438;
    --tl-ink: #e6ebf5; --tl-muted: #9ba7c0; --tl-line: #26324a;
    --tl-amber: #f3c46b; --tl-amber-soft: #3a2c10;
    --tl-blue: #9db6ff;  --tl-blue-soft: #1d2b55;
    --tl-red: #ff9a90;   --tl-red-soft: #451b1a;
    --tl-gray: #aab4c8;  --tl-gray-soft: #222c40;
    --tl-ghost: #a99bff; --tl-ghost-soft: #262046; --tl-ghost-ink: #ded8ff;
    --tl-on-danger: #3b0b07; --tl-on-ghost: #1b1446;
    --tl-shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --tl-primary: #3a62cc; --tl-primary-strong: #2c50b0; --tl-accent-ink: #a9c1ff;
  --tl-teal: #5cc2ae; --tl-teal-strong: #7fd6c4; --tl-teal-soft: #163c36;
  --tl-bg: #0e1422; --tl-surface: #151d2f; --tl-surface-2: #1a2438;
  --tl-ink: #e6ebf5; --tl-muted: #9ba7c0; --tl-line: #26324a;
  --tl-amber: #f3c46b; --tl-amber-soft: #3a2c10;
  --tl-blue: #9db6ff;  --tl-blue-soft: #1d2b55;
  --tl-red: #ff9a90;   --tl-red-soft: #451b1a;
  --tl-gray: #aab4c8;  --tl-gray-soft: #222c40;
  --tl-ghost: #a99bff; --tl-ghost-soft: #262046; --tl-ghost-ink: #ded8ff;
  --tl-on-danger: #3b0b07; --tl-on-ghost: #1b1446;
  --tl-shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px -18px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
html, body { height: 100%; }
body.tl-body {
  margin: 0;
  background: var(--tl-bg);
  color: var(--tl-ink);
  font: 15px/1.55 var(--tl-font-body);
  -webkit-font-smoothing: antialiased;
}
.tl-body img { max-width: 100%; }
.tl-body h1, .tl-body h2, .tl-body h3 { font-family: var(--tl-font-display); margin: 0; letter-spacing: -.01em; }
.tl-body a:where(:not(.tl-btn)) { color: var(--tl-accent-ink); } /* :where no suma especificidad: los botones y pestañas que son enlaces conservan su color */
.tl-body :focus-visible { outline: 2px solid var(--tl-teal); outline-offset: 2px; border-radius: 6px; }
.tl-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Logo claro / oscuro */
.tl-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-logo-light { display: none; }
  :root:not([data-theme="light"]) .tl-logo-dark { display: block; }
}
:root[data-theme="dark"] .tl-logo-light { display: none; }
:root[data-theme="dark"] .tl-logo-dark { display: block; }

/* Botón de tema: en claro ofrece la luna; en oscuro, el sol */
.tl-tema > span { display: inline-flex; }
.tl-tema-claro { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-tema-oscuro { display: none !important; }
  :root:not([data-theme="light"]) .tl-tema-claro { display: inline-flex !important; }
}
:root[data-theme="dark"] .tl-tema-oscuro { display: none !important; }
:root[data-theme="dark"] .tl-tema-claro { display: inline-flex !important; }

/* ---------- 3. Shell ---------- */
.tl-app { display: grid; grid-template-columns: var(--tl-sidebar-w) minmax(0, 1fr); min-height: 100%; }

.tl-sidebar {
  position: sticky; top: env(safe-area-inset-top, 0px);
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column;
  background: var(--tl-surface);
  border-right: 1px solid var(--tl-line);
  overflow: hidden;
}
.tl-brand { display: block; padding: 22px 22px 14px; }
.tl-brand img { width: 172px; height: auto; }
.tl-nav { flex: 1; overflow-y: auto; padding: 4px 14px 18px; }
.tl-nav-section + .tl-nav-section { margin-top: 18px; }
.tl-nav-title { margin: 0 10px 6px; font-size: 12.5px; font-weight: 600; color: var(--tl-muted); }
.tl-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tl-nav-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--tl-radius-sm);
  color: var(--tl-ink); text-decoration: none; font-weight: 500; font-size: 14.5px;
}
.tl-nav-link:hover { background: var(--tl-surface-2); }
.tl-nav-link .tl-ico { color: var(--tl-muted); }
.tl-nav-link.is-active { background: var(--tl-teal-soft); color: var(--tl-accent-ink); font-weight: 600; }
.tl-nav-link.is-active .tl-ico { color: var(--tl-teal-strong); }
.tl-nav-link.is-active::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tl-teal);
}
.tl-nav-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.tl-nav-badge {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center;
  background: var(--tl-primary); color: #fff; font-size: 12px; font-weight: 700;
}
.tl-nav-ro { color: var(--tl-muted); display: inline-flex; }
.tl-nav-ro .tl-ico { width: 16px; height: 16px; }

/* Bloque Master: sólo existe en el HTML cuando la sesión es Master */
.tl-nav-ghost {
  margin-top: 22px; padding: 12px 8px 8px;
  border: 1.5px dashed var(--tl-ghost); border-radius: var(--tl-radius);
  background: var(--tl-ghost-soft);
}
.tl-nav-ghost .tl-nav-title { color: var(--tl-ghost); display: flex; align-items: center; gap: 6px; }
.tl-nav-ghost .tl-nav-title .tl-ico { width: 16px; height: 16px; }
.tl-nav-ghost .tl-nav-link { color: var(--tl-ghost-ink); }
.tl-nav-ghost .tl-nav-link .tl-ico { color: var(--tl-ghost); }
.tl-nav-ghost .tl-nav-link:hover { background: color-mix(in srgb, var(--tl-ghost) 12%, transparent); }
.tl-nav-ghost .tl-nav-link.is-active { background: var(--tl-ghost); color: var(--tl-on-ghost); }
.tl-nav-ghost .tl-nav-link.is-active .tl-ico { color: var(--tl-on-ghost); }
.tl-nav-ghost .tl-nav-link.is-active::before { display: none; }

.tl-userbox {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid var(--tl-line);
}
.tl-userbox-text { min-width: 0; line-height: 1.3; }
.tl-userbox-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-userbox-role { font-size: 12.5px; color: var(--tl-muted); }
.tl-userbox form, .tl-userbox .tl-iconbtn { margin-left: auto; }

.tl-avatar {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: var(--tl-teal); color: var(--tl-on-teal); font: 700 13px/1 var(--tl-font-display);
}
.tl-avatar.is-ghost { background: var(--tl-ghost); color: var(--tl-on-ghost); }

.tl-main { min-width: 0; display: flex; flex-direction: column; }
.tl-topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; min-height: 64px;
  background: color-mix(in srgb, var(--tl-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tl-line);
}
.tl-burger { display: none; }
.tl-crumb { font-size: 13px; color: var(--tl-muted); }
.tl-page-title { font: 700 18px/1.2 var(--tl-font-display); }
.tl-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tl-iconbtn {
  position: relative; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--tl-line);
  background: var(--tl-surface); color: var(--tl-ink); cursor: pointer;
}
.tl-iconbtn:hover { border-color: var(--tl-teal); }
.tl-iconbtn .tl-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--tl-teal); border: 2px solid var(--tl-surface); }

.tl-ghostbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0; padding: 9px 28px; font-size: 13.5px;
  background: var(--tl-ghost-soft); color: var(--tl-ghost-ink);
  border-bottom: 1px dashed var(--tl-ghost);
}
.tl-ghostbar strong { color: var(--tl-ghost); }

.tl-content { padding: 26px 28px 48px; max-width: 1360px; width: 100%; }

.tl-scrim { display: none; }

@media (max-width: 991.98px) {
  .tl-app { grid-template-columns: minmax(0, 1fr); }
  .tl-sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: auto;
    width: min(86vw, var(--tl-sidebar-w));
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: var(--tl-shadow);
  }
  .tl-app.is-nav-open .tl-sidebar { transform: none; }
  .tl-app.is-nav-open .tl-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(10, 16, 32, .45); }
  .tl-burger { display: inline-grid; }
  .tl-topbar, .tl-ghostbar { padding-left: 16px; padding-right: 16px; }
  .tl-content { padding: 18px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { .tl-sidebar { transition: none; } }

/* ---------- 4. Componentes ---------- */
.tl-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.tl-hello h1 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; }
.tl-hello p { margin: 4px 0 0; color: var(--tl-muted); max-width: 62ch; }

.tl-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.tl-span-12 { grid-column: span 12; } .tl-span-8 { grid-column: span 8; } .tl-span-7 { grid-column: span 7; }
.tl-span-6 { grid-column: span 6; } .tl-span-5 { grid-column: span 5; } .tl-span-4 { grid-column: span 4; }
@media (max-width: 1199.98px) { .tl-span-8, .tl-span-7, .tl-span-6, .tl-span-5, .tl-span-4 { grid-column: span 12; } }

.tl-card { background: var(--tl-surface); border: 1px solid var(--tl-line); border-radius: var(--tl-radius-lg); padding: 20px 22px; box-shadow: var(--tl-shadow); min-width: 0; }
.tl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tl-card-title { font: 700 16px/1.3 var(--tl-font-display); }
.tl-card-sub { font-size: 13.5px; color: var(--tl-muted); margin-top: 2px; }
.tl-card.is-ghost { border: 1.5px dashed var(--tl-ghost); background: linear-gradient(var(--tl-ghost-soft), var(--tl-surface) 140px); }

.tl-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font: 600 14px/1.2 var(--tl-font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.tl-btn .tl-ico { width: 18px; height: 18px; }
.tl-btn-primary { background: var(--tl-primary); color: #fff; }
.tl-btn-primary:hover { background: var(--tl-primary-strong); }
.tl-btn-teal { background: var(--tl-teal); color: var(--tl-on-teal); }
.tl-btn-teal:hover { filter: brightness(.95); }
.tl-btn-ghost { background: var(--tl-surface); color: var(--tl-ink); border-color: var(--tl-line); }
.tl-btn-ghost:hover { border-color: var(--tl-teal); }
.tl-btn-danger { background: var(--tl-red); color: var(--tl-on-danger); }
.tl-btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.tl-btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

/* Perfil en el Inicio */
.tl-perfil { display: flex; align-items: center; gap: 18px; padding: 16px 22px; }
.tl-perfil-avatar { width: 52px; height: 52px; font-size: 17px; }
.tl-perfil-datos { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 22px; margin: 0; }
.tl-perfil-datos dt { font-size: 12.5px; color: var(--tl-muted); }
.tl-perfil-datos dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .tl-perfil { align-items: flex-start; }
  .tl-perfil-datos { grid-template-columns: 1fr; }
}

/* Estados de solicitud */
.tl-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tl-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pendiente_jefe { background: var(--tl-amber-soft); color: var(--tl-amber); }
.st-pendiente_rh   { background: var(--tl-blue-soft);  color: var(--tl-blue); }
.st-aprobada       { background: var(--tl-teal-soft);  color: var(--tl-teal-strong); }
.st-rechazada      { background: var(--tl-red-soft);   color: var(--tl-red); }
.st-cancelada      { background: var(--tl-gray-soft);  color: var(--tl-gray); }
.st-suspendido     { background: var(--tl-red-soft);   color: var(--tl-red); }

/* Saldo en panal: un hexágono por día de derecho (LFT art. 76) */
.tl-saldo { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; }
.tl-saldo-num { font: 800 64px/0.9 var(--tl-font-display); color: var(--tl-accent-ink); letter-spacing: -.03em; }
.tl-saldo-num small { display: block; margin-top: 8px; font: 500 14px/1.3 var(--tl-font-body); color: var(--tl-muted); letter-spacing: 0; }
.tl-hexes { display: flex; flex-wrap: wrap; gap: 5px 3px; max-width: 360px; }
.tl-hex {
  width: 26px; height: 30px; position: relative;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--tl-teal);
}
.tl-hex.is-used { background: var(--tl-primary); }
.tl-hex.is-pending { background: var(--tl-teal); }
.tl-hex.is-pending::after {
  content: ""; position: absolute; inset: 2.5px;
  clip-path: inherit; background: var(--tl-surface);
}
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; color: var(--tl-muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .tl-hex { width: 12px; height: 14px; }
.tl-legend .tl-hex.is-pending::after { inset: 1.5px; }

.tl-slots { display: flex; gap: 10px; margin: 6px 0 10px; }
.tl-slot { flex: 1; height: 44px; border-radius: 10px; border: 1.5px dashed var(--tl-line); display: grid; place-items: center; font-size: 12.5px; color: var(--tl-muted); }
.tl-slot.is-used { border-style: solid; border-color: var(--tl-primary); background: var(--tl-primary); color: #fff; font-weight: 600; }
.tl-slot.is-pending { border-style: solid; border-color: var(--tl-teal); color: var(--tl-teal-strong); font-weight: 600; }

/* KPIs */
.tl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 767.98px) { .tl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tl-kpi { padding: 14px 16px; border-radius: var(--tl-radius); background: var(--tl-surface); border: 1px solid var(--tl-line); }
.tl-kpi-value { font: 700 28px/1.1 var(--tl-font-display); }
.tl-kpi-label { font-size: 13px; color: var(--tl-muted); margin-top: 4px; }
.tl-kpi.is-alert .tl-kpi-value { color: var(--tl-blue); }

/* Tablas */
.tl-table-wrap { position: relative; overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tl-table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--tl-muted); padding: 8px 10px; border-bottom: 1px solid var(--tl-line); white-space: nowrap; }
.tl-table td { padding: 11px 10px; border-bottom: 1px solid var(--tl-line); vertical-align: middle; }
.tl-table tr:last-child td { border-bottom: 0; }
.tl-table .tl-who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.tl-table .tl-who small { display: block; color: var(--tl-muted); font-size: 12.5px; }
.tl-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tl-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--tl-muted); }
.tl-lock .tl-ico { width: 15px; height: 15px; }

/* Calendario mensual */
.tl-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.tl-cal-dow { font-size: 12px; font-weight: 600; color: var(--tl-muted); padding: 4px 0; }
.tl-cal-day { aspect-ratio: 1 / .82; display: grid; place-items: center; border-radius: 9px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tl-cal-day.is-out { color: transparent; }
.tl-cal-day.is-weekend { color: var(--tl-muted); }
.tl-cal-day.is-today { outline: 2px solid var(--tl-primary); outline-offset: -2px; font-weight: 700; }
.tl-cal-day.is-approved { background: var(--tl-primary); color: #fff; }
.tl-cal-day.is-pending { background: var(--tl-teal-soft); color: var(--tl-teal-strong); box-shadow: inset 0 0 0 1.5px var(--tl-teal); }
.tl-cal-day.is-holiday { color: var(--tl-red); font-weight: 700; }
button.tl-cal-day { font: inherit; color: inherit; border: 0; background: transparent; padding: 0; cursor: pointer; position: relative; }
.tl-cal-day.is-free:hover { background: var(--tl-surface-2); box-shadow: inset 0 0 0 1.5px var(--tl-line); }
.tl-cal-day.is-selected, .tl-cal-day.is-selected:hover { background: var(--tl-amber-soft); color: var(--tl-amber); font-weight: 700; box-shadow: inset 0 0 0 2px var(--tl-amber); }
.tl-cal-day.is-selected::after { position: absolute; right: 5px; bottom: 3px; font-size: 10px; font-weight: 700; line-height: 1; }
.tl-cal-day[data-tipo="vacaciones"]::after { content: "V"; }
.tl-cal-day[data-tipo="permiso_goce"]::after { content: "P"; }
.tl-cal-day[data-tipo="permiso_sin_goce"]::after { content: "SG"; }
.tl-cal-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.tl-cal-swatch.is-approved { background: var(--tl-primary); }
.tl-cal-swatch.is-pending { background: var(--tl-teal-soft); box-shadow: inset 0 0 0 1.5px var(--tl-teal); }
.tl-cal-swatch.is-selected { background: var(--tl-amber-soft); box-shadow: inset 0 0 0 1.5px var(--tl-amber); }
.tl-cal-swatch.is-holiday { background: var(--tl-red-soft); box-shadow: inset 0 0 0 1.5px var(--tl-red); }

/* Selección de días en Mi calendario */
.tl-sel { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.tl-sel li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 14px; }
.tl-sel select { font: 400 14px/1.3 var(--tl-font-body); color: var(--tl-ink); padding: 6px 8px; border-radius: 8px; border: 1px solid var(--tl-line); background: var(--tl-surface); }
.tl-sel-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 14px; }
.tl-sel-meter { padding: 10px 12px; border-radius: var(--tl-radius); background: var(--tl-surface-2); border: 1px solid var(--tl-line); font-size: 13px; color: var(--tl-muted); display: grid; gap: 2px; }
.tl-sel-meter b { color: var(--tl-ink); font-size: 14px; }
.tl-sel-meter.is-over { background: var(--tl-red-soft); border-color: var(--tl-red); }
.tl-sel-meter.is-over b { color: var(--tl-red); }

/* Calendario de equipo: una fila por persona, una columna por día */
.tl-teamcal-head { flex-wrap: wrap; }
.tl-teamcal-filter select { font: 400 13.5px/1.3 var(--tl-font-body); color: var(--tl-ink); padding: 6px 8px; border-radius: 8px; border: 1px solid var(--tl-line); background: var(--tl-surface); }
.tl-teamcal { border-collapse: separate; border-spacing: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
.tl-teamcal th, .tl-teamcal td { text-align: center; padding: 0; min-width: 26px; height: 30px; border-radius: 6px; }
.tl-teamcal thead th { font-weight: 600; color: var(--tl-muted); line-height: 1.15; padding: 2px 0; }
.tl-teamcal thead th span { display: block; font-size: 10.5px; font-weight: 500; }
.tl-teamcal thead th.is-today { background: var(--tl-primary); color: #fff; }
.tl-teamcal thead th.is-holiday { color: var(--tl-red); }
.tl-teamcal td { background: var(--tl-surface-2); font-size: 10.5px; font-weight: 700; }
.tl-teamcal td.is-weekend { background: transparent; }
.tl-teamcal td.is-holiday { background: var(--tl-red-soft); }
.tl-teamcal td.is-approved { background: var(--tl-primary); color: #fff; }
.tl-teamcal td.is-pending { background: var(--tl-teal-soft); color: var(--tl-teal-strong); box-shadow: inset 0 0 0 1.5px var(--tl-teal); }
.tl-teamcal .tl-teamcal-who { position: sticky; left: 0; z-index: 1; background: var(--tl-surface); text-align: left; min-width: 210px; padding: 4px 12px 4px 0; font-weight: 400; color: var(--tl-ink); font-size: 13.5px; }
.tl-teamcal .tl-teamcal-who .tl-who { min-width: 0; }
.tl-teamcal .tl-teamcal-who small { display: block; color: var(--tl-muted); font-size: 12px; }
.tl-teamcal .tl-teamcal-total { background: transparent; min-width: 40px; font-size: 13px; color: var(--tl-ink); }
.tl-teamcal-group th { text-align: left; padding: 12px 0 2px; font: 700 13px/1.3 var(--tl-font-display); color: var(--tl-accent-ink); height: auto; position: sticky; left: 0; }
.tl-teamcal tfoot th, .tl-teamcal tfoot td { font-weight: 600; color: var(--tl-muted); background: transparent; border-top: 1px solid var(--tl-line); border-radius: 0; }
.tl-teamcal tfoot td.is-crowded { background: var(--tl-amber-soft); color: var(--tl-amber); border-radius: 6px; }
.tl-kpi-of { font: 500 14px/1 var(--tl-font-body); color: var(--tl-muted); }
@media (max-width: 640px) {
  .tl-teamcal .tl-teamcal-who { min-width: 150px; }
  .tl-teamcal .tl-teamcal-who .tl-avatar { display: none; }
}

/* Departamentos */
.tl-areas { display: grid; gap: 12px; align-content: start; }
.tl-alta { align-self: start; position: sticky; top: 84px; }
.tl-area { padding-top: 0; padding-bottom: 0; }
.tl-area > summary { display: flex; align-items: center; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none; }
.tl-area > summary::-webkit-details-marker { display: none; }
.tl-area > summary:focus-visible { outline: 2px solid var(--tl-teal); outline-offset: 2px; border-radius: 8px; }
.tl-area-nombre { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tl-area-chev { display: inline-flex; color: var(--tl-muted); transition: transform .15s ease; }
.tl-area[open] > summary .tl-area-chev { transform: rotate(90deg); }
.tl-area[open] { padding-bottom: 14px; }
.tl-area[open] > summary { border-bottom: 1px solid var(--tl-line); margin-bottom: 4px; }
.tl-area .tl-actions form { margin: 0; }
.tl-table tr.is-resaltada > td { background: var(--tl-teal-soft); }
.tl-actions-nowrap { flex-wrap: nowrap; }
.tl-solo-angosto { display: none; }
@media (max-width: 1199.98px) { .tl-solo-angosto { display: inline-flex; } }
@media (max-width: 640px) {
  .tl-table-stack tr.is-resaltada { background: var(--tl-teal-soft); margin: 0 -12px; padding: 12px; border-radius: 10px; }
  .tl-table-stack tr.is-resaltada > td { background: none; }
}
.tl-btn-baja:hover { color: var(--tl-red); border-color: var(--tl-red); }
@media (max-width: 640px) {
  .tl-area > summary { flex-wrap: wrap; row-gap: 6px; }
  .tl-area-nombre { flex-basis: calc(100% - 44px); }
  .tl-area > summary .tl-pill { margin-left: 32px; white-space: normal; }
}
.tl-radios { border: 0; padding: 0; margin: 0 0 14px; }
.tl-radios legend { padding: 0; margin-bottom: 5px; font-size: 13.5px; font-weight: 600; float: none; width: auto; }
.tl-radios label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 400; font-size: 14.5px; }
.tl-radios label:has(input:disabled) { color: var(--tl-muted); }
@media (max-width: 1199.98px) { .tl-alta { position: static; } }

/* Barras por departamento */
.tl-bars { display: grid; gap: 12px; }
.tl-bar-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.tl-bar { height: 10px; border-radius: 6px; background: var(--tl-surface-2); overflow: hidden; border: 1px solid var(--tl-line); }
.tl-bar > i { display: block; height: 100%; background: var(--tl-teal); border-radius: 6px; }
.tl-bar-row b { font-variant-numeric: tabular-nums; }

/* Bitácora / feed */
.tl-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tl-feed li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; font-size: 14px; }
.tl-feed li::before { content: ""; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--tl-teal); }
.tl-feed time { display: block; font-size: 12.5px; color: var(--tl-muted); }
.tl-feed li.is-holiday::before { background: var(--tl-red); }

.tl-note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--tl-radius); font-size: 13.5px; background: var(--tl-blue-soft); color: var(--tl-blue); }
.tl-note.is-ghost { background: var(--tl-ghost-soft); color: var(--tl-ghost-ink); }
.tl-note .tl-ico { margin-top: 1px; }

.tl-empty { text-align: center; padding: 48px 20px; }
.tl-empty h2 { font-size: 20px; margin-bottom: 6px; }
.tl-empty p { color: var(--tl-muted); margin: 0 auto 18px; max-width: 52ch; }
.tl-empty dl { display: inline-grid; grid-template-columns: auto auto; gap: 6px 16px; text-align: left; font-size: 13.5px; margin: 0; padding: 14px 18px; border-radius: var(--tl-radius); background: var(--tl-surface-2); border: 1px solid var(--tl-line); }
.tl-empty dt { color: var(--tl-muted); }
.tl-empty dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }

/* Formularios mínimos (en CI4 se pueden usar los de Bootstrap) */
.tl-field { display: grid; gap: 5px; margin-bottom: 14px; font-size: 13.5px; font-weight: 600; }
.tl-field input, .tl-field select, .tl-field textarea {
  font: 400 14.5px/1.4 var(--tl-font-body); color: var(--tl-ink);
  padding: 9px 11px; border-radius: 9px; border: 1px solid var(--tl-line); background: var(--tl-surface);
}
.tl-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
/* Sin esto, un campo en una cuadrícula o columna angosta no se encoge y se sale de la tarjeta. */
.tl-field { min-width: 0; }
.tl-field input:not([type=radio], [type=checkbox]), .tl-field select, .tl-field textarea { width: 100%; min-width: 0; max-width: 100%; }
.tl-hint { font-weight: 400; color: var(--tl-muted); font-size: 13px; }
.tl-error { color: var(--tl-red); font-weight: 600; font-size: 13px; }

/* Diálogo nativo */
.tl-dialog { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--tl-line); border-radius: var(--tl-radius-lg); padding: 0; background: var(--tl-surface); color: var(--tl-ink); box-shadow: var(--tl-shadow); }
.tl-dialog::backdrop { background: rgba(10, 16, 32, .5); }
.tl-dialog-body { padding: 22px; }
.tl-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--tl-line); background: var(--tl-surface-2); border-radius: 0 0 var(--tl-radius-lg) var(--tl-radius-lg); }

/* Toast */
.tl-toast {
  position: fixed; z-index: 60; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px; border-radius: var(--tl-radius); background: var(--tl-ink); color: var(--tl-bg);
  font-size: 14px; box-shadow: var(--tl-shadow);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.tl-toast.is-on { opacity: 1; transform: none; }
.tl-toast.is-ghost { background: var(--tl-ghost); color: var(--tl-on-ghost); }

.tl-alert { padding: 11px 14px; border-radius: var(--tl-radius); margin-bottom: 16px; font-size: 14px; }
.tl-alert-success { background: var(--tl-teal-soft); color: var(--tl-teal-strong); }
.tl-alert-error { background: var(--tl-red-soft); color: var(--tl-red); }

/* ---------- 5. Ajustes de pantallas chicas ---------- */
@media (max-width: 640px) {
  .tl-crumb { display: none; }
  .tl-top-actions .tl-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tl-top-actions .tl-btn { padding: 9px 11px; }
  .tl-topbar { gap: 8px; }
  .tl-top-actions { gap: 6px; min-width: 0; }
  .tl-topbar > div:not(.tl-top-actions) { min-width: 0; flex: 1; }
  .tl-page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tl-saldo { grid-template-columns: 1fr; }
  .tl-field-row { grid-template-columns: 1fr; }
  .tl-sel li { grid-template-columns: 1fr auto; }
  .tl-sel li > span { grid-column: 1 / -1; }
}

/* ---- Equipo de cómputo / inventario de TI -------------------------------------------- */
.tl-eq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl-eq { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--tl-line); border-radius: var(--tl-radius); background: var(--tl-surface); }
.tl-eq-ico { flex: none; width: 34px; height: 34px; border-radius: var(--tl-radius-sm); display: grid; place-items: center; background: var(--tl-surface-2); color: var(--tl-muted); }
.tl-eq-body { min-width: 0; flex: 1; }
.tl-eq-title { font-weight: 600; }
.tl-eq-title a { color: inherit; }
.tl-eq-meta { display: block; font-size: 12.5px; color: var(--tl-muted); overflow-wrap: anywhere; }
.tl-eq-acc { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--tl-line); display: grid; gap: 4px; font-size: 13.5px; }
.tl-eq-acc .tl-ico { width: 14px; height: 14px; vertical-align: -2px; color: var(--tl-muted); margin-right: 4px; }
.tl-eq-vacio { margin: 0; color: var(--tl-muted); font-size: 14px; }
.tl-sn { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.tl-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-tab { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--tl-muted); background: var(--tl-surface-2); text-decoration: none; }
.tl-tab:hover { color: var(--tl-ink); }
.tl-tab.is-active { background: var(--tl-primary); color: #fff; }
.tl-tab small { font-weight: 500; opacity: .8; margin-left: 4px; }
.tl-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 14px 0; }
.tl-filtros .tl-field { margin: 0; min-width: 160px; flex: 1; }
.tl-filtros .tl-field.is-wide { flex: 2; min-width: 200px; }
.tl-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.tl-inline-form .tl-field { margin: 0; flex: 1; min-width: 180px; }
.tl-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; cursor: pointer; min-height: 40px; }
.tl-check input { width: 16px; height: 16px; accent-color: var(--tl-primary); }
.tl-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 22px; margin: 0 0 14px; }
.tl-datos dt { font-size: 12.5px; color: var(--tl-muted); }
.tl-datos dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tl-chips li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--tl-surface-2); border: 1px solid var(--tl-line); font-size: 13px; }
.tl-chips li small { color: var(--tl-muted); }
.tl-chips button { border: 0; background: none; color: var(--tl-muted); cursor: pointer; padding: 2px 6px; border-radius: 999px; font-size: 14px; line-height: 1; }
.tl-chips button:hover { color: var(--tl-red); background: var(--tl-red-soft); }
.tl-perfil-equipo { flex-basis: 100%; border-top: 1px solid var(--tl-line); padding-top: 14px; margin-top: 2px; }
.tl-perfil-equipo h3 { font-size: 13px; color: var(--tl-muted); font-weight: 600; margin: 0 0 8px; }
.tl-perfil-equipo .tl-eq-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tl-perfil.has-equipo { flex-wrap: wrap; }
.tl-perfil-responsiva { margin-top: 14px; }
/* Periodos de tenencia: en una columna angosta (no sólo en celular) se ven como tarjetas */
.tl-periodos-wrap { container-type: inline-size; }
@container (max-width: 520px) {
  .tl-periodos thead { display: none; }
  .tl-periodos tbody { display: block; }
  .tl-periodos tr { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--tl-line); }
  .tl-periodos tr:last-child { border-bottom: 0; }
  .tl-periodos td { display: block; flex: 1 1 calc(33% - 12px); padding: 0; border: 0; }
  .tl-periodos td:not([data-label]) { flex-basis: 100%; }
  .tl-periodos td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--tl-muted); margin-bottom: 2px; }
}

/* Carta responsiva */
.tl-stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.tl-resp-acciones { margin-bottom: 16px; }
.tl-resp-form { padding: 14px; border: 1px dashed var(--tl-line); border-radius: var(--tl-radius); background: var(--tl-surface-2); }
.tl-resp-form .tl-field input[type=file] { padding: 7px; background: var(--tl-surface); }
.tl-resp-titulo { font-size: 13px; color: var(--tl-muted); font-weight: 600; margin: 18px 0 8px; }
.tl-resp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tl-resp-list > li { display: grid; gap: 2px; justify-items: start; padding: 10px 12px; border: 1px solid var(--tl-line); border-radius: var(--tl-radius); }
.tl-resp-list > li > a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tl-resp-list form { margin-top: 6px; }
.tl-resp-list.is-compacta { gap: 4px; }
.tl-resp-list.is-compacta > li { display: block; padding: 0; border: 0; }
.tl-resp-list.is-compacta > li > a { font-weight: 500; font-size: 13.5px; }
/* Tabla que en celular se vuelve una tarjeta por fila; cada celda muestra su encabezado con data-label. */
@media (max-width: 640px) {
  .tl-table-stack thead { display: none; }
  .tl-table-stack, .tl-table-stack tbody { display: block; width: 100%; }
  /* Los datos cortos van de dos en dos; la persona y las acciones ocupan su propio renglón. */
  .tl-table-stack tr { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--tl-line); }
  .tl-table-stack td { display: block; flex: 1 1 calc(50% - 8px); padding: 0; border: 0; min-width: 0 !important; }
  .tl-table-stack td:not([data-label]), .tl-table-stack td:has(.tl-eq-list) { flex-basis: 100%; }
  .tl-table-stack td:has(> .tl-actions:not(:has(*))) { display: none; }
  .tl-table-stack td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--tl-muted); margin-bottom: 2px; }
  .tl-table-stack .tl-who { min-width: 0; }
  .tl-card-head:has(form) { flex-wrap: wrap; }
  .tl-card-head:has(form) > form { flex: 1 1 100%; }
}
@media (max-width: 767.98px) {
  .tl-datos { grid-template-columns: 1fr; }
  .tl-filtros .tl-field, .tl-inline-form .tl-field { min-width: 100%; }
}

/* Aviso de cierre por inactividad (talenti.js) */
.tl-inactividad { position: fixed; z-index: 1100; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(460px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--tl-radius-lg);
  background: var(--tl-surface); color: var(--tl-ink); border: 1px solid var(--tl-amber); box-shadow: var(--tl-shadow); }
.tl-inactividad p { margin: 0; flex: 1; font-size: 14px; font-weight: 600; }
@media (max-width: 480px) { .tl-inactividad { flex-direction: column; align-items: stretch; text-align: center; } }

/* Políticas */
.tl-pol-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tl-pol { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--tl-line); border-radius: var(--tl-radius); }
.tl-pol.is-pendiente { border-color: var(--tl-amber); background: var(--tl-amber-soft); }
.tl-pol-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tl-pol-titulo { font-weight: 600; }
.tl-pol-pdf { display: block; width: 100%; height: 72vh; min-height: 420px; border: 1px solid var(--tl-line); border-radius: var(--tl-radius); background: var(--tl-surface-2); }
.tl-pol-sub { font-size: 15px; margin: 0 0 4px; }
.tl-pol-hecho { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--tl-radius); background: var(--tl-teal-soft); color: var(--tl-teal-strong); font-weight: 600; font-size: 14px; }
@media (max-width: 640px) {
  .tl-pol { flex-wrap: wrap; }
  .tl-pol > .tl-pill, .tl-pol > .tl-btn { margin-left: 52px; }
  .tl-pol-pdf { height: 60vh; min-height: 320px; }
}

/* Notificaciones */
.tl-campana { position: relative; }
.tl-campana-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--tl-red); color: #fff; font: 700 11px/18px var(--tl-font-body); text-align: center; border: 2px solid var(--tl-bg); box-sizing: content-box; }
.tl-notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tl-body .tl-notif > a { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--tl-radius); border: 1px solid var(--tl-line); color: var(--tl-ink); text-decoration: none; }
.tl-notif > a:hover { border-color: var(--tl-teal); }
.tl-notif.is-nueva > a { background: var(--tl-blue-soft); border-color: transparent; }
.tl-notif-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tl-notif-punto { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--tl-primary); flex: none; }

/* Acceso al equipo (usuario y contraseña) */
.tl-acceso { border: 1px dashed var(--tl-line); border-radius: var(--tl-radius); padding: 10px 12px 0; margin: 0 0 14px; min-width: 0; }
.tl-acceso legend { font-size: 13.5px; font-weight: 600; padding: 0 4px; float: none; width: auto; margin: 0; }
.tl-clave { display: flex; gap: 6px; align-items: center; }
.tl-clave input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* RAM y almacenamiento del equipo */
.tl-specs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.tl-specs-alm { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.tl-specs-alm select { width: auto !important; }

/* Días de descanso */
.tl-descanso-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl-descanso-list li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--tl-line); border-radius: var(--tl-radius); }
.tl-descanso-list li.is-pasado { opacity: .6; }
.tl-descanso-list form { margin: 0; }
.tl-descanso-fecha { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 10px; background: var(--tl-red-soft); color: var(--tl-red); line-height: 1; }
.tl-descanso-fecha b { font: 700 18px/1 var(--tl-font-display); }
.tl-descanso-fecha small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.tl-descanso-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
@media (max-width: 640px) { .tl-card-head:has(> .tl-tabs) { flex-wrap: wrap; } .tl-card-head > .tl-tabs { flex-basis: 100%; } }
.tl-areas-barra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 18px; align-items: end; }
.tl-areas-barra .tl-inline-form { margin: 0; }
@media (max-width: 640px) { .tl-areas-barra { grid-template-columns: minmax(0, 1fr); } }
.tl-permisos-leyenda { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin: 14px 0 0; }
.tl-permisos-leyenda dt { font-weight: 600; font-size: 14px; }
.tl-permisos-leyenda dd { margin: 2px 0 0; font-size: 13px; color: var(--tl-muted); }
.tl-permisos td:not(:first-child), .tl-permisos th:not(:first-child) { text-align: center; }
@media (max-width: 640px) { .tl-permisos td:not(:first-child) { text-align: left; } }
.tl-area-admin { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; justify-content: space-between; margin: 14px 0 4px; padding-bottom: 14px; border-bottom: 1px solid var(--tl-line); }
.tl-area-admin .tl-inline-form { flex: 1 1 320px; max-width: 520px; }
/* El contenido de <details> hereda a través de un slot interno que no trae border-box: se fija aquí. */
.tl-area *, .tl-area *::before, .tl-area *::after { box-sizing: border-box; }

/* Master > Contraseñas */
.tl-pwd-list { list-style: none; margin: 0; padding: 0; }
.tl-pwd-list > li { border-top: 1px solid var(--tl-line); }
.tl-pwd-list > li:first-child { border-top: 0; }
.tl-pwd-list summary { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.tl-pwd-list summary::-webkit-details-marker { display: none; }
.tl-pwd-list summary .tl-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.tl-pwd-list summary .tl-who small { display: block; color: var(--tl-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.tl-pwd-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 0 0 14px; }
.tl-pwd-form, .tl-pwd-form * { box-sizing: border-box; }
.tl-pwd-form .tl-field { flex: 1 1 240px; margin: 0; }
.tl-pwd-form input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
@media (max-width: 599.98px) { .tl-pwd-list summary { flex-wrap: wrap; } .tl-pwd-list summary .tl-who { flex-basis: 100%; } }

/* Inventario TI: resumen de la ficha */
.tl-infra-dl { display: grid; gap: 10px; margin: 12px 0 0; }
.tl-infra-dl > div { display: flex; justify-content: space-between; gap: 12px; }
.tl-infra-dl dt { color: var(--tl-muted); font-size: 13px; }
.tl-infra-dl dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.tl-infra-red { white-space: nowrap; }

/* Oficina de cada equipo (C&C, Luna…) */
.tl-ofi { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
  background: var(--tl-blue-soft); color: var(--tl-blue); white-space: nowrap; vertical-align: 1px; margin-left: 6px; }
.tl-ofi.is-sin { background: var(--tl-amber-soft); color: var(--tl-amber); }

/* ---------- Incidencias de nómina ---------- */
.tl-inc-cal .tl-cal-day { aspect-ratio: auto; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 7px 2px; }
a.tl-inc-day { color: inherit; text-decoration: none; }
a.tl-inc-day:hover { background: var(--tl-surface-2); box-shadow: inset 0 0 0 1.5px var(--tl-line); }
a.tl-inc-day:focus-visible { outline: 2px solid var(--tl-primary); outline-offset: -2px; }
.tl-inc-day.is-programada { outline: 1.5px dashed var(--tl-blue); outline-offset: -3px; }
.tl-inc-day.is-sel, .tl-inc-day.is-sel:hover { background: var(--tl-blue-soft); box-shadow: inset 0 0 0 2px var(--tl-primary); font-weight: 700; }
.tl-inc-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.tl-inc-dots i { font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; padding: 1px 5px; border-radius: 999px; line-height: 1.4; }
.tl-inc-dots .is-pend, .tl-inc-dot.is-pend { background: var(--tl-amber-soft); color: var(--tl-amber); }
.tl-inc-dots .is-apl, .tl-inc-dot.is-apl { background: var(--tl-teal-soft); color: var(--tl-teal-strong); }
.tl-inc-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
.tl-inc-swatch { display: inline-block; width: 16px; height: 12px; border-radius: 4px; outline: 1.5px dashed var(--tl-blue); outline-offset: -2px; }
.tl-inc-otros { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--tl-ghost-soft); color: var(--tl-ghost-ink); }
.tl-inc-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tl-inc-lista li { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--tl-line); border-radius: var(--tl-radius); font-size: 14px; }
.tl-inc-lista-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tl-inc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--tl-muted); }
.tl-inc-notas { margin: 0; font-size: 13px; color: var(--tl-muted); overflow-wrap: anywhere; }
.tl-inc-editar { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.tl-inc-toggle { display: inline; margin: 0; }
.tl-inc-toggle button { border: 0; background: none; padding: 0; border-radius: 999px; cursor: pointer; }
.tl-inc-toggle button:hover .tl-pill { box-shadow: inset 0 0 0 1.5px currentColor; }
.tl-inc-toggle button:focus-visible { outline: 2px solid var(--tl-primary); outline-offset: 2px; }
.tl-inc-tabla { font-size: 13.5px; }
.tl-inc-tabla td, .tl-inc-tabla th { padding-left: 7px; padding-right: 7px; }
.tl-inc-tabla td:nth-child(2) { min-width: 150px; }
.tl-inc-notas-td { min-width: 180px; max-width: 260px; font-size: 13px; overflow-wrap: anywhere; }
.tl-inc-dialog { width: min(680px, calc(100vw - 32px)); }
.tl-inc-dialog .tl-dialog-body { max-height: calc(100vh - 150px); overflow-y: auto; }
@media (max-width: 575.98px) {
  .tl-inc-cal .tl-cal-day { min-height: 48px; padding: 5px 1px; }
  .tl-inc-dots i { min-width: 0; padding: 0 4px; font-size: 10px; }
}

/* ---------- Colaboradores: usuario y contraseña al dar de alta ---------- */
.tl-acceso { border: 1px solid var(--tl-line); border-radius: 12px; padding: 12px 14px 4px; margin: 0 0 14px; }
.tl-acceso > legend { padding: 0 6px; font-weight: 600; }
.tl-pwd-input { display: flex; gap: 6px; align-items: center; }
.tl-pwd-input input { flex: 1; min-width: 0; }
