/* IBT ONE HEALTH · estilos de la app. Los colores y medidas base vienen de tokens.css (DS web IBT). */

:root {
  --topbar-h: 60px;
  --sidebar-w: 232px;
  --line: #e6e9f0;
  --line-strong: #d5dae4;
  --ink: #141a2b;
  --ink-2: #4a5468;
  --ink-3: #7b8498;
  --canvas: #f5f7fb;
  --hover: #f2f5fc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-2: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);

  /* Estados: neutros (el texto del label basta; sin semáforo de colores). */
  --st-neutral: #64748b; --st-neutral-bg: #f1f5f9;
  --st-borrador: var(--st-neutral); --st-borrador-bg: var(--st-neutral-bg);
  --st-porhacer: var(--st-neutral); --st-porhacer-bg: var(--st-neutral-bg);
  --st-listadev: var(--st-neutral); --st-listadev-bg: var(--st-neutral-bg);
  --st-desarrollo: var(--st-neutral); --st-desarrollo-bg: var(--st-neutral-bg);
  --st-listaqa: var(--st-neutral); --st-listaqa-bg: var(--st-neutral-bg);
  --st-qa: var(--st-neutral); --st-qa-bg: var(--st-neutral-bg);
  --st-terminada: var(--st-neutral); --st-terminada-bg: var(--st-neutral-bg);
  --st-bloqueada: var(--st-neutral); --st-bloqueada-bg: var(--st-neutral-bg);
  --st-cancelada: var(--st-neutral); --st-cancelada-bg: var(--st-neutral-bg);
  /* alias de estados viejos (por si queda CSS/markup en caché) */
  --st-pendiente: var(--st-neutral); --st-pendiente-bg: var(--st-neutral-bg);
  --st-revision: var(--st-neutral); --st-revision-bg: var(--st-neutral-bg);
  --st-observada: var(--st-neutral); --st-observada-bg: var(--st-neutral-bg);
  --st-aprobada: var(--st-neutral); --st-aprobada-bg: var(--st-neutral-bg);
  --st-pruebas: var(--st-neutral); --st-pruebas-bg: var(--st-neutral-bg);
  --bad: #64748b; --bad-bg: #f1f5f9;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 14px/1.5 var(--font, "Poppins", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.25; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ico { flex: none; display: block; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.boot, .loading { padding: 48px; text-align: center; color: var(--ink-3); }

/* ---------- skeleton (carga vistas viewer) ---------- */
@keyframes sk-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.sk-line {
  display: block;
  flex: none;
  max-width: 100%;
  background: linear-gradient(
    105deg,
    #d5dbe8 0%,
    #d5dbe8 38%,
    #eef1f7 50%,
    #d5dbe8 62%,
    #d5dbe8 100%
  );
  background-size: 220% 100%;
  animation: sk-shimmer 1.25s ease-in-out infinite;
  border-radius: 6px;
}
.sk-dot { display: block; }
/* Misma caja que .btn; sin texto ni hover */
.btn.sk-btn {
  pointer-events: none;
  cursor: default;
  color: transparent !important;
  box-shadow: none !important;
  background: linear-gradient(
    105deg,
    #d5dbe8 0%,
    #d5dbe8 38%,
    #eef1f7 50%,
    #d5dbe8 62%,
    #d5dbe8 100%
  ) !important;
  background-size: 220% 100% !important;
  animation: sk-shimmer 1.25s ease-in-out infinite;
  border-color: var(--line-strong) !important;
}
.btn.sk-btn.primary {
  border-color: #b8c4e6 !important;
  background: linear-gradient(
    105deg,
    #c5ceed 0%,
    #c5ceed 38%,
    #dde3f7 50%,
    #c5ceed 62%,
    #c5ceed 100%
  ) !important;
  background-size: 220% 100% !important;
}
.btn.sk-btn.ghost {
  border-color: transparent !important;
  background: linear-gradient(
    105deg,
    #e2e7f0 0%,
    #e2e7f0 38%,
    #f3f5fa 50%,
    #e2e7f0 62%,
    #e2e7f0 100%
  ) !important;
  background-size: 220% 100% !important;
}
.btn.sk-btn:hover { background-position: inherit; }
.sk-page { gap: 20px; pointer-events: none; }
.sk-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sk-legend-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 0; border-top: 1px solid var(--line);
}
.sk-legend li:first-child .sk-legend-row { border-top: 0; }
.sk-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.sk-list-row:first-of-type { border-top: 0; }
.sk-table-card { padding: 0; overflow: hidden; }
.sk-table-head, .sk-table-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 2.2fr) 90px 56px 72px minmax(100px, 1fr) 90px;
  align-items: center; gap: 12px; padding: 14px 18px;
}
.sk-table-head { background: #f8f9fc; border-bottom: 1px solid var(--line); }
.sk-table-row { border-bottom: 1px solid var(--line); min-height: 58px; }
.sk-table-row:last-child { border-bottom: 0; }
.sk-cell-title { min-width: 0; }
.sk-lib-cols {
  grid-template-columns: 28px minmax(0, 2fr) 80px 90px 110px;
}
.sk-roadmap-axis {
  display: flex; justify-content: space-between; padding-left: 176px; margin: 8px 0 14px;
}
.sk-roadmap-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sk-roadmap-track { flex: 1; min-width: 0; }
.sk-rm-group { margin: 10px 0 6px; opacity: .85; }
.sk-rm-legend {
  display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.sk-rm-ref { grid-column: 1 / -1; margin-top: 4px; }
.sk-bl-head, .sk-bl-row {
  display: grid;
  grid-template-columns: 16px minmax(110px, 170px) minmax(0, 1fr) 160px 72px 70px 28px 28px 150px;
  align-items: center; gap: 12px; padding: 10px 16px;
}
.sk-bl-head { background: #f8f9fc; border-bottom: 1px solid var(--line); }
.sk-bl-row { border-bottom: 1px solid #f0f2f6; min-height: 52px; }
.sk-bl-row:last-child { border-bottom: 0; }
.sk-users-head, .sk-users-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(100px, .8fr) 100px 40px;
  align-items: center; gap: 14px; padding: 14px 18px;
}
.sk-users-head { background: #f8f9fc; border-bottom: 1px solid var(--line); }
.sk-users-row { border-bottom: 1px solid var(--line); min-height: 58px; }
.sk-users-row:last-child { border-bottom: 0; }
.sk-ingresos-row {
  display: grid;
  grid-template-columns: 90px 90px minmax(0, 1.2fr) 100px minmax(0, 1fr) 100px;
  align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.sk-ingresos-row:last-child { border-bottom: 0; }
.sk-ingresos-main {
  grid-template-columns: 36px minmax(160px, 1.2fr) 90px 90px 70px 60px minmax(0, 1fr) 48px;
}
.sk-seed-head, .sk-seed-row {
  display: grid;
  grid-template-columns: 36px 100px 90px 80px minmax(140px, 1fr) minmax(100px, .8fr) minmax(160px, 1fr);
  align-items: center; gap: 12px; padding: 12px 16px;
}
.sk-seed-head { background: #f8f9fc; border-bottom: 1px solid var(--line); }
.sk-seed-row { border-bottom: 1px solid var(--line); min-height: 56px; }
.sk-seed-row:last-child { border-bottom: 0; }
.sk-comment {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.sk-comment:first-of-type { border-top: 0; }
.kcard .sk-line { max-width: 100%; }
@media (max-width: 1100px) {
  .sk-table-head, .sk-table-row {
    grid-template-columns: 28px minmax(0, 1fr) 80px 56px;
  }
  .sk-table-head > :nth-child(n+5), .sk-table-row > :nth-child(n+5) { display: none; }
  .sk-bl-head, .sk-bl-row {
    grid-template-columns: 16px minmax(90px, 140px) minmax(0, 1fr) 120px;
  }
  .sk-bl-head > :nth-child(n+5), .sk-bl-row > :nth-child(n+5) { display: none; }
  .sk-users-head, .sk-users-row {
    grid-template-columns: minmax(0, 1fr) 100px 40px;
  }
  .sk-users-head > :nth-child(2), .sk-users-head > :nth-child(3),
  .sk-users-row > :nth-child(2), .sk-users-row > :nth-child(3) { display: none; }
  .sk-ingresos-main {
    grid-template-columns: 36px minmax(0, 1fr) 90px 70px;
  }
  .sk-ingresos-main > :nth-child(n+5) { display: none; }
  .sk-seed-head, .sk-seed-row {
    grid-template-columns: 36px 100px minmax(0, 1fr) minmax(140px, 1fr);
  }
  .sk-seed-head > :nth-child(3), .sk-seed-head > :nth-child(4), .sk-seed-head > :nth-child(6),
  .sk-seed-row > :nth-child(3), .sk-seed-row > :nth-child(4), .sk-seed-row > :nth-child(6) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-line { animation: none; background: #d5dbe8; }
}

/* ---------- botones y controles ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--hover); border-color: #c3cad8; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(0, 51, 217, .25); }
.btn.primary:hover { background: #002bb8; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.solid-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-3); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.link { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; }

input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 51, 217, .12); }
input:not([type=checkbox]):not([type=radio]):disabled, select:disabled, textarea:disabled { background: #f7f8fb; color: var(--ink-2); }
select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8498' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
select:disabled { cursor: default; background-image: none; padding-right: 12px; }

.search { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 420px; }
.search .ico { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.search input[type=search] { padding-left: 38px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: #e9edf5; }
.seg button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }
.select-inline { position: relative; display: inline-flex; align-items: center; }
.select-inline .ico { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.select-inline select { padding-left: 38px; min-width: 200px; }

/* ---------- marco ---------- */
.shell { min-height: 100vh; display: grid; grid-template: var(--topbar-h) 1fr / var(--sidebar-w) 1fr; grid-template-areas: "top top" "side main"; }
.topbar {
  grid-area: top; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; width: calc(var(--sidebar-w) - 40px); }
.brand img { display: block; height: 26px; width: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; padding-left: 12px; border-left: 1px solid var(--line); }
.brand b { font-size: 13px; letter-spacing: .08em; color: var(--brand-strong, #0000a0); white-space: nowrap; }
.brand small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.project-pick { position: relative; display: flex; align-items: center; }
.project-pick > .ico:first-child { position: absolute; left: 12px; color: var(--brand); pointer-events: none; }
.project-pick > .ico:last-child { display: none; }
.project-pick select { min-width: 280px; max-width: 420px; height: 40px; padding-left: 38px; font-weight: 600; border-color: var(--line); background-color: #f7f9fd; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.user-btn:hover { background: var(--hover); }
.user-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-txt b { font-size: 13px; font-weight: 600; }
.user-txt small { font-size: 11px; color: var(--ink-3); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); z-index: 30;
}
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; }
.menu-pop button:hover { background: var(--hover); }

.sidebar {
  grid-area: side; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column; gap: 20px; padding: 18px 12px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto;
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.on { background: var(--brand-bg, rgba(0, 51, 217, .09)); color: var(--brand); font-weight: 600; }
.nav-foot { margin-top: auto; padding: 0 12px; font-size: 11px; color: var(--ink-3); }
.content { grid-area: main; min-width: 0; }

/* ---------- página ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 20px; }
.page-wide { max-width: none; }
.page-narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 320px; }
.page-head h1 { font-size: 26px; font-weight: 700; color: var(--brand-strong, #0000a0); letter-spacing: -.01em; }
.page-head p { margin-top: 4px; color: var(--ink-2); max-width: 720px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-title { font-size: 16px; font-weight: 600; }
.card-title { margin-bottom: 14px; }
.eyebrow { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.big-num { font-size: 26px; font-weight: 700; line-height: 1; color: var(--ink); white-space: nowrap; }
.big-num small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-bg, #e8eeff); color: var(--brand); margin-bottom: 6px; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--ink-2); max-width: 420px; }
.empty .btn { margin-top: 10px; }

/* ---------- piezas ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--c); background: var(--bg);
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill-select { position: relative; padding-right: 8px; cursor: pointer; gap: 6px; border: 0; }
.pill-select select {
  min-height: 0; height: 26px; width: auto; padding: 0 22px 0 0; border: 0; background-color: transparent; color: inherit;
  font-weight: 600; font-size: 12px; box-shadow: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23556' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 4px center;
}
.pill-select:focus-within, .status-dd.is-open > .pill-select { box-shadow: 0 0 0 3px rgba(0, 51, 217, .15); }
.status-dd { position: relative; display: inline-flex; }
.status-dd > .status-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 280px; max-width: min(360px, 90vw);
  max-height: min(420px, 70vh); overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, .12);
}
.status-menu { display: flex; flex-direction: column; gap: 2px; }
.status-group + .status-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.status-group-l { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 6px 10px 4px; }
.status-opt {
  display: flex; align-items: flex-start; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 10px 10px; border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink);
}
.status-opt:hover:not(:disabled) { background: #f4f6fa; }
.status-opt.is-on { background: #eef1f6; }
.status-opt:disabled { opacity: .55; cursor: default; }
.status-check { width: 18px; flex: none; display: grid; place-items: center; margin-top: 1px; color: var(--brand); }
.status-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.status-opt-text b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.status-opt-text small { font-size: 12px; color: var(--ink-3); line-height: 1.35; font-weight: 400; }
.f-field > .status-menu { border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.st-borrador { --c: var(--st-borrador); --bg: var(--st-borrador-bg); }
.st-porhacer { --c: var(--st-porhacer); --bg: var(--st-porhacer-bg); }
.st-listadev { --c: var(--st-listadev); --bg: var(--st-listadev-bg); }
.st-desarrollo { --c: var(--st-desarrollo); --bg: var(--st-desarrollo-bg); }
.st-listaqa { --c: var(--st-listaqa); --bg: var(--st-listaqa-bg); }
.st-qa { --c: var(--st-qa); --bg: var(--st-qa-bg); }
.st-terminada { --c: var(--st-terminada); --bg: var(--st-terminada-bg); }
.st-bloqueada { --c: var(--st-bloqueada); --bg: var(--st-bloqueada-bg); }
.st-cancelada { --c: var(--st-cancelada); --bg: var(--st-cancelada-bg); }
.st-bg-borrador { background: var(--st-borrador); } .st-bg-porhacer { background: var(--st-porhacer); }
.st-bg-listadev { background: var(--st-listadev); } .st-bg-desarrollo { background: var(--st-desarrollo); }
.st-bg-listaqa { background: var(--st-listaqa); } .st-bg-qa { background: var(--st-qa); }
.st-bg-terminada { background: var(--st-terminada); }
.st-bg-bloqueada { background: var(--st-bloqueada); } .st-bg-cancelada { background: var(--st-cancelada); }
.status-motivo { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fafbfd; display: flex; flex-direction: column; gap: 4px; }
.status-motivo p { margin: 0; line-height: 1.45; white-space: pre-wrap; }
.status-motivo small { color: var(--ink-3); font-size: 12px; }
.status-log { margin-bottom: 14px; }
.status-log-h { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.status-log ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.h-motivo { display: block; font-size: 12px; font-weight: 400; color: var(--ink-2); line-height: 1.4; }
.cancel-tag { background: var(--st-cancelada-bg); color: var(--st-cancelada); }
.cdlg textarea { width: 100%; margin: 8px 0 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }

.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.prio i { width: 10px; height: 10px; border-radius: 3px; }
.prio-alta i, .prio-media i, .prio-baja i { background: #94a3b8; }
.prio-none { color: var(--ink-3); }
.pts {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: #eef1f6; color: var(--ink); font-size: 12px; font-weight: 600;
}
.pts-none { color: var(--ink-3); background: transparent; border: 1px dashed var(--line-strong); }
.pts-select { width: 64px !important; min-height: 0 !important; height: 30px; padding: 0 22px 0 10px !important; font-weight: 600; text-align: center; border-radius: 999px !important; background-position: right 8px center !important; }
.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, #0033d9, #00a3e0); color: #fff; font-weight: 600; letter-spacing: .02em;
}
.avatar-empty { background: #eef1f6; color: var(--ink-3); border: 1px dashed var(--line-strong); }
.code { font-family: var(--ibt-font-family-mono, ui-monospace, monospace); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: #eef1f6; color: var(--ink-2); }
.tag-activo, .tag-futuro, .tag-cerrado, .tag-backlog { background: #f1f5f9; color: var(--ink-2); }
.blocked-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.blocked-tag.big { font-size: 12px; padding: 4px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 500; cursor: pointer;
}
.chip.on { background: var(--brand-bg, #e8eeff); border-color: transparent; color: var(--brand); }
span.chip { cursor: default; }
.bar { display: block; height: 8px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #00a3e0); }
.bar.thin { height: 6px; }

/* ---------- inicio ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi-value small { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-left: 2px; }
.kpi-foot { font-size: 12px; color: var(--ink-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stack { display: flex; height: 14px; gap: 3px; border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.stack i { min-width: 6px; }
.stack-empty { background: #eef1f6; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.legend button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.legend button:hover { background: var(--hover); }
.legend span { flex: 1; color: var(--ink-2); }
.legend b { font-size: 15px; }
.legend small { width: 40px; text-align: right; color: var(--ink-3); }
.sprint-body { display: flex; align-items: center; gap: 20px; }
.ring-bg { fill: none; stroke: #eef1f6; stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s; }
.ring text { font-size: 17px; font-weight: 700; fill: var(--ink); }
.mini-stats { margin: 0; display: grid; gap: 8px; }
.mini-stats div { display: flex; flex-direction: column; }
.mini-stats dt { font-size: 12px; color: var(--ink-3); }
.mini-stats dd { margin: 0; font-size: 17px; font-weight: 700; }
.mini-stats small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.sprint-card .btn { margin-top: 14px; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 140px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.bar-pair i { width: 40%; max-width: 22px; border-radius: 5px 5px 0 0; min-height: 2px; }
.bar-col span { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.b-plan { background: #c9d4f5; } .b-done { background: var(--brand); }
.bar-key { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.bar-key span { display: inline-flex; align-items: center; gap: 6px; }
.bar-key i { width: 10px; height: 10px; border-radius: 3px; }
.people-list, .activity, .mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.people-list li { display: flex; align-items: center; gap: 12px; }
.pl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.pl-num b { font-size: 16px; }
.pl-num small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.activity li { display: flex; gap: 10px; align-items: flex-start; }
.activity p { color: var(--ink-2); line-height: 1.45; }
.activity p b { color: var(--ink); font-weight: 600; }
.activity small { display: block; color: var(--ink-3); font-size: 11px; }
.mini-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-list .pill { flex: none; }
.mini-list button { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 0; background: none; text-align: left; padding: 0; cursor: pointer; }
.mini-list button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mini-list button:hover span:last-child { color: var(--brand); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 10px; text-align: left; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.project-card:hover { border-color: #b9c6ef; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.project-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.project-card b { font-size: 16px; }
.project-card small { color: var(--ink-3); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-card-top .icon-btn { opacity: .55; }
.project-card:hover .project-card-top .icon-btn { opacity: 1; }
.project-code { align-self: flex-start; padding: 2px 8px; border-radius: 6px; background: var(--brand-bg, #e8eeff); color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.project-new { align-items: center; justify-content: center; min-height: 150px; border-style: dashed; color: var(--brand); box-shadow: none; }

/* En línea (admin) */
.online-summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.online-summary small { color: var(--ink-3); }
.online-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .2);
}
.online-avatar { position: relative; display: inline-flex; }
.online-avatar > .online-dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border: 2px solid #fff; box-shadow: none;
}
.chip-online { background: #dcfce7; color: #166534; }
.users-tr.is-online td { background: #f7fdf9; }

/* Ingresos: detalle colapsable (IP / sistema) */
.ingresos-table .ingresos-toggle { width: 40px; }
.ingresos-chevron .ico { transition: transform .15s ease; }
.ingresos-chevron.open .ico { transform: rotate(180deg); }
.ingresos-person { cursor: pointer; }
.ingresos-client { max-width: 220px; }
.ingresos-client .linkish {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 0; background: none; padding: 0; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
}
.ingresos-client .linkish:hover { color: var(--brand); text-decoration: underline; }
.users-tr.is-open td { background: #f4f7fb; }
.ingresos-detail-row td { padding: 0 16px 16px; background: #f8fafc; border-top: 0; }
.login-detail { padding: 4px 0 4px 28px; }
.login-detail h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.login-detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
@media (max-width: 900px) { .login-detail-grid { grid-template-columns: 1fr; } }
.login-meta { display: grid; grid-template-columns: minmax(110px, 140px) 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.login-meta > div { display: contents; }
.login-meta dt { color: var(--ink-3); }
.login-meta dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.login-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.login-history li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.login-history li small { display: block; margin-top: 2px; color: var(--ink-3); overflow-wrap: anywhere; }
.login-history-block { margin-top: 16px; }

/* Semillas (historial seed) */
.seed-run-card { padding: 16px 18px; margin-bottom: 16px; }
.seed-run-card h3 { margin: 0 0 6px; font-size: 16px; }
.seed-run-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.seed-run-form input { flex: 1; min-width: 200px; }
.seed-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.seed-detail .seed-codes ul {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px;
}
.seed-detail .seed-codes li code {
  display: inline-block; padding: 2px 6px; border-radius: 6px; background: #eef1f6; font-size: 11px;
}
.seed-detail .t-actions, .users-table .t-actions { white-space: nowrap; }
.users-table .t-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* Inicio: bloques de sprint con sus historias */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.section-title { margin: 0; font-size: 18px; }
.home-sprints { display: grid; gap: 16px; margin: 8px 0 24px; }
.home-sprint { padding: 0; overflow: hidden; }
.home-sprint-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.home-sprint-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.home-sprint-title h2 { margin: 0; font-size: 16px; }
.home-sprint-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 13px; }
.home-sprint-count { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.home-sprint-empty { margin: 0; padding: 18px 16px; color: var(--ink-3); font-size: 13px; }
.home-stories { list-style: none; margin: 0; padding: 0; }
.home-story {
  display: grid; grid-template-columns: minmax(100px, 150px) minmax(0, 1fr) 150px 72px 44px auto;
  align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f0f2f6;
}
.home-story:last-child { border-bottom: 0; }
.home-story.is-blocked { box-shadow: inset 3px 0 0 var(--bad); }
.home-story-head {
  padding-top: 8px; padding-bottom: 8px; background: #f7f9fc; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.home-story-head .home-story-people { display: inline-flex; gap: 10px; justify-self: end; }
.home-story-title {
  display: flex; align-items: baseline; gap: 8px; min-width: 0; border: 0; background: none; padding: 0; text-align: left; cursor: pointer;
}
.home-story-title span { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-story-title small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-story-title:hover span { color: var(--brand); text-decoration: underline; }
.home-story-people { display: inline-flex; align-items: center; gap: 4px; }
.home-story-people .avatar + .avatar { margin-left: -4px; }
.home-closed { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.home-closed > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--ink-2); }
.home-closed[open] > summary { border-bottom: 1px solid var(--line); }
.home-closed .home-sprint { border: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
.home-closed .home-sprint:first-of-type { border-top: 0; }

@media (max-width: 900px) {
  .home-story { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) auto; }
  .home-story .prio, .home-story .pts, .home-story-people { display: none; }
}

/* ---------- backlog ---------- */
.bl-section { padding: 0; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.bl-section.sp-activo { border-color: #b9c6ef; }
.bl-section.sp-epic { border-color: #d5dbe8; }
.bl-section.sp-epic .bl-head { background: #f7f9fc; }
.bl-section.drop-over { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 51, 217, .15); }
.bl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.sp-activo .bl-head { background: #f4f7ff; }
.bl-toggle { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; }
.bl-toggle h2 { font-size: 15px; font-weight: 600; }
.chev { display: inline-flex; color: var(--ink-3); transition: transform .15s; }
.chev.closed { transform: rotate(-90deg); }
.bl-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12px; }
.bl-meta .goal { color: var(--ink-2); }
.bl-count { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.bl-actions { display: flex; align-items: center; gap: 2px; }
.bl-empty { padding: 18px 16px; color: var(--ink-3); font-size: 13px; text-align: center; }
.bl-epic-filter {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 13px; color: var(--ink-2);
}
.bl-epic-filter > span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.bl-epic-filter select {
  border: 0; background: transparent; font: inherit; font-weight: 500; color: var(--ink); max-width: 220px; cursor: pointer;
}
.bl-epic-filter.is-filtered { border-color: var(--brand); color: var(--brand); }
.bl-epic-filter.is-filtered > span, .bl-epic-filter.is-filtered select { color: var(--brand); }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 16px minmax(110px, 170px) minmax(0, 1fr) 160px 72px 70px 28px 28px 150px; align-items: center; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid #f0f2f6; background: #fff;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafbff; }
.row[draggable=true] { cursor: grab; }
.row.is-blocked { box-shadow: inset 3px 0 0 var(--bad); }
.grip { color: #c3cad8; display: flex; }
.row:hover .grip { color: var(--ink-3); }
.row .code { overflow: hidden; text-overflow: ellipsis; }
/* Código de la historia: azul y clicable, igual que el título. */
.code-link { color: var(--brand); font-weight: 600; }
button.code-link { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
button.code-link:hover, .row-title:hover span:not(.blocked-dot):not(.fresh-dot) { text-decoration: underline; }
.row-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.row-title span:not(.blocked-dot):not(.fresh-dot) { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1000 auto; min-width: 0; }
.row-title span:not(.blocked-dot):not(.fresh-dot) { flex: 0 1 auto; min-width: 0; }
.row-title:hover span:not(.blocked-dot):not(.fresh-dot) { color: var(--brand); }
.blocked-dot { color: var(--bad); align-self: center; display: inline-flex; }
.fresh-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: center;
  background: var(--brand); box-shadow: 0 0 0 3px rgba(0, 51, 217, .16);
}
.row .prio { justify-self: start; }
.row .pill-select { width: 100%; min-width: 0; }
.pill-select select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.row .move { min-height: 0; height: 30px; font-size: 12px; padding-top: 0; padding-bottom: 0; color: var(--ink-2); }
.row:not([draggable=true]) { grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 160px 72px 70px 28px 28px; }
/* Encabezado de columnas del backlog (label + filtro). */
.row.row-head { padding-top: 8px; padding-bottom: 10px; background: #f7f9fc; cursor: default; align-items: end; color: var(--ink-3); }
.row.row-head:hover { background: #f7f9fc; }
.row-head .col-h { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-head .col-h > span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.row-head .col-h select {
  width: 100%; min-width: 0; height: 26px; padding: 0 6px; font-size: 11px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 6px; background: #fff; text-transform: none; letter-spacing: 0;
}
.row-head .col-h.is-filtered select { border-color: var(--brand); color: var(--brand); }
.row-head .h-h-resp, .row-head .h-h-asig { justify-self: stretch; }
.row-head .h-h-resp select, .row-head .h-h-asig select { padding-left: 2px; padding-right: 2px; }
.sprint-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.card > .sprint-form { padding: 0; border: 0; }
.sprint-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink-2); min-width: 150px; }
.sprint-form label.grow { flex: 1 1 220px; }
.sprint-form-actions { display: flex; gap: 6px; }

/* ---------- tablero ---------- */
.kboard { display: grid; gap: 14px; align-items: start; }
.kboard.cols-4 { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.kboard.cols-3 { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
.kboard.cols-2 { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
.kcol { display: flex; flex-direction: column; min-height: 420px; border-radius: var(--radius); background: #eef1f7; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.kcol.drop-over { background: #e4eaff; border-color: var(--brand); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; position: sticky; top: var(--topbar-h); }
.kcol-head h2 { font-size: 13px; font-weight: 600; }
.kcol-head small { color: var(--ink-3); font-size: 12px; }
.kcol-n { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.kcol-body { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; }
.kcol-empty { padding: 24px 8px; text-align: center; color: var(--ink-3); font-size: 12px; border: 1px dashed #cfd6e4; border-radius: 10px; }
.kcard {
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-1); cursor: grab; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.kcard:hover { box-shadow: var(--shadow-2); border-color: #cdd6ec; }
.kcard.dragging { opacity: .5; transform: rotate(1deg); }
.kcard.is-blocked { border-left: 3px solid var(--line-strong); }
.kcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kcard-title { font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kcard-epic { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-foot { display: flex; align-items: center; gap: 8px; }
.kcard-c { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.kcard-people { display: inline-flex; align-items: center; gap: 4px; }
.kcard-people .avatar + .avatar { margin-left: -6px; }

/* ---------- ficha (página de la historia) ---------- */
.ficha-page { gap: 16px; }
.ficha-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ficha-bar .back { margin-left: -12px; }
.crumbs { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.crumbs b { color: var(--ink-2); font-family: var(--ibt-font-family-mono, monospace); font-weight: 600; }
.crumbs .crumb-copy { width: 26px; height: 26px; color: var(--ink-3); }
.crumbs .crumb-copy:hover { color: var(--brand); }
.ficha-titlebar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.f-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; margin-bottom: 6px; }
.ficha-titlebar .f-label { flex: 1 0 100%; margin-bottom: 0; }
.ficha-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; flex: 1; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.ficha-title.editable:hover { background: var(--hover); cursor: text; }
.title-input, .desc-input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; box-shadow: none;
}
.title-input {
  font-size: 22px !important; font-weight: 700; flex: 1 1 100%; min-height: 48px;
}
.desc-field { display: flex; flex-direction: column; gap: 0; }
.desc-input {
  font-family: var(--ibt-font-family-mono, ui-monospace, monospace); font-size: 13px; font-weight: 400;
  line-height: 1.55; min-height: 280px; resize: vertical;
}
.desc-input:focus, .title-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 51, 217, .12); }
.desc-view { padding: 2px 0; }
.ficha-titlebar:has(.title-input) .blocked-tag { margin-top: 8px; }
.ficha-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.ficha-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ficha-main, .ficha-comments { display: flex; flex-direction: column; gap: 28px; min-width: 0; padding: 24px 28px; }
.ficha-comments { gap: 0; }
.f-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.f-sec-head h2 { font-size: 15px; font-weight: 600; }
.f-sec-head .btn { margin-left: auto; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: #eef1f6; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.md { color: var(--ink); line-height: 1.65; font-size: 14px; }
.md .md-h {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-strong, #0000a0); margin: 22px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.md .md-h:first-child { margin-top: 0; }
.md .md-h3 { font-size: 13px; letter-spacing: .04em; border-bottom: 0; padding-bottom: 0; }
.md .md-h4 {
  font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 650;
  color: var(--ink); border-bottom: 0; padding-bottom: 0; margin: 18px 0 8px;
}
.md .md-hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md .md-quote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--brand-strong, #0000a0);
  background: #f7f8fc;
  color: var(--ink-2);
}
.md-table-wrap { overflow-x: auto; margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 8px; }
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th, .md-table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.md-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: #fafbfd;
}
.md-table tr:last-child td { border-bottom: 0; }
.md-table td:first-child { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 1.25em; }
.md li { margin: 4px 0; }
.md li + li { margin-top: 6px; }
.md strong { font-weight: 650; color: var(--ink); }
.md a.md-toc {
  display: inline-flex; align-items: center; gap: 4px; margin: 8px 0 4px;
  padding: 4px 10px; border-radius: 999px; background: #f0f3f9; color: var(--ink-2);
  font-size: 12px; font-weight: 500; text-decoration: none;
}
.md a.md-toc:hover { background: #e6ebf5; color: var(--brand); }
.md-gherkin {
  display: inline-block; min-width: 4.6em; margin-right: 2px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--brand-strong, #0000a0);
}
.md-gherkin-cuando { color: #0f6a4c; }
.md-gherkin-entonces { color: #8a4b00; }
.md-ca-title {
  display: inline-block; margin: 2px 0 4px; padding: 2px 0;
  font-size: 13px; font-weight: 700; letter-spacing: 0; color: var(--ink);
}
.md p:has(> .md-ca-title) {
  margin: 14px 0 0; padding: 10px 14px 6px;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0;
  background: #f7f9fc;
}
.md p:has(> .md-ca-title) + ul {
  list-style: none; margin: 0 0 12px; padding: 2px 14px 12px;
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px;
  background: #fbfcfe;
}
.md p:has(> .md-ca-title) + ul > li { margin: 5px 0; padding: 0; }
.md-tasks { list-style: none; padding-left: 0; display: grid; gap: 6px; margin: 8px 0 14px; }
.md-task {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  padding: 8px 12px; border-radius: 8px; background: #f7f9fc; border: 1px solid var(--line);
  list-style: none;
}
.md-task .md-check {
  flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: 4px; background: #fff;
  font-size: 11px; line-height: 1; color: var(--st-aprobada, #0f6a4c);
}
.md-task.is-done .md-check { border-color: var(--st-aprobada, #0f6a4c); background: #e8f6ef; }
.md-task.is-done .md-task-txt { color: var(--ink-2); text-decoration: line-through; text-decoration-color: #c5ccd8; }
.md-task-txt { flex: 1; min-width: 0; }
.md-crit { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; counter-reset: md-crit; }
.md-crit > li {
  counter-increment: md-crit; display: grid; grid-template-columns: 28px 1fr; gap: 10px;
  margin: 0; padding: 10px 12px; border-radius: 10px; background: #f7f9fc; border: 1px solid var(--line);
  list-style: none;
}
.md-crit > li::before {
  content: counter(md-crit); display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--brand);
}
.md-gherkin-line { line-height: 1.55; }
.md-gherkin-sep { color: var(--ink-3); }
.md pre { background: #f6f8fb; padding: 12px; border-radius: 8px; overflow: auto; }
.md-mermaid {
  margin: 12px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; overflow-x: auto;
}
.md-mermaid-host svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.md-mermaid-err { margin: 0 0 8px; font-size: 12px; color: #b45309; }
.md-platform-locus {
  margin: 12px 0 16px; padding: 12px 14px; border: 1px solid #c7d2fe; border-radius: 10px;
  background: #f5f7ff;
}
.md-ref-kind-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.md-ref-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; text-transform: lowercase;
}
.md-ref-chip-platform { background: #e0e7ff; color: #3730a3; }
.md-platform-locus-title { font-weight: 600; color: var(--ink-1, #0f172a); }
.md-platform-locus-hint { margin: 0 0 10px; font-size: 12px; color: var(--ink-3); }
.md-platform-locus-dl { margin: 0; display: grid; gap: 6px; }
.md-platform-locus-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 13px; }
.md-platform-locus-row dt { margin: 0; font-weight: 600; color: var(--ink-2); }
.md-platform-locus-row dd { margin: 0; color: var(--ink-1); word-break: break-word; }
.md-platform-locus-links { margin: 10px 0 0; font-size: 13px; }
.md-img { display: block; max-width: 100%; height: auto; margin: 10px 0; border-radius: 8px; border: 1px solid var(--line); }
.md-img.is-clickable { cursor: zoom-in; }
/* PMO-028: listado y ficha de casos de uso */
.cu-list .row { grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) 110px; }
.cu-list .row > .muted { justify-self: end; text-align: right; }
.cu-meta-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; width: 100%; margin-top: 8px; }
.page-actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px;
  margin-left: 6px; border-radius: 999px; background: var(--brand-bg, rgba(0, 51, 217, .12));
  color: var(--brand); font-size: 11px; font-weight: 700;
}
.cu-import-result { margin-bottom: 16px; }
.imp-unchanged { background: #f0f2f6; color: var(--ink-2); }
/* PMO-030: códigos clicables y relaciones CU ↔ HU */
button.md-code-link {
  border: 0; background: none; padding: 0; margin: 0;
  font: inherit; font-family: var(--ibt-font-family-mono, monospace);
  font-weight: 600; color: var(--brand); cursor: pointer;
}
button.md-code-link:hover { text-decoration: underline; }
button.md-code-link code { font: inherit; color: inherit; background: transparent; padding: 0; }
.md-code-missing {
  font-family: var(--ibt-font-family-mono, monospace); font-weight: 600;
  color: var(--ink-3); border-bottom: 1px dashed var(--line-strong);
}
.f-related { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.f-related-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.f-related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.f-related li { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.f-related-title { font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-cu-codes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* PMO-031: informe de migración + checklist uno a uno */
.cu-import-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cu-import-head .card-title { margin: 0; }
.cu-validation { margin: 12px 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbff; }
.cu-check-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.cu-check-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.cu-check-list li.is-ok { color: var(--st-aprobada, #0a7a3e); }
.cu-check-list li.is-warn { color: var(--ink-3); }
.cu-pending { margin-bottom: 16px; }
.cu-pending-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cu-pending-head .card-title { margin: 0 0 4px; }
.cu-pending-head p { margin: 0; max-width: 52rem; }
.cu-pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cu-pick { border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, background .15s; }
.cu-pick.is-selected { border-color: var(--brand); background: var(--brand-bg, rgba(0, 51, 217, .06)); }
.cu-pick.is-done:not(.is-selected) { background: #f7faf8; }
.cu-pick-label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.cu-pick-label input { flex: none; accent-color: var(--brand); }
.cu-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cu-pick-main b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-pick-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-pending-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.md-editor textarea { font-family: var(--ibt-font-family-mono, monospace); font-size: 13px; }
.desc-field .hint { margin-top: 8px; }
.hint { font-size: 12px; color: var(--ink-3); }
.row-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.crit { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.crit li { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; background: #f7f9fc; line-height: 1.5; }
.crit .ico { color: var(--st-aprobada); margin-top: 2px; }
.files { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.thumb { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #f1f4f9; color: var(--ink-3); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; text-decoration: none; }
.attach-add { display: flex; gap: 8px; align-items: center; }
.attach-add input { flex: 1; }
.media-hint { margin: -4px 0 12px; }
.media-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fafbfd; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.media-tile { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.media-preview { display: grid; place-items: center; aspect-ratio: 1; width: 100%; background: #eef1f6; color: var(--ink-3); text-decoration: none; overflow: hidden; padding: 8px; text-align: center; gap: 6px; position: relative; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-preview span { font-size: 11px; line-height: 1.3; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.media-file, .media-video { background: #f1f4f9; }
.media-badge {
  position: absolute; top: 6px; left: 6px; padding: 2px 6px; border-radius: 999px;
  background: rgba(15, 23, 42, .78); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.media-open {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: inherit; font: inherit; color: inherit;
}
.media-open:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.media-meta { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-top: 1px solid var(--line); background: #fff; }
.media-meta .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.media-meta .media-action { color: var(--ink-2); }
.media-meta .media-action:hover:not(:disabled) { color: var(--brand); background: var(--hover); }

/* Visualizador multimedia (lightbox) */
.mv-scrim {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: 18px; background: rgba(15, 23, 42, .72); backdrop-filter: blur(2px);
}
.mv-panel {
  width: min(1100px, 100%); height: min(88vh, 900px); display: flex; flex-direction: column;
  background: #0b1220; color: #e8eefc; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-2);
}
.mv-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); background: #111827;
}
.mv-title { min-width: 0; flex: 1; display: grid; gap: 2px; }
.mv-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mv-title small { color: #9aa6bf; font-size: 12px; }
.mv-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.mv-actions .btn { color: #e8eefc; border-color: transparent; }
.mv-actions .btn:hover { background: rgba(255,255,255,.08); }
.mv-stage { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 44px 1fr 44px; align-items: stretch; }
/* Columna fija: si no hay flecha prev/next el body no debe caer en el riel de 44px. */
.mv-body {
  grid-column: 2; min-width: 0; min-height: 0; overflow: auto;
  display: flex; align-items: stretch; justify-content: center; padding: 12px; background: #0b1220;
}
.mv-nav {
  border: 0; background: transparent; color: #c7d2e8; cursor: pointer; display: grid; place-items: center;
}
.mv-nav.prev { grid-column: 1; }
.mv-nav.next { grid-column: 3; }
.mv-nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.mv-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; margin: auto; }
.mv-video { width: min(100%, 960px); max-height: 100%; background: #000; border-radius: 8px; margin: auto; }
.mv-audio { width: min(480px, 100%); text-align: center; color: #c7d2e8; margin: auto; }
.mv-audio audio { width: 100%; margin-bottom: 10px; }
.mv-frame { width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; border-radius: 8px; align-self: stretch; }
.mv-docx, .mv-text {
  box-sizing: border-box; width: 100%; max-width: 900px; min-width: 0; align-self: stretch;
  overflow: auto; padding: 24px 28px; border-radius: 10px;
  background: #fff; color: #111827; text-align: left; line-height: 1.55;
}
.mv-docx h1, .mv-docx h2, .mv-docx h3 { margin: 0.8em 0 0.35em; }
.mv-docx p { margin: 0.45em 0; }
.mv-docx img { max-width: 100%; height: auto; }
.mv-text { font-family: var(--ibt-font-family-mono, ui-monospace, monospace); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.mv-empty { display: grid; gap: 10px; place-items: center; text-align: center; color: #c7d2e8; padding: 24px; margin: auto; }
.mv-empty .muted { color: #9aa6bf; }
@media (max-width: 720px) {
  .mv-stage { grid-template-columns: 1fr; }
  .mv-body { grid-column: 1; }
  .mv-nav { display: none; }
  .mv-panel { height: min(92vh, 100%); }
}
.media-id { flex: 1; min-width: 0; font: inherit; font-family: var(--ibt-font-family-mono, monospace); font-size: 10px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.media-id:hover { color: var(--brand); }
.media-meta .icon-btn { width: 26px; height: 26px; flex: none; }
.media-add { border: 2px dashed #c3cde6; background: #f8faff; color: var(--brand); cursor: pointer; align-items: center; justify-content: center; gap: 6px; min-height: 112px; padding: 12px; font: inherit; }
.media-add:hover:not(:disabled) { border-color: var(--brand); background: #f0f4ff; }
.media-add:disabled { opacity: .6; cursor: wait; }
.media-add span { font-size: 12px; font-weight: 600; }
.media-add.media-link { color: var(--ink-2); border-style: solid; background: #fff; }
.media-badge-lib { top: auto; bottom: 6px; left: 6px; background: var(--brand); }
.media-badge-text { top: auto; bottom: 6px; left: 6px; background: #c2410c; }
.media-badge-missing { top: auto; bottom: 6px; left: 6px; background: #64748b; }
.media-tile.is-missing { opacity: .55; }
.media-url { margin-top: 10px; }

/* Picker de assets en la ficha */
.asset-picker {
  margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; gap: 10px;
}
.asset-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-picker input[type="search"] { width: 100%; }
.asset-picker-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; display: grid; gap: 4px; }
.asset-pick-row {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border: 0; border-radius: 8px; background: #f7f9fc; text-align: left; cursor: pointer; font: inherit;
}
.asset-pick-row:hover { background: var(--brand-bg, #e8eeff); }
.asset-pick-name { font-weight: 600; color: var(--ink); }
.asset-pick-row small { color: var(--ink-3); }

/* Referencias (assets del proyecto) */
.lib-drop { margin-bottom: 16px; }
.lib-hint { margin: 0 0 14px; max-width: 820px; }
.lib-toolbar { flex-wrap: wrap; }
.lib-kpis { margin-bottom: 16px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .kpis-3 { grid-template-columns: 1fr; } }
.lib-title-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.lib-title-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-edit-title { width: 26px; height: 26px; flex: none; opacity: .55; }
.lib-title-row:hover .lib-edit-title, .lib-edit-title:focus-visible { opacity: 1; }
.lib-title-input { width: 100%; font: inherit; font-weight: 600; padding: 4px 8px; }
.nav-count {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--brand-bg, #e8eeff); color: var(--brand);
}
.nav-item.on .nav-count { background: rgba(255,255,255,.85); }
.lib-table-wrap { padding: 0; overflow: auto; }
.lib-bulk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f3f6fc;
  font-size: 13px; color: var(--ink-2);
}
.lib-bulk .btn { margin-left: 0; }
.lib-bulk .btn.danger { margin-left: auto; }
.lib-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lib-table th, .lib-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lib-table th {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); background: #f7f9fc; white-space: nowrap;
}
.lib-table tr:last-child td { border-bottom: 0; }
.lib-table tr.is-orphan td { opacity: .85; }
.lib-table tr.is-selected td { background: #eef3ff; }
.lib-table tr.is-selected.is-orphan td { opacity: 1; }
.lib-check-col { width: 36px; padding-left: 14px !important; padding-right: 4px !important; }
.lib-check {
  width: 16px; height: 16px; margin: 0; accent-color: var(--brand);
  cursor: pointer; vertical-align: middle;
}
.lib-file-cell { min-width: 160px; max-width: 280px; }
.lib-file-cell b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-file-cell small { color: var(--ink-3); font-size: 11px; }
.lib-type {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: #f1f5f9; color: var(--ink-2); white-space: nowrap;
}
.lib-type-docx { background: #dbeafe; color: #1d4ed8; }
.lib-type-pdf { background: #fee2e2; color: #b91c1c; }
.lib-type-image { background: #dcfce7; color: #15803d; }
.lib-type-video { background: #f3e8ff; color: #7e22ce; }
.lib-ref {
  display: inline-flex; align-items: center; gap: 4px; max-width: 260px;
  border: 0; background: #f0f4ff; color: var(--brand); font: inherit; font-size: 11px; font-weight: 600;
  font-family: var(--ibt-font-family-mono, ui-monospace, monospace); padding: 3px 8px; border-radius: 6px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lib-ref:hover { background: var(--brand); color: #fff; }
.tag-ok { background: var(--ok-bg, #ccfbf1); color: var(--ok, #0f766e); }
.tag-mute { background: #f1f5f9; color: var(--ink-3); }
.lib-hu-cell { min-width: 140px; max-width: 280px; }
.lib-hu-wrap { display: grid; gap: 6px; }
.lib-hu-n { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.lib-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lib-hu {
  border: 0; background: var(--brand-bg, #e8eeff); color: var(--brand); font: inherit; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; cursor: pointer; letter-spacing: .02em;
}
.lib-hu.via-text { background: #fff7ed; color: #c2410c; }
.lib-hu.via-both { background: #ecfdf5; color: #047857; }
.lib-hu:hover { background: var(--brand); color: #fff; }
.lib-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.md-asset {
  color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
  word-break: break-all;
}
.md-asset:hover { color: var(--brand-strong, #0000a0); }
@media (max-width: 900px) {
  .lib-table th:nth-child(4), .lib-table td:nth-child(4) { max-width: 140px; }
}

.comment-new { display: flex; gap: 12px; margin-bottom: 18px; }
.comment-new.comment-reply { margin: 10px 0 4px; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.comments > .c-thread { display: block; }
.c-thread-list, .c-replies > ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.c-thread-list > li, .c-replies > ul > li { display: flex; gap: 12px; }
.c-replies { margin: 0; padding: 4px 0 0 20px; border-left: 2px solid var(--line); margin-left: 15px; }
.c-body { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: center; gap: 8px; }
.c-head small { color: var(--ink-3); font-size: 12px; }
.c-head .icon-btn { margin-left: auto; width: 26px; height: 26px; opacity: 0; }
.c-thread-list > li:hover .c-head .icon-btn,
.c-replies > ul > li:hover .c-head .icon-btn { opacity: 1; }
.c-compose-tabs {
  display: inline-flex; gap: 2px; margin-bottom: 8px; padding: 2px;
  border: 1px solid var(--line); border-radius: 8px; background: #f4f6fa;
}
.c-compose-tabs button {
  border: 0; background: transparent; color: var(--ink-3); font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
}
.c-compose-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.c-compose-input {
  width: 100%; min-height: 88px; resize: vertical; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; line-height: 1.5;
  background: #fff; color: var(--ink);
}
.c-compose-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 51, 217, .12); }
.c-md {
  margin-top: 4px; padding: 10px 14px; border-radius: 4px 12px 12px 12px; background: #f4f6fa; line-height: 1.55;
}
.c-md .md { font-size: 14px; }
.c-md .md > :first-child { margin-top: 0; }
.c-md .md > :last-child { margin-bottom: 0; }
.c-md-preview {
  min-height: 88px; border: 1px dashed #c3cad8; background: #fafbfd;
}
.c-actions { margin-top: 6px; }
.c-reply-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.c-attach-preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.c-attach-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px;
}
.c-attach-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; background: #eef1f6; }
.c-attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.c-attach-chip .icon-btn { width: 22px; height: 22px; flex: none; }
.c-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.c-media.compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.c-media-item {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
  text-decoration: none; color: inherit;
}
.c-media-open {
  display: block; width: 100%; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit;
}
.c-media-open:disabled { cursor: default; opacity: .55; }
.c-media-img .c-media-open { aspect-ratio: 1; background: #eef1f6; }
.c-media-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-media-file-inner {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; min-height: 48px; color: var(--ink-2); font-size: 13px;
}
.c-media-file-inner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.c-media-kind {
  flex: none; font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 6px; border-radius: 99px; background: #eef1f6; color: var(--ink-3); text-transform: uppercase;
}
.c-media-actions {
  display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-top: 1px solid var(--line); background: #fafbfd;
}
.c-media-actions .icon-btn { width: 28px; height: 28px; }
.history summary { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; color: var(--ink-2); list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.h-timeline { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.h-tl-item {
  position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px;
  padding: 0 0 18px; font-size: 13px;
}
.h-tl-item:last-child { padding-bottom: 2px; }
.h-tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 2px; background: var(--line);
}
.h-tl-dot {
  width: 12px; height: 12px; margin-top: 3px; border-radius: 50%; background: var(--brand);
  border: 2px solid #fff; box-shadow: 0 0 0 2px #c5cee0; z-index: 1; flex: none;
}
.h-tl-status .h-tl-dot { background: var(--brand); }
.h-tl-edit .h-tl-dot { background: #64748b; }
.h-tl-seed .h-tl-dot { background: #0d9488; }
.chip-seed { margin-left: 6px; background: #ccfbf1; color: #0f766e; font-size: 11px; vertical-align: middle; }
.h-who .chip-seed { font-weight: 600; }
.h-tl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.h-who { font-weight: 600; }
.h-what { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink-2); }
.h-summary { display: inline; }
.h-line { font-size: 12px; }
.h-diff { margin-top: 2px; }
.h-diff > summary {
  cursor: pointer; display: inline; font-size: 12px; font-weight: 500; color: var(--brand);
  padding: 0; list-style: none; text-decoration: underline; text-underline-offset: 2px;
}
.h-diff > summary::-webkit-details-marker { display: none; }
.h-diff[open] > summary { display: inline-block; margin-bottom: 6px; }
.h-diff-lines {
  border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; overflow: auto; max-height: 280px;
  font-family: var(--ibt-font-family-mono, ui-monospace, monospace); font-size: 11px; line-height: 1.45;
}
.h-dl { display: flex; gap: 8px; padding: 1px 8px; white-space: pre-wrap; word-break: break-word; }
.h-dl-mark { flex: none; width: 1ch; font-weight: 700; user-select: none; }
.h-dl-same { color: var(--ink-3); }
.h-dl-add { background: #ecfdf5; color: #166534; }
.h-dl-add .h-dl-mark { color: #15803d; }
.h-dl-del { background: #fef2f2; color: #991b1b; }
.h-dl-del .h-dl-mark { color: #b91c1c; }
.h-diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.h-diff-l { display: block; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.h-diff pre {
  margin: 0; padding: 8px; border-radius: 6px; background: #fff; border: 1px solid var(--line);
  font-size: 11px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
}
.history small { color: var(--ink-3); font-size: 11px; }
@media (max-width: 700px) {
  .h-diff-grid { grid-template-columns: 1fr; }
}
.f-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1); }
.f-field { display: flex; flex-direction: column; gap: 6px; }
.f-field > span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.f-field .pill-select { align-self: flex-start; height: 32px; padding-left: 12px; }
.f-field .pill-select select { height: 32px; font-size: 13px; }
.f-field:has(> .status-menu) { grid-column: 1 / -1; }
.f-field .pts-select { width: 90px !important; border-radius: var(--radius-sm) !important; height: 38px; }
.f-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.f-check input { margin-top: 4px; accent-color: var(--bad); }
.f-check span { display: flex; flex-direction: column; }
.f-check small { color: var(--ink-3); font-size: 12px; }
.f-meta { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.f-meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.f-meta dt { color: var(--ink-3); }
.f-meta dd { margin: 0; text-align: right; color: var(--ink-2); }
.f-value { min-height: 24px; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.f-value.empty-v { color: var(--ink-3); font-weight: 400; }
.f-side > .btn.danger { align-self: flex-start; }

/* ---------- formularios ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form > label, .form fieldset { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.form label small { font-weight: 400; color: var(--ink-3); }
.form .full { grid-column: 1 / -1; }
.form > p { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; padding-top: 4px; }
.roles { border: 0; padding: 0; margin: 0; display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.roles legend { padding: 0; margin-bottom: 6px; }
.role-opt { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.role-opt.on { border-color: var(--brand); background: #f4f7ff; box-shadow: 0 0 0 1px var(--brand); }
.role-opt input { accent-color: var(--brand); margin-top: 3px; }
.role-opt span { display: flex; flex-direction: column; }
.role-opt b { color: var(--ink); }
.role-opt small { font-weight: 400; color: var(--ink-3); }

/* ---------- usuarios y perfil ---------- */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.role-card { display: flex; flex-direction: column; padding: 16px 18px; }
.role-card b { font-size: 26px; line-height: 1.1; }
.role-card span { font-weight: 600; }
.role-card small { color: var(--ink-3); }
.users-table-card { width: 100%; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th,
.users-table td { vertical-align: middle; }
.users-tr { cursor: pointer; }
.users-tr:hover td { background: var(--hover); }
/* No poner display:flex en el td: rompe el borde de la fila. */
.users-tr .t-actions {
  width: 56px;
  text-align: center;
  white-space: nowrap;
  display: table-cell;
}
.users-tr .t-actions .icon-btn {
  vertical-align: middle;
  color: var(--bad);
  opacity: .85;
}
.users-tr .t-actions .icon-btn:hover,
.users-tr .t-actions .icon-btn:focus-visible {
  opacity: 1; color: var(--bad); background: var(--bad-bg);
}
.users-tr .t-actions .icon-btn:disabled {
  opacity: .35; cursor: not-allowed; color: var(--ink-3);
}
.icon-btn.danger { color: var(--bad); }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }
.user-detail-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.user-detail-block-head .card-title { margin: 0; }
.chip.role-admin { background: #eef0ff; color: var(--brand); }
.chip.role-editor { background: #e8f7ef; color: #0f7a45; }
.chip.role-viewer { background: #f1f4f9; color: var(--ink-2); }
.chip.warn { background: var(--bad-bg, #fdecea); color: var(--bad, #c0392b); }
.user-detail-head { display: flex; align-items: center; gap: 18px; }
.user-detail-head h2 { font-size: 20px; margin: 0 0 2px; }
.user-detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.user-detail-block { margin-top: 14px; }
.user-detail-block .card-title { margin-bottom: 8px; }
.user-detail-block .muted.small { margin: 0 0 12px; }
.roles-inline { margin-top: 4px; }
.user-dl { display: grid; gap: 10px; margin: 0; }
.user-dl div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: baseline; font-size: 14px; }
.user-dl dt { color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.user-dl dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.user-dl code { font-size: 13px; background: #f1f4f9; padding: 2px 6px; border-radius: 4px; }
.users-empty { padding: 24px; }
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 12px 16px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td select { width: 130px; }
.person { display: flex; align-items: center; gap: 12px; }
.person div { display: flex; flex-direction: column; min-width: 0; }
.person small { color: var(--ink-3); font-size: 12px; }
.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-head h2 { font-size: 20px; }
.profile-head .chips { margin-top: 8px; }
.avatar-btn { position: relative; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; }
.avatar-btn span { position: absolute; inset: auto 0 0; padding: 2px 0; border-radius: 0 0 36px 36px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 10px; opacity: 0; transition: opacity .15s; }
.avatar-btn:hover span { opacity: 1; }

/* ---------- cargar word ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 24px; text-align: center; border: 2px dashed #c3cde6; box-shadow: none; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.is-drag { border-color: var(--brand); background: #f4f7ff; }
.drop.is-busy { opacity: .6; cursor: progress; }
.drop-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-bg, #e8eeff); color: var(--brand); margin-bottom: 6px; }
.drop b { font-size: 16px; }
.drop span { color: var(--ink-2); }
.drop small { color: var(--ink-3); }
.imp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.imp-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.imp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.imp-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-main small { color: var(--ink-3); font-size: 12px; }
.imp-created { background: var(--st-aprobada-bg); color: var(--st-aprobada); }
.imp-updated { background: var(--st-revision-bg); color: var(--brand); }
.imp-failed { background: var(--bad-bg); color: var(--bad); }

/* ---------- landing ---------- */
.lp { min-height: 100vh; background: #fff; }
.lp-logo { display: inline-flex; align-items: center; gap: 12px; }
.lp-logo img { display: block; width: auto; }
.lp-logo span { padding-left: 12px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--brand-strong, #0000a0); }
.lp-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; height: 68px; padding: 0 max(24px, calc((100% - 1180px) / 2)); background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.btn.big { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 10px; }
.lp-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 72px max(24px, calc((100% - 1180px) / 2)) 80px;
  background: radial-gradient(900px 500px at 0% 0%, rgba(0, 196, 255, .14), transparent 60%), radial-gradient(900px 600px at 100% 100%, rgba(0, 51, 217, .12), transparent 60%), #fff;
}
.lp-kicker { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--brand-bg, #e8eeff); color: var(--brand); font-size: 12px; font-weight: 600; margin-bottom: 18px; }
.lp-hero h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -.03em; color: var(--brand-strong, #0000a0); }
.lp-hero p { margin-top: 18px; font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 540px; }
.lp-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.lp-preview { padding: 18px; border-radius: 20px; background: linear-gradient(135deg, #0033d9, #0000a0); box-shadow: 0 30px 60px rgba(0, 0, 160, .25); transform: rotate(-1.5deg); }
.lp-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px; border-radius: 14px; background: #eef1f7; }
.lp-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lp-col .pill { font-size: 10px; height: 22px; padding: 0 8px; overflow: hidden; }
.lp-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 8px; background: #fff; box-shadow: var(--shadow-1); }
.lp-card i { display: block; height: 6px; border-radius: 4px; background: #e2e7f1; }
.lp-card i:first-child { width: 45%; background: #c9d4f5; }
.lp-card b { display: block; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, #0033d9, #00a3e0); align-self: flex-end; }
.lp-sec { padding: 72px max(24px, calc((100% - 1180px) / 2)) 0; }
.lp-sec h2, .lp-band h2 { font-size: 28px; letter-spacing: -.02em; color: var(--brand-strong, #0000a0); }
.lp-sub { margin-top: 6px; color: var(--ink-2); font-size: 16px; }
.lp-etapas { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.lp-etapa { padding: 28px; }
.lp-etapa h3 { font-size: 22px; }
.lp-etapa p { margin-top: 6px; color: var(--ink-2); }
.lp-states { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.lp-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 28px; }
.lp-feature { padding: 24px; border-radius: var(--radius); background: #f7f9fd; }
.lp-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--brand); box-shadow: var(--shadow-1); margin-bottom: 14px; }
.lp-feature h3 { font-size: 16px; }
.lp-feature p { margin-top: 6px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.lp-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 72px max(24px, calc((100% - 1180px) / 2)) 0; padding: 36px 40px; border-radius: 20px; background: linear-gradient(135deg, #0033d9, #0000a0); color: #fff; }
.lp-band h2 { color: #fff; }
.lp-band p { margin-top: 6px; color: rgba(255, 255, 255, .85); }
.lp-band .btn { background: #fff; color: var(--brand); border-color: #fff; }
.lp-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 40px max(24px, calc((100% - 1180px) / 2)); margin-top: 72px; border-top: 1px solid var(--line); font-size: 13px; }

/* ---------- inicio de sesión ---------- */
.ap { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; background: #fff; }
.ap-side {
  position: relative; display: flex; flex-direction: column; padding: 32px 48px; color: #fff; overflow: hidden;
  background: radial-gradient(600px 400px at 0% 100%, rgba(0, 196, 255, .35), transparent 60%), linear-gradient(160deg, #0033d9 0%, #0000a0 100%);
}
.ap-side::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); }
.ap-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 500; cursor: pointer; }
.ap-back:hover { background: rgba(255, 255, 255, .2); }
.flip { display: inline-flex; transform: scaleX(-1); }
.ap-side-txt { margin: auto 0; max-width: 440px; position: relative; z-index: 1; }
.ap-side .lp-logo { padding: 10px 14px; border-radius: 12px; background: #fff; }
.ap-side h2 { margin-top: 32px; color: #fff; font-size: 32px; line-height: 1.15; letter-spacing: -.02em; }
.ap-side ul { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.ap-side li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .9); }
.ap-side li .ico { flex: none; padding: 3px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.ap-main { display: grid; place-items: center; padding: 32px 24px; background: var(--canvas); }
.ap-card { width: min(420px, 100%); }
.ap-card h1 { font-size: 30px; letter-spacing: -.02em; color: var(--brand-strong, #0000a0); }
.ap-sub { margin: 8px 0 24px; color: var(--ink-2); }
.ap-card form { display: flex; flex-direction: column; }
.ap-card label { font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
.ap-card form > label:first-child { margin-top: 0; }
.ap-card input:not([type=checkbox]) { height: 46px; background: #fff; }
.ap-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ap-two > div { display: flex; flex-direction: column; }
.ap .pw { position: relative; }
.ap .pw input { padding-right: 80px; }
.ap .pw .show { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: #eef1f6; font-size: 12px; font-weight: 600; cursor: pointer; }
.ap-submit { margin-top: 24px; height: 48px; width: 100%; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 51, 217, .25); }
.ap-submit:hover { background: #002bb8; }
.ap-submit:disabled { opacity: .6; }
.ap-note { margin-top: 14px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--ink-2); font-size: 14px; }
.ap .msg { margin-top: 14px; font-size: 13px; }
.ap .msg.err { padding: 10px 12px; border-radius: 8px; background: var(--bad-bg); color: #991b1b; }
.t-actions { text-align: right; white-space: nowrap; }
.t-actions .btn + .btn,
.t-actions .btn + .icon-btn,
.t-actions .icon-btn + .btn { margin-left: 6px; }

@media (max-width: 960px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 48px; }
  .lp-preview { transform: none; }
  .lp-features { grid-template-columns: 1fr 1fr; }
  .ap { grid-template-columns: 1fr; }
  .ap-side { padding: 20px 24px 28px; }
  .ap-side-txt { margin: 20px 0 0; }
  .ap-side h2 { font-size: 22px; margin-top: 18px; }
  .ap-side ul { display: none; }
  .ap-main { place-items: start center; }
}
@media (max-width: 640px) {
  .lp-etapas, .lp-features { grid-template-columns: 1fr; }
  .lp-board { grid-template-columns: repeat(2, 1fr); }
  .lp-band { padding: 28px 24px; margin-left: 16px; margin-right: 16px; }
  .lp-top .lp-logo span { display: none; }
}

/* ---------- avisos y confirmación ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: min(520px, calc(100% - 32px));
  padding: 12px 18px; border-radius: 10px; background: #111827; color: #fff; font-weight: 500; box-shadow: var(--shadow-2); animation: up .2s ease-out;
}
.toast[hidden] { display: none; }
@keyframes up { from { transform: translate(-50%, 8px); opacity: 0; } }
.cscrim { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(15, 23, 42, .4); }
.cdlg { width: min(440px, 100%); padding: 24px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-2); }
.cdlg .ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bad-bg); color: var(--bad); font-weight: 700; margin-bottom: 12px; }
.cdlg h3 { font-size: 17px; }
.cdlg .what { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #f4f6fa; font-size: 13px; color: var(--ink-2); max-height: 120px; overflow: auto; }
.cdlg p { margin-top: 10px; color: var(--ink-2); }
.cdlg .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.cscrim-progress { z-index: 95; pointer-events: all; }
.cdlg-progress { width: min(420px, 100%); }
.cdlg-progress .prog-meta { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.cdlg-progress .prog-current {
  margin-top: 12px; font-family: var(--ibt-font-family-mono, ui-monospace, monospace); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prog-bar {
  margin-top: 16px; height: 10px; border-radius: 999px; background: #e8edf5; overflow: hidden;
}
.prog-fill {
  height: 100%; width: 0; border-radius: inherit; background: var(--brand);
  transition: width .18s ease-out;
}
.prog-pct {
  margin-top: 10px; text-align: right; font-size: 13px; font-weight: 700;
  color: var(--brand-strong, #0000a0); letter-spacing: .02em;
}

/* ---------- pantallas medianas y celular ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row { grid-template-columns: 16px minmax(90px, 140px) minmax(0, 1fr) 150px 64px 70px 28px 28px 130px; }
}
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .kboard.cols-4, .kboard.cols-3, .kboard.cols-2 { grid-template-columns: repeat(var(--n, 4), minmax(250px, 1fr)); overflow-x: auto; padding-bottom: 8px; }
  .kboard.cols-3 { --n: 3; }
  .kboard.cols-2 { --n: 2; }
  .ficha-grid { grid-template-columns: 1fr; }
  .f-side { position: static; order: -1; display: grid; grid-template-columns: repeat(2, 1fr); }
  .f-side .f-meta, .f-side .f-check, .f-side > .btn { grid-column: 1 / -1; }
  .row .prio, .row .avatar, .row-head .h-h-prio, .row-head .h-h-resp, .row-head .h-h-asig { display: none; }
  .row { grid-template-columns: 16px minmax(80px, 120px) minmax(0, 1fr) 150px 64px 120px; }
  .row:not([draggable=true]) { grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) 150px 64px; }
}
@media (max-width: 820px) {
  .shell { grid-template: var(--topbar-h) auto 1fr / 1fr; grid-template-areas: "top" "side" "main"; }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand { width: auto; }
  .brand span, .user-txt, .user-btn > .ico { display: none; }
  .project-pick { flex: 1; min-width: 0; }
  .project-pick select { min-width: 0; width: 100%; }
  .sidebar { position: sticky; top: var(--topbar-h); z-index: 15; height: auto; flex-direction: row; gap: 4px; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav-group { flex-direction: row; gap: 4px; }
  .nav-label, .nav-foot { display: none; }
  .nav-item { height: 38px; padding: 0 12px; white-space: nowrap; }
  .page { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .role-cards, .form, .roles { grid-template-columns: 1fr; }
  .row, .row:not([draggable=true]) { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px; }
  .row .grip, .row .move, .row.row-head { display: none; }
  .row .code, .row .row-title { grid-column: 1 / -1; }
  .row-title { flex-direction: column; gap: 0; }
  .row-title span:not(.blocked-dot):not(.fresh-dot) { white-space: normal; }
  .row .pill-select { width: auto; justify-self: start; }
  .row .pts-select { justify-self: end; }
  .topbar .grow { display: none; }
  .crumbs { display: none; }
  .f-side { grid-template-columns: 1fr 1fr; }
  .f-side .f-field:has(.pill-select), .f-side .f-field:has(> .status-menu) { grid-column: 1 / -1; }
  .ficha-main, .ficha-comments { padding: 18px 16px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .search { max-width: none; }
  .seg { overflow-x: auto; max-width: 100%; }
}

/* ---------- roadmap ---------- */
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-value.small-v { font-size: 24px; }
.rm-empty { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-style: dashed; box-shadow: none; }
.rm-empty p { max-width: 640px; }
.rm-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); line-height: 1.55; }
.rm-alert.bad, .rm-alert.ok { background: #f1f5f9; color: var(--ink-2); }
.rm-alert .ico { margin-top: 2px; }
.rm-settings { display: grid; grid-template-columns: repeat(3, minmax(180px, 260px)); gap: 16px 20px; align-items: end; }
.rm-settings .rm-ref { grid-column: 1 / -1; }
.rm-field { display: flex; flex-direction: column; gap: 6px; }
.rm-field > span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rm-inline { display: flex; align-items: center; gap: 8px; }
.rm-inline input { width: 90px !important; text-align: center; font-weight: 600; }
.rm-inline small { color: var(--ink-3); font-size: 12px; line-height: 1.2; }
.rm-ref { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: #f4f7ff; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.rm-ref .ico { color: var(--brand); margin-top: 2px; }
.rm-gantt-card { padding: 0; overflow: hidden; }
.rm-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.rm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rm-sw { width: 14px; height: 8px; border-radius: 3px; }
.rm-sw-epic { background: linear-gradient(90deg, #0033d9, #00a3e0); }
.rm-sw-today { width: 2px; height: 12px; background: var(--bad); }
.rm-scroll { overflow-x: auto; }
.rm-grid { position: relative; display: grid; grid-template-columns: 340px var(--tl); }
.rm-left { position: sticky; left: 0; z-index: 2; background: #fff; border-right: 1px solid var(--line); }
.rm-head { height: 48px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.rm-head.rm-left { display: flex; align-items: center; padding: 0 16px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); z-index: 3; background: #fafbfd; }
.rm-months { display: flex; }
.rm-month { flex: 0 0 112px; display: flex; flex-direction: column; justify-content: center; padding: 0 10px; border-left: 1px solid var(--line); font-size: 12px; text-transform: capitalize; }
.rm-month small { color: var(--brand); font-weight: 600; font-size: 11px; text-transform: none; }
.rm-month.now { background: #f4f7ff; }
.rm-group { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #f4f6fa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--brand-strong, #0000a0); }
.rm-group.rm-track { padding: 0; }
.rm-group small { font-weight: 500; color: var(--ink-3); }
.rm-left.rm-group { background: #f4f6fa; }
.rm-name { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px 6px 16px; border-bottom: 1px solid #f0f2f6; font-size: 12px; }
.rm-name.crit { background: #fffaf0; }
.rm-code { font-family: var(--ibt-font-family-mono, monospace); font-weight: 600; color: var(--brand); }
.rm-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rm-st { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
.rm-pts { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.rm-track { position: relative; min-height: 38px; border-bottom: 1px solid #f0f2f6;
  background-image: repeating-linear-gradient(90deg, transparent 0 111px, var(--line) 111px 112px); }
.rm-track.crit { background-color: #fffaf0; }
.rm-bar { position: absolute; top: 10px; height: 18px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; padding: 0 8px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; }
.rm-bar span { overflow: hidden; text-overflow: ellipsis; }
.rm-dot { position: absolute; top: 13px; width: 12px; height: 12px; margin-left: -6px; border-radius: 3px; transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.rm-tbd { position: absolute; left: 12px; top: 10px; font-size: 11px; color: var(--ink-3); font-style: italic; }
.hs-cerrado { background: #0b7a45; color: #0b7a45; }
.hs-curso { background: #c47b00; color: #c47b00; }
.hs-espera { background: #7c3aed; color: #7c3aed; }
.hs-plan { background: #0033d9; color: #0033d9; }
.hs-tbd { background: #94a3b8; color: #64748b; }
.rm-bar.hs-cerrado, .rm-bar.hs-curso, .rm-bar.hs-espera, .rm-bar.hs-plan, .rm-bar.hs-tbd { opacity: .28; }
span.rm-st.hs-cerrado { background: #e6f4ec; } span.rm-st.hs-curso { background: #fdf1dc; } span.rm-st.hs-espera { background: #efe8ff; }
span.rm-st.hs-plan { background: #e8eeff; } span.rm-st.hs-tbd { background: #f1f5f9; }
.rm-epic.team-0 { background: linear-gradient(90deg, #0033d9, #2f6bff); }
.rm-epic.team-1 { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.rm-epic.team-2 { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.rm-epic.team-3 { background: linear-gradient(90deg, #c2410c, #fb923c); }
.rm-overlay { position: absolute; top: 0; bottom: 0; left: 340px; width: var(--tl); pointer-events: none; z-index: 1; }
.rm-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); }
.rm-mark { position: absolute; top: 0; bottom: 0; border-left: 2px dashed #00a3e0; }
.rm-mark.end { border-left-color: #0000a0; }
.rm-mark span { position: absolute; top: 52px; left: 4px; padding: 2px 6px; border-radius: 6px; background: #e0f6ff; color: #035e86; font-size: 10px; font-weight: 700; font-style: normal; white-space: nowrap; }
.rm-mark.end span { background: #e3e7ff; color: #0000a0; }
@media (max-width: 1100px) { .rm-settings { grid-template-columns: 1fr 1fr 1fr; } .rm-ref { grid-column: 1 / -1; } .kpis-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .rm-settings { grid-template-columns: 1fr; } .rm-grid { grid-template-columns: 200px var(--tl); } .rm-overlay { left: 200px; } .rm-name { grid-template-columns: 44px minmax(0, 1fr); } .rm-st, .rm-pts { display: none; } }

/* ---------- detalle de la historia (plantilla PMO-FR-055) ---------- */
.f-num { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--brand-bg, #e8eeff); color: var(--brand); font-size: 11px; font-weight: 700; }
.f-p { color: var(--ink); line-height: 1.65; }
.f-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.6; }
.f-list li.sub { margin-left: 18px; list-style: circle; color: var(--ink-2); }
.f-list.small { font-size: 13px; color: var(--ink-2); }
.open-txt { display: inline-flex; gap: 6px; align-items: baseline; padding: 2px 8px; border-radius: 6px; background: #fff7e0; color: #8a5a00; }
.open-txt .ico { align-self: center; flex: none; }
.open-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: #fff1cc; color: #8a5a00; font-size: 11px; font-weight: 700; }
.alerts { border: 1px solid #f6d58a; background: #fffaf0; border-radius: var(--radius); padding: 14px 16px; }
.alerts-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #8a5a00; }
.alerts-head b { font-size: 15px; }
.alerts-head span { color: #9a6b10; font-size: 13px; }
.alerts ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.alerts button { display: flex; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); line-height: 1.45; }
.alerts button:hover { background: #fff1cc; }
.alerts-sec { flex: none; min-width: 150px; font-size: 12px; font-weight: 600; color: #8a5a00; }
.resumen { padding: 16px 18px; border-radius: var(--radius); background: linear-gradient(135deg, #f4f7ff, #eef9ff); }
.resumen-txt { font-size: 16px; line-height: 1.6; color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.box { padding: 14px 16px; border-radius: 10px; }
.box h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.ok-box { background: var(--st-terminada-bg); } .ok-box h3 { color: var(--st-terminada); }
.out-box { background: #f4f6fa; } .out-box h3 { color: var(--ink-3); }
.cqp { margin: 0; display: grid; gap: 10px; }
.cqp div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 14px; border-radius: 10px; background: #f7f9fc; }
.cqp dt { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong, #0000a0); padding-top: 2px; }
.cqp dd { margin: 0; line-height: 1.55; }
.gwt { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gwt-row { display: grid; grid-template-columns: 44px 1fr 1fr 1fr; border-top: 1px solid var(--line); }
.gwt-row:first-child { border-top: 0; }
.gwt-row > span { padding: 10px 12px; line-height: 1.5; font-size: 13px; border-left: 1px solid #f0f2f6; }
.gwt-row > span:first-child { border-left: 0; }
.gwt-h { background: #f4f6fa; }
.gwt-h > span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.gwt-n { font-weight: 700; color: var(--brand); text-align: center; }
.gwt-full { grid-column: 2 / -1; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rules li { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; background: #f7f9fc; }
.rule-code { flex: none; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.rules b { font-weight: 600; }
.rules p { margin-top: 2px; color: var(--ink-2); line-height: 1.55; font-size: 13px; }
.fold { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 8px; }
.fold summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.fold[open] summary { margin-bottom: 10px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { text-align: left; padding: 8px 10px; border-top: 1px solid #f0f2f6; vertical-align: top; }
.mini-table thead th { border-top: 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mini-table tbody th { width: 160px; color: var(--ink-2); font-weight: 600; }
.f-meta div.warn dd, .f-meta div.warn dt { color: #8a5a00; font-weight: 700; }
/* diagrama */
.dia-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.small-seg button { height: 28px; padding: 0 12px; }
.story-dia { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; }
.sd-box { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid; }
.sd-box small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sd-box b { font-weight: 500; line-height: 1.45; }
.sd-como { background: #eef3ff; border-color: #c9d6ff; } .sd-como small { color: var(--brand); }
.sd-quiero { background: #f1ecff; border-color: #d9ccff; } .sd-quiero small { color: #6d28d9; }
.sd-para { background: #e6f7f1; border-color: #bfe8d9; } .sd-para small { color: #0f766e; }
.sd-arrow { display: grid; place-items: center; color: var(--ink-3); }
.sd-done { grid-column: 1 / -1; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line-strong); }
.sd-done small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.sd-done ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.sd-done li { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; }
.sd-done .ico { color: var(--st-aprobada); flex: none; margin-top: 2px; }
.flow { display: grid; gap: 6px; }
.flow-lanes, .flow-row { display: grid; grid-template-columns: repeat(var(--lanes), minmax(0, 1fr)); gap: 10px; }
.flow-lane-h { padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; text-align: center; }
.flow-row { position: relative; }
.flow-row::before { content: ""; position: absolute; left: 50%; top: -6px; height: 6px; border-left: 2px dotted #c3cad8; }
.flow-step { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid; font-size: 13px; line-height: 1.45; }
.flow-n { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #fff; font-size: 11px; font-weight: 700; }
.flow-paso { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #f4f6fa; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.a0 { background: #eef3ff; border-color: #c9d6ff; color: #0033d9; } .flow-step.a0 { color: var(--ink); }
.a1 { background: #e6f7f1; border-color: #bfe8d9; color: #0f766e; } .flow-step.a1 { color: var(--ink); }
.a2 { background: #f1ecff; border-color: #d9ccff; color: #6d28d9; } .flow-step.a2 { color: var(--ink); }
.a3 { background: #fff4e5; border-color: #fcd9a8; color: #c2410c; } .flow-step.a3 { color: var(--ink); }
/* alerta pequeña en filas y tarjetas */
.open-mini { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff1cc; color: #8a5a00; font-size: 11px; font-weight: 700; white-space: nowrap; }
@media (max-width: 820px) {
  .two, .story-dia { grid-template-columns: 1fr; }
  .sd-arrow { transform: rotate(90deg); }
  .gwt-row { grid-template-columns: 1fr; }
  .gwt-h { display: none; }
  .gwt-row > span { border-left: 0; }
  .gwt-row > span[data-l]::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .gwt-n { text-align: left; }
  .alerts-sec { min-width: 0; }
  .alerts button { flex-direction: column; gap: 2px; }
}
.kcard-flags { display: inline-flex; align-items: center; gap: 6px; }
.card-sub { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.row-title .open-mini { flex: none; align-self: center; }
/* cuentas de prueba en el login */
.demo { margin-top: 24px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; background: #fff; display: grid; gap: 8px; }
.demo p { display: flex; flex-direction: column; margin-bottom: 4px; }
.demo p b { font-size: 13px; }
.demo p span { font-size: 12px; color: var(--ink-3); }
.demo-btn { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
.demo-btn:hover { border-color: var(--brand); background: #f4f7ff; }
.demo-role { justify-self: start; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.r-admin { background: #e3e7ff; color: #0000a0; } .r-editor { background: var(--st-aprobada-bg); color: var(--st-aprobada); } .r-viewer { background: #f1f5f9; color: var(--ink-2); }
.demo-mail { display: flex; flex-direction: column; font-size: 13px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.demo-mail small { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.demo-btn code { font-size: 12px; padding: 2px 6px; border-radius: 6px; background: #f4f6fa; color: var(--ink-2); }
/* detalle en markdown: viñetas de Word, sub-ítems y pendientes */
.md li.sub { margin-left: 20px; list-style: circle; color: var(--ink-2); }
.md .open-txt { display: block; padding: 6px 10px; border-radius: 6px; background: #fff7e0; color: #8a5a00; }
.md li.open-txt { display: list-item; }
.md li.md-task.open-txt { display: flex; background: #fff7e0; }
/* cuerpo del detalle: tipografía legible; títulos y Gherkin llevan acento de marca */
.md p, .md li, .md li.sub { color: var(--ink); }
.md li.sub { list-style: circle; }
/* nueva historia desde un Word */
.word-drop, .word-ok, .word-warn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; }
.word-drop { border: 2px dashed #c3cde6; background: #f8faff; cursor: pointer; color: var(--brand); }
.word-drop:hover, .word-drop.is-drag { border-color: var(--brand); background: #f0f4ff; }
.word-drop b, .word-ok b { display: block; color: var(--ink); font-size: 14px; }
.word-drop small, .word-ok small { color: var(--ink-3); font-weight: 400; }
.word-ok { background: var(--st-terminada-bg); color: var(--st-terminada); }
.word-ok > div { flex: 1; min-width: 0; }
.word-ok b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-warn { background: #fff7e0; color: #8a5a00; font-size: 13px; }
/* Mi perfil → Acceso para IA (MCP) */
.mcp-card { display: flex; flex-direction: column; gap: 14px; }
.mcp-card .card-title { margin-bottom: 0; }
.mcp-url { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.mcp-url span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mcp-url code, .mcp-token code { padding: 4px 8px; border-radius: 6px; background: #f4f6fa; font-size: 12px; overflow-wrap: anywhere; }
.mcp-fresh { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 10px; border: 1px solid #f6d58a; background: #fffaf0; }
.mcp-token { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mcp-token code { flex: 1; min-width: 0; background: #fff; }
.mcp-fresh pre { margin: 8px 0; padding: 10px; border-radius: 8px; background: #fff; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mcp-fresh summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.mcp-fresh > .link { align-self: flex-start; }
.mcp-new { display: flex; gap: 10px; }
.mcp-new input { flex: 1; }
.mcp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mcp-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mcp-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mcp-list small { color: var(--ink-3); font-size: 12px; }
@media (max-width: 820px) { .mcp-new { flex-direction: column; } }


/* PMO-001: ficha en PDF (Descargar PDF → diálogo de impresión). */
.print-meta { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .ficha-bar, .f-side, .ficha-comments, .history, .gh, .toast, #motivo-root, .crumb-copy { display: none !important; }
  .shell, .content, .page, .ficha-grid, .ficha-stack { display: block !important; padding: 0 !important; margin: 0 !important; width: auto !important; max-width: none !important; overflow: visible !important; }
  .card { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  .print-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; margin: 8px 0 16px; padding: 10px 0; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; font-size: 11pt; }
  .print-meta div { display: flex; gap: 6px; }
  .print-meta dt { font-weight: 600; }
  .print-meta dd { margin: 0; }
  .ficha-title { color: #000 !important; }
  a { color: #000; }
  pre, table, img, .md-crit li { break-inside: avoid; }
}

/* Actividad del proyecto (PMO-003) */
.act-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 12px; }
.act-filters .search { flex: 1 1 260px; }
.act-filters select { flex: 1 1 150px; width: auto; min-width: 140px; max-width: 220px; }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line, #eceef2); }
.act-row:last-child { border-bottom: 0; }
.act-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef2ff; color: #3443c9; }
.act-estado .act-ico { background: #fff4e0; color: #9a5b00; }
.act-comentario .act-ico { background: #e8f6ee; color: #1d7a3a; }
.act-eliminada .act-ico { background: #fdeaea; color: #b42318; }
.act-body { flex: 1; min-width: 0; }
.act-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; font-size: 14px; }
.act-kind { color: var(--ink-3, #667085); }
.act-hu { color: inherit; text-decoration: none; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.act-hu:hover { text-decoration: underline; }
.act-hu code { font-weight: 600; color: var(--brand, #2340d9); }
.act-head small { color: var(--ink-3, #667085); font-size: 12px; white-space: nowrap; }
.act-changes { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 13px; }
.act-ch s { color: var(--ink-3, #667085); }
.act-text { margin: 4px 0 0; font-size: 13px; white-space: pre-wrap; color: var(--ink-2, #344054); }
.act-more { display: flex; justify-content: center; padding: 16px 0; }
.act-err { color: #b42318; }
@media (max-width: 820px) { .act-filters select { flex: 1 1 45%; min-width: 0; max-width: none; } .act-head .grow { display: none; } .act-hu { white-space: normal; } }

/* Notificaciones (PMO-004/005/006/007) */
.nt-bell { position: relative; margin-right: 6px; }
.nt-bell-btn { position: relative; width: 38px; height: 38px; }
.nt-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.nt-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 24px)); background: var(--surface, #fff); border: 1px solid var(--line, #e4e7ec); border-radius: 12px; box-shadow: var(--shadow-2); z-index: 60; overflow: hidden; }
.nt-pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line, #eceef2); }
.nt-pop-head .link { font-size: 12px; }
.nt-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.nt-list-page { max-height: none; }
.nt-row button { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--line, #f0f1f4); cursor: pointer; font: inherit; color: inherit; align-items: flex-start; }
.nt-row button:hover { background: #f7f8fb; }
.nt-row.unread button { background: #f3f6ff; }
.nt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.nt-body code { font-weight: 600; color: var(--brand, #2340d9); }
.nt-title { color: var(--ink-2, #344054); }
.nt-text { color: var(--ink-3, #667085); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nt-body small { color: var(--ink-3, #667085); font-size: 11px; }
.nt-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2340d9; margin-top: 6px; }
.nt-empty { padding: 18px 14px; margin: 0; }
.nt-all { display: block; width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--line, #eceef2); background: #fafbfc; font: inherit; font-weight: 600; color: var(--brand, #2340d9); cursor: pointer; }
.nt-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; margin-bottom: 12px; }
.nt-filters select { width: auto; min-width: 160px; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-act { border: 0; background: #fff; color: #111827; font: inherit; font-weight: 700; padding: 4px 12px; border-radius: 6px; cursor: pointer; }
.f-follow { padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line, #eceef2); }
.f-follow-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.f-follow-check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.f-follow-check span { display: flex; flex-direction: column; font-size: 13px; }
.f-follow-check small { color: var(--ink-3, #667085); font-size: 12px; }
.f-follow-who { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.f-follow-who small { margin-left: 6px; color: var(--ink-3, #667085); font-size: 12px; }
.mn-wrap { position: relative; }
.mn-pop { position: absolute; left: 8px; bottom: calc(100% + 4px); z-index: 30; list-style: none; margin: 0; padding: 4px; min-width: 260px; background: var(--surface, #fff); border: 1px solid var(--line, #e4e7ec); border-radius: 10px; box-shadow: var(--shadow-2); }
.mn-pop button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 6px; font: inherit; text-align: left; cursor: pointer; }
.mn-pop button.on, .mn-pop button:hover { background: #eef2ff; }
.mn-pop small { color: var(--ink-3, #667085); }

/* Negocio (PMO-020) y épicas (PMO-011) */
.biz { margin: 8px 0 24px; }
.biz-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.biz-grid .kpi:nth-child(n+5) { grid-column: span 1; }
.biz-main { grid-row: span 2; display: flex; flex-direction: column; gap: 6px; padding: 18px; }
.bar.big { height: 10px; }
.biz-plazo { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 13px; }
.biz-plazo small { color: var(--ink-3, #667085); }
.sem { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.sem-ok { background: #e3f6e8; color: #1d7a3a; } .sem-warn { background: #fff4e0; color: #9a5b00; }
.sem-bad { background: #fdeaea; color: #b42318; } .sem-muted { background: #eef1f5; color: #475467; }
.biz-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.biz-bars li { display: grid; grid-template-columns: minmax(80px, 1.4fr) 2fr 44px 80px; gap: 10px; align-items: center; font-size: 13px; }
.biz-bars li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-bars small { color: var(--ink-3, #667085); text-align: right; }
.biz-block { margin-top: 12px; }
@media (max-width: 1000px) { .biz-grid { grid-template-columns: 1fr 1fr; } .biz-main { grid-column: span 2; grid-row: auto; } }
.ep-grid { display: grid; gap: 10px; }
.ep-card { padding: 0; overflow: hidden; }
.ep-head { display: grid; grid-template-columns: 1fr 200px 20px; gap: 16px; align-items: center; width: 100%; padding: 14px 18px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.ep-head h2 { margin: 0; font-size: 15px; }
.ep-head small { color: var(--ink-3, #667085); }
.ep-pct { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center; }
.ep-card.open .ep-head .ico:last-child { transform: rotate(180deg); }
.ep-list { list-style: none; margin: 0; padding: 0 0 6px; border-top: 1px solid var(--line, #eceef2); }
.ep-list button { display: grid; grid-template-columns: 170px 1fr auto auto; gap: 12px; align-items: center; width: 100%; padding: 8px 18px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.ep-list button:hover { background: #f7f8fb; }
.ep-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) { .ep-head { grid-template-columns: 1fr; } .ep-list button { grid-template-columns: 1fr auto; } .ep-list .code { grid-column: span 2; } }

/* Evidencia Platform (610_) */
.platform-evidence-hint { margin: 0 0 12px; max-width: 62ch; }
.platform-evidence-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.platform-evidence-item { border: 1px solid var(--line, #e4e7ec); border-radius: 10px; padding: 12px 14px; background: #fafbfc; }
.platform-evidence-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.platform-evidence-id { font-size: 12px; }
.platform-evidence-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: #475467; }
.platform-evidence-status.st-linked { background: #e3f6e8; color: #1d7a3a; }
.platform-evidence-status.st-proposed { background: #eef2ff; color: #3538cd; }
.platform-evidence-status.st-stale,
.platform-evidence-status.st-superseded { background: #fff4e0; color: #9a5b00; }
.platform-evidence-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.platform-evidence-notes { margin: 0 0 6px; font-size: 13px; max-width: 68ch; }
.platform-evidence-cu { margin: 0 0 6px; font-size: 12px; }
.platform-evidence-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.platform-evidence-thumb { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.platform-evidence-thumb-btn { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line, #e4e7ec); border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.platform-evidence-thumb-btn .media-preview { display: block; width: 100%; aspect-ratio: 16 / 10; }
.platform-evidence-thumb-btn .media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.platform-evidence-thumb-overlay { position: absolute; inset: auto 8px 8px auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.72); color: #fff; opacity: 0; transition: opacity .15s ease; }
.platform-evidence-thumb-btn:hover .platform-evidence-thumb-overlay,
.platform-evidence-thumb-btn:focus-visible .platform-evidence-thumb-overlay { opacity: 1; }
.platform-evidence-caption { margin: 0; font-size: 12px; line-height: 1.35; color: var(--ink-2, #344054); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.platform-evidence-fallback { font-size: 12px; }
@media (max-width: 820px) { .platform-evidence-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .platform-evidence-thumbs { grid-template-columns: 1fr; } }
