/* Xylorve System — "Aurora Console" (2026-11-02).
   Capa cargada después de styles.css: redefine tokens y restila componentes sin tocar las clases de app.js.
   Tinta + papel, aurora del logo (violeta → azul → cian) usada con medida.
   Tipos: Instrument Serif (títulos) · Geist (interfaz) · Geist Mono (datos y etiquetas). */
:root {
  --ink-0: #05061A; --ink-1: #0B0C24; --ink-2: #12143A; --ink-3: #1C1F4F;
  --au-v: #8B5CF6; --au-b: #3B6BFF; --au-c: #22D3EE;
  --aurora: linear-gradient(90deg, var(--au-v), var(--au-b) 52%, var(--au-c));
  --grad: var(--aurora);

  --bg: #F5F3EE;
  --surface: #FFFFFF; --surface-solid: #FFFFFF; --surface-2: #EEEBE4;
  --border: rgba(11, 12, 36, .10); --border-2: rgba(11, 12, 36, .17);
  --text: #0B0C24; --muted: #4A4D66; --dim: #74778E;
  --primary: #3B5BFF; --primary-ink: #FFFFFF;
  --btn-bg: var(--ink-1); --btn-fg: #FFFFFF;
  --ok: #0F8A5F; --ok-bg: rgba(15, 138, 95, .10);
  --warn: #A3620A; --warn-bg: rgba(163, 98, 10, .11);
  --info: #0E6F86; --info-bg: rgba(14, 111, 134, .10);
  --bad: #C2362F; --bad-bg: rgba(194, 54, 47, .09);
  --side: var(--ink-1); --side-text: #C9CBE6; --side-dim: #7D80A6; --side-hover: rgba(255,255,255,.05); --side-on: rgba(255,255,255,.08);
  --dots: rgba(11, 12, 36, .075);
  --glow: rgba(91, 92, 246, .10);
  --hi: inset 0 1px 0 rgba(255,255,255,.9);
  --shadow: 0 1px 0 rgba(11,12,36,.03);
  --shadow-lg: 0 18px 50px -12px rgba(11,12,36,.22);

  /* Paleta de datos coherente (índigo, violeta, cian, menta, ámbar apagado) */
  --c-blue: #3B5BFF; --c-purple: #7C5CF0; --c-cyan: #0EA5C4; --c-pink: #7C5CF0;
  --c-green: #19A783; --c-orange: #C08A2E;

  --r: 14px; --r-m: 10px; --r-s: 6px;
  --display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #07081C;
  --surface: #0E1030; --surface-solid: #0E1030; --surface-2: #151840;
  --border: rgba(170, 178, 255, .10); --border-2: rgba(170, 178, 255, .18);
  --text: #ECEDFB; --muted: #A8ABD0; --dim: #7E82AC;
  --primary: #7C9CFF; --primary-ink: #05061A;
  --btn-bg: #FFFFFF; --btn-fg: var(--ink-1);
  --ok: #3DD6A3; --ok-bg: rgba(61, 214, 163, .11);
  --warn: #F0B44C; --warn-bg: rgba(240, 180, 76, .11);
  --info: #4FD8EE; --info-bg: rgba(79, 216, 238, .11);
  --bad: #FF7A70; --bad-bg: rgba(255, 122, 112, .11);
  --side: var(--ink-0); --side-text: #C9CBE6;
  --dots: rgba(170, 178, 255, .07);
  --glow: rgba(91, 92, 246, .20);
  --hi: inset 0 1px 0 rgba(255,255,255,.05);
  --shadow: 0 1px 0 rgba(0,0,0,.25);
  --shadow-lg: 0 18px 50px -12px rgba(0,0,0,.6);
  --c-blue: #7C9CFF; --c-purple: #A48BFF; --c-cyan: #4FD8EE; --c-pink: #A48BFF;
  --c-green: #3DD6A3; --c-orange: #E0B061;
  color-scheme: dark;
}

/* ---------- Base ---------- */
body {
  background:
    radial-gradient(1100px 380px at 62% -140px, var(--glow), transparent 70%),
    radial-gradient(circle at 1px 1px, var(--dots) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--bg);
  background-attachment: fixed;
  font: 14.5px/1.55 var(--font);
  font-feature-settings: 'ss01', 'cv11';
}
::selection { background: color-mix(in srgb, var(--au-b) 26%, transparent); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-s); }
a { color: var(--primary); }

/* ---------- Tipografía ---------- */
h1, .display { font-family: var(--display); font-weight: 400; letter-spacing: -.012em; }
h1 { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.02; }
h1 em, .display em { font-style: italic; }
h2 { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -.005em; }
.eyebrow, .nav-label, .stat-lbl, .kcell-lbl, .cal .dow, .table th, .rows .date, .task .due {
  font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: .12em;
}
.eyebrow { font-size: 10.5px; color: var(--dim); }
.grad-text { background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kcell-num, .stat-num, .kpi .num, .plan .price, .table td, .rows .date, .ch-h { font-variant-numeric: tabular-nums; }

/* ---------- Superficies ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--hi), var(--shadow); backdrop-filter: none; -webkit-backdrop-filter: none; padding: 20px;
}
.card-head h2 { font-size: 15px; }
.click:hover { transform: translateY(-1px); box-shadow: var(--hi), var(--shadow-lg); border-color: var(--border-2); }
.chip { border-radius: var(--r-s); font-size: 11.5px; font-weight: 500; padding: 3px 8px; border: 1px solid var(--border); background: var(--surface-2); }
.chip.ok, .chip.warn, .chip.info, .chip.bad { border-color: transparent; }

/* ---------- Menú lateral (tinta en ambos modos) ---------- */
.side { background: var(--side); border-right: 1px solid rgba(255,255,255,.06); }
.side::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 220px; pointer-events: none;
  background: radial-gradient(260px 160px at 30% -40px, rgba(91,92,246,.22), transparent 70%); }
.side > * { position: relative; }
.brand b { font-family: var(--display); font-size: 22px; letter-spacing: -.01em; }
.brand span { font-size: 10px; }
.switcher { border-radius: var(--r-m); background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.09); }
.switcher select option { color: var(--ink-1); }
.biz-dot { border-radius: 8px; }
.nav-label { font-size: 9.5px; letter-spacing: .18em; margin: 16px 10px 5px; }
.nav-item { position: relative; border-radius: 8px; min-height: 38px; font-size: 14px; }
.nav-item.on { background: var(--side-on); box-shadow: none; }
.nav-item.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--au-v), var(--au-b), var(--au-c)); box-shadow: 0 0 12px rgba(59,107,255,.7); }
.nav-item .count { border-radius: 5px; font-family: var(--mono); font-size: 10.5px; background: rgba(255,255,255,.08); }
/* Claude: anillo aurora */
.nav-item.heart { background: transparent; }
.nav-item.heart::after { content: ''; position: absolute; inset: 0; border-radius: 8px; padding: 1px; pointer-events: none;
  background: var(--aurora); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; }
.nav-item.heart:hover, .nav-item.heart.on { background: rgba(91,92,246,.14); box-shadow: none; }
.nav-item.heart.on::after { opacity: 1; }
.side-foot { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Barra superior ---------- */
.top { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px) saturate(1.1); }
.top .crumb { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.top .crumb b { font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 13px; }
.seg { border-radius: var(--r-s); background: var(--surface); }
.seg button { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; min-height: 32px; }
.seg button.on { background: var(--btn-bg); color: var(--btn-fg); }
.icon-btn { border-radius: var(--r-s); width: 34px; height: 34px; }
.avatar-btn { border-radius: var(--r-s); min-height: 34px; }
.avatar-btn i { border-radius: 5px; background: var(--ink-2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.menu { border-radius: var(--r-m); }

/* ---------- Botones ---------- */
.btn { border-radius: var(--r-s); min-height: 38px; font-weight: 500; font-size: 13.5px; background: var(--surface); box-shadow: var(--hi); }
.btn:hover { filter: none; border-color: color-mix(in srgb, var(--text) 30%, transparent); box-shadow: var(--hi); }
.btn.primary, .btn.grad { position: relative; background: var(--btn-bg); color: var(--btn-fg); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(11,12,36,.2); isolation: isolate; }
.btn.primary::after, .btn.grad::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1;
  background: var(--aurora); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .2s; }
.btn.primary:hover, .btn.grad:hover { filter: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 6px 22px -6px rgba(59,107,255,.55); }
.btn.primary:hover::after, .btn.grad:hover::after { opacity: 1; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.sm { min-height: 32px; font-size: 12.5px; }
.x-btn { border-radius: var(--r-s); }

/* ---------- Formularios ---------- */
input, textarea, select { border-radius: var(--r-s); min-height: 40px; background: var(--surface-solid); }
input:focus, textarea:focus, select:focus { border-color: var(--au-b);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--au-b) 16%, transparent), 0 0 0 1px color-mix(in srgb, var(--au-c) 40%, transparent); }
.form label, .field-l { font-size: 12.5px; font-weight: 500; }
.dropzone { border-radius: var(--r); background: var(--surface); }
.filters button { border-radius: var(--r-s); font-size: 12.5px; min-height: 32px; background: var(--surface); }
.filters button.on { background: var(--btn-bg); color: var(--btn-fg); }
.lib-search { border-radius: var(--r-s); }
.auth-tabs, .auth-tabs button { border-radius: var(--r-s); }
.steps i.on { background: var(--aurora); }
.plan { border: 1px solid var(--border-2); border-radius: var(--r); position: relative; overflow: hidden; box-shadow: var(--hi); }
.plan::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--aurora); }

/* ---------- Tarjeta de Claude: tinta + haz de luz aurora (ambos modos) ---------- */
.heart-card {
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); color: #fff;
  background:
    radial-gradient(420px 260px at 78% -30%, rgba(34,211,238,.28), transparent 70%),
    radial-gradient(520px 300px at 50% -60%, rgba(91,92,246,.55), transparent 72%),
    linear-gradient(180deg, var(--ink-2), var(--ink-1) 60%, var(--ink-0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 60px -30px rgba(11,12,36,.6);
}
.heart-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--aurora); opacity: .9; }
.heart-card::after { content: ''; position: absolute; left: 50%; top: -40%; width: 46%; height: 140%; pointer-events: none;
  background: linear-gradient(180deg, rgba(139,92,246,.30), rgba(59,107,255,.10) 45%, transparent 75%);
  transform: translateX(-30%) skewX(-18deg); filter: blur(18px); }
.heart-card > *:not(.hero-3d):not(.heart-orb) { position: relative; z-index: 1; }
.heart-card .hero-3d { z-index: 1; }
.heart-orb { display: none; }
.heart-card h1 { font-size: clamp(32px, 3.4vw, 48px); }
.composer { border-radius: var(--r-m); background: rgba(255,255,255,.97); box-shadow: 0 12px 30px -10px rgba(0,0,0,.5); }
.composer textarea { color: var(--ink-1); }
.composer .btn.grad { background: var(--ink-1); color: #fff; }
.suggest button { border-radius: var(--r-s); font-size: 12.5px; border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.04); }
.suggest button:hover { border-color: rgba(124,156,255,.6); background: rgba(91,92,246,.16); }
.hero-3d { border-radius: var(--r-m); }

/* ---------- Franja de KPIs ---------- */
.kstrip {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 16px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--hi), var(--shadow); overflow: hidden;
}
.kstrip.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.kcell { position: relative; padding: 18px 20px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kcell + .kcell { border-left: 1px solid var(--border); }
.kcell-top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.kcell-ic { flex: none; width: 26px; height: 26px; border-radius: var(--r-s); display: grid; place-items: center;
  border: 1px solid var(--border-2); color: var(--muted); background: var(--surface-2); }
.kcell-ic svg { width: 14px; height: 14px; }
.kcell-lbl { font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcell-num { font-family: var(--display); font-size: clamp(30px, 2.6vw, 40px); line-height: 1; color: var(--text); overflow-wrap: anywhere; }
.kcell-foot { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--ok); }
.kcell-foot.down { color: var(--bad); }
/* La primera cifra lleva la firma aurora */
.kcell:first-child::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--aurora); }
.kcell:first-child { background: radial-gradient(240px 120px at 0% 0%, color-mix(in srgb, var(--au-b) 9%, transparent), transparent 70%); }
.kcell:first-child .kcell-num { background: linear-gradient(100deg, var(--text) 30%, var(--au-b) 75%, var(--au-c)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kcell:first-child .kcell-ic { color: var(--au-b); border-color: color-mix(in srgb, var(--au-b) 35%, transparent); background: color-mix(in srgb, var(--au-b) 8%, var(--surface)); }
[data-theme="dark"] .kcell:first-child .kcell-num { background: linear-gradient(100deg, #fff 30%, var(--au-c) 85%); -webkit-background-clip: text; background-clip: text; }

/* ---------- Tarjetas de dato ---------- */
.stat { align-items: center; }
.stat-num { font-family: var(--display); font-size: 32px; line-height: 1; color: var(--text); }
.stat-lbl { font-size: 10px; font-weight: 500; color: var(--dim); margin-top: 8px; }
.stat-ic { width: 34px; height: 34px; border-radius: var(--r-s); color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-2); }
.stat-ic svg { width: 16px; height: 16px; }
.kpi .num { font-family: var(--display); }
.kpi .ic { border-radius: var(--r-s); border: 1px solid var(--border-2); }

/* ---------- Avance y gráficos ---------- */
.pbar-top { font-size: 13px; }
.pbar-top b { font-family: var(--mono); font-weight: 500; font-size: 12px; }
.pbar-track { height: 6px; border-radius: 3px; }
.pbar-track i { border-radius: 3px; background: var(--aurora) !important; }
.pbar .small { font-family: var(--mono); font-size: 11px; }
.line-chart .ch-m, .rev-chart .ch-m { font-family: var(--mono); font-size: 10.5px; }
.lc-grid { stroke: var(--border); stroke-dasharray: 2 6; }
.rev-chart rect { fill: color-mix(in srgb, var(--c-blue) 26%, transparent); }
.rev-chart g:last-of-type rect { fill: var(--c-blue); }
.rev-chart .ch-val { font-family: var(--mono); }

/* ---------- Listas, tablas, calendario ---------- */
.rows .date, .task .due { font-size: 10.5px; }
.table th { font-size: 10px; font-weight: 500; color: var(--dim); }
.table td { font-size: 13.5px; }
.channel { border-radius: var(--r-m); box-shadow: var(--hi); }
.channel:hover { border-color: color-mix(in srgb, var(--au-b) 45%, transparent); }
.ch-ic { border-radius: var(--r-s); border: 1px solid var(--border-2); }
.code, .prompt pre { border-radius: var(--r-s); }
.cal .day { border-radius: var(--r-s); }
.cal .day:hover { border-color: color-mix(in srgb, var(--au-b) 55%, transparent); }
.cal .day.today { box-shadow: inset 0 0 0 1px var(--au-b), inset 0 2px 0 var(--au-c); }
.ev { border-radius: 4px; }

/* ---------- Chat ---------- */
.msg .who { border-radius: 7px; }
.msg .bubble { border-radius: var(--r-m); box-shadow: var(--hi); }
.msg.user .bubble { background: var(--btn-bg); color: var(--btn-fg); }
.msg.user .who { background: var(--ink-3); }
.chat-box { border-radius: var(--r-m); }

/* ---------- Biblioteca ---------- */
.cover { border-radius: var(--r-m); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 24px -14px rgba(11,12,36,.6); }
.cover::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(180px 120px at 85% 0%, rgba(255,255,255,.16), transparent 70%),
              radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 1.4px) 0 0 / 14px 14px; }
.cover::after { width: 6px; background: rgba(0,0,0,.25); }
.cover b { font-size: 21px; line-height: 1.08; }

/* ---------- Acceso ---------- */
.auth-art { background:
    radial-gradient(520px 300px at 50% -80px, rgba(91,92,246,.45), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--ink-1); }
.auth-art::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--aurora); }
.auth-art h1 { font-size: clamp(38px, 4.4vw, 60px); }
.auth-art .heart-orb { display: block; opacity: .35; }

/* ---------- Varios ---------- */
.toast { border-radius: var(--r-m); background: var(--btn-bg); color: var(--btn-fg); }
dialog { border-radius: var(--r); box-shadow: var(--hi), var(--shadow-lg); }
dialog::backdrop { background: rgba(5, 6, 26, .55); }
.set-photo { border-radius: var(--r-m); }
.set-initials { background: var(--ink-2); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .kstrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kstrip.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kstrip .kcell { border-left: 0; border-top: 1px solid var(--border); }
  .kstrip:not(.k4) .kcell:nth-child(-n+3), .kstrip.k4 .kcell:nth-child(-n+2) { border-top: 0; }
  .kstrip:not(.k4) .kcell:not(:nth-child(3n+1)), .kstrip.k4 .kcell:nth-child(2n) { border-left: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .kstrip, .kstrip.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kstrip .kcell { padding: 14px; border-left: 0; border-top: 1px solid var(--border); }
  .kstrip .kcell:nth-child(-n+2) { border-top: 0; }
  .kstrip .kcell:nth-child(2n) { border-left: 1px solid var(--border); }
  .kstrip:not(.k4) .kcell:first-child { grid-column: 1 / -1; }
  .kstrip:not(.k4) .kcell:first-child + .kcell { border-top: 1px solid var(--border); border-left: 0; }
  .kstrip:not(.k4) .kcell:nth-child(3) { border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
  .kstrip:not(.k4) .kcell:nth-child(4) { border-left: 0; }
  .kstrip:not(.k4) .kcell:nth-child(5) { border-left: 1px solid var(--border); }
  .kcell-num { font-size: 28px; }
  h1 { font-size: 32px; }
}

/* Detalles */
a.btn { color: var(--text); text-decoration: none; }
a.btn.primary { color: var(--btn-fg); }
.chip.plain[style*="--c-blue"] { color: var(--primary-ink) !important; border-color: transparent; }
.top > * { flex: none; }
.top .crumb { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .top { gap: 6px; }
  .top .crumb { font-size: 10px; }
  .avatar-btn span { display: none; }
  .avatar-btn { padding: 3px; }
}
/* Columna de fecha: en mono mayúscula no cabía "NOV 4, 2026 · 10:00" en 110 px y se partía en dos líneas. */
.rows .date { width: auto; min-width: 104px; white-space: nowrap; }
@media (max-width: 640px) { .rows .date { min-width: 0; white-space: normal; max-width: 92px; } }
