/* Analitica Alfresco — hoja de estilos unica */

:root {
  --azul: #2563eb;
  --azul-osc: #1d4ed8;
  --tinta: #0f172a;
  --tinta-2: #1e293b;
  --gris: #64748b;
  --gris-2: #94a3b8;
  --linea: #e2e8f0;
  --fondo: #f1f5f9;
  --blanco: #ffffff;
  --verde: #10b981;
  --ambar: #f59e0b;
  --rojo: #ef4444;
  --violeta: #8b5cf6;
  --sombra: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --radio: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em;
}

/* ── Estructura ───────────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.lateral {
  width: 252px;
  flex: 0 0 252px;
  background: linear-gradient(180deg, #0f172a 0%, #172033 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.marca {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.marca b { color: #fff; font-size: 15px; letter-spacing: -.01em; display: block; }
.marca span { font-size: 11.5px; color: #64748b; }

.menu { padding: 14px 10px; flex: 1; overflow-y: auto; }
.menu-tit {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #475569;
  padding: 14px 12px 6px;
  font-weight: 600;
}
.menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 2px;
  transition: background .13s, color .13s;
}
.menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.menu a.activo { background: var(--azul); color: #fff; font-weight: 500; }
.menu a svg { flex: 0 0 17px; opacity: .9; }

.pie-lateral {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12.5px;
  color: #94a3b8;
}
.pie-lateral .quien { color: #e2e8f0; font-weight: 500; }
.pie-lateral a { color: #94a3b8; font-size: 12.5px; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.barra {
  background: var(--blanco);
  border-bottom: 1px solid var(--linea);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.barra h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.barra .sub { font-size: 12.5px; color: var(--gris); margin-top: 2px; }

.lienzo { padding: 24px 28px 48px; }

/* ── Tarjetas ─────────────────────────────────────────────────────────────── */
.rejilla { display: grid; gap: 16px; }
.rejilla.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rejilla.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tarjeta {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.tarjeta-cab {
  padding: 15px 18px;
  border-bottom: 1px solid var(--linea);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tarjeta-cab h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.tarjeta-cab .nota { font-size: 12px; color: var(--gris); }
.tarjeta-cuerpo { padding: 18px; }

.kpi { padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.kpi-icono {
  width: 42px; height: 42px;
  flex: 0 0 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
}
.kpi-et { font-size: 12px; color: var(--gris); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kpi-val { font-size: 25px; font-weight: 650; letter-spacing: -.025em; margin-top: 3px; line-height: 1.15; }
.kpi-pie { font-size: 12.5px; color: var(--gris-2); margin-top: 3px; }

.bg-azul { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-verde { background: linear-gradient(135deg, #34d399, #10b981); }
.bg-ambar { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.bg-rojo { background: linear-gradient(135deg, #f87171, #ef4444); }
.bg-violeta { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }

/* ── Tablas ───────────────────────────────────────────────────────────────── */
.tabla-env { overflow-x: auto; }
table.datos { width: 100%; border-collapse: collapse; font-size: 14px; }
table.datos th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gris);
  font-weight: 600;
  padding: 10px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--linea);
  white-space: nowrap;
}
table.datos td {
  padding: 11px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
table.datos tbody tr:last-child td { border-bottom: 0; }
table.datos tbody tr:hover { background: #f8fafc; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recortar { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vacio { padding: 40px 18px; text-align: center; color: var(--gris); }
.vacio b { display: block; color: var(--tinta-2); margin-bottom: 4px; }

/* ── Elementos ────────────────────────────────────────────────────────────── */
.barra-prog { height: 6px; background: #eef2f7; border-radius: 99px; overflow: hidden; min-width: 90px; }
.barra-prog i { display: block; height: 100%; border-radius: 99px; background: var(--azul); }

.etiqueta {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: #eef2f7;
  color: var(--tinta-2);
}
.etiqueta.verde { background: #d1fae5; color: #065f46; }
.etiqueta.ambar { background: #fef3c7; color: #92400e; }
.etiqueta.roja { background: #fee2e2; color: #991b1b; }
.etiqueta.azul { background: #dbeafe; color: #1e40af; }
.etiqueta.gris { background: #f1f5f9; color: #475569; }

.punto { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }

.icono-arch {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  margin-right: 9px;
  vertical-align: -8px;
  text-transform: uppercase;
}

/* ── Formularios ──────────────────────────────────────────────────────────── */
label.campo { display: block; margin-bottom: 14px; }
label.campo span { display: block; font-size: 12.5px; font-weight: 600; color: var(--tinta-2); margin-bottom: 5px; }

input[type=text], input[type=password], input[type=search], select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  color: var(--tinta);
  background: #fff;
  transition: border-color .13s, box-shadow .13s;
}
input:focus, select:focus {
  outline: 0;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--azul);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .13s, border-color .13s;
}
.btn:hover { background: var(--azul-osc); text-decoration: none; color: #fff; }
.btn.sec { background: #fff; border-color: #cbd5e1; color: var(--tinta-2); }
.btn.sec:hover { background: #f8fafc; border-color: var(--gris-2); }
.btn.peligro { background: #fff; border-color: #fca5a5; color: #b91c1c; }
.btn.peligro:hover { background: #fef2f2; }
.btn.chico { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

.filtros {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  margin-bottom: 16px;
}
.filtros label.campo { margin: 0; min-width: 170px; }
.filtros .crecer { flex: 1; min-width: 220px; }

/* ── Avisos ───────────────────────────────────────────────────────────────── */
.aviso {
  padding: 12px 16px;
  border-radius: 11px;
  border: 1px solid var(--linea);
  background: #fff;
  margin-bottom: 16px;
  font-size: 13.5px;
}
.aviso-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.aviso-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.aviso-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ── Migas y paginacion ───────────────────────────────────────────────────── */
.migas {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--linea);
}
.migas .sep { color: var(--gris-2); }
.migas .actual { font-weight: 600; color: var(--tinta); }

.paginacion {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding: 13px 18px;
  border-top: 1px solid var(--linea);
  font-size: 13px;
  color: var(--gris);
  flex-wrap: wrap;
}
.paginacion a, .paginacion span.pag {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--linea);
  background: #fff;
  color: var(--tinta-2);
}
.paginacion a:hover { background: #f1f5f9; text-decoration: none; }
.paginacion span.pag { background: var(--azul); border-color: var(--azul); color: #fff; font-weight: 600; }
.paginacion .info { margin-right: auto; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.acceso {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #1d4ed8 160%);
  padding: 24px;
}
.acceso-caja {
  width: 100%;
  max-width: 390px;
  background: #fff;
  border-radius: 18px;
  padding: 34px 32px;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5);
}
.acceso-caja h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.acceso-caja p.lead { margin: 0 0 22px; color: var(--gris); font-size: 13.5px; }
.acceso-caja .btn { width: 100%; justify-content: center; padding: 11px; font-size: 14.5px; }
.acceso-pie { margin-top: 18px; text-align: center; font-size: 12px; color: var(--gris-2); }

/* ── Detalle duplicado ────────────────────────────────────────────────────── */
.hash-caja {
  background: #0f172a;
  color: #93c5fd;
  padding: 11px 14px;
  border-radius: 10px;
  word-break: break-all;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.lista-def { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 13.5px; }
.lista-def dt { color: var(--gris); font-weight: 500; }
.lista-def dd { margin: 0; font-weight: 500; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .rejilla.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rejilla.c3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .app { flex-direction: column; }
  .lateral { width: 100%; flex: none; height: auto; position: static; }
  .menu { display: flex; flex-wrap: wrap; gap: 4px; }
  .menu-tit { display: none; }
  .rejilla.c2, .rejilla.c4 { grid-template-columns: 1fr; }
  .lienzo, .barra { padding-left: 16px; padding-right: 16px; }
}
