:root {
  --ink: #1a2332;
  --muted: #5d6776;
  --line: #e3dbcf;
  --paper: #f4f1ea;
  --card: #fffcf8;
  --teal: #0e5c59;
  --teal-soft: #e6f3f2;
  --amber: #8a4b08;
  --amber-bg: #fbf3e4;
  --red: #8d2c45;
  --red-bg: #f8e9ed;
  --green: #1c6b45;
  --shadow: 0 10px 30px rgba(26, 35, 50, 0.05);
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --yellow: #e6ff4d;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 100% -10%, #e7f3f1 0%, transparent 55%),
    var(--paper);
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--teal); }

header.barra {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}

.marca {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  margin-right: 8px;
}

.marca strong { display: block; font-size: 15px; letter-spacing: 0.01em; }
.marca small { display: block; color: var(--muted); font-size: 12px; }

.marca-marca {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: white;
  font-family: var(--mono);
  font-size: 13px;
  border-radius: 8px;
}

header.barra nav { display: flex; gap: 6px; }

header.barra nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 500;
}

header.barra nav a.activo,
header.barra nav a:hover {
  background: var(--teal-soft);
  color: var(--teal);
}

.nav-cuenta {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

main {
  width: min(1120px, calc(100% - 36px));
  margin: 28px auto 64px;
}

h1 { font-size: 32px; line-height: 1.15; margin: 0 0 8px; font-weight: 600; }
.lead { margin: 0 0 22px; color: var(--muted); max-width: 68ch; }

.aviso {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid #efd7b0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi, .card, .grupo {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.kpi { padding: 14px 16px; }
.kpi span { display: block; color: var(--muted); font-size: 13px; }
.kpi strong { display: block; font-size: 28px; margin-top: 4px; letter-spacing: -0.03em; }
.kpi em { font-style: normal; color: var(--red); font-size: 12px; }

.layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 12px;
}

.card { padding: 16px 18px 18px; }
.card h2, .grupo h2 { margin: 0 0 12px; font-size: 16px; }

.grupo-lista { display: grid; gap: 10px; }

.grupo-fila { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; }
.grupo-fila b { font-family: var(--mono); font-size: 13px; }
.grupo-fila small { color: var(--muted); display: block; }

.barra-prog {
  height: 8px;
  background: #efeae2;
  border-radius: 99px;
  overflow: hidden;
}
.barra-prog span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.lista { margin: 0; padding-left: 18px; }
.lista li { margin: 6px 0; }

.voltajes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--mono);
}
.chip.fuera { background: var(--red-bg); color: var(--red); border-color: transparent; }

.fila-acciones, .filtros, .mapeo, .botones { display: flex; flex-wrap: wrap; gap: 8px; }

.filtros { margin-bottom: 12px; }

input[type="search"], input[type="text"], select, textarea {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

textarea { width: 100%; min-height: 72px; }

button, .btn {
  border: 0;
  background: var(--teal);
  color: white;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

button.secundario, .btn.secundario {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

button:disabled { opacity: 0.55; cursor: not-allowed; }

.tabla-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fbf8f3; position: sticky; top: 0; }
tr.fila { cursor: pointer; }
tr.fila:hover { background: #f7fbfa; }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }

.etiqueta {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: var(--teal-soft);
  color: var(--teal);
}
.etiqueta.inactivo { background: #eeeae4; color: var(--muted); }
.etiqueta.alerta { background: var(--red-bg); color: var(--red); }

.soltar {
  border: 1.5px dashed #b7c8c6;
  background: white;
  border-radius: 16px;
  padding: 36px 18px;
  text-align: center;
}
.soltar strong { display: block; margin-bottom: 6px; }
.soltar p { margin: 0; color: var(--muted); }

.mapeo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.campo { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.campo span { color: var(--muted); }
.campo select { width: 100%; }

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0;
  color: var(--ink);
}

.nota { color: var(--muted); font-size: 13px; }

.pasos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.paso {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.paso.ahora { background: var(--teal); color: white; border-color: var(--teal); }
.paso.listo { background: var(--teal-soft); color: var(--teal); }
.instruccion { border-color: #b7d5d2; }

dialog {
  width: min(560px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(26, 35, 50, 0.35); }
.ficha { padding: 18px; }
.ficha h2 { margin: 0 0 4px; font-family: var(--mono); font-size: 18px; }
.ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.cerrar {
  float: right;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 20px;
  padding: 0 4px;
}

body.mesa {
  background: #d8d8d8;
  color: #1a1a1a;
  height: 100vh;
  overflow: hidden;
}
body.mesa:not(.lista) { visibility: hidden; }

.escritorio {
  height: 100vh;
  min-height: 0;
  padding: 14px;
  display: flex;
  overflow: hidden;
}

.ventana {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f4f2ee;
  border-radius: 28px;
  border: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

body.mesa #nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px 6px;
  background: transparent;
  border-bottom: 0;
}

.ns-brand { position: relative; display: flex; align-items: center; gap: 10px; min-width: 180px; }
body.mesa button.ns-perfil {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 1px 0 0;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.ns-perfil-menu {
  position: absolute;
  top: 42px;
  left: 0;
  z-index: 30;
  min-width: 210px;
  padding: 12px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.ns-perfil-menu strong, .ns-perfil-menu span { display: block; }
.ns-perfil-menu strong { font-size: 14px; }
.ns-perfil-menu span { margin-top: 2px; color: #8a877f; font-size: 12px; }
.ns-perfil-menu #ns-salir {
  width: 100%;
  margin-top: 12px;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e7e3db;
}
.ns-consulta-nota {
  margin: 0;
  color: #6d6a64;
  font-size: 13px;
}
.ns-barra.bloqueado, .ns-btn.bloqueado {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}
.fantasma {
  position: fixed;
  z-index: 80;
  width: 42px;
  margin-left: -21px;
  pointer-events: none;
  animation: fantasma-sale 1.5s ease forwards;
}
.fantasma svg { display: block; width: 42px; height: 48px; }
@keyframes fantasma-sale {
  0% { opacity: 0; transform: translateY(6px) scale(0.85); }
  18% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-56px) scale(1); }
}
.ns-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.ns-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8a8a8a;
  font-size: 13px;
}
.ns-crumb a { color: #5c5c5c; text-decoration: none; }
.ns-crumb a:hover { color: #1c1c1c; }
.ns-sep { color: #b5b5b5; }
.ns-pill {
  background: #1a1a1a;
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.ns-meta { margin-left: auto; text-align: right; }
.ns-meta strong, .ns-meta span { display: block; }
.ns-meta strong { font-size: 13px; font-weight: 700; letter-spacing: -0.02em; }
.ns-meta span { color: #8a877f; font-size: 12px; }

body.mesa #main {
  width: auto;
  margin: 0;
  flex: 1;
  min-height: 0;
  display: flex;
}

.ns-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  min-height: 0;
}
.ns-grid.dos { grid-template-columns: 320px minmax(0, 1fr); }
.ns-grid.familia { grid-template-columns: 220px minmax(0, 1fr); }
.ns-grid.analisis { grid-template-columns: 240px minmax(0, 1fr) 460px; }

.ns-col {
  padding: 12px 16px 22px;
  overflow: auto;
  background: transparent;
  border-right: 0;
}
.ns-col:last-child { border-right: 0; background: transparent; }
.ns-col.centro { background: transparent; }

.ns-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #1a1a1a;
}
.ns-col h2 {
  margin: 2px 0 14px;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.ns-cifra {
  margin: 0 0 4px;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 600;
}
.ns-cifra small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 500;
  color: #6d6d6d;
}

.ns-nuevo { display: flex; gap: 8px; margin-bottom: 14px; }
.ns-nuevo input { flex: 1; min-width: 0; }

body.mesa input[type="text"],
body.mesa input[type="number"],
body.mesa input[type="search"],
body.mesa select {
  background: #fff;
  border: 1px solid #e7e3db;
  border-radius: 999px;
  padding: 8px 14px;
}

body.mesa button {
  background: #1a1a1a;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 600;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}
body.mesa button.accion { background: #1a1a1a; }
body.mesa button.secundario {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e7e3db;
}
body.mesa button.ns-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 10px 10px;
  font-weight: 500;
  margin-bottom: 4px;
}
body.mesa button.ns-item b {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
}
body.mesa button.ns-item small { display: block; color: #6d6d6d; font-weight: 400; }
body.mesa button.ns-item.activo {
  background: #fff;
  border-left-color: #ef5b25;
}

.ns-pasos { display: grid; gap: 6px; margin: 16px 0; }
.ns-paso {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #f7f7f7;
  border: 1px solid #e4e4e4;
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.ns-paso span { color: #6d6d6d; font-variant-numeric: tabular-nums; }
.ns-paso.ahora { background: #fff; border-left-color: #ef5b25; }
.ns-paso.listo { color: #3d3d3d; }

.ns-acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 14px 0; }
.ns-acciones.pila { flex-direction: column; align-items: stretch; }
.ns-acciones.pila .ns-btn,
.ns-acciones.pila button { width: 100%; justify-content: center; }

.ns-fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #e6e6e6;
  text-decoration: none;
  color: inherit;
}
.ns-fila b { font-family: var(--mono); margin-right: 6px; }
.ns-fila em { font-style: normal; font-variant-numeric: tabular-nums; color: #6d6d6d; font-size: 13px; }
.ns-fila:hover { background: #fff; }
.ns-codigos {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 10px 12px;
}

.ns-caja {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.ns-caja strong { display: block; margin-top: 4px; }
.ns-caja ul { margin: 8px 0 0; padding-left: 18px; }
.ns-subir {
  background: #fff;
  border: 1px dashed #c8c8c8;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
}
.ns-subir.sobre { border-color: #ef5b25; background: #fff7f3; }
.ns-subir p { margin: 8px 0 0; color: #6d6d6d; font-size: 13px; overflow-wrap: anywhere; }
.ns-subir input[type="file"] { max-width: 100%; }
.ns-caja strong { overflow-wrap: anywhere; }
.ns-flag {
  background: #fff1ea;
  border: 1px solid #f0c2ae;
  color: #9a3412;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.ns-ok {
  background: #f4f4f4;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.ns-historial { list-style: none; margin: 0; padding: 0; }
.ns-historial li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #ececec;
  font-size: 13px;
}
.ns-historial time { color: #6d6d6d; font-family: var(--mono); font-size: 11px; }
.ns-texto { margin: 0 0 12px; max-width: 62ch; }

body.mesa button.ns-medida {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: #f7f7f7;
  color: inherit;
  border: 1px solid #e4e4e4;
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  font-weight: 500;
}
body.mesa button.ns-medida.activo { background: #fff; border-left-color: #ef5b25; }
body.mesa button.ns-medida b { display: block; font-size: 14px; }
body.mesa button.ns-medida small { display: block; color: #6d6d6d; font-weight: 400; }
.ns-pct { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ns-estado {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6d6d6d;
}

body.mesa a.ns-item {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 10px;
  margin-bottom: 4px;
}
body.mesa a.ns-item b { display: block; font-family: var(--mono); font-size: 13px; }
body.mesa a.ns-item small { display: block; color: #6d6d6d; font-weight: 400; }
body.mesa a.ns-item:hover { background: #fff; }

body.mesa a.ns-medida {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: #f7f7f7;
  border: 1px solid #e4e4e4;
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}
body.mesa a.ns-medida b { display: block; font-size: 14px; }
body.mesa a.ns-medida small { display: block; color: #6d6d6d; }
body.mesa a.ns-medida:hover { background: #fff; border-left-color: #ef5b25; }

.ns-hero { display: flex; gap: 22px; align-items: center; margin: 8px 0 16px; }
.ns-anillo {
  width: 168px;
  height: 168px;
  flex: 0 0 168px;
  border-radius: 50%;
  background: conic-gradient(#ef5b25 calc(var(--p) * 1%), #e6e6e6 0);
  display: grid;
  place-items: center;
}
.ns-anillo div {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: #efefef;
  display: grid;
  place-items: center;
  text-align: center;
}
.ns-col.centro .ns-anillo div { background: #efefef; }
.ns-anillo.lg { width: 240px; height: 240px; flex: 0 0 240px; margin: 0; }
.ns-anillo.lg div {
  width: 168px;
  height: 168px;
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ns-anillo.lg strong { font-size: 44px; line-height: 1; }
.ns-anillo strong { font-size: 28px; letter-spacing: -0.04em; line-height: 1; }
.ns-cifra.chica { font-size: 28px; margin-top: 4px; }

.ns-tablero {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px 20px;
  background: transparent;
}
.ns-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ns-kpi {
  background: #fff;
  border: 0;
  border-radius: 20px;
  padding: 14px 16px;
}
.ns-kpi span {
  display: block;
  color: #8a877f;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
}
.ns-kpi strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -0.04em; line-height: 1; }
.ns-kpi em { display: block; margin-top: 6px; font-style: normal; color: #6d6d6d; font-size: 12px; }
.ns-tablero-main {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.ns-card {
  background: #fff;
  border: 0;
  border-radius: 24px;
  padding: 16px 18px 12px;
}
.ns-card h2 { margin: 2px 0 10px; font-size: 22px; letter-spacing: -0.03em; }
.ns-dona { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ns-hero-pct {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--yellow);
  border-radius: 24px;
  padding: 18px 18px 16px;
  min-height: 180px;
}
.ns-hero-pct span { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.ns-hero-pct strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 64px;
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 600;
}
.ns-hero-pct p { margin: 0; max-width: 28ch; color: #2a2a2a; font-size: 13px; line-height: 1.4; }
.ns-avance {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
.ns-avance .ns-hero-pct { min-height: 0; justify-content: center; }
.ns-leyenda-caja {
  background: #fff;
  border-radius: 24px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
}
.ns-dona-cuerpo {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 0 20px;
}
.ns-dona-nota {
  margin: 18px 0 0;
  color: #8a8a8a;
  font-size: 13px;
  line-height: 1.45;
}
.ns-dona > .ns-btn { align-self: stretch; justify-content: center; margin-top: 8px; }
.ns-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}
body.mesa.fit .ns-tablero { overflow: hidden; gap: 10px; padding: 12px 14px; }
body.mesa.fit .ns-tablero-main { flex: 1; min-height: 0; }
body.mesa.fit .ns-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
body.mesa.fit .ns-barras { flex: 1; min-height: 0; }
body.mesa.fit .ns-barra { flex: 1 1 0; min-height: 0; padding: 0 4px; }
.ns-card-head h2 { margin-bottom: 0; }
.ns-card-tools { display: flex; align-items: center; gap: 10px; }
.ns-sort {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  background: #efece6;
  border-radius: 999px;
  padding: 3px;
}
body.mesa .ns-sort button {
  background: transparent;
  color: #6d6a64;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}
body.mesa .ns-sort button.activo { background: #1a1a1a; color: #fff; }
body.mesa .ns-sort button:hover { color: #1c1c1c; }
.ns-barras { display: flex; flex-direction: column; }
.ns-barra {
  display: grid;
  grid-template-columns: 28px 220px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
  padding: 6px 2px;
  border-bottom: 1px solid #f0eee9;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
}
.ns-barra:last-child { border-bottom: 0; }
.ns-barra b { font-family: var(--mono); font-size: 12px; }
.ns-barra span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-barra i {
  display: block;
  height: 8px;
  background: #efece6;
  border-radius: 99px;
  overflow: hidden;
}
.ns-barra em { display: block; height: 100%; border-radius: 99px; background: var(--yellow); }
.ns-barra.medio em { background: #1a1a1a; }
.ns-barra strong { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.ns-barra.vacio, .ns-barra.vacio strong { color: #8a8a8a; font-weight: 500; }
.ns-barra:hover { background: #fff; }
.ns-anillo span { display: block; color: #6d6d6d; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

.ns-losas { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.ns-losa {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 10px 12px;
}
.ns-losa span, .ns-losa em { display: block; color: #6d6d6d; font-size: 12px; font-style: normal; }
.ns-losa strong { display: block; font-size: 26px; letter-spacing: -0.04em; line-height: 1.1; margin: 4px 0; }

.ns-pila { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #ececec; margin-top: 8px; }
.ns-pila span { display: block; height: 100%; }
.ns-pila .c, .ns-leyenda .c::before { background: #1c1c1c; }
.ns-pila .f, .ns-leyenda .f::before { background: #ef5b25; }
.ns-pila .a, .ns-leyenda .a::before { background: #8d8d8d; }
.ns-pila .i, .ns-leyenda .i::before { background: #d5d5d5; }
.ns-leyenda { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 12px; color: #6d6d6d; font-size: 12px; }
.ns-leyenda span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
}
.ns-grupo {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 64px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e4e4e4;
  background: transparent;
}
.ns-grupo-nom b { font-family: var(--mono); margin-right: 8px; }
.ns-grupo-nom span { color: #3d3d3d; }
.ns-counts { display: flex; gap: 14px; margin-top: 6px; color: #6d6d6d; font-size: 12px; font-variant-numeric: tabular-nums; }
.ns-counts i { font-style: normal; }
.ns-guia { margin: 8px 0 12px; padding-left: 18px; }
.ns-guia li { margin: 6px 0; }
body.mesa a.ns-btn, body.mesa button.ns-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  border-radius: 14px;
  border: 0;
  padding: 10px 14px;
  font-weight: 600;
  background: transparent;
  color: #5e5b55;
  box-shadow: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
body.mesa a.ns-btn:hover, body.mesa button.ns-btn:hover { background: #fff; color: #1a1a1a; }
body.mesa a.ns-btn:active, body.mesa button.ns-btn:active { transform: scale(0.98); }
body.mesa a.ns-btn.accion {
  background: #1a1a1a;
  color: #fff;
  justify-content: center;
  border-radius: 999px;
}
body.mesa a.ns-btn.accion:hover { background: #000; color: #fff; }
body.mesa a.ns-btn.secundario { background: transparent; color: #5e5b55; }
body.mesa a.ns-btn.aqui,
body.mesa a.ns-btn.aqui:hover,
body.mesa a.ns-btn.aqui:active {
  background: #1a1a1a;
  color: #fff;
  transform: none;
  box-shadow: none;
}
.ns-acciones.pila .ns-btn { width: 100%; }
.ns-col.centro .ns-caja { max-width: 720px; }

.ns-kpi-row { display: flex; align-items: center; gap: 28px; margin: 8px 0 12px; }
.ns-col.centro:has(.ns-familia) { display: flex; flex-direction: column; }
.ns-familia { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.ns-familia h2 { margin-bottom: 10px; }
.ns-kpis-top { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ns-kpi-tile {
  border: 0;
  border-radius: 20px;
  background: #fff;
  padding: 14px 16px;
}
.ns-kpi-tile span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #8a877f;
}
.ns-kpi-tile strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 28px;
  letter-spacing: -0.04em;
  line-height: 1;
}
.ns-kpi-tile em { font-style: normal; color: #8a8a8a; font-size: 12px; }
.ns-panel {
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  background: #f7f7f7;
  padding: 12px 14px;
}
.ns-panel .ns-kpi-row { margin: 4px 0 0; }
.ns-panel .nota { margin: 8px 0 0; }
.ns-detalles { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ns-detalles > .ns-kicker { margin-bottom: 8px; }
.ns-tarjetas {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
body.mesa button.ns-tarjeta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 14px;
  background: #f7f6f3;
  color: inherit;
  border: 2px solid transparent;
  border-radius: 20px;
  font-weight: 500;
  text-align: left;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
body.mesa button.ns-tarjeta:hover {
  background: #fff;
  transform: none;
}
body.mesa button.ns-tarjeta.sel,
body.mesa button.ns-tarjeta.sel:hover {
  background: #fff;
  border-color: #1a1a1a;
  transform: none;
  box-shadow: none;
}
.ns-tarjeta header { display: flex; flex-direction: column; gap: 2px; }
.ns-tarjeta header b { font-family: var(--mono); font-size: 12px; }
.ns-tarjeta header span { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; }
.ns-tarjeta dl { margin: 10px 0 0; }
.ns-tarjeta dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #ececec;
  font-size: 13px;
}
.ns-tarjeta dt { color: #6d6d6d; }
.ns-tarjeta dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.ns-tarjeta footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  margin-top: auto;
  padding-top: 10px;
}
.ns-tarjeta footer span { color: #6d6d6d; font-size: 12px; }
.ns-tarjeta footer strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.ns-tarjeta footer i {
  grid-column: 1 / -1;
  display: block;
  height: 8px;
  margin-top: 6px;
  background: #efece6;
  border-radius: 99px;
  overflow: hidden;
}
.ns-tarjeta footer em { display: block; height: 100%; background: var(--yellow); border-radius: 99px; }
.ns-kicker.marca { letter-spacing: -0.02em; font-weight: 600; color: #8a877f; }
.ns-corte {
  flex: 0 0 300px;
  width: 300px;
  margin-left: auto;
  align-self: center;
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  background: #f3f3f3;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.ns-corte h3 { margin: 2px 0 10px; font-size: 18px; letter-spacing: -0.03em; font-weight: 600; }
.ns-corte-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ns-corte-grid div {
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  background: #fff;
  padding: 7px 8px;
}
.ns-corte-grid div:last-child { grid-column: 1 / -1; }
.ns-corte-grid strong { display: block; font-size: 18px; letter-spacing: -0.03em; line-height: 1; }
.ns-corte-grid span { display: block; margin-top: 4px; color: #6d6d6d; font-size: 11px; }
body.mesa button.ns-barra {
  width: 100%;
  background: transparent;
  color: inherit;
  border: 0;
  border-bottom: 1px solid #e6e6e6;
  border-radius: 0;
  font-weight: 500;
  text-align: left;
}
body.mesa button.ns-barra.sel {
  background: #fff;
  box-shadow: inset 3px 0 0 #1a1a1a;
  border-radius: 12px;
}
.ns-kpi-dona { display: flex; flex-direction: column; align-items: center; }
.ns-kpi-dona .ns-dona-nota { margin: 10px 0 0; }
.ns-leyenda-kpi { display: flex; flex-direction: column; gap: 14px; min-width: 240px; }
.ns-leyenda-kpi div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: baseline;
}
.ns-leyenda-kpi i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  grid-row: 1 / span 2;
  align-self: center;
}
.ns-leyenda-kpi i.c { background: #d6ee3a; }
.ns-leyenda-kpi i.f { background: #1c1c1c; }
.ns-leyenda-kpi i.a { background: #6d6d6d; }
.ns-leyenda-kpi strong { font-variant-numeric: tabular-nums; font-size: 18px; }
.ns-leyenda-kpi em { grid-column: 2 / span 2; font-style: normal; color: #8a8a8a; font-size: 12px; }
.ns-fichas {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.ns-ficha-g {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ns-ficha-g header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.ns-ficha-g header b { font-family: var(--mono); font-size: 13px; }
.ns-ficha-g header span { color: #3d3d3d; font-size: 14px; }
.ns-metrica { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: 13px; color: #6d6d6d; }
.ns-metrica strong { color: #1c1c1c; font-variant-numeric: tabular-nums; }
.ns-ficha-pie { margin-top: 10px; }
.ns-ficha-pie .ns-pct { display: block; text-align: right; margin-bottom: 4px; }
.ns-ficha-pie i {
  display: block;
  height: 6px;
  background: #e4e4e4;
  border-radius: 99px;
  overflow: hidden;
}
.ns-ficha-pie em { display: block; height: 100%; background: #1c1c1c; border-radius: 99px; }
.ns-volver { display: inline-block; margin: 0 0 12px; color: #1c1c1c; font-weight: 600; }
.ns-desplegable { border-bottom: 1px solid #e6e6e6; }
.ns-desplegable:last-child { border-bottom: 0; }
.ns-desplegable summary.ns-barra {
  cursor: pointer;
  list-style: none;
  border-bottom: 0;
  padding: 8px 2px;
}
.ns-desplegable summary.ns-barra::-webkit-details-marker { display: none; }
.ns-desplegable summary.ns-barra::marker { content: ""; }
.ns-desplegable[open] summary.ns-barra {
  background: #fff1ea;
  box-shadow: inset 3px 0 0 #ef5b25;
}
.ns-desplegable-cuerpo { padding: 0 8px 6px 36px; }
.ns-desplegable-cuerpo .ns-metrica {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  margin: 0;
  padding: 7px 0;
  border-top: 1px solid #ececec;
  font-size: 13px;
  color: #6d6d6d;
}
.ns-desplegable-cuerpo .ns-metrica strong {
  color: #1c1c1c;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

body.mesa.ancho .ns-grid { grid-template-columns: 260px minmax(0, 1fr); }
body.mesa.ancho .ns-tabla { min-width: 0; }

@media (max-width: 980px) {
  .ns-kpis { grid-template-columns: 1fr 1fr; }
  .ns-tablero-main { grid-template-columns: 1fr; }
  .ns-hero { flex-direction: column; align-items: flex-start; }
  .escritorio { padding: 0; }
  .ventana { min-height: 100vh; border-radius: 0; }
  .ns-grid, .ns-grid.familia, .ns-grid.analisis { grid-template-columns: 1fr; }
  .ns-fichas { grid-template-columns: 1fr 1fr; }
  .ns-kpi-row, .ns-avance { flex-direction: column; align-items: flex-start; }
  .ns-avance { grid-template-columns: 1fr; }
  .ns-kpis-top, .ns-tarjetas { grid-template-columns: 1fr 1fr; }
  .ns-corte { width: 100%; flex-basis: auto; margin-left: 0; }
  .ns-col { border-right: 0; border-bottom: 1px solid #e3e3e3; }
  body.mesa #nav { flex-wrap: wrap; }
  .ns-meta { margin-left: 0; text-align: left; }
}

@media (max-width: 860px) {
  header.barra { flex-wrap: wrap; padding: 12px 14px; }
  .nav-cuenta { margin-left: 0; }
  .kpis, .layout, .mapeo, .ficha-grid { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
  main { width: min(1120px, calc(100% - 20px)); }
}
