/* ==========================================================================
 * Asistente de cierre de contrato (C.2) — identidad Wizard V2
 *
 * Modal pantalla completa con hero contextual, stepper guiado, workspace +
 * sidebar resumen y footer de acciones. Usa los tokens de tema existentes
 * (--text, --muted, --panel, --border, --primary) y los de los badges de
 * cierre (--nd-con-estado-cerrado-*, --nd-con-estado-pend-cierre-*).
 *
 * Namespace: .cier-w2 (paralelo a .cob-w2 para no chocar).
 * ========================================================================== */

.cier-w2 {
  position: fixed;
  inset: 0;
  /* Por encima de:
     - .nd-modal-backdrop.is-open (10200)
     - .app-fixed-brand (10101)
     - Cualquier sidebar/header del shell de la app
     El asistente debe tapar TODO el viewport mientras esté abierto. */
  z-index: 10300;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

/* Defensivo: styles.css tiene dos selectores globales sin namespace que están
   pensados para el shell principal de la app pero atrapan también a los
   elementos del asistente:
     aside { position: fixed; top: 0; left: 0; width: 250px; height: 100vh; ... }
     main  { padding: 20px; margin-left: 250px; min-height: 100vh; isolation: ... }

   Usamos :where() para que estos resets NO sumen especificidad — así las
   propiedades específicas de .cier-w2__summary y .cier-w2__workspace siguen
   ganando por orden de declaración. */
.cier-w2 :where(aside) {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  max-height: none;
  z-index: auto;
}

.cier-w2 :where(main) {
  margin: 0;
  padding: 0;
  min-height: 0;
  isolation: auto;
}

.cier-w2.hidden {
  display: none !important;
}

.cier-w2__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, 0.62);
  backdrop-filter: blur(2px);
}

.cier-w2__shell {
  position: relative;
  margin: auto;
  /* Ancho del shell: el operador prefiere 1280px de modal centrado (más
     proporcionado) en pantallas grandes, en vez de estirarlo a 1480. En
     pantallas <= 1280px ocupa todo el viewport igual. */
  width: min(1280px, 100%);
  max-height: 100vh;
  height: 100%;
  background: var(--panel);
  color: var(--text);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "hero"
    "stepper"
    "body"
    "actions";
  border-radius: 0;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  overflow: hidden;
  min-height: 0;
}

@media (min-width: 900px) {
  .cier-w2__shell {
    height: min(880px, calc(100vh - 24px));
    border-radius: 18px;
    border: 1px solid var(--border);
  }
}

/* ----------------------------- Hero contextual --------------------------- */
.cier-w2__hero {
  grid-area: hero;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    var(--cier-hero-bg, rgba(16, 185, 129, 0.14)) 0%,
    transparent 110%
  );
  position: relative;
}

.cier-w2__hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--cier-hero-icon-bg, rgba(16, 185, 129, 0.2));
  color: var(--cier-hero-icon-fg, #10b981);
  border: 1px solid var(--cier-hero-icon-border, rgba(16, 185, 129, 0.4));
  font-size: 1.2rem;
  font-weight: 700;
  align-self: start;
  flex-shrink: 0;
}

.cier-w2__hero-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cier-w2__hero-eyebrow {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cier-hero-eyebrow-fg, #10b981);
  line-height: 1.2;
}

.cier-w2__hero-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.2;
}

.cier-w2__hero-meta {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cier-w2__hero-meta-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.cier-w2__hero-meta-line strong {
  color: var(--text);
}

.cier-w2__hero-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: start;
}

.cier-w2__hero-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.cier-w2__hero-close:hover {
  background: var(--border);
}

/* Variantes de hero por tipo de cierre */
.cier-w2__hero[data-cier-tipo="operativo"] {
  --cier-hero-bg: rgba(16, 185, 129, 0.14);
  --cier-hero-icon-bg: rgba(16, 185, 129, 0.2);
  --cier-hero-icon-fg: #047857;
  --cier-hero-icon-border: rgba(16, 185, 129, 0.4);
  --cier-hero-eyebrow-fg: #047857;
}
.cier-w2__hero[data-cier-tipo="rescision"] {
  --cier-hero-bg: rgba(217, 119, 6, 0.16);
  --cier-hero-icon-bg: rgba(217, 119, 6, 0.2);
  --cier-hero-icon-fg: #b45309;
  --cier-hero-icon-border: rgba(217, 119, 6, 0.42);
  --cier-hero-eyebrow-fg: #b45309;
}
.cier-w2__hero[data-cier-tipo="pend_cierre"] {
  --cier-hero-bg: rgba(217, 119, 6, 0.2);
  --cier-hero-icon-bg: rgba(217, 119, 6, 0.26);
  --cier-hero-icon-fg: #b45309;
  --cier-hero-icon-border: rgba(217, 119, 6, 0.5);
  --cier-hero-eyebrow-fg: #b45309;
}
.cier-w2__hero[data-cier-tipo="cerrado"] {
  --cier-hero-bg: rgba(15, 23, 42, 0.14);
  --cier-hero-icon-bg: rgba(15, 23, 42, 0.18);
  --cier-hero-icon-fg: #0f172a;
  --cier-hero-icon-border: rgba(15, 23, 42, 0.35);
  --cier-hero-eyebrow-fg: #0f172a;
}

html.theme-f10 .cier-w2__hero[data-cier-tipo="operativo"] {
  --cier-hero-icon-fg: #6ee7b7;
  --cier-hero-eyebrow-fg: #6ee7b7;
}
html.theme-f10 .cier-w2__hero[data-cier-tipo="rescision"],
html.theme-f10 .cier-w2__hero[data-cier-tipo="pend_cierre"] {
  --cier-hero-icon-fg: #fbbf24;
  --cier-hero-eyebrow-fg: #fbbf24;
}
html.theme-f10 .cier-w2__hero[data-cier-tipo="cerrado"] {
  --cier-hero-icon-fg: #cbd5e1;
  --cier-hero-eyebrow-fg: #cbd5e1;
}

/* Tema dark default (sin clase): los colores dark del eyebrow / icono. */
html:not(.theme-f5) .cier-w2__hero[data-cier-tipo="operativo"] {
  --cier-hero-icon-fg: #6ee7b7;
  --cier-hero-eyebrow-fg: #6ee7b7;
}
html:not(.theme-f5) .cier-w2__hero[data-cier-tipo="rescision"],
html:not(.theme-f5) .cier-w2__hero[data-cier-tipo="pend_cierre"] {
  --cier-hero-icon-fg: #fbbf24;
  --cier-hero-eyebrow-fg: #fbbf24;
}
html:not(.theme-f5) .cier-w2__hero[data-cier-tipo="cerrado"] {
  --cier-hero-icon-fg: #cbd5e1;
  --cier-hero-eyebrow-fg: #cbd5e1;
}

/* ------------------------------- Stepper -------------------------------- */
.cier-w2__stepper-wrap {
  grid-area: stepper;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 6px 10px;
}

.cier-w2__stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

@media (max-width: 720px) {
  .cier-w2__stepper {
    grid-template-columns: 1fr 1fr;
  }
}

.cier-w2__step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--muted);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-width: 0;
  width: 100%;
}

.cier-w2__step:hover {
  background: rgba(255, 255, 255, 0.04);
}

html.theme-f5 .cier-w2__step:hover {
  background: rgba(60, 54, 48, 0.06);
}

.cier-w2__step.is-active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--text);
}

.cier-w2__step.is-done {
  color: var(--text);
}

.cier-w2__step:disabled,
.cier-w2__step[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.cier-w2__step-n {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

html.theme-f5 .cier-w2__step-n {
  background: rgba(60, 54, 48, 0.1);
}

.cier-w2__step.is-active .cier-w2__step-n {
  background: rgba(16, 185, 129, 0.6);
  color: #052e1f;
}

.cier-w2__step.is-done .cier-w2__step-n {
  background: rgba(16, 185, 129, 0.3);
  color: var(--text);
}

.cier-w2__step-t {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cier-w2__step-t strong {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.18;
}

.cier-w2__step-t span {
  font-size: 0.72rem;
  opacity: 0.85;
  line-height: 1.25;
}

/* -------------------------------- Body ---------------------------------- */
.cier-w2__body {
  grid-area: body;
  display: grid;
  /* Sidebar de KPIs un toque más ancho para aprovechar el shell extendido a
     1480px y dar más respiro a labels largos (TOTAL A COBRAR AL INQUILINO,
     etc.) sin que se quiebren feo. */
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  grid-template-areas: "workspace summary";
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 899px) {
  .cier-w2__body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "summary"
      "workspace";
    overflow: hidden;
  }
}

.cier-w2__workspace {
  grid-area: workspace;
  overflow-y: auto;
  overflow-x: hidden;
  /* Más padding lateral (22 → 28) ahora que el shell es más ancho, para que
     las cards no queden pegadas al borde y respiren mejor. */
  padding: 18px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  outline: none;
  min-height: 0;
}

.cier-w2__summary {
  /* Reset agresivo del selector global `aside { position: fixed; top: 0; left: 0;
     width: 250px; height: 100vh; z-index: 10100; }` que vive en styles.css y
     que estaba sacando este sidebar del grid del modal y plantándolo sobre el
     backdrop. Forzamos volver al flujo normal del grid del shell. */
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  max-height: none;
  z-index: auto;

  grid-area: summary;
  border-left: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.05) 100%
  ),
  var(--panel);
  padding: 18px 18px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  min-width: 280px;
  box-sizing: border-box;
}

html.theme-f5 .cier-w2__summary {
  background: linear-gradient(
    180deg,
    rgba(60, 54, 48, 0.04) 0%,
    rgba(60, 54, 48, 0.08) 100%
  ),
  var(--panel);
}

@media (max-width: 899px) {
  .cier-w2__summary {
    border-left: 0;
    border-bottom: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    max-height: 38vh;
    padding: 14px 16px 16px;
  }
}

/* Cards y secciones del workspace */
.cier-w2-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cier-w2-card--accent {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(
    180deg,
    rgba(16, 185, 129, 0.07) 0%,
    transparent 60%
  );
}

.cier-w2-card--warn {
  border-color: var(--nd-con-estado-pend-cierre-border, rgba(217, 119, 6, 0.42));
  background: linear-gradient(
    180deg,
    var(--nd-con-estado-pend-cierre-bg, rgba(217, 119, 6, 0.16)) 0%,
    transparent 60%
  );
}

.cier-w2-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cier-w2-card__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

.cier-w2-card__sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.cier-w2-card__divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Listas de conceptos read-only (lo que se cobra / se devuelve / es constancia) */
.cier-w2-concepts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cier-w2-concept {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
  gap: 4px 14px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.cier-w2-concept:last-child {
  border-bottom: 0;
}

.cier-w2-concept__lbl {
  font-size: 0.92rem;
  color: var(--text);
  min-width: 0;
  word-break: break-word;
}

.cier-w2-concept__sub {
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

.cier-w2-concept__val {
  font-weight: 700;
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-align: right;
  word-break: break-word;
  min-width: 0;
}

/* Stack: label arriba, valor abajo (texto largo: vigencia, direcciones). */
.cier-w2-concept--stack {
  grid-template-columns: 1fr;
  gap: 2px;
}
.cier-w2-concept--stack .cier-w2-concept__val {
  text-align: left;
  font-weight: 600;
}

.cier-w2-concept--neg .cier-w2-concept__val {
  color: #b45309;
}

html.theme-f10 .cier-w2-concept--neg .cier-w2-concept__val {
  color: #fbbf24;
}

.cier-w2-concept--ok .cier-w2-concept__val {
  color: #047857;
}

html.theme-f10 .cier-w2-concept--ok .cier-w2-concept__val {
  color: #6ee7b7;
}

/* Chips semánticos: caja vs constancia, etc. */
.cier-w2-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.cier-w2-chip--caja {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.4);
}

html.theme-f10 .cier-w2-chip--caja {
  color: #6ee7b7;
}

.cier-w2-chip--constancia {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.32);
}

html.theme-f10 .cier-w2-chip--constancia {
  color: #f59e0b;
}

.cier-w2-chip--info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.32);
}

html.theme-f10 .cier-w2-chip--info {
  color: #93c5fd;
}

.cier-w2-chip--warn {
  background: var(--nd-con-estado-pend-cierre-bg, rgba(217, 119, 6, 0.16));
  color: var(--nd-con-estado-pend-cierre-fg, #b45309);
  border-color: var(--nd-con-estado-pend-cierre-border, rgba(217, 119, 6, 0.42));
}

/* Alert blocks (aviso operativo + warnings) */
.cier-w2-alert {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  border: 1px solid var(--border);
  background: var(--panel);
}

.cier-w2-alert--warn {
  border-color: var(--nd-con-estado-pend-cierre-border, rgba(217, 119, 6, 0.42));
  background: var(--nd-con-estado-pend-cierre-bg, rgba(217, 119, 6, 0.12));
  color: var(--nd-con-estado-pend-cierre-fg, #b45309);
}

.cier-w2-alert--info {
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
}

html.theme-f10 .cier-w2-alert--info {
  color: #93c5fd;
}

.cier-w2-alert--ok {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

html.theme-f10 .cier-w2-alert--ok {
  color: #6ee7b7;
}

.cier-w2-alert__title {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.cier-w2-alert p {
  margin: 4px 0;
}

.cier-w2-alert__list {
  margin: 6px 0 4px;
  padding-left: 18px;
  list-style: disc;
}

.cier-w2-alert__list li {
  margin: 2px 0;
}

/* ------------------------- Inputs y radios (C.2-B) ----------------------
 * Campos editables del asistente. Identidad Wizard V2: cards limpias, prefix
 * de moneda, hints abajo, focus ring verde, radios tipo "card seleccionable".
 * ------------------------------------------------------------------------ */

.cier-w2-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 720px) {
  .cier-w2-fields--row {
    flex-direction: row;
    align-items: stretch;
  }
  .cier-w2-fields--row > * {
    flex: 1 1 0;
    min-width: 0;
  }
}

.cier-w2-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cier-w2-field--compact {
  gap: 2px;
}

.cier-w2-field__lbl {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cier-w2-field__hint {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.cier-w2-field__input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cier-w2-field__input:focus-within {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.cier-w2-field__prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--border);
  min-width: 38px;
}

html.theme-f5 .cier-w2-field__prefix {
  background: rgba(60, 54, 48, 0.04);
}

.cier-w2-field--text .cier-w2-field__input {
  /* sin prefix → padding del input directo */
}

.cier-w2-input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.94rem;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  padding: 9px 12px;
  min-width: 0;
  width: 100%;
}

.cier-w2-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.cier-w2-input::-webkit-outer-spin-button,
.cier-w2-input::-webkit-inner-spin-button {
  /* Spinners feos por defecto: los ocultamos; los importes se editan a mano. */
  -webkit-appearance: none;
  margin: 0;
}

.cier-w2-input[type="number"] {
  -moz-appearance: textfield;
}

/* C.3.1 — Resolución de caja: select como cier-w2-input + estado disabled. */
select.cier-w2-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% + 1px),
    calc(100% - 11px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
  cursor: pointer;
}

.cier-w2-input[type="date"] {
  font-variant-numeric: tabular-nums;
}

.cier-w2-field--disabled .cier-w2-field__lbl {
  opacity: 0.55;
}

.cier-w2-field--disabled .cier-w2-field__input {
  opacity: 0.55;
  pointer-events: none;
  background: rgba(127, 127, 127, 0.06);
}

/* Radio groups: cada opción es una "card" seleccionable, en columna. */
.cier-w2-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cier-w2-radio {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.cier-w2-radio:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(16, 185, 129, 0.32);
}

html.theme-f5 .cier-w2-radio:hover {
  background: rgba(60, 54, 48, 0.04);
}

.cier-w2-radio.is-checked {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.07);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12) inset;
}

/* C.3.1 fix#1 — radio bloqueado cuando el último mes no está cobrado en
 * Cobranzas. Se muestra atenuado y sin hover; igual queda visible para que
 * el operador entienda que la opción existe pero no se puede usar todavía. */
.cier-w2-radio.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(127, 127, 127, 0.04);
}

.cier-w2-radio.is-disabled:hover {
  background: rgba(127, 127, 127, 0.04);
  border-color: var(--border);
}

html.theme-f5 .cier-w2-radio.is-disabled:hover {
  background: rgba(60, 54, 48, 0.03);
}

.cier-w2-radio input[type="radio"] {
  /* Radio nativo oculto, mostramos el indicador custom. */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.cier-w2-radio__indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
  position: relative;
  margin-top: 2px;
  transition: border-color 0.15s ease;
}

.cier-w2-radio.is-checked .cier-w2-radio__indicator {
  border-color: #10b981;
  background: radial-gradient(circle at center, #10b981 38%, transparent 42%);
}

.cier-w2-radio__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cier-w2-radio__body strong {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.cier-w2-radio__body span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ------------------------------- Sidebar -------------------------------- */
.cier-w2-sum__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.cier-w2-sum__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.cier-w2-sum__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.cier-w2-sum__meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.cier-w2-sum-kpis {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cier-w2-sum-kpi {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cier-w2-sum-kpi__lbl {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cier-w2-sum-kpi__val {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.cier-w2-sum-kpi__hint {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 2px;
}

.cier-w2-sum-kpi--neto .cier-w2-sum-kpi__val {
  color: #047857;
}

html.theme-f10 .cier-w2-sum-kpi--neto .cier-w2-sum-kpi__val {
  color: #6ee7b7;
}

.cier-w2-sum-kpi--devolver .cier-w2-sum-kpi__val {
  color: #b45309;
}

html.theme-f10 .cier-w2-sum-kpi--devolver .cier-w2-sum-kpi__val {
  color: #fbbf24;
}

.cier-w2-sum-divider {
  height: 1px;
  background: var(--border);
}

.cier-w2-sum__foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ------------------------------- Actions -------------------------------- */
.cier-w2__actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}

.cier-w2__actions-left,
.cier-w2__actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cier-w2__actions .btn {
  min-width: 110px;
}

@media (max-width: 720px) {
  .cier-w2__actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .cier-w2__actions-left,
  .cier-w2__actions-right {
    width: 100%;
  }
  .cier-w2__actions-right {
    justify-content: space-between;
  }
  .cier-w2__actions .btn {
    flex: 1;
    min-width: 0;
  }
}

/* Body lock cuando el asistente está abierto */
body.cier-w2-open {
  overflow: hidden;
}
