/* ============================================================
   Control Center — Actividades
   Estilos del rediseño "red de decisiones": choice cards, wizard,
   stepper, kanban, agenda, buscador de entidades, chips.
   Tokens-first (css/tokens.css). Dark + light vía variables.
   ============================================================ */

/* ---- color por contexto: cada bloque setea --cc (acción/proceso) ---- */
.cc--accent  { --cc: var(--accent);  --cc-dim: var(--accent-dim);  --cc-border: var(--accent-border); }
.cc--purple  { --cc: var(--purple);  --cc-dim: var(--purple-dim);  --cc-border: rgba(168,85,247,.35); }
.cc--success { --cc: var(--success); --cc-dim: var(--success-dim); --cc-border: rgba(16,185,129,.35); }
.cc--info    { --cc: var(--info);    --cc-dim: var(--info-dim);    --cc-border: rgba(59,130,246,.35); }
.cc--warning { --cc: var(--warning); --cc-dim: var(--warning-dim); --cc-border: rgba(245,158,11,.4); }

/* ============================================================
   Choice cards (wizard: Acción vs Seguimiento, tipos de proceso)
   ============================================================ */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-2) 0 var(--sp-4);
}
.choice-grid--mini { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }

.choice-card {
  --cc: var(--accent); --cc-dim: var(--accent-dim); --cc-border: var(--accent-border);
  position: relative;
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.choice-card:hover {
  transform: translateY(-3px);
  border-color: var(--cc-border);
  box-shadow: 0 10px 28px -10px var(--cc-dim), 0 0 0 1px var(--cc-border);
  background: linear-gradient(180deg, var(--cc-dim) 0%, var(--bg-2) 60%);
}
.choice-card:focus-visible { outline: 2px solid var(--cc); outline-offset: 2px; }
.choice-card.is-selected {
  border-color: var(--cc);
  box-shadow: var(--shadow-glow);
}
.choice-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  background: var(--cc-dim); color: var(--cc);
}
.choice-card__icon svg { width: 24px; height: 24px; }
.choice-card__title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-hi); }
.choice-card--mini .choice-card__title { font-size: var(--fs-md); }
.choice-card__desc { font-size: var(--fs-sm); color: var(--text-md); line-height: 1.5; }
.choice-card__bullets { margin: var(--sp-1) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.choice-card__bullets li { font-size: var(--fs-xs); color: var(--text-lo); display: flex; gap: 6px; align-items: center; }
.choice-card__bullets li::before { content: '•'; color: var(--cc); font-weight: 700; }

/* ============================================================
   Wizard (un solo modal con swap interno de pantallas)
   ============================================================ */
.wiz__trail {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}
.wiz__trail-item {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-lo);
  background: none; border: none; padding: 2px 0; cursor: default;
}
.wiz__trail-item.is-clickable { cursor: pointer; }
.wiz__trail-item.is-clickable:hover { color: var(--text-md); }
.wiz__trail-item.is-current { color: var(--cc, var(--accent)); position: relative; }
.wiz__trail-item.is-current::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: var(--cc, var(--accent)); transform-origin: left;
  animation: wizUnderline var(--dur) var(--ease);
}
.wiz__trail-sep { color: var(--text-dim); font-size: var(--fs-xs); }
@keyframes wizUnderline { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.wiz__stage { position: relative; min-height: 180px; }
.wiz-screen { animation: wizIn var(--dur-slow) var(--ease); }
.wiz-screen.is-back { animation: wizInBack var(--dur-slow) var(--ease); }
@keyframes wizIn     { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes wizInBack { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }

.wiz__screen-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-hi); margin-bottom: var(--sp-1); }
.wiz__screen-sub { font-size: var(--fs-sm); color: var(--text-lo); margin-bottom: var(--sp-4); }

.wiz__actions {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-top: var(--sp-5); padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}
.wiz__actions .wiz__spacer { flex: 1; }

/* preview del árbol de pasos antes de crear el seguimiento */
.wiz__preview { display: flex; flex-direction: column; gap: 6px; margin: var(--sp-3) 0; }
.wiz__preview-step {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px solid var(--border-subtle); font-size: var(--fs-sm);
}
.wiz__preview-step .num {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700;
  background: var(--cc-dim, var(--accent-dim)); color: var(--cc, var(--accent));
}

/* ============================================================
   Entidad chip (entidad anclada en el wizard)
   ============================================================ */
.entidad-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-md);
  background: var(--bg-2); border: 1px solid var(--cc-border, var(--border));
  margin-bottom: var(--sp-3);
}
.entidad-chip__icon { width: 28px; height: 28px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--cc-dim, var(--accent-dim)); color: var(--cc, var(--accent)); }
.entidad-chip__icon svg { width: 16px; height: 16px; }
.entidad-chip__main { display: flex; flex-direction: column; line-height: 1.25; }
.entidad-chip__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-hi); }
.entidad-chip__sub { font-size: var(--fs-xs); color: var(--text-lo); }
.entidad-chip__x { margin-left: var(--sp-2); background: none; border: none; color: var(--text-lo); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.entidad-chip__x:hover { color: var(--danger); }

/* ============================================================
   Buscador de entidades (dropdown en vivo)
   ============================================================ */
.bent { position: relative; }
.bent__inputwrap { position: relative; display: flex; align-items: center; }
.bent__icon { position: absolute; left: 12px; color: var(--text-lo); pointer-events: none; }
.bent__input {
  width: 100%; height: 40px; padding: 0 12px 0 36px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-hi); font-size: var(--fs-base); font-family: inherit;
}
.bent__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.bent__menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10;
  max-height: 320px; overflow-y: auto;
  background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 4px; display: none;
}
.bent[data-state="open"] .bent__menu { display: block; }
.bent__hint { padding: 12px; font-size: var(--fs-sm); color: var(--text-lo); text-align: center; }
.bent__group-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
  color: var(--text-dim); padding: 8px 10px 4px;
}
.bent__opt {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
}
.bent__opt:hover, .bent__opt.is-highlighted { background: var(--bg-3); }
.bent__opt-icon { width: 26px; height: 26px; flex: 0 0 26px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.bent__opt-icon svg { width: 15px; height: 15px; }
.bent__opt-icon--accent  { background: var(--accent-dim);  color: var(--accent); }
.bent__opt-icon--purple  { background: var(--purple-dim);  color: var(--purple); }
.bent__opt-icon--info    { background: var(--info-dim);    color: var(--info); }
.bent__opt-icon--warning { background: var(--warning-dim); color: var(--warning); }
.bent__opt-icon--success { background: var(--success-dim); color: var(--success); }
.bent__opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.bent__opt-label { font-size: var(--fs-sm); color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bent__opt-sub { font-size: var(--fs-xs); color: var(--text-lo); }
.bent__opt-code { font-size: var(--fs-xs); color: var(--text-lo); }

/* ============================================================
   Ligar documento (Acción): filtros por tipo + detalle a la derecha
   ============================================================ */
.doc-filtros {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: var(--sp-3); overflow-x: auto;
}
.doc-filtro {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-md);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 5px 12px; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.doc-filtro:hover { border-color: var(--border-strong); color: var(--text-hi); }
.doc-filtro.is-active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Sub-filtro (cubetas de estatus de facturas): tier secundario, más chico. */
.doc-subfiltros { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-3); }
.doc-subfiltros:empty { display: none; }
.doc-subfiltro {
  font-size: 11px; font-weight: 600; color: var(--text-lo);
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 3px 10px; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.doc-subfiltro:hover { border-color: var(--border-strong); }
/* Cada cubeta lleva el color de su badge en el desglose (texto siempre tintado;
   relleno + borde fuerte al estar activa). */
.doc-subfiltro--todos { color: var(--text-md); }
.doc-subfiltro--info { color: var(--info); }
.doc-subfiltro--success { color: var(--success); }
.doc-subfiltro--danger { color: var(--danger); }
.doc-subfiltro--todos.is-active { background: var(--bg-3); border-color: var(--border-strong); color: var(--text-hi); }
.doc-subfiltro--info.is-active { background: var(--info-dim); border-color: var(--info); }
.doc-subfiltro--success.is-active { background: var(--success-dim); border-color: var(--success); }
.doc-subfiltro--danger.is-active { background: var(--danger-dim); border-color: var(--danger); }

.doc-periodo { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.doc-periodo__lbl { font-size: var(--fs-xs); font-weight: 600; color: var(--text-lo); }
.doc-periodo__sel { max-width: 150px; }
.doc-periodo__sel:disabled { opacity: 0.5; cursor: not-allowed; }
/* Mes = multi-select (mismo componente que contabilidad). */
.doc-periodo__meses { min-width: 170px; max-width: 210px; }
.doc-periodo__meses.is-muted { opacity: 0.5; pointer-events: none; }

.docpick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); align-items: start; }
.docpick__list { min-width: 0; }
.docpick__detail { min-width: 0; }

.docdet { border: 1px solid var(--cc-border, var(--border)); border-radius: var(--radius-lg); background: var(--bg-1); overflow: hidden; }
.docdet--empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  text-align: center; padding: var(--sp-6) var(--sp-4); border-style: dashed;
  color: var(--text-lo); font-size: var(--fs-sm); line-height: 1.4;
}
.docdet--empty svg { width: 28px; height: 28px; color: var(--text-dim); }
.docdet__head {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--cc-dim, var(--accent-dim)); border-bottom: 1px solid var(--cc-border, var(--border));
}
.docdet__head-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--bg-1); color: var(--cc, var(--accent)); }
.docdet__head-icon svg { width: 18px; height: 18px; }
.docdet__head-main { flex: 1; min-width: 0; }
.docdet__type { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--cc, var(--accent)); }
.docdet__title { font-size: var(--fs-sm); font-weight: 700; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docdet__rows { padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.docdet__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); font-size: var(--fs-sm); }
.docdet__row > span { color: var(--text-lo); flex: 0 0 auto; }
.docdet__row > b { color: var(--text-hi); font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.docdet__block { display: flex; flex-direction: column; gap: 3px; }
.docdet__block > span { color: var(--text-lo); font-size: var(--fs-xs); }
.docdet__block > p { margin: 0; color: var(--text-md); font-size: var(--fs-sm); line-height: 1.45; white-space: pre-wrap; }
.docdet__foot { padding: 0 var(--sp-4) var(--sp-3); }
.docdet__foot-btn { background: none; border: none; padding: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--cc, var(--accent)); cursor: pointer; }
.docdet__foot-btn:hover { text-decoration: underline; }

/* Overlay de "detalle sencillo" del documento — por encima del modal del wizard
   (z-index del modal = 1000), sin pestaña nueva ni stacking de modal.js. */
.docdet-overlay { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: var(--sp-4); }
.docdet-overlay__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); animation: ccFade var(--dur) var(--ease); }
.docdet-overlay__card { position: relative; z-index: 1; width: min(540px, 94vw); max-height: 86vh; overflow: auto; animation: ccPop var(--dur) var(--ease); }
.docdet-overlay__card .docdet,
.docdet-overlay__card .docdet-lineas { box-shadow: var(--shadow-lg); }
.docdet-overlay__card .docdet__head { padding-right: 46px; }   /* espacio para la × */
.docdet-overlay__close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-1); border: 1px solid var(--border); color: var(--text-md); cursor: pointer; font-size: 1.15rem; line-height: 1; }
.docdet-overlay__close:hover { color: var(--danger); border-color: var(--danger); }
@keyframes ccFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ccPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* Líneas/conceptos del documento dentro del overlay de detalle. */
.docdet-lineas { margin-top: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-1); overflow: hidden; }
.docdet-lineas:empty { display: none; }
.docdet-lineas__head { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-lo); border-bottom: 1px solid var(--border); background: var(--bg-2); }
.docdet-lineas__loading, .docdet-lineas__empty { padding: var(--sp-3) var(--sp-4); color: var(--text-lo); font-size: var(--fs-sm); }
.docdet-lineas__text { padding: var(--sp-3) var(--sp-4); color: var(--text-md); font-size: var(--fs-sm); line-height: 1.5; white-space: pre-wrap; }
.docdet-lineas__table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.docdet-lineas__table th, .docdet-lineas__table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.docdet-lineas__table th:first-child, .docdet-lineas__table td:first-child { padding-left: var(--sp-4); }
.docdet-lineas__table th:last-child, .docdet-lineas__table td:last-child { padding-right: var(--sp-4); }
.docdet-lineas__table .num { text-align: right; white-space: nowrap; }
.docdet-lineas__table thead th { font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; background: var(--bg-2); }
.docdet-lineas__table tbody td { color: var(--text-md); overflow-wrap: anywhere; }
.docdet-lineas__table tbody td:first-child { color: var(--text-hi); }
.docdet-linea__sub { color: var(--text-hi); font-weight: 600; }
.docdet-lineas__table tfoot td { border-bottom: none; background: var(--bg-2); color: var(--text-lo); font-weight: 600; }
.docdet-lineas__table tfoot td.num { color: var(--text-hi); }

/* documento ligado clickable en el detalle de la actividad */
.cc-doclink { display: inline-flex; align-items: center; gap: 6px; color: var(--text-hi); text-decoration: none; }
.cc-doclink:hover { color: var(--accent); }
.cc-doclink__ext { font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }

/* ============================================================
   Stepper (tracker A→B→C→D)
   ============================================================ */
.stepper {
  display: flex; align-items: flex-start; gap: 0;
  margin: var(--sp-2) 0 var(--sp-5); overflow-x: auto; padding-bottom: 4px;
}
.stepper__step {
  position: relative; flex: 1 1 0; min-width: 110px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 0 6px;
}
/* conector hacia la derecha (excepto el último) */
.stepper__step:not(:last-child)::after {
  content: ''; position: absolute; top: 17px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 2px; background: var(--border); z-index: 0;
}
.stepper__step.is-done:not(:last-child)::after { background: var(--success); }
.stepper__node {
  position: relative; z-index: 1;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm);
  background: var(--bg-3); color: var(--text-lo); border: 2px solid var(--border);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.stepper__step.is-done .stepper__node { background: var(--success); color: #fff; border-color: var(--success); animation: stepDone var(--dur-slow) var(--ease); }
.stepper__step.is-current .stepper__node { background: var(--bg-1); color: var(--proc, var(--accent)); border-color: var(--proc, var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--proc, var(--accent)) 18%, transparent); animation: stepPulse 2.4s var(--ease) infinite; }
.stepper__step.is-blocked .stepper__node { background: var(--danger-dim); color: var(--danger); border-color: var(--danger); }
.stepper__title { font-size: var(--fs-xs); font-weight: 600; color: var(--text-md); line-height: 1.3; }
.stepper__step.is-current .stepper__title { color: var(--text-hi); }
.stepper__step.is-future .stepper__title { color: var(--text-lo); }
.stepper__meta { font-size: 0.66rem; color: var(--text-lo); }
.stepper__step.is-clickable { cursor: pointer; }
.stepper__step.is-clickable:hover .stepper__node { transform: translateY(-2px); }
.stepper__step.is-active .stepper__node { box-shadow: 0 0 0 4px var(--accent-dim); }
@keyframes stepDone { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes stepPulse { 0%,100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--proc, var(--accent)) 18%, transparent); } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--proc, var(--accent)) 6%, transparent); } }

/* ============================================================
   Kanban (seguimientos por etapa)
   ============================================================ */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-2); }
.kanban__col { background: var(--bg-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 120px; }
.kanban__col-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3); border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-sm); font-weight: 600; color: var(--text-md); }
.kanban__col-count { font-size: var(--fs-xs); color: var(--text-lo); background: var(--bg-3); border-radius: var(--radius-full); padding: 1px 8px; }
.kanban__col-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3); overflow-y: auto; }
.kanban__card {
  position: relative; padding: var(--sp-3); padding-left: calc(var(--sp-3) + 4px);
  background: var(--bg-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  cursor: pointer; transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.kanban__card::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--proc, var(--accent)); }
.kanban__card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.kanban__card-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-hi); margin-bottom: 3px; }
.kanban__card-meta { font-size: var(--fs-xs); color: var(--text-lo); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban__empty { padding: var(--sp-4); font-size: var(--fs-xs); color: var(--text-dim); text-align: center; }

/* ============================================================
   Agenda (acciones por día)
   ============================================================ */
.agenda { display: flex; flex-direction: column; gap: var(--sp-4); }
.agenda__day-head { font-size: var(--fs-sm); font-weight: 700; color: var(--text-hi); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); }
.agenda__day-head .agenda__count { font-size: var(--fs-xs); font-weight: 500; color: var(--text-lo); }
.agenda__item {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
  background: var(--bg-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.agenda__item:hover { background: var(--bg-2); border-color: var(--border); }
.agenda__item + .agenda__item { margin-top: 6px; }
.agenda__time { flex: 0 0 62px; display: flex; flex-direction: column; line-height: 1.2; }
.agenda__time-date { font-size: 11px; font-weight: 600; color: var(--text-lo); }
.agenda__time-hora { font-size: var(--fs-sm); font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.agenda__time-none { color: var(--text-dim); }
.agenda__main { flex: 1; min-width: 0; }
.agenda__title { font-size: var(--fs-sm); color: var(--text-hi); }
.agenda__sub { font-size: var(--fs-xs); color: var(--text-lo); }
.agenda__meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.agenda__meta-k { color: var(--text-lo); font-weight: 600; }
.agenda__meta-sep { opacity: .5; margin: 0 2px; }
.agenda__item.is-vencida .agenda__time-date,
.agenda__item.is-vencida .agenda__time-hora { color: var(--danger); }

/* Estatus "Abierta" de actividades — paleta ámbar propia (pedido de Tim). */
.badge--cc-abierta { background: rgba(255, 191, 0, 0.16); color: #946F00; border-color: transparent; }
[data-theme="dark"] .badge--cc-abierta { color: #FFD24D; }

/* ============================================================
   Reuniones (panel del paso C de Nuevos Negocios)
   ============================================================ */
.reunion-list { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-2) 0; }
.reunion-item { display: flex; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); background: var(--bg-2); border-radius: var(--radius-md); border-left: 3px solid var(--info); }
.reunion-item__fecha { font-size: var(--fs-sm); font-weight: 600; color: var(--text-hi); }
.reunion-item__body { flex: 1; min-width: 0; }
.reunion-item__notas { font-size: var(--fs-sm); color: var(--text-md); }
.reunion-item__meta { font-size: var(--fs-xs); color: var(--text-lo); }

/* paso seleccionado en el detalle */
.paso-panel { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-4); margin-top: var(--sp-2); }
.paso-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.paso-panel__title { font-size: var(--fs-md); font-weight: 600; color: var(--text-hi); }

/* barra de progreso fina del seguimiento */
.proc-progress { height: 6px; border-radius: var(--radius-full); background: var(--bg-3); overflow: hidden; margin: var(--sp-2) 0; }
.proc-progress__fill { height: 100%; background: var(--proc, var(--accent)); border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease); }

/* header del detalle tintado por proceso */
.act-detail__kind { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; padding: 2px 10px; border-radius: var(--radius-full); background: var(--cc-dim, var(--accent-dim)); color: var(--cc, var(--accent)); }
.act-detail__kind svg { width: 14px; height: 14px; }

/* ============================================================
   Intención de la acción: chip (detalle + wizard) + atajo + checklist
   ============================================================ */
.cc-intent-chip,
.wiz__intent-tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 600; padding: 2px 9px; border-radius: var(--radius-full); background: var(--accent-dim); color: var(--accent); vertical-align: middle; }
.cc-intent-chip svg,
.wiz__intent-tag svg { width: 13px; height: 13px; }

/* atajo contextual del detalle de acción */
.cc-atajo { border-left: 3px solid var(--accent); }
.cc-atajo__label { font-size: var(--fs-xs); color: var(--text-lo); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.cc-atajo__row { font-size: var(--fs-sm); }

/* mini-checklist de la acción (detalle) */
.cc-chk-list { display: flex; flex-direction: column; gap: 4px; }
.cc-chk { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-md); padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.cc-chk:hover { background: var(--bg-2); }
.cc-chk input { width: 16px; height: 16px; accent-color: var(--success); cursor: pointer; flex: none; }
.cc-chk.is-done span { color: var(--text-lo); text-decoration: line-through; }

/* editor de la checklist (wizard) */
.cc-chk-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.cc-chk-edit__row { display: flex; align-items: center; gap: 6px; }
.cc-chk-edit__row input { flex: 1; min-width: 0; }
.cc-chk-edit__x { flex: none; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-2); color: var(--text-lo); cursor: pointer; font-size: 16px; line-height: 1; }
.cc-chk-edit__x:hover { color: var(--danger); border-color: var(--danger); }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 640px) {
  .stepper { flex-direction: column; align-items: stretch; gap: var(--sp-1); overflow-x: visible; }
  .stepper__step { flex-direction: row; align-items: center; text-align: left; gap: var(--sp-3); min-width: 0; padding: 4px 0; }
  .stepper__step:not(:last-child)::after { top: 36px; bottom: -4px; left: 17px; right: auto; width: 2px; height: auto; }
  .stepper__node { width: 34px; height: 34px; }
  .kanban { grid-auto-columns: 80vw; }
  .wiz__actions { position: sticky; bottom: 0; background: var(--bg-1); }
  .docpick { grid-template-columns: 1fr; }
  /* Forms/filas inline del detalle (checklist, evidencias, reuniones, "Actualizar
     estatus"): en desktop son `flex ... flex-wrap` con campos de ancho mixto; en
     ≤640px se reflowean en una rejilla ragged (campos y el botón saltando de
     renglón). Apilarlos en una sola columna full-width los vuelve un form vertical
     limpio + botón táctil ancho. `.cc-inline-form.flex` (0,2,0) gana a `.items-end`
     y `.flex-wrap` (0,1,0 c/u) sin importar el orden de carga de utilities.css, y
     cubre tanto <form> como <div>. align-items:stretch estira campos Y botón a
     full-width (ninguno fija width:explícito); nowrap asegura una sola columna (el
     flex:1/min-width inline quedan inertes en columna de altura auto). */
  .cc-inline-form.flex { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .wiz-screen, .wiz-screen.is-back,
  .wiz__trail-item.is-current::after,
  .stepper__step.is-done .stepper__node,
  .stepper__step.is-current .stepper__node,
  .docdet-overlay__backdrop, .docdet-overlay__card { animation: none; }
}
