/* Crewator OS — la ventana.
   Diseno: la propuesta de plataforma (compacta, densa, barra superior),
   en su paleta clara. Los tokens de marca vienen del vault (org/tokens.css).
   Escala del diseno: eyebrow 11, cuerpo 12.5-13, cifra 22, titulo 30. */

:root {
  --bg: #ffffff;
  --surf: #f7f8fb;
  --surf-2: #f0f2f6;
  --surf-3: #e2e6ee;
  --line: #eceef2;
  --line-2: #e7eaf0;
  --tx: #2c3038;
  --tx-2: #454a55;
  --mut: #6b7180;
  --faint: #9aa1ad;
  --faint-2: #b3b9c4;
  --acc: var(--crw-blue);
  --acc-hi: #0046d1;
  --acc-tint: #eaf1ff;
  --ok: #1a7f37;
  --bad: #c0303c;
  --warn: #9a6700;
  --warn-tint: #fff8e6;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font-family: var(--crw-font-ui); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }

/* ── Barra superior ───────────────────────────────────────────── */
.top {
  display: flex; align-items: center; gap: 8px; height: 56px;
  padding: 0 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--bg); z-index: 20;
}
.top .brand { display: flex; align-items: center; margin-right: 18px; }
.top .brand img { height: 19px; width: auto; }
.top nav { display: flex; align-items: center; gap: 2px; }
.top nav a {
  padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--mut);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .16s ease, color .16s ease;
}
.top nav a:hover { color: var(--tx); background: var(--surf); }
.top nav a.on { background: var(--acc-tint); color: var(--acc); }
.top nav a .n {
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
  background: var(--surf-3); color: var(--mut);
}
.top nav a.on .n { background: var(--acc); color: #fff; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top .search {
  display: flex; align-items: center; gap: 8px; width: 250px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--faint); font-size: 12.5px;
}
.top .search svg { width: 14px; height: 14px; flex: none; }
.top .who {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surf-3); color: var(--tx-2);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
}
a.who:hover { background: var(--acc); color: #fff; }
/* Sin puerta configurada. Que se vea, para no confundir "no me pide
   contrasena" con "esto es seguro". */
.top .who.abierta { background: var(--warn-tint); color: var(--warn); border: 1px solid #f3e5bd; }

/* ── Pagina ───────────────────────────────────────────────────── */
main { max-width: 1320px; margin: 0 auto; padding: 26px 22px 80px; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 7px;
}
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.lede { margin-top: 7px; color: var(--mut); font-size: 13px; max-width: 76ch; }
.head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.head > div:first-child { flex: 1; min-width: 0; }

/* ── KPIs: fondo plano, sin iconos ────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 15px; margin-bottom: 30px; }
.kpi { background: var(--surf); border: 1px solid var(--line); border-radius: 10px; padding: 17px 19px; }
.kpi b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.kpi span { display: block; margin-top: 5px; font-size: 12px; color: var(--mut); }
.kpi.acc b { color: var(--acc); }
.kpi.acc { border-color: rgba(0, 87, 253, .3); }
.kpi.warn b { color: var(--warn); }
.kpi.warn { background: var(--warn-tint); border-color: #f3e5bd; }

/* ── Rejilla principal: contenido + raíl ──────────────────────── */
.two { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 34px; align-items: start; }
.sec { margin-bottom: 30px; }
.sec > header {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 11px;
}
.sec > header h2 {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
  flex: 1;
}
.sec > header a { font-size: 12.5px; font-weight: 700; color: var(--acc); }
.sec > header a:hover { color: var(--acc-hi); }

/* ── Tabla ────────────────────────────────────────────────────── */
.tbl { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--faint); padding: 11px 16px;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
td { padding: 13px 16px; border-bottom: 1px solid var(--surf-2); font-size: 12.5px; color: var(--mut); }
tr:last-child td { border-bottom: none; }
td.k { font-weight: 700; color: var(--acc); font-size: 13px; }
td.k a { color: inherit; }
td.k a:hover { color: var(--acc-hi); }
td.num { color: var(--tx); font-weight: 700; }
.mono { font-family: var(--crw-font-mono); font-size: 11.5px; }

/* ── Tarjetas del raíl ────────────────────────────────────────── */
.rail-card {
  background: var(--surf); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 9px; display: block;
}
.rail-card:hover { border-color: var(--line-2); }
.rail-card .t { font-size: 13px; font-weight: 700; color: var(--tx); line-height: 1.35; }
.rail-card .m { margin-top: 7px; font-size: 11.5px; color: var(--faint); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rail-card .m .k { color: var(--acc); font-weight: 700; }
.rail-card .m .ok { color: var(--ok); font-weight: 700; }
.rail-card .m .bad { color: var(--bad); font-weight: 700; }
.rail-card.rev { background: var(--warn-tint); border-color: #f3e5bd; }
.rail-card form { display: inline; }
.rail-card .acts { margin-top: 11px; display: flex; gap: 7px; }

/* ── Tarjetas de contenido ────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 13px; }
.item {
  display: block; background: var(--surf); border: 1px solid var(--line); border-radius: 10px;
  padding: 15px 17px; transition: border-color .16s ease;
}
.item:hover { border-color: rgba(0, 87, 253, .35); }
.item h3 { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; color: var(--tx); }
.item .m { margin-top: 9px; display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Etiquetas ────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 5px; background: var(--surf-3); color: var(--mut);
  letter-spacing: .02em;
}
.tag.acc { background: var(--acc-tint); color: var(--acc); }
.tag.ok { background: #e8f5ec; color: var(--ok); }
.tag.warn { background: #fdf0d8; color: var(--warn); }
.tag.bad { background: #fdeef0; color: var(--bad); }
.tag.lav { background: var(--crw-lavender-tint); color: var(--crw-purple); }
.tag.out { background: transparent; border: 1px solid var(--line-2); color: var(--faint); }
.tag.mono { font-family: var(--crw-font-mono); letter-spacing: 0; text-transform: none; }

/* Barra de proporcion. Sin numeros dentro: el numero ya esta en su columna,
   la barra solo sirve para ver de un vistazo quien se lleva el trimestre. */
.barra { background: var(--surf-2); border-radius: 999px; height: 7px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--acc); border-radius: 999px; }

/* ── Controles ────────────────────────────────────────────────── */
button {
  font-family: inherit; font-size: 12px; font-weight: 700; border-radius: 7px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--tx-2);
  padding: 6px 12px; cursor: pointer; transition: all .16s ease;
}
button:hover { border-color: var(--faint-2); color: var(--tx); }
button.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
button.primary:hover { background: var(--acc-hi); border-color: var(--acc-hi); }
button.ghost { color: var(--bad); }
/* Un boton apagado tiene que PARECER apagado. Sin esto, `disabled` se veia
   igual que un boton secundario y nadie sabia cual estaba muerto. */
button:disabled, button:disabled:hover {
  background: var(--surf-2); border-color: var(--line); color: var(--faint);
  cursor: not-allowed; opacity: .55;
}
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
input[type=text], textarea, select {
  font-family: inherit; font-size: 12.5px; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 9px 12px; width: 100%; background: var(--bg); color: var(--tx);
}
.row { display: flex; gap: 9px; margin-top: 9px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.form { background: var(--surf); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }

/* ── Pestañas ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 5px; margin-bottom: 16px; }
.tabs a {
  padding: 6px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 700; color: var(--mut);
  background: var(--surf);
}
.tabs a:hover { color: var(--tx); }
.tabs a.on { background: var(--acc-tint); color: var(--acc); }

/* ── Markdown ─────────────────────────────────────────────────── */
.md { max-width: 74ch; color: var(--tx-2); font-size: 13.5px; line-height: 1.65; }
.md h1 { font-size: 21px; font-weight: 800; letter-spacing: -.015em; margin: 26px 0 10px; color: var(--tx); }
.md h2 { font-size: 16px; font-weight: 800; margin: 26px 0 8px; color: var(--tx); }
.md h3 { font-size: 13.5px; font-weight: 800; margin: 20px 0 6px; color: var(--tx); }
.md p { margin: 0 0 12px; }
.md code { background: var(--surf-2); padding: 1.5px 6px; border-radius: 5px; font-family: var(--crw-font-mono); font-size: 11.5px; color: var(--tx); }
.md pre { background: var(--surf); padding: 15px 17px; border-radius: 9px; overflow-x: auto; border: 1px solid var(--line); }
.md pre code { background: none; padding: 0; }
.md table { font-size: 12.5px; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.md th { background: var(--surf); }
.md th, .md td { padding: 9px 13px; }
.md blockquote { border-left: 2px solid var(--acc); margin-left: 0; padding-left: 14px; color: var(--mut); }
.md a { color: var(--acc); font-weight: 700; }
.md ul, .md ol { padding-left: 19px; }
.md li { margin: 3px 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* ── La puerta ─────────────────────────────────────────────────
   Pantalla suelta sobre el ink de marca (--crw-ink). Columna estrecha
   y centrada, al modo del login de GitHub: aqui solo hay una decision. */
body.solo {
  background: var(--crw-ink); min-height: 100vh;
  display: grid; place-items: center; padding: 32px 20px;
}
.entrada { width: 100%; max-width: 344px; text-align: center; color: #fff; }
.entrada > img { height: 46px; width: auto; margin-bottom: 22px; }
.entrada h1 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.entrada p { margin: 14px 0 0; font-size: 13px; line-height: 1.6; color: #aebbd6; }
.entrada p b { color: #fff; font-weight: 700; }
.entrada code {
  font-family: var(--crw-font-mono); font-size: 11.5px; color: #fff;
  background: rgba(255, 255, 255, .12); padding: 1.5px 6px; border-radius: 5px;
}
.entrada .caja {
  margin-top: 26px; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px; padding: 22px 20px;
}
.entrada .caja p:first-child { margin-top: 0; }
.entrada .gh {
  display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  background: #fff; color: var(--crw-ink); border: none; border-radius: 9px;
  padding: 12px 16px; font-family: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.entrada .gh:hover { background: #eaf1ff; }
.entrada .gh svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.entrada .pie { margin-top: 20px; font-size: 11.5px; color: #7b89a8; }
.entrada .pie a { color: #aebbd6; text-decoration: underline; }
/* Puerta cerrada: mismo lienzo, aviso en rojo de marca */
.entrada .caja.no { border-color: rgba(229, 86, 75, .5); background: rgba(229, 86, 75, .1); }
.entrada .caja.no + .pie { margin-top: 16px; }

/* ── Grafico de horas: columna apilada ───────────────────────
   Una columna por dia, apilada por cliente. Los dias sin trabajo se
   pintan igual (columna a cero): un hueco es informacion. */
.gr {
  position: relative; height: 260px; margin-bottom: 8px;
  padding: 0 0 22px 34px; border-bottom: 1px solid var(--line);
}
.gr .eje { position: absolute; inset: 0 0 22px 34px; }
.gr .linea {
  position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-2);
}
.gr .linea span {
  position: absolute; left: -34px; top: -8px; width: 28px; text-align: right;
  font-size: 10px; font-weight: 600; color: var(--faint-2);
  font-family: var(--crw-font-mono);
}
.gr .cols {
  position: relative; height: 100%; display: flex; align-items: flex-end; gap: 1px;
}
.gr .col {
  flex: 1 1 0; min-width: 0; height: 100%; position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
}
/* El fin de semana con fondo apenas visible: se ve el ritmo sin gritar. */
.gr .col.finde::before {
  content: ""; position: absolute; inset: 0 0 0 0; background: var(--surf); border-radius: 2px;
}
.gr .col:hover::before { content: ""; position: absolute; inset: 0; background: var(--acc-tint); border-radius: 2px; }
.gr .pila {
  position: relative; z-index: 1; display: flex; flex-direction: column-reverse;
  border-radius: 2px 2px 0 0; overflow: hidden;
}
.gr .pila i { display: block; width: 100%; }
.gr .col .pie {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 600; color: var(--faint-2); white-space: nowrap;
  font-family: var(--crw-font-mono);
}

/* Leyenda, que ademas filtra */
.leyenda { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.leyenda .chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 20px; background: var(--surf); border: 1px solid var(--line);
  color: var(--tx-2);
}
.leyenda .chip:hover { border-color: var(--faint-2); }
.leyenda .chip i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.leyenda .chip.off { opacity: .4; }
/* El filtro suma, asi que hay que ver de un vistazo cuales estan puestas */
.leyenda .chip.on { color: var(--tx); border-color: var(--tx-2); background: var(--bg); }
.leyenda .chip.quitar { color: var(--acc); border-style: dashed; }
.leyenda .pista { font-size: 11.5px; color: var(--mut); align-self: center; margin-left: 4px; }

/* Tablero agrupado */
.grupo { margin-bottom: 18px; }
.grupo:last-child { margin-bottom: 0; }
.grupo h3 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mut);
}
.grupo h3 .tag { letter-spacing: 0; text-transform: none; }
/* Selector de agrupacion, en la cabecera de la seccion */
.pills { display: flex; gap: 2px; margin-right: auto; margin-left: 14px; }
.pills .pill {
  font-size: 11.5px; font-weight: 700; color: var(--mut);
  padding: 3px 9px; border-radius: 7px; white-space: nowrap;
}
.pills .pill:hover { background: var(--surf); color: var(--tx); }
.pills .pill.on { background: var(--acc-tint); color: var(--acc); }
.sec > header { gap: 0; }

/* Conectar: bloques de comando para copiar */
.cmd {
  position: relative; background: #1c2028; color: #e8eaef;
  border-radius: 10px; padding: 16px 108px 16px 18px; margin-bottom: 10px;
  font-family: var(--crw-font-mono); font-size: 12px; line-height: 1.65;
  overflow-x: auto; white-space: pre; scrollbar-width: thin;
}
/* Azul de terminal, no de marca: el #0057FD no se lee sobre fondo oscuro. */
.cmd em { color: #8fb6ff; font-style: normal; }
.cmd i { color: #8a919e; font-style: normal; }
.cmd button {
  position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.16); color: #d8dce4; font-size: 11px;
}
.cmd button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.cmd button.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.paso { display: flex; gap: 13px; margin-bottom: 15px; align-items: flex-start; }
.paso .n2 {
  flex: none; width: 21px; height: 21px; border-radius: 50%; background: var(--acc-tint);
  color: var(--acc); font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.paso p { margin: 0; font-size: 12.5px; color: var(--tx-2); }
.paso p b { color: var(--tx); }
/* Fuera de .md no hay estilo de codigo, y el mono del navegador desentona. */
.paso code, .nota code, .lede code {
  background: var(--surf-2); padding: 1.5px 6px; border-radius: 5px;
  font-family: var(--crw-font-mono); font-size: 11px; color: var(--tx);
}
.nota {
  background: var(--surf); border: 1px solid var(--line); border-left: 2px solid var(--acc);
  border-radius: 0 9px 9px 0; padding: 13px 16px; font-size: 12.5px; color: var(--mut);
}
.nota b { color: var(--tx); }

@media (max-width: 1080px) {
  .two { grid-template-columns: 1fr; gap: 20px; }
  .top .search { display: none; }
}
@media (max-width: 760px) {
  .top { overflow-x: auto; }
  main { padding: 20px 16px 60px; }
  h1 { font-size: 24px; }
}

/* ── Diff de PR ─────────────────────────────────────────────────── */
.diff {
  margin: 0; background: var(--surf); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; overflow: auto; max-height: 68vh;
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 11.5px; line-height: 1.6;
}
.diff span { display: block; white-space: pre; padding: 0 6px; border-radius: 3px; }
.diff .add { background: #e9f7ee; color: #116329; }
.diff .del { background: #fdeef0; color: #a4232f; }
.diff .hunk { color: var(--acc); margin-top: 5px; }
.diff .file { font-weight: 700; color: var(--tx); margin-top: 13px; }
.diff .meta { color: var(--faint); }

/* La linea de numeros bajo los grupos de /agentes. La fila plana de agentes
   que habia aqui la sustituyo `public/orbita.css`. */
.ags-n { margin: 0 0 26px; font-size: 12.5px; color: var(--mut); }
.ags-l { color: var(--faint); }

