/* ── Variables ───────────────────────────────────────────── */
:root {
  --naranja:   #FF5100;   /* Naranja oficial Hualpén — Pantone Orange 021 C */
  --naranja-d: #D94500;   /* Variante oscura para hovers */
  --blanco:    #ffffff;
  --gris-claro:#f4f5f7;
  --gris-med:  #e2e4e8;
  --gris-text: #6b7280;
  --negro:     #1f2937;
  --danger:    #dc2626;
  --success:   #16a34a;
  --radius:    6px;
  --shadow:    0 1px 4px rgba(0,0,0,.10);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* el atributo hidden siempre oculta, pese a display:flex/inline-flex */
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px;
       background: var(--gris-claro); color: var(--negro); line-height: 1.5;
       overflow-x: clip; }   /* red de seguridad: ningún elemento debe generar scroll horizontal del body (clip no rompe position:sticky) */
a { color: var(--naranja); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: var(--naranja);
  color: var(--blanco);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 60px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  position: sticky; top: 0; z-index: 100;
}
.navbar-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.05rem; color: var(--blanco); letter-spacing: .3px; }
.navbar-brand:hover { text-decoration: none; }
.navbar-brand span { font-weight: 300; }
.navbar-logo { height: 44px; width: auto; display: block; }
.navbar-links { display: flex; align-items: center; gap: .25rem; margin-left: 1.5rem; margin-right: auto; }
.navbar-links a, .navbar-right > a { white-space: nowrap; }
.navbar-links a {
  color: rgba(255,255,255,.85); font-size: .88rem; font-weight: 500;
  padding: .4rem .9rem; border-radius: var(--radius); transition: background .15s;
}
.navbar-links a:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.navbar-links a.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 600; }

/* Nuevos Ingresos: módulo principal — destacado permanente (pill blanco) */
.navbar-links a.nav-principal { font-weight: 700; display: inline-flex; align-items: center; gap: .4rem; }
/* El menú donde estás parado queda en pill blanco (Usuarios ya no está siempre seleccionado) */
.navbar-links a.active, .nav-mas-btn.active { background: #fff; color: var(--naranja); font-weight: 700; }
.navbar-links a.active:hover { background: #fff; color: var(--naranja-d); }
.nav-badge {
  background: var(--naranja); color: #fff; font-size: .68rem; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.nav-sep { width: 1px; height: 22px; background: rgba(255,255,255,.4); margin: 0 .45rem; flex-shrink: 0; }

/* B2 — Semáforo de antigüedad de equipo */
.antig-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.antig-verde    { background: #16a34a; }
.antig-amarillo { background: #f59e0b; }
.antig-rojo     { background: #dc2626; }

/* A2 — Breadcrumb de retorno a una gestión de Nuevos Ingresos */
.ingreso-breadcrumb {
  position: sticky; top: 60px; z-index: 90;
  display: flex; align-items: center; gap: 1rem;
  background: #fff7f2; border-bottom: 1px solid var(--naranja);
  padding: .5rem 1.5rem;
}
.ingreso-breadcrumb a {
  color: var(--naranja); font-weight: 600; font-size: .86rem; text-decoration: none;
}
.ingreso-breadcrumb a:hover { color: var(--naranja-d); text-decoration: underline; }
.ingreso-breadcrumb .ingreso-bc-tag {
  margin-left: auto; font-size: .74rem; font-weight: 700; color: var(--naranja);
  background: #fff; border: 1px solid var(--naranja); border-radius: 999px; padding: .12rem .6rem;
}
.navbar-right { display: flex; align-items: center; gap: 1rem; }

/* Botón hamburguesa — oculto en escritorio; se muestra en el bloque responsivo (≤900px) */
.nav-hamburger {
  display: none; margin-left: auto;
  background: rgba(255,255,255,.15); border: none; cursor: pointer;
  width: 42px; height: 34px; border-radius: var(--radius); padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: background .15s;
}
.nav-hamburger:hover { background: rgba(255,255,255,.28); }
.nav-hamburger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.navbar.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navbar.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
.navbar.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* D1 — Barra de búsqueda global estática en el navbar */
.navsearch {
  position: relative; display: flex; align-items: center; gap: .35rem;
  background: #fff; border-radius: var(--radius); padding: 0 .6rem; height: 34px;
}
.navsearch-lupa { font-size: .9rem; line-height: 1; color: var(--gris-text); }
.navsearch-input {
  border: none; outline: none; background: transparent; color: var(--negro);
  font-size: .85rem; width: 200px; max-width: 36vw; height: 100%;
}
.navsearch-input::placeholder { color: #9ca3af; }
.navsearch-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: 360px; max-width: 90vw;
  max-height: 70vh; overflow-y: auto; background: #fff;
  border: 1px solid var(--gris-med); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 1000;
}
.gsearch-hintmsg { padding: 1.25rem; text-align: center; color: var(--gris-text); font-size: .85rem; }
.gsearch-group { border-bottom: 1px solid var(--gris-claro); }
.gsearch-grouphead {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--gris-text); padding: .5rem 1.1rem .25rem;
}
.gsearch-item { display: flex; flex-direction: column; gap: .1rem; padding: .5rem 1.1rem; text-decoration: none; color: var(--negro); }
.gsearch-item:hover { background: #fff7f2; text-decoration: none; }
.gsearch-item strong { font-size: .86rem; }
.gsearch-item small { font-size: .76rem; color: var(--gris-text); }

/* B1 — Campana de alertas */
.alert-bell { position: relative; }
.alert-bell-btn {
  background: none; border: none; cursor: pointer; font-size: 1.15rem; line-height: 1;
  position: relative; padding: .2rem; color: #fff;
}
.alert-bell-badge {
  position: absolute; top: -4px; right: -6px;
  background: #fff; color: var(--naranja); font-size: .62rem; font-weight: 800;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.alert-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 360px; max-height: 70vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--gris-med); border-radius: var(--radius);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.18)); z-index: 200;
}
.alert-panel-head {
  font-weight: 700; font-size: .9rem; color: var(--negro); padding: .7rem .9rem;
  border-bottom: 1px solid var(--gris-med); position: sticky; top: 0; background: #fff;
}
.alert-panel-head span { color: var(--gris-text); font-weight: 600; }
.alert-panel-tabs {
  display: flex; flex-wrap: wrap; gap: .3rem; padding: .5rem .7rem;
  border-bottom: 1px solid var(--gris-med); position: sticky; top: 2.55rem; background: #fff; z-index: 1;
}
.alert-tab {
  border: 1px solid var(--gris-med); background: var(--gris-claro, #f4f5f7); color: var(--gris-text);
  font-size: .72rem; font-weight: 600; padding: .22rem .55rem; border-radius: 999px; cursor: pointer;
  line-height: 1.3;
}
.alert-tab:hover { border-color: #ffb38f; }
.alert-tab b { font-weight: 700; opacity: .8; margin-left: .15rem; }
.alert-tab.active { background: #FF5100; color: #fff; border-color: #FF5100; }
.alert-tab.active b { opacity: 1; }
.alert-empty { padding: 1.25rem; text-align: center; color: var(--gris-text); font-size: .85rem; }
.alert-item {
  display: flex; align-items: flex-start; gap: .6rem; padding: .65rem .9rem;
  border-bottom: 1px solid var(--gris-claro); text-decoration: none; color: var(--negro);
}
.alert-item:hover { background: #fff7f2; text-decoration: none; }
.alert-item-ico { font-size: 1.1rem; line-height: 1.2; }
.alert-item-txt { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.alert-item-txt strong { font-size: .83rem; }
.alert-item-txt small { font-size: .76rem; color: var(--gris-text); }
.alert-item-go { font-size: .74rem; color: var(--naranja); font-weight: 700; white-space: nowrap; }
.navbar-right .user { font-size: .85rem; opacity: .9; }
.btn-logout {
  background: rgba(255,255,255,.20); border: none; color: var(--blanco);
  padding: .3rem .8rem; border-radius: var(--radius); cursor: pointer;
  font-size: .82rem; transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.35); }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--blanco); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem;
}

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem 1rem; border-radius: var(--radius);
  border: none; cursor: pointer; font-size: .85rem; font-weight: 500;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(.92); }
.btn-primary  { background: var(--naranja); color: var(--blanco); }
.btn-secondary{ background: var(--gris-med); color: var(--negro); }
.btn-danger   { background: var(--danger); color: var(--blanco); }
.btn-sm { padding: .3rem .7rem; font-size: .78rem; }
.btn-icon { background: none; border: none; cursor: pointer; padding: .25rem; color: var(--gris-text); }
.btn-icon:hover { color: var(--naranja); }

/* ── Patrón unificado "copiar al portapapeles" ────────────────
   El propio valor es clicable. Al pasar el cursor se resalta con
   un fondo naranja muy tenue y aparece un ícono de copiar (::after).
   Al hacer clic copia y muestra el toast global (ver copiar() en app.js).
   Funciona dentro de filas clicables: el helper hace stopPropagation. */
.copiable {
  cursor: pointer; border-radius: 4px; padding: .08rem .3rem;
  display: inline-flex; align-items: center; gap: .3rem;
  transition: background .12s, color .12s;
}
.copiable::after {
  content: "📋"; font-size: .78em; line-height: 1;
  opacity: 0; transition: opacity .12s; flex-shrink: 0;
}
.copiable:hover,
.copiable:focus-visible {
  background: rgba(255,81,0,.08); color: var(--naranja-d); outline: none;
}
.copiable:hover::after,
.copiable:focus-visible::after { opacity: .85; }
.copiable.copiado { background: #dcfce7; color: var(--success); }
.copiable.copiado::after { content: "✓"; opacity: 1; }

/* ── Toast global unificado ───────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(.75rem);
  background: #111827; color: #fff;
  padding: .55rem 1.2rem;
  border-radius: 10px; font-size: .84rem; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.22);
  opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; z-index: 99999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Encabezado de página ─────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.3rem; font-weight: 700; color: var(--negro); }
.page-header .subtitle { font-size: .83rem; color: var(--gris-text); margin-top: .2rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Toggle de secciones de Inventario (Equipos / Herramientas / BitLocker) ── */
.inv-toggle { display: inline-flex; border: 1px solid var(--gris-med); border-radius: 8px; overflow: hidden; margin-bottom: 1rem; }
.inv-toggle a { padding: .45rem 1rem; font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--gris-text); background: var(--blanco); }
.inv-toggle a.active { background: var(--naranja); color: #fff; }
.inv-toggle a.active:hover { text-decoration: none; }
.inv-toggle a:not(.active):hover { background: var(--gris-claro); text-decoration: none; }

/* ── Tarjetas KPI ─────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: .85rem; margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--blanco); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .95rem 1.1rem; display: flex; flex-direction: column; gap: .5rem;
  border: 1px solid transparent; text-decoration: none;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.stat-card:hover {
  transform: translateY(-2px); box-shadow: 0 5px 16px rgba(0,0,0,.12);
  text-decoration: none;
}
.stat-card .stat-top {
  display: flex; align-items: center; gap: .4rem;
  font-size: .73rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; color: var(--gris-text);
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--negro); }
.stat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-total    { background: var(--naranja); }
.dot-libre    { background: #16a34a; }
.dot-asignado { background: #2563eb; }
.dot-temporal { background: #ea580c; }
.dot-baja     { background: #dc2626; }
.dot-pdev     { background: #ca8a04; }
.dot-antiguos { background: #7c3aed; }
.stat-card.active {
  border-color: var(--naranja);
  box-shadow: 0 0 0 2px rgba(242,101,34,.15), var(--shadow);
}
.stat-card.active .stat-value { color: var(--naranja); }

/* ── Layout: sidebar de filtros + contenido ───────────────── */
.inv-layout {
  display: grid; grid-template-columns: 210px 1fr;
  gap: 1.25rem; align-items: start;
}
.inv-main { min-width: 0; }   /* permite que la tabla haga scroll horizontal */

/* ── Barra lateral de filtros (desplegables compactos) ────── */
.filters-sidebar {
  background: var(--blanco); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1rem; position: sticky; top: 68px;
}
.fs-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.fs-header h3 { font-size: .98rem; font-weight: 700; color: var(--negro); }
.fs-clear { font-size: .76rem; font-weight: 600; color: var(--gris-text); }
.fs-clear:hover { color: var(--naranja); text-decoration: none; }

.facet { padding: .65rem 0 0; }
.facet-title {
  display: block;
  font-size: .71rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--gris-text); margin-bottom: .35rem;
}
.facet-select {
  width: 100%; padding: .42rem .6rem; font-size: .84rem;
  border: 1px solid var(--gris-med); border-radius: var(--radius);
  background: var(--blanco); color: var(--negro); cursor: pointer;
}
.facet-select:focus {
  outline: none; border-color: var(--naranja);
  box-shadow: 0 0 0 2px rgba(242,101,34,.12);
}

/* ── Barra de búsqueda ────────────────────────────────────── */
.search-row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-row input {
  flex: 1; padding: .6rem .95rem; font-size: .9rem;
  border: 1px solid var(--gris-med); border-radius: var(--radius);
  background: var(--blanco); color: var(--negro);
}
.search-row input:focus {
  outline: none; border-color: var(--naranja);
  box-shadow: 0 0 0 2px rgba(242,101,34,.12);
}
.btn-search {
  display: flex; align-items: center; justify-content: center;
  width: 46px; flex-shrink: 0; background: var(--naranja); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer; font-size: 1.05rem;
  transition: filter .15s;
}
.btn-search:hover { filter: brightness(.92); }

/* ── Botón "Exportar" unificado (verde éxito) — usado en todos los módulos ── */
.btn-export {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--success); color: #fff; border: none;
  border-radius: var(--radius); padding: .35rem .8rem;
  font-size: .8rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: filter .15s;
}
.btn-export:hover { filter: brightness(.94); color: #fff; text-decoration: none; }

/* ── Barra de resultados (encima de la tabla) ─────────────── */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: .8rem; margin-bottom: .25rem;
}
.results-count { font-size: .85rem; color: var(--negro); font-weight: 700; }
.results-tools { display: flex; align-items: center; gap: 1rem; }
.results-page  { font-size: .78rem; color: var(--gris-text); }
.per-page { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--gris-text); }
.per-page select {
  padding: .25rem .5rem; border: 1px solid var(--gris-med); border-radius: var(--radius);
  font-size: .8rem; background: var(--blanco); color: var(--negro); cursor: pointer;
}
.per-page select:focus { outline: none; border-color: var(--naranja); }

/* ── Indicador de carga HTMX ──────────────────────────────── */
#tabla-wrap.htmx-request { opacity: .5; transition: opacity .15s; }

/* ── Toolbar (barra sobre tabla) ──────────────────────────── */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .6rem; margin-bottom: 1rem;
}
.toolbar-right { margin-left: auto; }

/* ── Buscador / Filtros ───────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input {
  padding: .42rem .9rem .42rem 2rem; border: 1px solid var(--gris-med);
  border-radius: var(--radius); width: 240px; font-size: .85rem;
  background: var(--blanco);
}
.search-wrap input:focus { outline: none; border-color: var(--naranja); }
.search-icon { position: absolute; left: .55rem; top: 50%; transform: translateY(-50%);
               color: var(--gris-text); font-size: .9rem; pointer-events: none; }

select.filter {
  padding: .42rem .75rem; border: 1px solid var(--gris-med);
  border-radius: var(--radius); font-size: .83rem; background: var(--blanco);
  color: var(--negro); cursor: pointer;
}
select.filter:focus { outline: none; border-color: var(--naranja); }

/* ── Tabla ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--gris-claro); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; color: var(--gris-text);
  padding: .65rem .85rem; text-align: left; border-bottom: 2px solid var(--gris-med);
  white-space: nowrap; cursor: pointer; user-select: none;
}
thead th:hover { color: var(--naranja); }
thead th.sorted { color: var(--naranja); }
tbody tr { border-bottom: 1px solid var(--gris-med); transition: background .1s; }
tbody tr:hover { background: #fff7f2; }
tbody tr.row-click { cursor: pointer; }
tbody td { padding: .6rem .85rem; font-size: .85rem; vertical-align: middle; }
td.acciones { white-space: nowrap; }

/* ── Badges de estado ─────────────────────────────────────── */
.badge {
  display: inline-block; padding: .18rem .6rem; border-radius: 99px;
  font-size: .72rem; font-weight: 600; letter-spacing: .3px;
}
.badge-asignacion { background: #dbeafe; color: #1d4ed8; }
.badge-libre      { background: #dcfce7; color: #15803d; }
.badge-baja       { background: #fee2e2; color: #991b1b; }
.badge-prestamo   { background: #fef9c3; color: #92400e; }
.badge-robado     { background: #f3e8ff; color: #7e22ce; }
.badge-temporal   { background: #ffe4cc; color: #c2410c; }
.badge-pdev       { background: #fef9c3; color: #854d0e; }
.badge-revisar    { background: #e0e7ff; color: #3730a3; }
.badge-default    { background: var(--gris-med); color: var(--gris-text); }

/* Frescura de check-in del agente (módulo Activos) */
.badge-fresco-verde    { background: #dcfce7; color: #15803d; }
.badge-fresco-amarillo { background: #fef9c3; color: #92400e; }
.badge-fresco-rojo     { background: #fee2e2; color: #991b1b; }
.badge-fresco-baja     { background: var(--gris-med); color: var(--gris-text); }

/* ── Paginación ───────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: .35rem;
  justify-content: center; margin-top: 1.25rem; flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-block; padding: .35rem .7rem; border-radius: var(--radius);
  border: 1px solid var(--gris-med); font-size: .82rem; color: var(--negro);
}
.pagination a:hover { background: #fff1e8; border-color: var(--naranja); color: var(--naranja); text-decoration: none; }
.pagination .active { background: var(--naranja); color: var(--blanco); border-color: var(--naranja); font-weight: 600; }
.pagination .disabled { color: var(--gris-text); pointer-events: none; background: var(--gris-claro); }

/* ── Formularios ─────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: .82rem; font-weight: 600; color: var(--gris-text); }
input[type=text], input[type=date], input[type=password], input[type=email],
select, textarea {
  padding: .45rem .75rem; border: 1px solid var(--gris-med);
  border-radius: var(--radius); font-size: .875rem; width: 100%;
  background: var(--blanco); color: var(--negro);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--naranja); box-shadow: 0 0 0 2px rgba(242,101,34,.12);
}
textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
.field-error { font-size: .78rem; color: var(--danger); margin-top: .15rem; }

/* ── Alertas ─────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-size: .87rem; border-left: 4px solid;
}
.alert-danger  { background: #fee2e2; border-color: var(--danger); color: #7f1d1d; }
.alert-success { background: #dcfce7; border-color: var(--success); color: #14532d; }

/* ── Sección de detalle ───────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: .75rem 1.5rem; }
.detail-item label { font-size: .75rem; font-weight: 600; text-transform: uppercase;
                     letter-spacing: .4px; color: var(--gris-text); display: block; }
.detail-item span  { font-size: .9rem; color: var(--negro); }
.section-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--gris-text);
  padding-bottom: .4rem; border-bottom: 2px solid var(--naranja);
  margin: 1.5rem 0 .9rem;
}

/* ── Historial de asignaciones ───────────────────────────── */
.timeline { list-style: none; padding: 0; }
.timeline li {
  display: flex; gap: 1rem; padding: .75rem 0;
  border-bottom: 1px solid var(--gris-med);
}
.timeline li:last-child { border-bottom: none; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--naranja); margin-top: .35rem; flex-shrink: 0;
}
.timeline-dot.cerrada { background: var(--gris-text); }
.timeline-content { flex: 1; }
.timeline-who  { font-weight: 600; font-size: .88rem; }
.timeline-meta { font-size: .78rem; color: var(--gris-text); margin-top: .15rem; }

/* ── Login ───────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #1f2937;
  position: relative;
}
.login-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 0;
}
.login-wrap > * { position: relative; z-index: 1; }
.login-card {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  padding: 2.5rem 2rem; width: 100%; max-width: 360px;
}
.login-card label { color: rgba(255,255,255,.9); }
.login-card h1    { color: #ffffff; }
.login-card p     { color: rgba(255,255,255,.75); }
.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo .icon { font-size: 2.5rem; }
.login-logo h1 { font-size: 1.25rem; font-weight: 700; color: var(--negro); margin-top: .5rem; }
.login-logo p  { font-size: .82rem; color: var(--gris-text); }

/* ── Modal confirmación ───────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--blanco); border-radius: 10px; padding: 1.75rem;
  max-width: 380px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal-box h3 { font-size: 1rem; margin-bottom: .5rem; }
.modal-box p  { font-size: .87rem; color: var(--gris-text); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ── Editor de historial ──────────────────────────────────── */
.hist-row { display: flex; align-items: flex-end; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--gris-med); }
.hist-row:last-child { border-bottom: none; }
.hist-form { display: flex; align-items: flex-end; gap: .5rem; flex: 1; flex-wrap: wrap; }
.hist-field { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 110px; }
.hist-field label { font-size: .7rem; font-weight: 600; color: var(--gris-text); }
.hist-field input { padding: .35rem .5rem; border: 1px solid var(--gris-med); border-radius: var(--radius); font-size: .82rem; width: 100%; }
.hist-field input:disabled { background: var(--gris-claro); color: var(--negro); font-weight: 600; }

/* Colaboradores anteriores sin fechas: lista que se ordena a mano
   (arrastrando el asa o con ↑/↓ cuando el asa tiene el foco). */
.exasig-list { display: flex; flex-direction: column; }
.exasig-row { align-items: flex-end; background: var(--blanco); }
.exasig-grip { flex: 0 0 auto; align-self: flex-end; margin-bottom: .3rem;
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--gris-text); font-size: 1.05rem; line-height: 1; padding: .25rem .35rem;
  cursor: grab; touch-action: none; }
.exasig-grip:hover, .exasig-grip:focus-visible {
  color: var(--naranja); border-color: var(--gris-med); outline: none; }
.exasig-row--drag { box-shadow: var(--shadow); border-left: 3px solid var(--naranja);
  border-bottom-color: transparent; }
.exasig-row--drag .exasig-grip { cursor: grabbing; color: var(--naranja); }
.exasig-estado { font-size: .78rem; color: var(--gris-text); margin: .6rem 0 0 }
.exasig-estado--ok { color: var(--success); font-weight: 600; }
.exasig-estado--error { color: var(--danger); font-weight: 600; }
.exasig-hint { color: var(--naranja); font-weight: 700; }

/* ── Responsive ───────────────────────────────────────────────
   BREAKPOINTS CANÓNICOS DE CERBERUS TI (mobile-first en espíritu,
   escritos como max-width para adaptar el diseño de escritorio):
     · 1100px — "compacto": ventanas angostas / pantalla partida.
                Navbar en una sola fila pero con fuentes y padding
                reducidos y etiquetas ocultas (íconos).
     ·  900px — "tablet": el navbar colapsa a menú hamburguesa;
                sidebars y layouts de 2 columnas pasan a 1 columna.
     ·  560px — "móvil": grillas de tarjetas y filas de formulario
                de 2 columnas pasan a 1 columna.
     ·  400px — "móvil chico": ajustes finos de padding/tamaños.
   Reutilizar estos cortes en los CSS de módulo para mantener
   coherencia en toda la plataforma. ─────────────────────────── */
@media (max-width: 900px) {
  .inv-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; }
  .facet-list.scroll { max-height: 140px; }
}
@media (max-width: 640px) {
  .search-wrap input { width: 160px; }
  .container { padding: 1rem .75rem; }
}
@media (max-width: 560px) {
  .search-wrap input { width: 100%; }
  .search-wrap { flex: 1 1 100%; }
  .toolbar { gap: .5rem; }
  .toolbar-right { margin-left: 0; }
  .page-header h1 { font-size: 1.15rem; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .modal-actions { flex-wrap: wrap; }
}


/* Menú «Más ▾»: agrupa los módulos secundarios del navbar */
.nav-mas { position: relative; }
.nav-mas-btn {
  background: none; border: 0; cursor: pointer; font: inherit; white-space: nowrap;
  color: rgba(255,255,255,.85); font-size: .88rem; font-weight: 500;
  padding: .4rem .9rem; border-radius: var(--radius); transition: background .15s;
}
.nav-mas-btn:hover, .nav-mas.open .nav-mas-btn { background: rgba(255,255,255,.15); color: #fff; }
.nav-mas-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px; z-index: 300;
  background: #2a1538; border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35); padding: .35rem; flex-direction: column; gap: .1rem;
}
.nav-mas.open .nav-mas-menu { display: flex; }
.nav-mas-menu a { display: block; padding: .5rem .8rem; }

/* ── Navbar modo compacto (laptops / ventanas angostas) ──────────────
   El navbar tiene muchos ítems; para que NUNCA desborde en anchos de
   laptop (~1100–1300px) el modo compacto arranca temprano: oculta las
   etiquetas secundarias (quedan íconos) y reduce fuentes/padding. */
@media (max-width: 1280px) {
  .navbar { height: 48px; padding: 0 .9rem; }
  .navbar-logo { height: 30px; }
  .navbar-brand { font-size: .92rem; gap: .35rem; }
  .navbar-links { margin-left: .75rem; gap: .1rem; }
  .navbar-links a { padding: .32rem .6rem; font-size: .8rem; }
  .nav-sep { margin: 0 .25rem; }
  .navbar-right { gap: .5rem; }
  .navsearch { padding: 0 .45rem; height: 30px; }
  .navsearch-input { width: 110px; }
  .lbl-full { display: none; }
  .btn-logout { padding: .25rem .6rem; font-size: .78rem; }
  .ingreso-breadcrumb { top: 48px; }
}

/* ── Navbar responsivo: menú hamburguesa (tablet y móvil) ──────────
   A ≤900px el navbar deja de intentar caber en una fila y colapsa:
   la barra superior queda con logo + hamburguesa, y los enlaces,
   el buscador global, la campana y el bloque de usuario se apilan
   verticalmente en un panel que se abre con el botón. Se conservan
   todos los ids/handlers existentes; solo cambia la disposición.
   Arranca en 1050px: por debajo de eso ni el modo compacto alcanza a
   entrar en una fila sin apretujar los enlaces principales. */
@media (max-width: 1600px) {
  .navbar {
    flex-wrap: wrap; height: auto; min-height: 52px;
    padding: .5rem .9rem; row-gap: .5rem; align-items: center;
  }
  .navbar-logo { height: 34px; }
  .navbar-brand { font-size: 1rem; }
  .nav-hamburger { display: flex; }

  /* Ambos grupos ocupan todo el ancho, se apilan y quedan ocultos hasta abrir */
  .navbar-links,
  .navbar-right {
    order: 3; flex-basis: 100%; width: 100%; margin: 0;
    display: none; flex-direction: column; align-items: stretch; gap: .12rem;
  }
  .navbar.nav-open .navbar-links,
  .navbar.nav-open .navbar-right { display: flex; }

  .navbar-links { padding-top: .5rem; margin-top: .3rem; border-top: 1px solid rgba(255,255,255,.25); }
  .navbar-right { padding-bottom: .3rem; gap: .3rem; }

  /* En el panel vertical vuelven a mostrarse las etiquetas de texto */
  .lbl-full { display: inline !important; }
  .nav-sep { display: none; }
  /* En el panel vertical «Más» se muestra desplegado, sin botón */
  .nav-mas-btn { display: none; }
  .nav-mas-menu { display: flex; position: static; background: none; border: 0; box-shadow: none; padding: 0; min-width: 0; }
  .nav-mas-menu a { display: flex; }

  .navbar-links a,
  .navbar-right > a {
    width: 100%; box-sizing: border-box;
    padding: .6rem .75rem; border-radius: var(--radius);
    font-size: .92rem; display: flex; align-items: center; gap: .5rem;
  }
  .navbar-links a.nav-principal { justify-content: flex-start; }
  /* El enlace que solo envuelve el botón "Cerrar sesión" no lleva padding propio */
  .navbar-right > a[href="/logout"] { padding: 0; }

  /* Buscador global a ancho completo */
  .navsearch { width: 100%; height: 40px; }
  .navsearch-input { width: 100%; max-width: none; flex: 1 1 auto; }
  .navsearch-results { position: static; width: 100%; max-height: 46vh; margin-top: .3rem; box-shadow: none; border-color: var(--gris-med); }

  /* Campana como fila del menú */
  .alert-bell { width: 100%; }
  .alert-bell-btn { width: 100%; justify-content: flex-start; gap: .5rem; padding: .6rem .75rem; border-radius: var(--radius); font-size: 1rem; }
  .alert-bell-btn::after { content: "Alertas"; font-size: .92rem; font-weight: 500; }
  .alert-bell-badge { position: static; top: auto; right: auto; margin-left: 0; }
  .alert-panel { position: static; width: 100%; max-height: 46vh; margin-top: .3rem; }

  .navbar-right .user { width: 100%; padding: .5rem .75rem; opacity: 1; }
  .btn-logout { width: 100%; padding: .6rem; font-size: .9rem; margin-top: .15rem; }
}

@media (max-width: 400px) {
  .navbar-brand { font-size: .92rem; }
  .container { padding: .85rem .6rem; }
}

/* Alertas: marcar como leídas */
.alert-actions { display:flex; justify-content:space-between; align-items:center; gap:.6rem; flex-wrap:wrap; padding:.45rem .2rem 0; font-size:.76rem; width:100%; flex-basis:100%; }
.alert-leer-todas { border:1px solid #fdba74; background:#fff7f2; color:#c2410c; font:inherit; font-weight:700; border-radius:7px; padding:.28rem .6rem; cursor:pointer; }
.alert-leer-todas:hover { background:#ffedd5; }
.alert-aldia { color:#047857; font-weight:700; }
.alert-actions label { color:#6b7280; cursor:pointer; white-space:nowrap; }
.alert-item { position:relative; }
.alert-item.leida { opacity:.55; }
.alert-read { flex:0 0 auto; align-self:flex-start; margin-left:.35rem; width:1.5rem; height:1.5rem; line-height:1.5rem; text-align:center; border-radius:50%; border:1px solid #d1d5db; color:#6b7280; font-size:.8rem; font-weight:800; cursor:pointer; background:#fff; }
.alert-read:hover { background:#ecfdf5; border-color:#34d399; color:#047857; }
