/* Jarvis — sala de control de Yaxa.
 * Tokens de marca: /home/store/astro/design-system/tokens.css (fuente de verdad del storefront).
 * Reglas de la marca: naranja #FF7800 solo para marca y acción principal (con brillo), texto naranja #BD5900,
 * botones y chips en píldora, tarjetas rounded-2xl, cuerpo text-sm, tipografía del sistema. */

:root {
  /* marca */
  --yaxa-orange: #ff7800;
  --yaxa-accent: #bd5900;
  --yaxa-fire: #ff6b00;
  --yaxa-deep: #c75500;
  --yaxa-blue: #26c2ff;
  --yaxa-blue-a: #1a9fd6;
  --yaxa-green: #1b8378;
  --yaxa-cobalt: #2563eb;
  --yaxa-plus: #d40000;
  --yaxa-gold: #ffb800;

  /* superficies y texto (tema claro: el preferido del equipo) */
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f3f4f6;
  --line: #ececee;
  --line-strong: #dedfe3;
  --ink: #1d1d1f;
  --ink-2: #474747;
  --muted: #6b7280;
  --faint: #9ca3af;

  /* roles */
  --brand: var(--yaxa-orange);
  --brand-ink: var(--yaxa-accent);
  --brand-soft: #fff4e8;
  --brand-soft-2: #ffe7d1;
  --run: var(--yaxa-blue-a);
  --run-soft: #e8f6fc;
  --ok: var(--yaxa-green);
  --ok-soft: #e7f4f2;
  --wait: #b45309;
  --wait-soft: #fef3c7;
  --bad: var(--yaxa-plus);
  --bad-soft: #fdecec;
  --info: var(--yaxa-cobalt);
  --info-soft: #eaf0fe;
  --code: #f6f7f9;

  /* forma y profundidad */
  --r-sm: 8px;
  --r-md: 12px;
  --r-card: 16px;
  --r-xl: 24px;
  --pill: 9999px;
  --shadow-sm: 0 1px 2px rgb(17 17 26 / .05);
  --shadow: 0 1px 2px rgb(17 17 26 / .04), 0 6px 24px -8px rgb(17 17 26 / .10);
  --shadow-lg: 0 2px 4px rgb(17 17 26 / .04), 0 18px 40px -12px rgb(17 17 26 / .18);
  --shadow-cta: 0 10px 15px -3px rgb(255 120 0 / .45), 0 4px 6px -4px rgb(255 120 0 / .45);
  --ring: 0 0 0 3px rgb(255 120 0 / .28);

  /* tipografía */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* distribución */
  --rail-w: 232px;
  --assistant-w: 420px;
  --dock-h: 108px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1012;
  --surface: #17181b;
  --surface-2: #1c1d21;
  --surface-3: #232429;
  --line: #2a2b31;
  --line-strong: #34363d;
  --ink: #f2f2f3;
  --ink-2: #d4d4d8;
  --muted: #a1a1aa;
  --faint: #71717a;
  --brand-ink: #ff9a3d;
  --brand-soft: #2a1a0b;
  --brand-soft-2: #3a230d;
  --run: #4cc9f5;
  --run-soft: #0e2530;
  --ok: #3fbfae;
  --ok-soft: #0f2522;
  --wait: #fbbf24;
  --wait-soft: #2a2110;
  --bad: #ff5c5c;
  --bad-soft: #2d1416;
  --info: #6c9bff;
  --info-soft: #141f39;
  --code: #121316;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -10px rgb(0 0 0 / .5);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 18px 40px -12px rgb(0 0 0 / .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1012; --surface: #17181b; --surface-2: #1c1d21; --surface-3: #232429; --line: #2a2b31; --line-strong: #34363d;
    --ink: #f2f2f3; --ink-2: #d4d4d8; --muted: #a1a1aa; --faint: #71717a; --brand-ink: #ff9a3d; --brand-soft: #2a1a0b;
    --brand-soft-2: #3a230d; --run: #4cc9f5; --run-soft: #0e2530; --ok: #3fbfae; --ok-soft: #0f2522; --wait: #fbbf24;
    --wait-soft: #2a2110; --bad: #ff5c5c; --bad-soft: #2d1416; --info: #6c9bff; --info-soft: #141f39; --code: #121316;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -10px rgb(0 0 0 / .5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 18px 40px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft-2); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- botones (siempre píldora) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px;
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.btn:hover { border-color: var(--brand); color: var(--brand-ink); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.sm { height: 28px; padding: 0 11px; font-size: 12.5px; }
.btn.sm .ico { width: 14px; height: 14px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-cta); }
.btn.primary:hover { background: var(--yaxa-deep); border-color: var(--yaxa-deep); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.btn.lg { height: 48px; padding: 0 26px; font-size: 15.5px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--pill);
  border: 0; background: transparent; color: var(--muted); transition: background .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }

/* ---------- chips y estados ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
button.chip { transition: border-color .15s, background .15s; }
button.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand-ink); }
.chip .ico { width: 14px; height: 14px; }
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--pill);
  font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--muted); flex: none;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.run { background: var(--run-soft); color: var(--run); }
.status.run::before { animation: blink 1.4s ease-in-out infinite; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.wait { background: var(--wait-soft); color: var(--wait); }
.status.bad { background: var(--bad-soft); color: var(--bad); }
.status.brand { background: var(--brand); color: #fff; }
.status.brand::before { background: #fff; }
@keyframes blink { 50% { opacity: .3; } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.run { background: var(--run); animation: blink 1.4s ease-in-out infinite; }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--bad); }
.dot.wait { background: var(--wait); }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.count:empty { display: none; }
.count.hot { background: var(--brand); color: #fff; }
.count.bad { background: var(--bad); color: #fff; }

/* ---------- estructura ---------- */
.app {
  height: 100vh; height: 100dvh;
  display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--assistant-w);
}

/* barra lateral */
.rail {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; min-height: 0;
  background: var(--surface); border-right: 1px solid var(--line);
}
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.rail-brand .logo { height: 30px; width: auto; display: block; }
.rail-brand .product {
  font-weight: 750; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2);
  padding: 3px 9px; border-radius: var(--pill); background: var(--surface-3);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--r-md);
  border: 0; background: transparent; color: var(--ink-2); font-weight: 600; text-align: left; width: 100%;
  transition: background .15s, color .15s;
}
.nav-item .ico { width: 20px; height: 20px; color: var(--muted); }
.nav-item span.label { flex: 1; }
.nav-item:hover { background: var(--surface-3); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-item.active .ico { color: var(--brand); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.usage-card { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.usage-card .title { font-size: 11px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.meter .bar { grid-column: 1 / -1; height: 6px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .4s var(--ease); }
.meter.hot .bar i { background: var(--wait); }
.meter.crit .bar i { background: var(--bad); }
.meter b { font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand-soft-2); color: var(--brand-ink); font-weight: 750; font-size: 12.5px;
}
.who .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* contenido principal */
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 26px 32px 6px; }
.page-head h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.4px; font-weight: 750; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .m-only { display: none; align-items: center; gap: 6px; }
.views { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 32px 48px; }
.view { display: flex; flex-direction: column; gap: 24px; max-width: 1240px; }

/* requiere tu atención */
.attention { display: flex; gap: 10px; overflow-x: auto; padding: 10px 32px 4px; scrollbar-width: none; flex: none; }
.attention::-webkit-scrollbar { display: none; }
.alert {
  display: flex; align-items: center; gap: 10px; flex: none; max-width: 360px; height: 44px; padding: 0 16px 0 9px;
  border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 600; color: var(--ink); text-align: left; transition: border-color .15s, transform .15s var(--ease);
}
.alert .tag { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.alert .tag .ico { width: 15px; height: 15px; }
.alert span.text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert.bad .tag { background: var(--bad-soft); color: var(--bad); }
.alert.wait .tag { background: var(--wait-soft); color: var(--wait); }
.alert.info .tag { background: var(--info-soft); color: var(--info); }
button.alert:hover { border-color: var(--brand); transform: translateY(-1px); }

/* cifras clave */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); text-align: left; min-width: 0; width: 100%; overflow: hidden;
}
button.kpi { transition: border-color .15s, box-shadow .2s; }
button.kpi:hover { border-color: var(--brand); box-shadow: var(--shadow-lg); }
.kpi .k-label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.kpi .k-label span { overflow: hidden; text-overflow: ellipsis; }
.kpi .k-label .ico { width: 15px; height: 15px; }
.kpi .k-value { font-size: 28px; font-weight: 750; letter-spacing: -.5px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .k-sub { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.run .k-value { color: var(--run); }
.kpi.bad .k-value { color: var(--bad); }
.kpi.wait .k-value { color: var(--wait); }
.kpi.brand .k-value { color: var(--brand-ink); }

/* secciones y tarjetas */
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.1px; }
.section-head .muted { font-size: 12.5px; white-space: nowrap; }
.section-head .spacer { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; text-align: left;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
button.card:hover, .card.hoverable:hover { box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card.live { border-color: color-mix(in srgb, var(--run) 35%, var(--line)); }
.card.jarvis { background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); border-color: var(--brand-soft-2); }
.card-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.card-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.card-sub > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub .ico { width: 14px; height: 14px; }
.activity {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2);
  font: 12px/1.4 var(--mono); color: var(--ink-2); min-width: 0; border: 1px solid var(--line);
}
.activity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity .ico { width: 14px; height: 14px; color: var(--muted); }
.activity.run { background: var(--run-soft); border-color: transparent; color: var(--ink); }
.activity.run .ico { color: var(--run); }
.activity.wait { background: var(--wait-soft); border-color: transparent; color: var(--ink); }
.activity.wait .ico { color: var(--wait); }
.card-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.card-foot .item { display: inline-flex; align-items: center; gap: 5px; }
.card-foot .ico { width: 13px; height: 13px; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.steps { display: flex; align-items: center; }
.step { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--faint); white-space: nowrap; }
.step + .step::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--line-strong); margin: 0 6px; }
.step i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.step.done { color: var(--ok); }
.step.done i { background: var(--ok); }
.step.now { color: var(--run); }
.step.now i { background: var(--run); box-shadow: 0 0 0 4px var(--run-soft); }
.phase { display: flex; flex-direction: column; gap: 6px; }
.phase-bar { display: grid; gap: 4px; }
.phase-bar i { height: 6px; border-radius: var(--pill); background: var(--line-strong); }
.phase-bar i.done { background: var(--ok); }
.phase-bar i.now { background: var(--run); animation: blink 1.6s ease-in-out infinite; }
.phase-label { font-size: 12.5px; color: var(--muted); }
.phase-label b { color: var(--ink); font-weight: 700; }
.steps-wrap { overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.steps-wrap::-webkit-scrollbar { display: none; }
.agents { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.agent-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; }
.agent-row .a-label { font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row .a-meta { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.empty {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-card);
  border: 1px dashed var(--line-strong); color: var(--muted); background: var(--surface-2); grid-column: 1 / -1;
}
.empty .e-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); flex: none; color: var(--faint); }
.empty b { color: var(--ink-2); display: block; font-size: 13.5px; }
.skeleton { height: 72px; border-radius: var(--r-card); background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- ramas ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }
.repo { display: flex; flex-direction: column; gap: 10px; }
.repo-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repo-head .r-ico { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.repo-head h3 { margin: 0; font-size: 16px; font-weight: 750; }
.repo-head .r-meta { font-size: 12.5px; color: var(--muted); }
.repo-head .r-pills { display: flex; gap: 6px; margin-left: auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-title { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel-title .ico { width: 14px; height: 14px; }
.row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); transition: background .15s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.row-title a { color: inherit; }
.row-title a:hover { color: var(--brand-ink); text-decoration: none; }
.row-title .pr-num { color: var(--muted); font-weight: 600; margin-right: 4px; }
.row-sub { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); min-width: 0; }
.row-sub > span { white-space: nowrap; flex: none; }
.row-sub .branch { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
@media (hover: hover) { .row .row-act { opacity: 0; transition: opacity .15s; } .row:hover .row-act, .row:focus-within .row-act { opacity: 1; } }
.row-side { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ci { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--faint); }
.ci .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.ci.SUCCESS { background: var(--ok-soft); color: var(--ok); }
.ci.FAILURE, .ci.ERROR { background: var(--bad-soft); color: var(--bad); }
.ci.PENDING, .ci.EXPECTED { background: var(--wait-soft); color: var(--wait); }
.tagline { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.tagline.ok { background: var(--ok-soft); color: var(--ok); }
.tagline.wait { background: var(--wait-soft); color: var(--wait); }
.tagline.bad { background: var(--bad-soft); color: var(--bad); }
.tagline.brand { background: var(--brand-soft); color: var(--brand-ink); }
.more { width: 100%; height: 40px; border: 0; border-top: 1px solid var(--line); background: var(--surface); color: var(--brand-ink); font-weight: 650; font-size: 13px; }
.more:hover { background: var(--brand-soft); }

/* ---------- consola (línea de tiempo) ---------- */
.console-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; top: -14px; z-index: 5; margin: -14px -32px 0; padding: 14px 32px 10px; background: linear-gradient(var(--bg) 80%, transparent); }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.tool { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.tool::before { content: ""; position: absolute; left: 16px; top: 36px; bottom: -8px; width: 2px; background: var(--line); }
.tool:last-child::before { display: none; }
.t-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); z-index: 1; }
.t-ico .ico { width: 16px; height: 16px; }
.tool.running .t-ico { color: var(--run); border-color: var(--run); box-shadow: 0 0 0 4px var(--run-soft); }
.tool.ok .t-ico { color: var(--ok); }
.tool.err .t-ico { color: var(--bad); border-color: var(--bad); }
.t-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; min-width: 0; box-shadow: var(--shadow-sm); }
.tool.sub .t-card { border-left: 3px solid var(--lane, var(--run)); }
.t-head { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: transparent; padding: 9px 12px; text-align: left; min-width: 0; }
.t-head:hover { background: var(--surface-2); }
.t-name { font-weight: 700; font-size: 13px; flex: none; }
.t-sum { font: 12.5px/1.4 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.t-lane { font-size: 11px; font-weight: 700; color: var(--lane, var(--run)); background: color-mix(in srgb, var(--lane, var(--run)) 12%, transparent); padding: 2px 9px; border-radius: var(--pill); flex: none; max-width: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-time { font-size: 11.5px; color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.t-body { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.t-body pre, .say {
  margin: 0; font: 12px/1.55 var(--mono); background: var(--code); padding: 10px 12px; border-radius: var(--r-sm);
  overflow: auto; white-space: pre-wrap; word-break: break-word; max-height: 380px; border: 1px solid var(--line);
}
.t-body pre.cmd { color: var(--ink); font-weight: 600; }
.t-body pre.err { color: var(--bad); }
.diff .del { color: var(--bad); background: var(--bad-soft); display: block; }
.diff .add { color: var(--ok); background: var(--ok-soft); display: block; }
.todo { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.todo li { display: flex; gap: 8px; align-items: center; }
.todo li.done { color: var(--muted); text-decoration: line-through; }
.todo li.doing { color: var(--run); font-weight: 650; }
.say { font-family: var(--font); font-size: 13px; background: var(--surface-2); }

/* ---------- asistente (Jarvis) ---------- */
.assistant { min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); position: relative; }
.a-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.a-head .m-only { display: none; }
.a-title { flex: 1; min-width: 0; }
.a-name { font-weight: 750; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.a-state { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-state.live { color: var(--run); }
.a-state.rec { color: var(--brand-ink); }
.a-state.off { color: var(--faint); }

/* orbe */
.orb {
  --level: 0; --size: 40px;
  position: relative; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background: radial-gradient(circle at 34% 30%, #ffd2a1 0%, #ffa24d 22%, var(--yaxa-orange) 55%, var(--yaxa-deep) 100%);
  box-shadow: 0 6px 18px -4px rgb(255 120 0 / .55), inset 0 -4px 10px rgb(150 50 0 / .25);
  animation: breathe 4.5s ease-in-out infinite; transition: filter .3s;
}
.orb::before, .orb::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; pointer-events: none; }
.orb.lg { --size: 112px; }
.orb.listening { animation: none; transform: scale(calc(1 + var(--level) * .18)); transition: transform .08s linear; }
.orb.listening::before { border-color: rgb(255 120 0 / .45); animation: ripple 1.2s ease-out infinite; }
.orb.listening::after { border-color: rgb(255 120 0 / .3); animation: ripple 1.2s ease-out .4s infinite; }
.orb.working { animation: breathe 1.8s ease-in-out infinite; }
.orb.working::before { inset: -5px; border: 2.5px solid transparent; border-top-color: var(--yaxa-blue); border-right-color: rgb(38 194 255 / .4); animation: spin 1.1s linear infinite; }
.orb.speaking { animation: talk .5s ease-in-out infinite alternate; }
.orb.speaking::before { border-color: rgb(255 120 0 / .35); animation: ripple 1.6s ease-out infinite; }
.orb.off { filter: grayscale(1) opacity(.5); animation: none; }
@keyframes breathe { 50% { transform: scale(1.04); } }
@keyframes talk { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes ripple { from { transform: scale(1); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 12px; }
.hero { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 12px 4px 20px; }
.hero h2 { margin: 10px 0 0; font-size: 22px; letter-spacing: -.3px; font-weight: 750; }
.hero p { margin: 0; color: var(--muted); max-width: 320px; }
.suggest { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }
.suggest button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); text-align: left; font-size: 13.5px; color: var(--ink-2);
  transition: border-color .15s, background .15s;
}
.suggest button:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.suggest .ico { color: var(--brand); width: 16px; height: 16px; }
.msg { max-width: 92%; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 18px 18px 6px 18px; white-space: pre-wrap; font-size: 14px; }
:root[data-theme="dark"] .msg.user { background: var(--surface-3); color: var(--ink); }
.msg.user .by { display: block; font-size: 10.5px; opacity: .6; margin-top: 2px; text-align: right; }
.msg.jarvis { align-self: flex-start; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; max-width: 100%; }
.m-avatar { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ffd2a1, var(--yaxa-orange) 55%, var(--yaxa-deep)); margin-top: 2px; flex: none; }
.msg.jarvis .m-body { min-width: 0; font-size: 14px; line-height: 1.6; }
.msg.jarvis.live .md > :last-child::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--brand); border-radius: 2px; animation: blink 1s steps(2) infinite; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 6px 0; }
.md ul, .md ol { padding-left: 20px; margin: 6px 0; }
.md li { margin: 2px 0; }
.md strong { font-weight: 700; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.md pre { background: var(--code); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--r-sm); overflow-x: auto; font-size: 12.5px; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; font-size: 12.5px; display: block; overflow-x: auto; margin: 8px 0; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { color: var(--muted); font-weight: 650; }
.spoken {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--brand-soft); color: var(--ink); font-size: 13.5px; border: 1px solid var(--brand-soft-2);
}
.spoken button { border: 0; background: var(--surface); color: var(--brand-ink); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: var(--shadow-sm); }
.spoken button .ico { width: 14px; height: 14px; }
.note { align-self: center; font-size: 12px; color: var(--faint); text-align: center; padding: 2px 10px; }
.note.warn { color: var(--wait); }
.note.error { color: var(--bad); }
.meta { font-size: 11.5px; color: var(--faint); margin: -4px 0 0 36px; font-variant-numeric: tabular-nums; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 36px; }
.act {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 10px; border-radius: var(--pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: 12px; text-align: left; transition: border-color .15s;
}
.act:hover { border-color: var(--brand); }
.act .ico { width: 13px; height: 13px; color: var(--muted); }
.act span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.act.running .ico { color: var(--run); }
.act.ok .ico { color: var(--ok); }
.act.err .ico { color: var(--bad); }

.composer-wrap { padding: 10px 14px calc(var(--dock-h) + 4px); border-top: 1px solid var(--line); background: var(--surface); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 7px 0; font: inherit; font-size: 14px; color: var(--ink); max-height: 150px; }
.composer textarea::placeholder { color: var(--faint); }
.composer textarea:focus-visible { box-shadow: none; }
.send { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--ink); color: #fff; flex: none; transition: background .15s, transform .15s; }
:root[data-theme="dark"] .send { background: var(--brand); }
.send:hover { background: var(--brand); }
.send .ico { width: 16px; height: 16px; }

/* micrófono */
.dock {
  position: fixed; right: 0; bottom: 0; width: var(--assistant-w); height: var(--dock-h); z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 6px 18px 16px;
  pointer-events: none;
}
.dock > * { pointer-events: auto; }
.dock .left { justify-self: end; }
.dock .right { justify-self: start; }
.mic {
  position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-cta); touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .15s var(--ease), background .2s;
}
.mic:hover { background: var(--yaxa-fire); }
.mic:active { transform: scale(.96); }
.mic .ico { width: 26px; height: 26px; position: relative; z-index: 1; stroke-width: 2.1; }
.mic-level { position: absolute; inset: 0; border-radius: 50%; background: rgb(255 120 0 / .28); opacity: 0; transition: transform .08s linear; }
.mic.rec { background: var(--yaxa-deep); }
.mic.rec .mic-level { opacity: 1; }
.mic.busy { animation: blink 1.2s ease-in-out infinite; }
.mic-hint { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 11px; color: var(--faint); pointer-events: none; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 650; font-size: 12.5px; box-shadow: var(--shadow-sm); }
.pill-btn .ico { width: 15px; height: 15px; }
.pill-btn.stop { color: var(--bad); }
.pill-btn.stop:hover { border-color: var(--bad); background: var(--bad-soft); }
.pill-btn.hush:hover { border-color: var(--brand); }
.caption {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 142px); z-index: 25;
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: rise-c .2s var(--ease);
}
@keyframes rise-c { from { transform: translateY(8px); opacity: 0; } }
:root[data-theme="dark"] .caption { background: var(--surface-3); color: var(--ink); }

/* ---------- cajones ---------- */
.scrim { position: fixed; inset: 0; background: rgb(15 16 18 / .32); z-index: 39; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); z-index: 40; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: slide .22s var(--ease);
}
.drawer.wide { width: min(660px, 100%); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.d-head { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 16px) 18px 14px; border-bottom: 1px solid var(--line); }
.d-head h2 { margin: 0; font-size: 17px; font-weight: 750; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field select { font: inherit; font-weight: 500; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); height: 40px; padding: 0 12px; }
.field input[type=range] { width: 100%; accent-color: var(--brand); }
.field .f-row { display: flex; justify-content: space-between; align-items: center; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 2px 0; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: var(--pill); background: var(--line-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.group { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: var(--r-card); background: var(--surface-2); border: 1px solid var(--line); }
.group-title { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.d-actions { display: flex; flex-direction: column; gap: 8px; }
.d-actions .btn { width: 100%; height: 40px; }
.tl { display: flex; flex-direction: column; gap: 6px; }
.tl-item { font-size: 13px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); overflow-wrap: anywhere; border: 1px solid var(--line); }
.tl-item.tool { font-family: var(--mono); font-size: 12px; background: transparent; border-style: dashed; color: var(--ink-2); }
.tl-item.result { font-family: var(--mono); font-size: 11.5px; color: var(--muted); max-height: 110px; overflow: hidden; }
.tl-item.user { background: var(--brand-soft); border-color: var(--brand-soft-2); }
.tl-item.side { margin-left: 16px; }
.d-section { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 6px 0 -6px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 60; display: flex; gap: 8px; align-items: center;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--pill); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: rise .2s var(--ease); max-width: calc(100vw - 32px);
}
@keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } }

.tabbar { display: none; }

/* ---------- puerta (login) ---------- */
body.gate { display: grid; place-items: center; padding: 16px; overflow: auto; background: radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), var(--bg) 60%); }
.gate-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 36px 32px 28px; text-align: center; box-shadow: var(--shadow-lg); }
.gate-card .logo { height: 46px; width: auto; }
.gate-card .orb { margin: 24px auto 0; --size: 72px; }
.gate-card h1 { margin: 20px 0 4px; font-size: 26px; letter-spacing: -.4px; font-weight: 750; }
.gate-sub { color: var(--muted); margin: 0 0 26px; }
.gate-card .btn.lg { width: 100%; gap: 10px; }
.gate-card .g { width: 22px; height: 22px; background: #fff; border-radius: 50%; padding: 3px; }
.gate-note { color: var(--faint); font-size: 12px; margin: 18px 0 0; line-height: 1.5; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  :root { --rail-w: 76px; --assistant-w: 380px; }
  .rail { padding: 16px 10px; align-items: center; }
  .rail-brand { padding: 4px 0 16px; justify-content: center; }
  .rail-brand .logo { height: 22px; }
  .rail-brand .product, .nav-item span.label, .usage-card, .who .email { display: none; }
  .nav-item { width: 52px; justify-content: center; padding: 0; position: relative; }
  .nav-item .count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .who { padding: 0; justify-content: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --dock-h: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { display: none; }
  .app[data-view="jarvis"] .main { display: none; }
  .app:not([data-view="jarvis"]) .assistant { display: none; }
  .assistant { border-left: 0; }
  .a-head { padding: calc(env(safe-area-inset-top) + 12px) 14px 12px 16px; }
  .a-head .m-only, .page-head .m-only { display: flex; }
  .page-head { padding: calc(env(safe-area-inset-top) + 16px) 16px 4px; align-items: center; }
  .page-head h1 { font-size: 22px; }
  .page-head p { font-size: 13px; }
  .attention { padding: 10px 16px 2px; }
  .views { padding: 12px 16px 150px; }
  .console-bar { top: -12px; margin: -12px -16px 0; padding: 12px 16px 10px; }
  .view { gap: 20px; }
  .kpis { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .k-value { font-size: 24px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .composer-wrap { padding: 10px 12px 96px; }
  .hero .orb.lg { --size: 96px; }
  .dock {
    left: 0; right: 0; width: auto; height: auto; bottom: calc(env(safe-area-inset-bottom) + 66px);
    padding: 0 16px 10px; grid-template-columns: 1fr auto 1fr;
  }
  .mic-hint { display: none; }
  .app:not([data-view="jarvis"]) ~ .dock { grid-template-columns: 1fr auto; padding-right: 18px; }
  .app:not([data-view="jarvis"]) ~ .dock .left { display: none; }
  .app:not([data-view="jarvis"]) ~ .dock .mic { width: 56px; height: 56px; grid-column: 2; grid-row: 1; }
  .app:not([data-view="jarvis"]) ~ .dock .right { grid-column: 1; grid-row: 1; justify-self: end; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); z-index: 30; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--faint); font-size: 11px; font-weight: 650; padding: 4px 0; position: relative; border-radius: var(--r-md); }
  .tab .ico { width: 22px; height: 22px; }
  .tab.active { color: var(--brand-ink); }
  .tab .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .drawer, .drawer.wide { width: 100%; }
  .row { padding: 11px 12px; gap: 10px; }
  .row-side .hide-sm { display: none; }
  .repo-head .r-pills { margin-left: 0; width: 100%; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip { flex: none; }
}
@media (min-width: 901px) { .caption { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
