/* Centro de mando · 123business. Outfit, negro y blanco, con el arcoíris de la marca como firma. */

@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/outfit-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --sunken: #f1f1f0;
  --ink: #0a0a0a;
  --ink-2: #2e2e2e;
  --muted: #5f5f5f;
  --faint: #8f8f8f;
  --line: #e7e7e5;
  --line-strong: #d3d3d0;
  --hover: #f3f3f2;
  --accent: #0a0a0a;
  --accent-ink: #ffffff;
  --focus: #2f6bff;
  --link: #1f56e0;
  /* Serie categórica validada (orden fijo): azul, naranja, cian, verde, violeta, magenta. */
  --s1: #2f6bff; --s2: #df7905; --s3: #09a1c2; --s4: #08ab4c; --s5: #9b5cff; --s6: #ff2e88;
  --s0: #b9b9b5;
  /* Estado: reservado, siempre con ícono y texto. */
  --good: #0aac23; --good-ink: #006c10; --good-bg: #e8f6ea;
  --warn: #fbb315; --warn-ink: #7a5200; --warn-bg: #fff5dc;
  --serious: #f18a59; --serious-ink: #9a3f12; --serious-bg: #fdeee6;
  --crit: #dc3c3d; --crit-ink: #a8231f; --crit-bg: #fcebeb;
  --info-bg: #eaf0ff; --info-ink: #1d4ed8;
  --grid: #e7e7e7; --baseline: #c2c2c2;
  --rainbow: linear-gradient(90deg, #00b4d8, #2f6bff, #9b5cff, #ff2e88, #ff8a00, #ffd60a, #21c55d);
  --radius: 22px;
  --radius-m: 14px;
  --radius-s: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side: 248px;
  --shadow: 0 1px 2px rgba(10, 10, 10, .04), 0 10px 30px -18px rgba(10, 10, 10, .22);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --surface: #141414; --surface-2: #181818; --sunken: #101010;
    --ink: #f2f2f2; --ink-2: #d9d9d9; --muted: #a3a3a3; --faint: #7a7a7a;
    --line: #262626; --line-strong: #383838; --hover: #1c1c1c;
    --accent: #f2f2f2; --accent-ink: #0a0a0a; --focus: #5d90fe; --link: #8eb1ff;
    --s1: #5d90fe; --s2: #dc7708; --s3: #00b0d3; --s4: #00b34f; --s5: #a474fe; --s6: #ff5895; --s0: #555552;
    --good: #00b34f; --good-ink: #53c556; --good-bg: #0f2414;
    --warn: #fbb315; --warn-ink: #fbc54a; --warn-bg: #2a2209;
    --serious: #f18a59; --serious-ink: #f5a47c; --serious-bg: #2b1a11;
    --crit: #e5524f; --crit-ink: #ff8a85; --crit-bg: #2c1413;
    --info-bg: #111c33; --info-ink: #9dbaff;
    --grid: #303030; --baseline: #474747;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 30px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --surface: #141414; --surface-2: #181818; --sunken: #101010;
  --ink: #f2f2f2; --ink-2: #d9d9d9; --muted: #a3a3a3; --faint: #7a7a7a;
  --line: #262626; --line-strong: #383838; --hover: #1c1c1c;
  --accent: #f2f2f2; --accent-ink: #0a0a0a; --focus: #5d90fe; --link: #8eb1ff;
  --s1: #5d90fe; --s2: #dc7708; --s3: #00b0d3; --s4: #00b34f; --s5: #a474fe; --s6: #ff5895; --s0: #555552;
  --good: #00b34f; --good-ink: #53c556; --good-bg: #0f2414;
  --warn: #fbb315; --warn-ink: #fbc54a; --warn-bg: #2a2209;
  --serious: #f18a59; --serious-ink: #f5a47c; --serious-bg: #2b1a11;
  --crit: #e5524f; --crit-ink: #ff8a85; --crit-bg: #2c1413;
  --info-bg: #111c33; --info-ink: #9dbaff;
  --grid: #303030; --baseline: #474747;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 30px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; }
p { margin: 0 0 .8em; text-wrap: pretty; }
strong, b { font-weight: 620; }
small { font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
::selection { background: #ffd60a; color: #0a0a0a; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.num, .tbl td.n, .tbl th.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.nowrap > .row, .row.nowrap { flex-wrap: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.right { text-align: right; }
.center { text-align: center; }
.mt0 { margin-top: 0 !important; } .mt1 { margin-top: 8px; } .mt2 { margin-top: 16px; } .mt3 { margin-top: 24px; } .mt4 { margin-top: 36px; }
.mb0 { margin-bottom: 0 !important; } .mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1 1 auto; min-width: 0; }
.hide-sm { }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  padding: 18px 14px 14px; background: var(--surface); border-right: 1px solid var(--line);
}
.side::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--rainbow); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; text-decoration: none; }
.brand img { height: 26px; width: auto; }
:root[data-theme="dark"] .brand img { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: invert(1); } }
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1.2; }
.proj { margin: 2px 4px 14px; padding: 12px 12px; border-radius: var(--radius-m); background: var(--sunken); border: 1px solid var(--line); }
.proj b { display: block; font-size: 13.5px; line-height: 1.25; }
.proj span { font-size: 12.5px; color: var(--muted); }
.count { display: inline-flex; align-items: baseline; gap: 4px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.count strong { font-size: 18px; letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-h { margin: 14px 10px 6px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 11px; text-decoration: none;
  color: var(--ink-2); font-size: 14.5px; font-weight: 450; transition: background-color .15s;
}
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--surface); font-weight: 560; }
.nav a[aria-current="page"] .ico { stroke: var(--surface); }
.nav a .badge-dot { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--crit-bg); color: var(--crit-ink); font-size: 12px; display: grid; place-items: center; font-weight: 600; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.side-foot .who { font-size: 13.5px; line-height: 1.2; }
.side-foot .who span { display: block; color: var(--muted); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.top .menu-btn { display: none; }
.search { position: relative; flex: 0 1 420px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 18px; height: 18px; }
.search input[type="search"] { padding-left: 38px; min-height: 40px; height: 40px; border-radius: 999px; background: var(--surface); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 11.5px "Outfit", sans-serif; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.top .spacer { flex: 1; }
.page { padding: 10px 28px 56px; max-width: 1320px; width: 100%; }
/* Tarjetas y rejillas seguidas en la página: siempre con aire entre ellas. */
.page > :is(.card, .grid) + :is(.card, .grid) { margin-top: 16px; }

/* ---------- Encabezado de página ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.ph h1 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 640; letter-spacing: -.03em; }
.ph .sub { margin-top: 6px; color: var(--muted); font-size: 14.5px; max-width: 70ch; }
.ph .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.hl { background: linear-gradient(color-mix(in srgb, var(--hl, #ffd60a) 55%, transparent), color-mix(in srgb, var(--hl, #ffd60a) 55%, transparent)) no-repeat 0 88% / 100% 36%; padding-inline: .04em; }

/* ---------- Tarjetas y rejillas ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.grid.top { align-items: start; }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-h h2, .card-h h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-h .hint { font-size: 13px; color: var(--muted); }
.card-b { padding: 16px 22px 20px; }
.card-b.flush { padding: 8px 0 6px; }
.card-f { padding: 12px 22px 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.card.tone-dark { background: #0a0a0a; color: #f2f2f2; border-color: #0a0a0a; }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 28px 0 12px; }

/* Métricas */
.stat { padding: 18px 20px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; position: relative; }
a.stat:hover { background: var(--surface-2); border-radius: var(--radius); }
.stat .lbl { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .val { font-size: 30px; font-weight: 620; letter-spacing: -.035em; line-height: 1.1; }
.stat .val small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat .cap { font-size: 13px; color: var(--muted); }
/* Las líneas entre métricas salen del hueco de 1 px sobre el color de línea; las columnas dependen de cuántas hay (sin huérfanas). */
.stats { display: grid; gap: 1px; background: var(--line); grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.stats > .stat { background: var(--surface); }
.stats:has(> .stat:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats:has(> .stat:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
section.card > .stats { border-radius: calc(var(--radius) - 1px); }
a.stat:hover { border-radius: 0; }
.delta-up { color: var(--good-ink); } .delta-down { color: var(--crit-ink); }

/* Barra de avance hacia la meta */
.meter { position: relative; height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; margin-top: 8px; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--ink); }
.meter > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); }
.meter.s1 > span { background: var(--s1); } .meter.s2 > span { background: var(--s2); } .meter.s3 > span { background: var(--s3); } .meter.s4 > span { background: var(--s4); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 14px; font-weight: 560;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .2s var(--ease), box-shadow .25s, background-color .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .6); }
.btn:active { transform: none; }
.btn .ico { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.quiet { background: transparent; color: var(--ink-2); padding-inline: 10px; }
.btn.quiet:hover { background: var(--hover); box-shadow: none; transform: none; }
.btn.danger { background: var(--crit); color: #fff; }
.btn.good { background: var(--good-ink); color: #fff; }
.btn.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.btn.lg { min-height: 52px; padding: 12px 24px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 40px; }
.btn.icon.sm { width: 32px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn.glow { position: relative; isolation: isolate; }
.btn.glow::before { content: ""; position: absolute; inset: -2px; z-index: -1; border-radius: inherit; background: var(--rainbow); filter: blur(10px); opacity: 0; transition: opacity .3s; }
.btn.glow:hover::before { opacity: .55; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }

/* ---------- Formularios ---------- */
label { font-size: 13.5px; font-weight: 520; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.fields { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.fields.one { grid-template-columns: 1fr; }
.fields .span2 { grid-column: span 2; }
.fields .full { grid-column: 1 / -1; }
input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="search"], input[type="url"], input[type="password"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 13px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; line-height: 1.5; resize: vertical; }
textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; min-height: 320px; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--ink); }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; cursor: pointer; }
.check input { margin-top: 2px; }
.inline-form { display: inline; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-height: 36px; padding-block: 6px; font-size: 14px; border-radius: 999px; }
.filters input[type="search"] { min-width: 220px; }
.filters-row { display: contents; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg > * { flex: 0 0 auto; white-space: nowrap; }
/* Pestañas sueltas en la página: bloque a su ancho, con aire abajo (se junta con el mt2 de lo que sigue). */
.page > .seg { display: flex; width: fit-content; margin-bottom: 16px; }
.seg a, .seg button { padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: 13.5px; color: var(--muted); background: none; border: 0; font: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg a[aria-current="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 560; }
.seg .ico { width: 16px; height: 16px; }

/* ---------- Tablas ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 520; font-size: 12.5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td.n, .tbl th.n { text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 22px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 22px; }
.tbl a.rowlink { text-decoration: none; font-weight: 520; }
.tbl a.rowlink:hover { text-decoration: underline; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.tbl .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.tbl.compact td { padding-block: 8px; }

/* ---------- Distintivos ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 540; line-height: 1.6; white-space: nowrap; background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); }
.badge .ico { width: 14px; height: 14px; stroke-width: 2; }
.badge.good { background: var(--good-bg); color: var(--good-ink); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.badge.serious { background: var(--serious-bg); color: var(--serious-ink); border-color: transparent; }
.badge.crit { background: var(--crit-bg); color: var(--crit-ink); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info-ink); border-color: transparent; }
.badge.dark { background: var(--ink); color: var(--surface); border-color: transparent; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; background: var(--s0); flex: 0 0 auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; text-decoration: none; color: var(--ink-2); background: var(--surface); }
a.chip:hover { border-color: var(--ink); }
.chip[aria-current="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.avatar { width: 30px; height: 30px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 640; color: #fff; background: var(--s0); flex: 0 0 auto; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.c0 { --c: var(--s1); } .c1 { --c: var(--s2); } .c2 { --c: var(--s3); } .c3 { --c: var(--s4); } .c4 { --c: var(--s5); } .c5 { --c: var(--s6); }
.avatar[class*=" c"] { background: var(--c); }
.dot[class*=" c"] { background: var(--c); }

/* ---------- Avisos ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-m); margin: 4px 0 18px; font-size: 14.5px; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { background: var(--good-bg); color: var(--good-ink); border-color: transparent; }
.flash.err { background: var(--crit-bg); color: var(--crit-ink); border-color: transparent; }
.flash.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.flash.info { background: var(--info-bg); color: var(--info-ink); border-color: transparent; }
.flash .ico { margin-top: 1px; }
.notice { padding: 14px 18px; border-radius: var(--radius-m); background: var(--sunken); border: 1px dashed var(--line-strong); color: var(--ink-2); font-size: 14px; }
.notice code, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; background: var(--sunken); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
pre { margin: 0; padding: 14px 16px; border-radius: 12px; background: #0f0f0f; color: #e8e8e8; overflow-x: auto; font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* Vacío */
.empty { padding: 36px 22px; text-align: center; color: var(--muted); }
.empty .ico { width: 30px; height: 30px; margin: 0 auto 10px; color: var(--faint); }
.empty b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 4px; }

/* ---------- Listas y línea de tiempo ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 22px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .meta { font-size: 13px; color: var(--muted); }
.list a { text-decoration: none; }
.list a:hover { text-decoration: underline; }
.timeline { list-style: none; margin: 0; padding: 4px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 33px; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 9px 22px; }
.timeline .tl-ico { width: 24px; height: 24px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); display: grid; place-items: center; position: relative; z-index: 1; color: var(--muted); }
.timeline .tl-ico .ico { width: 13px; height: 13px; stroke-width: 2.1; }
.timeline .tl-ico.good { background: var(--good-bg); border-color: transparent; color: var(--good-ink); }
.timeline .tl-ico.info { background: var(--info-bg); border-color: transparent; color: var(--info-ink); }
.timeline .tl-ico.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn-ink); }
.timeline .tl-ico.crit { background: var(--crit-bg); border-color: transparent; color: var(--crit-ink); }
.timeline .tl-t { font-size: 14px; }
.timeline .tl-m { font-size: 12.5px; color: var(--muted); }
.timeline .tl-b { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Gráficas ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font: 500 11.5px "Outfit", system-ui, sans-serif; fill: var(--muted); }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--baseline); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .bar { transition: opacity .15s; }
.chart:hover .bar { opacity: .72; }
.chart .bar:hover, .chart .bar:focus { opacity: 1; outline: none; }
.chart .xh { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .mk { stroke: var(--surface); stroke-width: 2; }
.chart .lbl-direct { font-weight: 600; fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.f1 { fill: var(--s1); } .f2 { fill: var(--s2); } .f3 { fill: var(--s3); } .f4 { fill: var(--s4); } .f5 { fill: var(--s5); } .f6 { fill: var(--s6); } .f0 { fill: var(--s0); }
.k1 { stroke: var(--s1); } .k2 { stroke: var(--s2); } .k3 { stroke: var(--s3); } .k4 { stroke: var(--s4); } .k5 { stroke: var(--s5); } .k6 { stroke: var(--s6); } .k0 { stroke: var(--s0); }
.b1 { background: var(--s1); } .b2 { background: var(--s2); } .b3 { background: var(--s3); } .b4 { background: var(--s4); } .b5 { background: var(--s5); } .b6 { background: var(--s6); } .b0 { background: var(--s0); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 0 0 10px; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .sw.line { height: 2px; width: 14px; border-radius: 2px; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; padding: 8px 11px; border-radius: 10px; background: #0a0a0a; color: #f2f2f2;
  font-size: 12.5px; line-height: 1.45; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); max-width: 260px; opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s;
}
.tip.on { opacity: 1; transform: none; }
.tip b { font-weight: 600; }
.tip .tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tip .sw { width: 8px; height: 8px; border-radius: 2px; }
details.tablev { margin-top: 10px; }
details.tablev summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.tablev summary::-webkit-details-marker { display: none; }
details.tablev summary:hover { color: var(--ink); }
details.tablev[open] summary { margin-bottom: 8px; }
details.tablev .tbl th:first-child, details.tablev .tbl td:first-child { padding-left: 0; }
/* Barras horizontales: nombre y valor arriba, barra delgada abajo (el nombre nunca se corta). */
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; align-items: baseline; gap: 6px 12px; font-size: 13.5px; }
.hbar .track { grid-area: t; position: relative; height: 12px; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .fill.ghost { opacity: .22; }
.hbar .v { grid-area: v; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; white-space: nowrap; }
.hbar .l { grid-area: l; min-width: 0; overflow-wrap: anywhere; }
.split { display: flex; height: 22px; gap: 2px; border-radius: 4px; overflow: hidden; }
.split > span { display: block; height: 100%; min-width: 3px; }
.spark { display: block; }

/* ---------- Gantt ---------- */
.gantt { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); border-top: 1px solid var(--line); }
.gantt-names { border-right: 1px solid var(--line); }
.gantt-names .gn { height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 22px; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.gantt-names .gn:hover { background: var(--surface-2); }
.gantt-names .gn.phase { font-weight: 600; font-size: 12.5px; color: var(--muted); background: var(--surface-2); }
.gantt-names .gn .clip { flex: 1; }
.gantt-names .gn.done .clip { color: var(--faint); text-decoration: line-through; }
.gantt-scroll { overflow-x: auto; }
.gantt-scroll svg { display: block; max-width: none; }
.gantt text { font: 500 11px "Outfit", sans-serif; fill: var(--muted); }
.gantt .gbar { rx: 4; }
.gantt .today { stroke: var(--focus); stroke-width: 2; }
.gantt .evday { stroke: var(--s6); stroke-width: 2; }

/* ---------- Kanban de tareas por persona ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.task-card { display: block; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; margin-bottom: 8px; }
.task-card:hover { border-color: var(--ink); }
.task-card .t { font-size: 14px; font-weight: 500; line-height: 1.35; }
.task-card .m { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Correo: vista previa ---------- */
.mail-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius-m); background: #F5EFE6; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 14px 22px 14px 62px; border-bottom: 1px solid var(--line); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 22px; top: 14px; width: 26px; height: 26px; border-radius: 99px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; }
.steps li:last-child { border-bottom: 0; }

/* Ventana de confirmación */
dialog { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 10, 10, .45); backdrop-filter: blur(2px); }
dialog .dlg { padding: 24px; }
dialog h3 { font-size: 19px; margin-bottom: 8px; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Imprimir (reporte semanal) */

/* ---------- Piezas de Ajustes, búsqueda y enlaces ---------- */
.scrim { display: none; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.notice.warn { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn-ink); }
.notice.info { background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--info-ink) 25%, transparent); color: var(--info-ink); }
.notice ul { padding-left: 18px; }
.notice ul li + li { margin-top: 4px; }
.copy-box { display: block; padding: 12px 14px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-s); max-width: 100%; overflow-x: auto; }
.copy-box code { display: block; background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; }
.input-prefix, .input-suffix { position: relative; display: flex; align-items: center; min-width: 0; }
.input-prefix > span, .input-suffix > span { position: absolute; color: var(--muted); font-size: 15px; pointer-events: none; }
.input-prefix > span { left: 13px; }
.input-prefix > input { padding-left: 28px; }
.input-suffix > span { right: 13px; }
.input-suffix > input { padding-right: 34px; }
.inline-edit { margin-top: 6px; }
.inline-edit > summary { list-style: none; display: inline-block; font-size: 13px; cursor: pointer; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.inline-edit[open] { padding: 10px 0 4px; }
.inline-edit .form-actions { margin-top: 10px; }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.ico.good { color: var(--good-ink); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.fields .wide { grid-column: 1 / -1; }
select.sm { min-height: 32px; width: auto; padding: 4px 30px 4px 10px; font-size: 13px; border-radius: 999px; background-position: right 9px center; }
.list .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.list > li > a.row { flex: 1; min-width: 0; color: inherit; flex-wrap: nowrap; }
.list > li > a.row:hover { text-decoration: none; }
.list > li > a.row:hover b { text-decoration: underline; }
.list > li > a.row .grow { min-width: 0; }
@media (max-width: 900px) { .scrim { display: block; } }

@media print {
  .side, .top, .no-print, .ph .actions { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; font-size: 12px; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ddd; }
  a { text-decoration: none; }
}

/* ---------- Pantallas chicas ---------- */
@media (max-width: 1520px) {
  .stats:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .stats:has(> .stat:nth-child(4):last-child), .stats:has(> .stat:nth-child(5):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats:has(> .stat:nth-child(5):last-child) > .stat:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: 0 0 60px rgba(0,0,0,.25); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side.open + .scrim { opacity: 1; pointer-events: auto; }
  .top { padding: 10px 16px; }
  .top .menu-btn { display: inline-flex; }
  .page { padding: 4px 16px 48px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .search kbd { display: none; }
  .hide-sm { display: none !important; }
  .card-h { padding: 16px 16px 0; }
  .card-b { padding: 14px 16px 16px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
  .list > li, .timeline li { padding-inline: 16px; }
  .timeline::before { left: 27px; }
  .gantt { grid-template-columns: 150px minmax(0, 1fr); }
  .gantt-names .gn { padding-left: 12px; }
  .fields .span2 { grid-column: auto; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .stats, .stats:has(> .stat:nth-child(3):last-child), .stats:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats:has(> .stat:nth-child(3):last-child) > .stat:last-child { grid-column: 1 / -1; }
  .stat .val { font-size: 24px; }
  .ph h1 { font-size: 24px; }
  /* Filtros y segmentos: la búsqueda arriba y lo demás en una fila que se desliza de lado (no seis renglones de filtros). */
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .filters .filters-row, .tags.slide { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 0 16px 2px; }
  .filters .filters-row::-webkit-scrollbar, .tags.slide::-webkit-scrollbar { display: none; }
  .filters .filters-row > *, .tags.slide > * { flex: 0 0 auto; }
  .filters input[type="search"] { min-width: 0; width: 100%; }
}

/* ---------- Páginas sueltas (entrar, setup) ---------- */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.solo-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 28px; position: relative; overflow: hidden; }
.solo-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--rainbow); }
.solo-card .brand { padding: 0 0 18px; }
.solo-card h1 { font-size: 24px; margin-bottom: 8px; }
.solo-card.wide { width: min(640px, 100%); }
