/* =========================================================
   APP.CSS — PARTE 1/3
   - Tokens (colores, tamaños)
   - Tipografía y resets
   - Sidebar fijo
   - Header (topbar) como “card”
   - Contenedores base (main/content/card/input)
   ========================================================= */

:root{
  /* Paleta base */
  --bg:#f4f6f9;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --blue:#005a86;
  --line:#e5e7eb;

  /* Sombra y radios consistentes (look moderno) */
  --shadow: 0 10px 24px rgba(17,24,39,.06);
  --radius: 16px;

  /* Sidebar */
  --sb-w:84px;
  --sb-bg:#002d30;
  --sb-active:#285153;
  --sb-icon:#cfe7e8;
  --sb-icon-dim:#8fb8ba;
  --sb-glow: rgba(93, 208, 214, .35);

  /* Header como contenedor (card flotante) */
  --topbar-card-h: 62px;
  --topbar-pad-y: 8px;
}

/* Tipografía (Gellix) */
@font-face{
  font-family:"Gellix";
  src:url("fonts/Gellix-Regular.woff2") format("woff2");
  font-weight:400;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Gellix";
  src:url("fonts/Gellix-Medium.woff2") format("woff2");
  font-weight:500;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Gellix";
  src:url("fonts/Gellix-Bold.woff2") format("woff2");
  font-weight:700;
  font-style:normal;
  font-display:swap;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:"Gellix", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text)
}
a{color:inherit;text-decoration:none}

/* Controles con tipografía consistente (incluye button Buscar) */
button, input, select, textarea{ font-family:inherit; }

/* =========================
   SIDEBAR
   ========================= */
.sidebar{
  width:var(--sb-w);
  background:var(--sb-bg);
  border-right:1px solid rgba(255,255,255,.08);
  padding:10px 10px;

  position:fixed;
  top:0; left:0;
  height:100vh;

  /* Evita scroll horizontal dentro del sidebar */
  overflow-x:hidden;
  overflow-y:auto;

  z-index:20;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:center;
  padding-top:12px;
}

.nav a{
  width:52px;height:52px;
  display:grid;
  place-items:center;
  border-radius:16px;
  color:var(--sb-icon-dim);
  border:1px solid transparent;
  position:relative;
  transition:transform .08s ease, background .08s ease, box-shadow .08s ease, color .08s ease;
}

/* Tooltip fijo para no “ensanchar” sidebar */
.nav a::after{
  content: attr(data-label);
  position:fixed;
  left: calc(var(--sb-w) + 14px);
  background:rgba(15, 23, 42, .92);
  color:#fff;
  font-size:12px;
  font-weight:700;
  padding:8px 10px;
  border-radius:10px;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease, transform .12s ease;
  transform:translateY(-50%);
  top:0;
}
.nav a:hover::after{
  opacity:1;
  top:120px; /* fallback */
}

.nav a svg{
  width:22px;height:22px;
  stroke:currentColor;
  stroke-width:2;
  fill:none;
}

.nav a:hover{
  color:var(--sb-icon);
  background:rgba(255,255,255,.06);
  box-shadow:0 0 0 1px rgba(255,255,255,.06), 0 10px 20px rgba(0,0,0,.18);
  transform:translateY(-1px);
}
.nav a:hover svg{ filter: drop-shadow(0 0 10px var(--sb-glow)); }

.nav a.active{
  background:var(--sb-active);
  color:#ffffff;
  box-shadow:0 10px 22px rgba(0,0,0,.22);
}
.nav a.active::before{
  content:"";
  position:absolute;
  left:-10px;
  top:10px;
  width:6px;
  height:32px;
  border-radius:10px;
  background:#5dd0d6;
  box-shadow:0 0 14px rgba(93,208,214,.35);
}

/* =========================
   HEADER (Topbar) como card
   ========================= */
.topbar{
  position:fixed;
  top:0;
  left:var(--sb-w);
  right:0;
  z-index:15;

  background:transparent;
  border-bottom:0;
  padding: var(--topbar-pad-y) 18px;
}
.topbar-inner{
  height:var(--topbar-card-h);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
}

/* El contenido “baja” exactamente lo que ocupa el header fijo */
.main{
  margin-left:var(--sb-w);
  padding-top: calc(var(--topbar-card-h) + (var(--topbar-pad-y) * 2) + 2px);
  min-height:100vh;
}

/* Marca (título/subtítulo) */
.brand{display:flex;flex-direction:column;gap:2px;line-height:1.05}
.brand-title{font-weight:800;color:var(--blue);letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted);font-weight:600}

/* Usuario */
.userbox{display:flex;gap:12px;align-items:center;color:var(--muted);font-size:13px}
.userpill{
  display:flex;align-items:center;gap:8px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fbfcfd;
}
.userpill .u-name{color:var(--text);font-weight:800}

/* =========================
   CONTENEDORES
   ========================= */
.content{padding:14px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
}
.card-tight{padding:12px}
.note{color:var(--muted);font-size:12px}

/* Input base (se usa con floating label) */
.input{
  padding:16px 12px 10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  width:100%;
}
/* =========================================================
   APP.CSS — PARTE 2/3
   - Filtros (details/summary)
   - Grillas de filtros (incluye FIX ancho fila 2)
   - Floating label (inputs y selects)
   - Botones
   ========================================================= */

/* =========================
   FILTROS
   ========================= */
.filters{border:0}
.filters-summary{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
}
.filters-summary::-webkit-details-marker{display:none}
.filters-title{font-weight:900}
.filters-body{margin-top:10px}

/* Grillas existentes */
.filters-compact .grid4{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-bottom:10px;
}
.grid2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

/* ✅ NUEVO: grid7 para equipos.jsp
   - Se usa en FILA 1 y FILA 2
   - Esto garantiza que Tipo Adquisición / Fechas tengan el mismo ancho
*/
.grid7{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
  gap:10px;
  margin-bottom:10px;
}

/* ✅ Utilidad: hacer que un bloque ocupe varias columnas */
.span4{ grid-column: span 4; }

/* ✅ Botones del filtro a la derecha, usando el espacio sobrante */
.actions-right{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  align-items:end;
}

/* =========================
   FLOATING LABEL
   ========================= */
.field{position:relative}
.field > label{
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  font-size:13px;
  font-weight:800;
  color:var(--muted);
  pointer-events:none;
  padding:0 6px;
  background:var(--card);
  transition:top .12s ease, transform .12s ease, font-size .12s ease, color .12s ease;
}
.field:focus-within > label{
  top:-8px;
  transform:none;
  font-size:11px;
  color:#4b5563;
}
.field input.input:not(:placeholder-shown) + label{
  top:-8px;
  transform:none;
  font-size:11px;
  color:#4b5563;
}

/* ✅ FIX selects:
   - En selects el label SIEMPRE arriba (no tapa el “-- Todos --”)
*/
.field-select > label{
  top:-8px !important;
  transform:none !important;
  font-size:11px !important;
  color:#4b5563 !important;
}
.field-select .input{ padding-top:18px; }

/* =========================
   BOTONES
   ========================= */
.btn{
  border:1px solid var(--line);
  background:var(--card);
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
  transition:transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}
.btn:hover{
  border-color:#cfe6f5;
  box-shadow:0 10px 24px rgba(17,24,39,.06);
  transform:translateY(-1px);
}
.btn-primary{
  background:var(--blue);
  border-color:var(--blue);
  color:#fff
}
.btn-primary:hover{box-shadow:0 10px 24px rgba(0,90,134,.20)}
.btn-sm{padding:8px 10px;border-radius:10px;font-size:12px;font-weight:800}
.btn-icon{display:inline-flex;align-items:center;gap:8px}
.btn-icon svg{width:16px;height:16px;stroke:currentColor;stroke-width:2;fill:none}
.icon-blue{color:var(--blue)}
.icon-red{color:#b91c1c}
.btn-gear{background:#f3f4f6;border-color:#e5e7eb;color:#6b7280}
.btn-gear:hover{border-color:#d1d5db}

/* chips */
.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  border:1px solid var(--line);
  background:#fff;
}
.chip-ghost{color:var(--muted);background:#fbfcfd}
.chip-ok{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.chip-warn{border-color:#fed7aa;background:#fff7ed;color:#9a3412}
.chip-info{border-color:#bae6fd;background:#f0f9ff;color:#075985}
.chip-bad{border-color:#fecaca;background:#fef2f2;color:#7f1d1d}

.strong{font-weight:900}
.muted{color:var(--muted)}
.small{font-size:12px}
/* =========================================================
   APP.CSS — PARTE 3/3
   - Listado “Dispositivos” (list-head / device-row)
   - Encabezado recupera estilo (fondo oscuro)
   - Columna Opciones pegada a la derecha (sin espacio vacío)
   - Responsive
   ========================================================= */

/* Top del listado: título + meta */
.list-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.list-title{font-weight:900}
.list-meta{color:var(--muted);font-size:12px;font-weight:800}

/* ✅ 7 columnas: la ÚLTIMA se vuelve flexible para “matar” el vacío a la derecha */
.list-head,
.device-row{
  display:grid;
  grid-template-columns:
    190px                 /* Código */
    240px                 /* Tipo/Marca/Modelo */
    120px                 /* Adquisición */
    120px                 /* Fecha */
    190px                 /* Estado Asignación */
    190px                 /* Estado Funcionamiento */
    minmax(320px, 1fr);   /* ✅ Opciones: crece hasta el borde derecho */
  gap: 12px;
  align-items:center;
}

/* ✅ Encabezado del listado (recupera formato “header” elegante) */
.list-head{
  padding:10px 12px;
  border-radius:12px;
  background:#0b1f2a;
  color:#ffffff;
  font-weight:900;
  font-size:12px;
  letter-spacing:.35px;
  text-transform:uppercase;
}

/* Alineaciones utilitarias usadas en equipos.jsp */
.col-center{ text-align:center; justify-content:center; }
.list-head > .col-center{ display:flex; justify-content:center; }

.col-opciones-head{
  text-align:right;
  justify-self:end; /* fuerza el título “Opciones” al borde derecho */
}

/* Cuerpo del listado */
.list-body{margin-top:10px;display:flex;flex-direction:column;gap:10px}

.device-row{
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  transition:transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}
.device-row:hover{border-color:#cfe6f5;box-shadow:var(--shadow);transform:translateY(-1px)}

.device-title{font-weight:900;display:flex;align-items:center;gap:8px}
.device-sub{margin-top:4px;color:var(--muted);font-size:12px}

/* Semáforo */
.dot{width:10px;height:10px;border-radius:50%}
.dot-gray{background:#cbd5e1}
.dot-ok{background:#22c55e}
.dot-warn{background:#f59e0b}
.dot-info{background:#3b82f6}
.dot-bad{background:#ef4444}

/* Vacío */
.empty{
  padding:22px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:#fbfcfd;
  text-align:center;
}
.empty-title{font-weight:900;margin-bottom:4px}
.empty-sub{color:var(--muted);font-size:13px}

/* Paginador */
.pager{
  margin-top:12px;
  display:flex;
  gap:8px;
  justify-content:center;
  flex-wrap:wrap;
}

/* ✅ BOTONES EN “OPCIONES”:
   - en desktop: NO wrap (no baja a otra línea)
   - alineados a la derecha
*/
.dr-actions-centered{
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
  justify-content:flex-end; /* ✅ FIX: pegado a la derecha */
}

/* Compacto para que quepan 4 acciones */
.dr-actions-centered .btn.btn-sm{ padding:7px 9px; }
.dr-actions-centered .btn{ white-space:nowrap; }

/* =========================
   RESPONSIVE (móvil)
   ========================= */
@media (max-width: 1100px){
  .list-head{display:none}
  .device-row{grid-template-columns:1fr;grid-auto-rows:auto}

  /* en mobile sí permitimos wrap */
  .dr-actions-centered{justify-content:flex-start;flex-wrap:wrap}

  .filters-compact .grid4{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .grid7{grid-template-columns:1fr}
  .actions-right{justify-content:flex-start}
  .nav a::after{display:none}
}
/* =========================================================
   HISTORIAL (split high-tech)
   ========================================================= */

.card-soft{
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.inv-hdr{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  border: 1px solid rgba(0,90,134,.10);
  position:relative;
  overflow:hidden;
}
.inv-hdr::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(800px 240px at 10% -10%, rgba(93,208,214,.25), transparent 55%),
    radial-gradient(800px 240px at 90% -20%, rgba(0,90,134,.18), transparent 60%);
  pointer-events:none;
}
.inv-hdr-left{position:relative}
.inv-hdr-kicker{
  font-size:12px;
  font-weight:900;
  letter-spacing:.45px;
  text-transform:uppercase;
  color:#0b1f2a;
  opacity:.78;
}
.inv-hdr-title{
  font-size:18px;
  font-weight:1000;
  letter-spacing:.2px;
  margin-top:2px;
}
.inv-hdr-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:8px;
}
.inv-pill{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.72);
  font-size:12px;
  font-weight:800;
  color:#0b1f2a;
}
.inv-hdr-actions{
  position:relative;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.split2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 1100px){
  .split2{ grid-template-columns: 1fr; }
}

.panel-tech{
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 12px 30px rgba(17,24,39,.06);
}

.panel-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding-bottom:10px;
  border-bottom:1px solid var(--line);
  margin-bottom:10px;
}
.panel-title{ font-weight:1000; letter-spacing:.2px; }
.panel-sub{ font-size:12px; color:var(--muted); font-weight:700; margin-top:2px; }

.timeline{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.t-card{
  border:1px solid rgba(17,24,39,.10);
  border-radius:16px;
  background: rgba(255,255,255,.9);
  padding:12px;
  position:relative;
  overflow:hidden;
  transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}
.t-card:hover{
  transform: translateY(-1px);
  border-color: rgba(0,90,134,.22);
  box-shadow: 0 14px 34px rgba(17,24,39,.08);
}
.t-card::after{
  content:"";
  position:absolute;
  inset:auto -30% -50% -30%;
  height:160px;
  background: radial-gradient(closest-side, rgba(93,208,214,.18), transparent 70%);
  pointer-events:none;
}

.t-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.t-id{ font-weight:1000; color:#0b1f2a; }

.t-body{ margin-top:10px; display:grid; gap:8px; }
.t-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 10px;
  border:1px solid rgba(17,24,39,.06);
  border-radius:12px;
  background: #fbfcfd;
}
.t-label{ font-size:12px; color:var(--muted); font-weight:900; letter-spacing:.2px; text-transform:uppercase; }
.t-val{ font-size:13px; font-weight:900; color:#0b1f2a; text-align:right; }

.t-actions{
  margin-top:10px;
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.t-active{
  border-color: rgba(34,197,94,.35);
}
.rep-card.rep-active{
  border-color: rgba(245,158,11,.45);
}
