/* ============================================================
   Estrategia Q4 — Pampling / Wituka
   ============================================================ */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f7f8fa;
  --surface3: #eef0f4;
  --line: #e3e6ec;
  --line2: #ccd2dc;
  --tx: #161c26;
  --tx2: #5a6478;
  --tx3: #8b95a7;
  --acc: #5b4bdb;
  --acc-soft: #5b4bdb14;
  --mint: #0f9d63;
  --amber: #b8790a;
  --rose: #d92a4e;
  --cyan: #0c7d94;
  --r: 12px;
  --r-sm: 8px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --shadow: 0 10px 30px rgba(22, 28, 38, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 460px at 10% -10%, #f4f2ff 0%, transparent 62%),
    radial-gradient(800px 400px at 94% -14%, #eef7fb 0%, transparent 58%),
    var(--bg);
  color: var(--tx);
  font: 14px/1.55 var(--sans);
  padding: 0 24px 72px;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
::selection { background: var(--acc-soft); }

/* ── Barra superior ───────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 0 13px; margin-bottom: 20px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 10px;
  background: linear-gradient(140deg, var(--acc), #4f46e5);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800; letter-spacing: -.3px; color: #fff;
  box-shadow: 0 4px 14px rgba(91, 75, 219, .28);
}
.brand-txt { min-width: 0; }
h1 {
  margin: 0; font-size: 16.5px; font-weight: 650; letter-spacing: -.2px;
  outline: none; border-radius: 5px;
}
h1:focus { box-shadow: 0 0 0 2px var(--acc-soft); }
.brand-sub { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--tx3); flex-wrap: wrap; }
.dot-sep { opacity: .5; }
.sync { display: inline-flex; align-items: center; gap: 5px; color: var(--tx3); }
.sync::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tx3); }
.sync.ok { color: var(--mint); } .sync.ok::before { background: var(--mint); box-shadow: 0 0 7px var(--mint); }
.sync.off { color: var(--rose); } .sync.off::before { background: var(--rose); }

.topbar-right { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

.search { position: relative; display: flex; align-items: center; }
.search svg {
  position: absolute; left: 10px; width: 14px; height: 14px;
  fill: none; stroke: var(--tx3); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.search input {
  font: inherit; font-size: 13px; color: var(--tx);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px 7px 30px; width: 210px;
  transition: border-color .15s, width .18s;
}
.search input::placeholder { color: var(--tx3); }
.search input:focus { outline: none; border-color: var(--acc); width: 250px; }

.icon-btn, .btn-primary, .who {
  font: inherit; font-size: 12.5px; cursor: pointer;
  border-radius: 9px; padding: 7px 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--tx2);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .13s, color .13s, border-color .13s, transform .13s;
}
.icon-btn:hover { background: var(--surface3); color: var(--tx); border-color: var(--line2); }
.icon-btn.sq { padding: 6px 10px; font-size: 14px; line-height: 1; }
.btn-primary {
  background: var(--acc); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 3px 12px rgba(91, 75, 219, .26);
}
.btn-primary:hover { background: #4a3ac9; transform: translateY(-1px); }
.btn-primary span { font-size: 15px; margin-top: -1px; }
.who {
  width: 30px; height: 30px; padding: 0; border-radius: 50%; justify-content: center;
  background: linear-gradient(140deg, #2b3450, #202840); color: var(--tx);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
}
.link-btn {
  font: inherit; font-size: 11.5px; background: none; border: 0; color: var(--tx3);
  cursor: pointer; padding: 2px 4px; border-radius: 5px;
}
.link-btn:hover { color: var(--acc); }

/* ── Aviso de arranque ────────────────────────────────────── */
.prestart {
  display: flex; align-items: center; gap: 11px;
  background: linear-gradient(90deg, #f3f1ff, transparent 70%);
  border: 1px solid var(--line); border-left: 2px solid var(--acc);
  border-radius: var(--r-sm); padding: 11px 15px; margin-bottom: 20px;
  font-size: 12.5px; color: var(--tx2);
}
.prestart b { color: var(--tx); font-weight: 600; }

/* ── Bloques ──────────────────────────────────────────────── */
.block { margin-bottom: 22px; }
.block-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; }
.block-head h2 {
  margin: 0; font-size: 11px; font-weight: 650; letter-spacing: .9px;
  text-transform: uppercase; color: var(--tx3);
}

/* ── Tiras de KPI ─────────────────────────────────────────── */
.kpistrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.kpi {
  background: linear-gradient(165deg, var(--surface2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 17px 14px;
}
.kpi-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.kpi-name { font-size: 11.5px; color: var(--tx2); font-weight: 550; }
.kpi-tag { font-size: 10px; color: var(--tx3); font-family: var(--mono); }
.kpi-obj { font-size: 27px; font-weight: 700; letter-spacing: -.8px; margin: 7px 0 1px; font-variant-numeric: tabular-nums; }
.kpi-obj small { font-size: 11px; font-weight: 500; color: var(--tx3); letter-spacing: 0; margin-left: 5px; }
.kpi-rows { margin-top: 13px; display: flex; flex-direction: column; gap: 9px; }
.kpi-row { display: grid; grid-template-columns: 66px 1fr auto; align-items: center; gap: 9px; font-size: 11.5px; }
.kpi-row .lbl { color: var(--tx3); }
.kpi-row .track { height: 5px; border-radius: 3px; background: var(--surface3); overflow: hidden; }
.kpi-row .track > i { display: block; height: 100%; border-radius: 3px; }
.kpi-row .val { font-family: var(--mono); font-size: 11.5px; color: var(--tx2); font-variant-numeric: tabular-nums; }

/* ── Flows ────────────────────────────────────────────────── */
.flownav { display: flex; gap: 9px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.flownav::-webkit-scrollbar { display: none; }
.flowchip {
  flex: 1 1 0; min-width: 178px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 14px; font: inherit; color: var(--tx);
  transition: border-color .13s, background .13s, transform .13s;
  position: relative; overflow: hidden;
}
.flowchip:hover { transform: translateY(-1px); background: var(--surface2); }
.flowchip.on { border-color: var(--line2); background: var(--surface3); }
.fc-top { display: flex; align-items: center; gap: 7px; }
.fc-name { font-size: 13.5px; font-weight: 620; }
.fc-n { margin-left: auto; font-size: 10.5px; color: var(--tx3); font-family: var(--mono); }
.fc-meta { font-size: 11px; color: var(--tx3); margin-top: 5px; display: flex; gap: 9px; align-items: center; }
.fc-meta b { color: var(--tx2); font-weight: 600; }
.fc-risk { color: var(--rose); }

/* ── Barra de vistas ──────────────────────────────────────── */
.viewbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 15px;
}
.segmented { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg {
  font: inherit; font-size: 12.5px; cursor: pointer; border: 0; background: transparent;
  color: var(--tx2); padding: 6px 14px; border-radius: 8px; transition: background .13s, color .13s;
}
.seg:hover { color: var(--tx); }
.seg.active { background: var(--surface3); color: var(--tx); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line2); }
.viewbar-right { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mini-select {
  font: inherit; font-size: 12px; color: var(--tx2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px;
}
.mini-select:focus { outline: none; border-color: var(--acc); color: var(--tx); }
.count { font-size: 11.5px; color: var(--tx3); font-family: var(--mono); }

/* ── Tarjetas de iniciativa ───────────────────────────────── */
.group { margin-bottom: 26px; }
.group-head {
  display: flex; align-items: center; gap: 9px; margin: 0 0 12px;
  font-size: 12px; font-weight: 650; letter-spacing: .5px; text-transform: uppercase;
}
.group-head .gline { flex: 1; height: 1px; background: var(--line); }
.group-head .gn { font-size: 10.5px; color: var(--tx3); font-family: var(--mono); letter-spacing: 0; text-transform: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 13px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px 13px; cursor: pointer; position: relative;
  transition: border-color .14s, transform .14s, box-shadow .14s;
  display: flex; flex-direction: column; gap: 11px;
}
.card:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; gap: 8px; }
.cnum {
  font-family: var(--mono); font-size: 10.5px; color: var(--tx3);
  background: var(--surface3); border-radius: 6px; padding: 2px 6px; flex: none;
}
.card-top .sp { flex: 1; }
.card h3 { margin: 0; font-size: 14.5px; font-weight: 620; line-height: 1.35; letter-spacing: -.1px; }
.card-desc {
  font-size: 12px; color: var(--tx3); line-height: 1.5; margin: -4px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-kpi {
  border-top: 1px solid var(--line); padding-top: 11px;
  display: flex; flex-direction: column; gap: 7px;
}
.ck-head { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.ck-name { font-size: 11.5px; color: var(--tx2); }
.ck-obj { font-family: var(--mono); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ck-bar { height: 6px; border-radius: 4px; background: var(--surface3); position: relative; overflow: hidden; }
.ck-bar > i { display: block; height: 100%; border-radius: 4px; transition: width .3s; }
.ck-bar > u { position: absolute; top: -2px; width: 2px; height: 10px; background: var(--amber); border-radius: 1px; }
.ck-foot { display: flex; align-items: center; justify-content: space-between; gap: 9px; font-size: 11px; color: var(--tx3); }
.ck-foot .cmp { font-family: var(--mono); }
.card-foot { display: flex; align-items: center; gap: 9px; font-size: 11px; color: var(--tx3); flex-wrap: wrap; }
.card-foot .who-mini {
  width: 19px; height: 19px; border-radius: 50%; background: #2b3450; color: var(--tx);
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
}

/* Etiquetas */
.tag { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line2); color: var(--tx2); white-space: nowrap; }
.tag.pampling { color: #4c3fc4; border-color: #d4cffa; background: #f2f0ff; }
.tag.wituka { color: #0b7a4d; border-color: #bfe8d5; background: #eefaf3; }
.tag.ambas { color: var(--tx2); background: var(--surface3); }
.tag.alta { color: #9a6206; border-color: #f2ddb4; background: #fdf6e8; }
.tag.baja { color: var(--tx3); }
.tag.auto { color: var(--cyan); border-color: #1d4e57; background: #0f2226; }
.tag.man { color: var(--tx3); }

.state { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--tx2); white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tx3); flex: none; }
.state.encurso::before { background: var(--acc); box-shadow: 0 0 6px var(--acc); }
.state.enriesgo::before { background: var(--rose); box-shadow: 0 0 6px var(--rose); }
.state.completada::before { background: var(--mint); }
.state.pausada::before { background: var(--amber); }

.pc { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pc.ok { color: var(--mint); } .pc.warn { color: var(--amber); } .pc.bad { color: var(--rose); } .pc.none { color: var(--tx3); }
.up { color: var(--mint); } .down { color: var(--rose); } .muted { color: var(--tx3); }

/* ── Tabla ────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface2); color: var(--tx3);
  font-size: 10px; text-transform: uppercase; letter-spacing: .7px; font-weight: 650;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th.r, td.r { text-align: right; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface2); cursor: pointer; }
tbody tr.gr td {
  background: #0d1119; color: var(--tx3); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; font-weight: 700; padding: 8px 12px;
}
tbody tr.gr:hover { background: var(--surface2); cursor: default; }
td.c-num { color: var(--tx3); font-family: var(--mono); font-size: 11.5px; width: 38px; }
td.c-nom { min-width: 250px; max-width: 380px; }
td.c-nom b { font-weight: 600; }
td.c-nom span { display: block; font-size: 11px; color: var(--tx3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.n { font-family: var(--mono); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini-prog .t { flex: 1; height: 5px; background: var(--surface3); border-radius: 3px; position: relative; overflow: hidden; }
.mini-prog .t > i { display: block; height: 100%; }
.mini-prog .t > u { position: absolute; top: -2px; width: 2px; height: 9px; background: var(--amber); }

/* ── Semanal ──────────────────────────────────────────────── */
.wk-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); max-height: 72vh; }
.wk-wrap table { font-size: 12px; }
.wk-wrap thead th { padding: 7px 5px; text-align: center; }
.wk-wrap th.mon { background: var(--surface3); color: var(--tx2); font-size: 10px; letter-spacing: 1.2px; border-left: 1px solid var(--line); }
.wk-wrap th.stl, .wk-wrap td.stl {
  position: sticky; left: 0; z-index: 6; background: var(--surface2);
  text-align: left; min-width: 240px; max-width: 240px;
}
.wk-wrap thead th.stl { z-index: 9; }
.wk-wrap th.sto, .wk-wrap td.sto {
  position: sticky; left: 240px; z-index: 6; background: var(--surface2);
  text-align: right; min-width: 104px; font-family: var(--mono); font-size: 11px;
}
.wk-wrap thead th.sto { z-index: 9; }
.wk-wrap td.stl, .wk-wrap td.sto { border-right: 1px solid var(--line); }
.wk-name { font-size: 12.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-name:hover { color: var(--acc); }
.wk-sub { font-size: 10px; color: var(--tx3); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
th.wk { font-size: 9.5px !important; letter-spacing: 0 !important; min-width: 58px; color: var(--tx2) !important; }
th.wk.now { background: #221f45; color: var(--amber) !important; }
th.wk span { display: block; font-weight: 400; color: var(--tx3); font-size: 8.5px; letter-spacing: 0; }
td.cell { padding: 0; position: relative; text-align: center; }
td.cell input {
  width: 100%; border: 0; background: transparent; color: var(--tx2);
  font: inherit; font-family: var(--mono); font-size: 11px; text-align: center; padding: 9px 2px;
  -moz-appearance: textfield; font-variant-numeric: tabular-nums;
}
td.cell input::-webkit-outer-spin-button, td.cell input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
td.cell input:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--acc); background: #0c1018; color: var(--tx); }
td.cell.auto input { color: var(--cyan); }
td.cell.now { background: #f1efff; }
td.cell.fut { background: #fafbfc; }
td.cell.fut input::placeholder { color: var(--line2); }
td.cell.ok::after, td.cell.bad::after { content: ''; position: absolute; left: 3px; right: 3px; bottom: 0; height: 2px; border-radius: 2px; }
td.cell.ok::after { background: var(--mint); }
td.cell.bad::after { background: var(--rose); }
.cell-note { position: absolute; top: 2px; right: 3px; font-size: 9px; color: var(--amber); line-height: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--tx3); margin: 11px 2px 0; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ── Calendario ───────────────────────────────────────────── */
.gantt { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow-x: auto; }
.gantt-grid { display: grid; grid-template-columns: 268px 1fr; min-width: 880px; }
.gantt-corner { border-bottom: 1px solid var(--line); background: var(--surface2); }
.gmonths { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface2); border-bottom: 1px solid var(--line); }
.gmonths div { font-size: 10.5px; color: var(--tx2); text-align: center; padding: 8px 0; border-left: 1px solid var(--line); letter-spacing: .5px; }
.grow-name {
  padding: 9px 14px; font-size: 12.5px; border-bottom: 1px solid var(--line); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.grow-name:hover { color: var(--acc); background: var(--surface2); }
.grow-name .cnum { flex: none; }
.gtrack { position: relative; border-bottom: 1px solid var(--line); padding: 9px 0; min-height: 38px; }
.gtrack .gbar {
  position: absolute; top: 10px; height: 17px; border-radius: 9px;
  display: flex; align-items: center; padding: 0 9px; overflow: hidden; white-space: nowrap;
  font-size: 10px; color: #fff; font-weight: 600; opacity: 1;
}
.gbar.open { border-radius: 9px 3px 3px 9px; }
.gtoday { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--amber); opacity: .8; }
.gsep { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }

/* ── Cajón / hoja ─────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end;
  background: rgba(22, 28, 38, .34); backdrop-filter: blur(3px);
  animation: fade .14s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  background: var(--surface); width: min(760px, 100%); height: 100%;
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
  animation: slide .18s cubic-bezier(.2, .8, .3, 1);
  box-shadow: -20px 0 60px rgba(22, 28, 38, .18);
}
.drawer.narrow { width: min(480px, 100%); }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 14.5px; font-weight: 620; }
.drawer-nav { display: flex; align-items: center; gap: 7px; }
.pnum { font-family: var(--mono); font-size: 12px; color: var(--tx3); }
.flowtag { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--tx2); }
.drawer-title {
  font: inherit; font-size: 19px; font-weight: 650; letter-spacing: -.3px; color: var(--tx);
  background: transparent; border: 0; border-bottom: 1px solid transparent;
  padding: 14px 18px 10px; width: 100%;
}
.drawer-title:focus { outline: 0; border-bottom-color: var(--acc); }
.drawer-tabs { display: flex; gap: 3px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.dtab {
  font: inherit; font-size: 12.5px; cursor: pointer; background: none; border: 0;
  color: var(--tx3); padding: 9px 11px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.dtab:hover { color: var(--tx2); }
.dtab.active { color: var(--tx); border-bottom-color: var(--acc); font-weight: 600; }
.drawer-body { overflow-y: auto; padding: 20px 18px 60px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.stat { background: var(--surface2); padding: 12px 14px; }
.stat span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--tx3); }
.stat b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat em { display: block; font-size: 10.5px; font-style: normal; color: var(--tx3); margin-top: 2px; }

.sec { margin-bottom: 26px; scroll-margin-top: 12px; }
.sec > h4 {
  margin: 0 0 12px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--tx3); font-weight: 650;
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 13px; }
.fld { display: flex; flex-direction: column; gap: 5px; }
.fld.wide { grid-column: 1 / -1; }
.fld label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--tx3); }
.fld input, .fld select, .fld textarea {
  font: inherit; font-size: 13px; color: var(--tx); width: 100%;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px;
  transition: border-color .13s, background .13s;
}
.fld textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 0; border-color: var(--acc); background: var(--surface3); }
.fld input:disabled { opacity: .45; }
.fld .hint { font-size: 10.5px; color: var(--tx3); line-height: 1.45; }
.fld .hint a { color: var(--acc); text-decoration: none; border-bottom: 1px dotted var(--acc); }
.check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tx2); padding-top: 22px; }
.check input { width: auto; }
.saved { animation: flash .7s ease-out; }
@keyframes flash { from { border-color: var(--mint); } to { border-color: var(--line); } }

.wkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; }
.wkcell { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 9px; }
.wkcell.now { border-color: var(--amber); }
.wkcell.fut { opacity: .55; }
.wkcell label { display: block; font-size: 9.5px; color: var(--tx3); }
.wkcell input {
  width: 100%; border: 0; background: transparent; color: var(--tx);
  font: inherit; font-family: var(--mono); font-size: 13px; padding: 2px 0;
}
.wkcell input:focus { outline: 0; color: var(--acc); }
.wkcell .ly { font-size: 9px; color: var(--tx3); font-family: var(--mono); }

.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.btn-danger {
  font: inherit; font-size: 12.5px; cursor: pointer; border-radius: 9px; padding: 7px 12px;
  background: transparent; border: 1px solid #f2c2cd; color: #b32340;
}
.btn-danger:hover { background: #fdeef1; }

/* ── Actividad ────────────────────────────────────────────── */
.act { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.act .av {
  width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface3);
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700; text-transform: uppercase; color: var(--tx);
}
.act .body { min-width: 0; }
.act .who-n { font-weight: 600; }
.act .what { color: var(--tx2); }
.act .when { font-size: 10.5px; color: var(--tx3); font-family: var(--mono); margin-top: 1px; }

/* ── Contexto ─────────────────────────────────────────────── */
.ctx-txt {
  font-size: 13.5px; line-height: 1.75; color: var(--tx2); white-space: pre-wrap;
  background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 17px; min-height: 160px;
}
.ctx-txt:focus { outline: 0; border-color: var(--acc); }

/* ── Vacío ────────────────────────────────────────────────── */
.empty { text-align: center; padding: 54px 20px; color: var(--tx3); }
.empty b { display: block; color: var(--tx2); font-size: 14px; font-weight: 600; margin-bottom: 5px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--surface3); border: 1px solid var(--line2); color: var(--tx);
  padding: 9px 17px; border-radius: 999px; font-size: 12.5px; z-index: 200;
  box-shadow: var(--shadow); animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.foot { display: flex; justify-content: space-between; gap: 14px; margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--tx3); flex-wrap: wrap; }

/* ── Scrollbars ───────────────────────────────────────────── */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #232b3c; border-radius: 6px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--line2); }

@media (max-width: 860px) {
  body { padding: 0 14px 48px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 11px; position: static; }
  .topbar-right { justify-content: space-between; }
  .search input { width: 100%; } .search { flex: 1; }
  .cards { grid-template-columns: 1fr; }
  .flownav { gap: 7px; }
  .flowchip { min-width: 150px; }
}

/* ── Añadidos: edición de indicadores, vacíos, modal ───────── */
.fc-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.kpi-ed { display: flex; flex-direction: column; gap: 11px; }
.kpi-ed .fld label { font-size: 9.5px; }
.kpi-ed .fld input, .kpi-ed .fld select { font-size: 12px; padding: 6px 8px; }
.kpi-add {
  font: inherit; font-size: 12.5px; cursor: pointer; color: var(--tx2);
  background: transparent; border: 1px dashed var(--line2); border-radius: var(--r);
  min-height: 120px; transition: color .13s, border-color .13s, background .13s;
}
.kpi-add:hover { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }

.hint { font-size: 11px; color: var(--tx3); line-height: 1.5; }
.hint a { color: var(--acc); text-decoration: none; border-bottom: 1px dotted var(--acc); }

.empty.big { padding: 62px 24px; max-width: 620px; margin: 0 auto; }
.empty-ico { font-size: 34px; margin-bottom: 14px; opacity: .9; }
.empty.big b { font-size: 17px; margin-bottom: 10px; }
.empty.big p { font-size: 13px; line-height: 1.65; margin: 0 0 10px; }
.empty.big .btn-primary { margin-top: 14px; }

.modal {
  height: auto; max-width: 400px; border: 1px solid var(--line2);
  border-radius: var(--r); box-shadow: var(--shadow);
}

.flow-ed {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 15px; margin-bottom: 11px;
}

/* ── Enlace al "por qué" (evidencia en la presentación) ────── */
.whylink {
  position: absolute; top: 13px; right: 14px;
  font-size: 10.5px; color: var(--cyan); text-decoration: none;
  border: 1px solid #bfe2ea; background: #f0f9fb; border-radius: 999px;
  padding: 2px 8px; white-space: nowrap; transition: background .13s, color .13s;
}
.whylink:hover { background: #e2f3f8; color: #075f72; }
td .whylink { position: static; }
.card { position: relative; }
.card h3 { padding-right: 74px; }
.whybox {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  background: var(--surface2); border: 1px solid var(--line); border-left: 2px solid var(--cyan);
  border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 22px;
  transition: background .13s, border-color .13s;
}
.whybox:hover { background: var(--surface3); border-color: var(--line2); }
.whybox .wb-ico {
  width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: #0f2226; color: var(--cyan); font-size: 13px; border: 1px solid #1d4e57;
}
.whybox b { display: block; font-size: 13px; font-weight: 620; color: var(--tx); }
.whybox em { display: block; font-size: 11.5px; font-style: normal; color: var(--tx3); margin-top: 1px; }

/* Referencia de la misma semana de 2025 dentro de cada celda: permite leer la
   rejilla y planificar antes de que el periodo arranque. */
.cell-py { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center;
           font-size: 8.5px; line-height: 1; color: var(--tx3, #7b8494); pointer-events: none;
           opacity: .85; letter-spacing: -.2px; }
td.cell { padding-bottom: 11px; }
td.cell input { padding-bottom: 9px; }

/* ============================================================
   Resumen del plan, filtro "solo las mías" y avance de tareas.
   Lo que el equipo necesita ver sin abrir nada.
   ============================================================ */
.planresumen { margin: 14px 0 4px; }
.pr-fila {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.pr-pill {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 82px;
  padding: 8px 13px;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  text-align: left;
}
.pr-pill b {
  font-size: 19px;
  font-weight: 680;
  line-height: 1.05;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.pr-pill span { font-size: 11.5px; color: #6b7484; }
.pr-pill.ok b { color: #15803d; }
.pr-pill.warn b { color: #b45309; }

button.pr-pill { cursor: pointer; transition: border-color .12s, background .12s; }
button.pr-mias { border-color: #d8ccff; background: #faf8ff; }
button.pr-mias b { color: #6d3fe0; }
button.pr-mias:hover { border-color: #b9a2ff; background: #f5f0ff; }

.pr-tareas {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 190px;
  padding: 8px 14px;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  background: #fff;
}
.pr-tareas-t { font-size: 11.5px; color: #6b7484; }
.pr-tareas-t b { font-size: 13.5px; color: #0f172a; font-variant-numeric: tabular-nums; }
.pr-bar { height: 5px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.pr-bar i { display: block; height: 100%; background: #7c5cff; border-radius: 3px; }

.pr-avisos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pr-av {
  padding: 4px 10px;
  border-radius: 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 11.5px;
  color: #78350f;
}
.pr-av.bad { background: #fff5f5; border-color: #fbdcdc; color: #991b1b; }

/* Botón de filtro rápido en la barra de vistas */
.chip-btn {
  padding: 6px 12px;
  border: 1px solid #e3e8ef;
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  color: #38414f;
  cursor: pointer;
  transition: all .12s;
}
.chip-btn:hover { border-color: #c9d1de; }
.chip-btn.on { background: #6d3fe0; border-color: #6d3fe0; color: #fff; }

/* Avance de la lista de tareas dentro de la tarjeta */
.card-pasos {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 9px 0 0;
}
.cp-bar {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: #eef1f6;
  overflow: hidden;
}
.cp-bar i { display: block; height: 100%; background: #22c55e; border-radius: 3px; }
.cp-txt {
  font-size: 11px;
  color: #8b93a3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-aviso {
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 7px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 11.5px;
  color: #78350f;
  cursor: help;
}


/* ============================================================
   Rediseno: una sola pantalla (el Plan) y el resto en borrador.
   ============================================================ */

/* La pestana del plan ya no compite con nadie: ocupa su sitio */
.mainnav {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.mainnav > .mtab {
  flex: 0 0 auto;
  min-width: 290px;
}

/* Desplegable de las vistas a medias */
.borrador {
  align-self: center;
  margin-left: auto;
  position: relative;
}
.borrador > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px dashed #d3dae5;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: #6b7484;
  transition: border-color .12s, color .12s;
}
.borrador > summary::-webkit-details-marker { display: none; }
.borrador > summary::after { content: '▾'; font-size: 10px; color: #a8b0be; }
.borrador > summary:hover { border-color: #b9a2ff; color: #38414f; }
.borrador[open] > summary { border-style: solid; border-color: #b9a2ff; color: #38414f; }
.bo-tag {
  padding: 1px 7px;
  border-radius: 20px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 10px;
  font-weight: 620;
  color: #b45309;
  letter-spacing: .03em;
}

.bo-lista {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 30;
  width: 330px;
  padding: 11px;
  border: 1px solid #e3e8ef;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, .13);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bo-nota {
  margin: 0 3px 5px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #8b93a3;
}
.mtab.bo-item {
  min-width: 0;
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}
.mtab.bo-item:hover { background: #f7f8fc; border-color: #e9edf4; }
.mtab.bo-item .mt-n { font-size: 12.5px; }
.mtab.bo-item .mt-c { font-size: 10.5px; }
.mtab.bo-item .mt-d { font-size: 11px; }
.mtab.bo-item.active { background: #f5f0ff; border-color: #d8ccff; }

/* Filtros secundarios plegados */
.masfiltros { position: relative; }
.masfiltros > summary {
  padding: 6px 11px;
  border: 1px solid #e3e8ef;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: #6b7484;
}
.masfiltros > summary::-webkit-details-marker { display: none; }
.masfiltros > summary:hover { border-color: #c9d1de; }
.masfiltros[open] > summary { border-color: #b9a2ff; color: #38414f; }
.mf-caja {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e3e8ef;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}
.mf-caja .mini-select { min-width: 186px; }

/* El calendario sigue en el codigo, fuera de la barra */
.seg.oculto-seg { display: none; }

/* Bloque de "por revisar" en el resumen */
.pr-revisar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 8px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
}
.pr-revisar b {
  font-size: 19px;
  font-weight: 680;
  line-height: 1.05;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}
.pr-revisar span { font-size: 11.5px; color: #92400e; }
.pr-revisar em {
  font-style: normal;
  font-size: 10.5px;
  color: #b45309;
  opacity: .85;
}


/* ============================================================
   CAPA DE DISEÑO
   El color no es decoración: cada iniciativa pertenece a un flow
   y ese color la acompaña desde la cabecera del grupo hasta el
   canto de la tarjeta. Así se sabe de qué va sin leer.
   ============================================================ */

/* ── Fondo: papel muy claro y tarjetas blancas de verdad ────── */
body {
  background:
    radial-gradient(1200px 520px at 6% -12%, #f2efff 0%, transparent 58%),
    radial-gradient(900px 440px at 96% -16%, #e9f6fb 0%, transparent 54%),
    #f6f7fb;
}

/* ── Píldoras de flow ───────────────────────────────────────── */
.flowchip {
  border-radius: 13px;
  overflow: hidden;
  transition: transform .14s, box-shadow .14s, border-color .14s, background .14s;
}
.flowchip .fc-edge { width: 100%; height: 3px; }
.flowchip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--fc) 22%, transparent);
  border-color: color-mix(in srgb, var(--fc) 40%, var(--line));
  background: #fff;
}
.flowchip.on {
  border-color: color-mix(in srgb, var(--fc) 55%, var(--line));
  background: color-mix(in srgb, var(--fc) 7%, #fff);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--fc) 18%, transparent);
}
.flowchip.on .fc-name { color: var(--fc); }
.flowchip .fc-n {
  background: color-mix(in srgb, var(--fc) 12%, #fff);
  color: var(--fc);
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

/* ── Cabecera de grupo ──────────────────────────────────────── */
.group-head {
  align-items: center;
  font-weight: 680;
  letter-spacing: -.01em;
}
.group-head .gline {
  background: linear-gradient(90deg, currentColor, transparent);
  opacity: .28;
}
.group-head .gn {
  background: color-mix(in srgb, currentColor 11%, #fff);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ── Tarjeta ────────────────────────────────────────────────── */
.card {
  border-radius: 14px;
  padding: 15px 17px 14px 19px;
  box-shadow: 0 1px 2px rgba(22, 28, 38, .04);
}
/* el canto de color: es lo que ata la tarjeta a su flow */
.card::after {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--fc);
  opacity: .85;
  transition: top .14s, bottom .14s, opacity .14s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--fc) 34%, var(--line));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--fc) 15%, rgba(22, 28, 38, .09));
}
.card:hover::after { top: 0; bottom: 0; opacity: 1; }

.cnum {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--fc) 10%, #fff);
  color: var(--fc);
  font-weight: 680;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 7px;
}
.cnum i { font-style: normal; font-size: 10px; opacity: .9; }

.card h3 { font-size: 14.5px; font-weight: 660; letter-spacing: -.015em; }
.card-desc { line-height: 1.6; }

/* ── Prioridad: tres colores y se acabó ─────────────────────── */
.card-top .tag.prio {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 6px;
  border: 0;
}
.tag.prio.p0 { background: #fee2e2; color: #b91c1c; }
.tag.prio.p1 { background: #fef3c7; color: #92400e; }
.tag.prio.p2 { background: #e2e8f0; color: #475569; }

/* ── Estado: un color por estado, los cinco que existen ─────── */
.state {
  font-size: 10.5px;
  font-weight: 620;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.state.noiniciada { background: #f1f3f7; color: #64748b; border-color: #e3e8ef; }
.state.encurso    { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.state.enriesgo   { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.state.completada { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.state.pausada    { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
/* el punto de color de delante ya no hace falta con el chip teñido */
.state::before { display: none; }

/* ── El bloque del KPI: que se lea como "el número" ─────────── */
.card-kpi {
  background: #fbfcfe;
  border: 1px solid #eef1f6;
  border-radius: 11px;
  padding: 10px 12px 9px;
}
.ck-name { font-size: 11.5px; color: var(--tx2); }
.ck-obj {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--tx);
  font-variant-numeric: tabular-nums;
}
.ck-bar { height: 6px; border-radius: 4px; background: #eaeef4; }
.ck-bar i { border-radius: 4px; }
.ck-foot { font-size: 11px; color: var(--tx3); }

.tag.auto { background: #eef9f3; color: #0f8a5f; border: 0; font-size: 9.5px; font-weight: 660; }
.tag.man  { background: #f4f6fa; color: #6b7484; border: 0; font-size: 9.5px; font-weight: 660; }

/* ── Pie de tarjeta ─────────────────────────────────────────── */
.card-foot { font-size: 11px; color: var(--tx3); }
.who-mini {
  background: color-mix(in srgb, var(--fc) 14%, #fff);
  color: var(--fc);
  font-weight: 700;
  border: 0;
}
.tag.val { background: #dcfce7; color: #15803d; border: 0; font-weight: 620; }

/* ── Avance de tareas: verde solo cuando hay avance ─────────── */
.cp-bar { background: #eaeef4; }
.cp-bar i { background: linear-gradient(90deg, #34d399, #10b981); }

/* ── Resumen: cada cifra con su color ───────────────────────── */
.pr-pill { border-radius: 12px; box-shadow: 0 1px 2px rgba(22, 28, 38, .04); }
.pr-pill.ok    { background: #f2fbf6; border-color: #cdeedd; }
.pr-pill.ok b  { color: #15803d; }
.pr-pill.warn  { background: #fffdf5; border-color: #fdeec2; }
.pr-pill.warn b { color: #b45309; }
.pr-pill.bad   { background: #fff5f5; border-color: #fbdcdc; }
.pr-pill.bad b { color: #b91c1c; }
.pr-tareas { border-radius: 12px; box-shadow: 0 1px 2px rgba(22, 28, 38, .04); }
.pr-bar i { background: linear-gradient(90deg, #8b7cff, #6d3fe0); }
.pr-revisar { border-radius: 12px; }

/* ── Barra de vistas ────────────────────────────────────────── */
.segmented { background: #eff1f6; border-radius: 10px; padding: 3px; }
.seg { border-radius: 8px; font-size: 12px; transition: background .12s, color .12s; }
.seg.active { background: #fff; color: var(--tx); box-shadow: 0 1px 3px rgba(22, 28, 38, .1); }
.mini-select { border-radius: 9px; }

/* ── Cajón de detalle: la pestaña activa con color ──────────── */
.dtab.active { color: var(--acc); border-bottom-color: var(--acc); }

/* Sin soporte de color-mix, se cae al color plano y sigue funcionando */
@supports not (color: color-mix(in srgb, red 10%, white)) {
  .cnum, .who-mini, .flowchip .fc-n { background: var(--surface3); color: var(--tx2); }
}

/* El aviso suave (decisión deliberada) frente al grave (error de dedo) */
.card-aviso {
  background: #f8f9fc;
  border-color: #e5e9f0;
  color: #6b7484;
}
.card-aviso.grave {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  font-weight: 600;
}

/* ── El "qué hay que hacer", debajo del título ───────────────
   Es la parte accionable, así que va antes que el gancho y con
   más peso de texto. Los dos van recortados para que las
   tarjetas de una misma fila no queden desiguales. */
.card-que {
  border-left: 2px solid color-mix(in srgb, var(--fc) 42%, #eef1f6);
  padding-left: 10px;
}
.cq-l {
  display: block;
  margin-bottom: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--fc) 78%, #5a6478);
}
.card-que p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #38414f;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: help;
}
@supports not (color: color-mix(in srgb, red 10%, white)) {
  .card-que { border-left-color: #eef1f6; }
  .cq-l { color: #5a6478; }
}


/* ── Evolución del objetivo en la tarjeta ────────────────────
   Tres marcas en una regla en vez de dos números y una resta
   mental. El color solo dice una cosa: si el recorrido acerca
   al objetivo o se aleja de él.
   ============================================================ */
.ev-kpi {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--tx2);
}

.ev-regla { margin-top: 26px; }
.ev-track {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: #e9edf4;
  margin-bottom: 21px;
}
/* el tramo que queda por recorrer, de hoy al objetivo */
.ev-recorrido {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #fcd34d 0 5px, #fde68a 5px 10px);
}
.ev-recorrido.ok { background: #86efac; }

.ev-m {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  text-decoration: none;
  cursor: help;
}
.ev-m::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid currentColor;
}
.ev-m b {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  color: currentColor;
  font-variant-numeric: tabular-nums;
}
.ev-m span {
  position: absolute;
  left: 50%;
  top: 11px;
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #a8b0be;
}
.ev-m.base { color: #94a3b8; z-index: 1; }
.ev-m.hoy  { color: #4f46e5; z-index: 3; }
.ev-m.hoy.mal { color: #dc2626; }
.ev-m.hoy.ok  { color: #16a34a; }
/* el objetivo es una bandera, no un punto: es una meta, no un estado */
.ev-m.obj { color: #16a34a; z-index: 2; }
.ev-m.obj::before {
  width: 3px; height: 15px;
  border-radius: 2px;
  background: currentColor;
  border: 0;
}

.ev-pie {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}
.ev-ok  { color: #15803d; font-weight: 620; }
.ev-mal { color: #b91c1c; font-weight: 620; }
.ev-neu { color: #6b7484; }
.ev-dir { color: #b6bdc9; font-size: 10px; white-space: nowrap; }

/* Las 18 semanas en miniatura */
.ev-spark {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
  margin-top: 9px;
  padding-top: 2px;
}
.ev-s {
  flex: 1;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  background: #cbd5e1;
}
.ev-s.ok  { background: #4ade80; }
.ev-s.mal { background: #fca5a5; }
.ev-s.vacia { background: #f1f3f7; height: 4px !important; }
.ev-s.ahora { outline: 1px solid #4f46e5; outline-offset: 1px; }
.ev-tgt {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 1px dashed #16a34a;
  opacity: .65;
}

.ev-nada {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #a8b0be;
}


/* ── Selector de marca ───────────────────────────────────────
   Es el primer filtro de la pantalla porque el plan tiene dos
   marcas y casi nunca se miran juntas.
   ============================================================ */
.marcanav {
  display: flex;
  gap: 6px;
  margin: 16px 0 2px;
  padding: 4px;
  background: #eef1f6;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.mca {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: #5a6478;
  transition: background .13s, color .13s, box-shadow .13s;
}
.mca:hover { background: rgba(255, 255, 255, .6); }
.mca-n { font-size: 13px; font-weight: 620; letter-spacing: -.01em; }
.mca-c {
  min-width: 21px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #dfe4ec;
  font-size: 11px;
  font-weight: 680;
  color: #6b7484;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.mca.on {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(22, 28, 38, .12);
}
.mca.on .mca-c { background: #eef1f6; color: #38414f; }

/* cada marca con su color cuando está elegida */
.mca.pampling.on { color: #5b21b6; }
.mca.pampling.on .mca-c { background: #ede9fe; color: #6d28d9; }
.mca.wituka.on { color: #0f766e; }
.mca.wituka.on .mca-c { background: #ccfbf1; color: #0f766e; }

@media (max-width: 620px) {
  .marcanav { width: 100%; }
  .mca { flex: 1; justify-content: center; }
}


/* ── Aviso de a qué marca pertenece lo que se ve ─────────────
   Los umbrales de ROAS y las cuatro vistas en borrador son de
   una marca concreta, y leerlos como si fueran de la otra da
   numeros que no son.
   ============================================================ */
.rm-marca-aviso {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #f2fbf9;
  border: 1px solid #cceee8;
  font-size: 12.5px;
  line-height: 1.55;
  color: #0f766e;
}
.rm-marca-aviso b { color: #0d5c56; }
.rm-marca-aviso.pam {
  background: #f7f5ff;
  border-color: #e2dbff;
  color: #5b21b6;
}
.rm-marca-aviso.pam b { color: #4c1d95; }

.solo-marca {
  display: inline-block;
  margin-left: 9px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: .02em;
  color: #6d28d9;
  vertical-align: middle;
}
