/* Mosal CRM · Rediseño UX (23/10/2026, fase 6) · seguimiento-rd-comercial.css
   El Panel comercial del rediseño (seguimiento-rd-comercial.js), acotado a .rd-com (solo existe con REDISENO_UX), y las
   dos hojas que abre en la ventana del portal (.rc-hoja-cita, .rc-hoja-envio, dentro del envoltorio .m-rd de los diálogos).
   La fila del comercial: dos líneas en el escritorio (nombre y lugar · fase y Cita · Contrato · Fotos), la siguiente acción
   en medio, el plazo y UN botón; apilada por debajo de 760 px de página. */
.rd-com { display: block; }
.rd-com .rc-page { padding-top: var(--m-sp-3, 12px); }

/* Resumen: las cifras filtran; a la derecha, «Ver el panel de» y «Nuevo presupuesto» */
.rd-com .rc-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin: 0 0 var(--m-sp-2, 8px); }
.rd-com .rc-summary .m-summary__item { background: none; border: 0; padding: 6px 4px; font: inherit; color: var(--m-text); cursor: pointer; display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; border-radius: var(--m-r-sm, 4px); }
.rd-com .rc-summary .m-summary__item:hover { background: var(--m-hover, #f2f4f3); }
.rd-com .rc-summary .m-summary__item.is-on { box-shadow: inset 0 -3px 0 var(--m-text); }
.rd-com .rc-summary .m-summary__n { font-size: var(--m-fs-18, 18px); font-weight: var(--m-fw-bold, 700); font-variant-numeric: tabular-nums; }
.rd-com .rc-summary__fin { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rd-com .rc-ver { display: inline-flex; align-items: center; gap: 8px; font-size: var(--m-fs-14, 14px); color: var(--m-text-2); }
.rd-com .rc-ver .m-input { min-height: 36px; padding: 0 8px; max-width: 260px; }
.rd-com .rc-tabs { margin: 0 0 var(--m-sp-2, 8px); }
.rd-com .rc-tabs .m-tab { background: none; border: 0; font: inherit; cursor: pointer; }
.rd-com .rc-week { margin: 0 0 var(--m-sp-3, 12px); }
.rd-com .rc-week .m-weekstrip__day { font: inherit; text-align: left; cursor: pointer; }
.rd-com .m-filtro-on .m-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--m-link, #0e5ca8); text-decoration: underline; }
.rd-com .rc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--m-line); }
.rd-com .rc-chips .m-chip { font: inherit; cursor: pointer; }
.rd-com .rc-listas { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--m-sp-3, 12px); }
.rd-com .rc-listas > * { min-width: 0; }

/* La fila */
.rd-com .rc-row { display: grid; grid-template-columns: 20px minmax(200px, 1fr) minmax(0, 1fr) minmax(110px, auto) auto;
  grid-template-areas: "ic who next due act" "ic marks marks due act" "ic est est est est"; column-gap: 16px; row-gap: 4px; align-items: center; padding: 10px 16px; }
.rd-com .rc-row .m-row__ic { grid-area: ic; align-self: start; padding-top: 2px; }
.rd-com .rc-row__who { grid-area: who; display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; }
.rd-com .rc-row__who .m-row__open { flex: 0 1 auto; min-width: 4em; max-width: 72%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-com .rc-row__who .m-row__open--sin { color: var(--m-text); font-weight: var(--m-fw-semibold, 600); text-decoration: none; }
.rd-com .rc-row__marks { grid-area: marks; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px 12px; min-width: 0; }
.rd-com .rc-row__next { grid-area: next; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: var(--m-fs-15, 15px); }
.rd-com .rc-row__next .m-row__txt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rd-com .rc-row__marks .m-marks { flex-wrap: nowrap; }
.rd-com .rc-row .m-row__due { grid-area: due; justify-self: start; }
.rd-com .rc-row .m-row__act { grid-area: act; justify-self: end; }
.rd-com .rc-row__estado { grid-area: est; min-width: 0; }
.rd-com .rc-row__estado .m-savestate:empty { display: none; }
.rd-com .rc-row .m-tick { font-size: var(--m-fs-14, 14px); }
.rd-com .rc-row .m-tick--subir input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rd-com .rc-row--pres .m-row__open--sin { font-weight: var(--m-fw-semibold, 600); }
.rd-com .rc-rastro { padding: 10px 16px; }
.rd-com .rc-obras .m-list { border-top: 0; }
.rd-com .rc-pres__otro { display: inline-flex; margin-top: 8px; font-size: var(--m-fs-14, 14px); }
.rd-com .m-pres__act { flex-wrap: wrap; gap: 6px; }

@container pagina (max-width: 820px) {
  .rd-com .rc-row { grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-areas: "ic who due" "ic marks marks" "ic next next" "ic act act" "ic est est"; }
  .rd-com .rc-row__marks, .rd-com .rc-row__marks .m-marks { flex-wrap: wrap; }
  .rd-com .rc-row__next .m-row__txt { white-space: normal; }
  .rd-com .rc-row .m-row__due { justify-self: end; }
  .rd-com .rc-row .m-row__act { justify-self: start; flex-wrap: wrap; }
}
@container pagina (max-width: 520px) {
  .rd-com .rc-row { grid-template-columns: 20px minmax(0, 1fr); grid-template-areas: "ic who" "ic due" "ic marks" "ic next" "ic act" "ic est"; padding: 10px 12px 12px; }
  .rd-com .rc-row__who { flex-wrap: wrap; row-gap: 2px; }
  .rd-com .rc-row__who .m-row__open { max-width: 100%; }
  .rd-com .rc-row .m-row__place { flex-basis: 100%; }
  .rd-com .rc-row .m-row__act { width: 100%; }
  .rd-com .rc-row .m-row__act .m-btn--row { flex: 1 1 auto; min-height: var(--m-target, 44px); }
  .rd-com .rc-row .m-row__act .m-icon-btn { width: var(--m-target, 44px); height: var(--m-target, 44px); }
  /* components.css fija con !important las áreas de la fila en el móvil (who · sub · state · next · marks · act): la fila
     del comercial usa esas mismas, y su línea de estado va debajo, a todo el ancho */
  .rd-com .rc-row .rc-row__estado { grid-area: auto; grid-column: 2 / -1; }
  .rd-com .rc-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .rd-com .rc-summary { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 4px; }
  .rd-com .rc-summary .m-summary__item { min-height: 44px; }
  .rd-com .rc-summary__fin { margin-left: 0; width: 100%; grid-column: 1 / -1; }
  .rd-com .rc-summary__fin .m-btn { writing-mode: horizontal-tb; }
  .rd-com .rc-summary__fin .rc-nuevo { flex: 1 1 auto; }
  .rd-com .rc-ver { width: 100%; }
  .rd-com .rc-ver .m-input { max-width: none; flex: 1 1 auto; }
  .rd-com .rc-week { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(96px, max-content); overflow-x: auto; }
  .rd-com .rc-chips { flex-wrap: nowrap; overflow-x: auto; }
  .rd-com .m-tabs { overflow-x: auto; }
  .rd-com .rc-tabs .m-tab { white-space: nowrap; }
}

/* El contrato en la página: el formulario de siempre (contracting.js) y la barra de acción dentro del área de contenido */
.rd-com .rc-page--contrato { max-width: 960px; }
.rd-com .rc-contrato__cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 8px; }
.rd-com .rc-contrato__cab .m-h2 { margin: 0; font-size: var(--m-fs-20, 20px); }
.rd-com .rc-contrato__nota { margin: 0 0 12px; }
.rd-com .rc-contrato__form .ct-submit, .rd-com .rc-contrato__form #contract-save-status, .rd-com .rc-contrato__form .ct-eyebrow { display: none; }
.rd-com .rc-contrato__form .ct-form-wrap > .ct-title { display: none; }
.rd-com .rc-contrato__form .ct-form-wrap > .ct-sub { margin-top: 0; }
.rd-com .rc-dock { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; padding: 12px 16px; background: var(--m-surface); border: 1px solid var(--m-line); border-radius: var(--m-r-md, 8px); box-sizing: border-box; z-index: 20; }
.rd-com .rc-dock.is-fija { margin: 0; box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
.rd-com .rc-dock__estado { margin-right: auto; color: var(--m-text-2); font-size: var(--m-fs-14, 14px); min-width: 0; }
.rd-com .rc-dock[hidden] { display: none; }
@media (max-width: 520px) { .rd-com .rc-dock .m-btn { flex: 1 1 auto; min-height: var(--m-target, 44px); } }

/* Las hojas (en la ventana del portal) */
.rc-hoja-cita .rc-hoja__nota { margin: 0 0 8px; }
.rc-hoja-cita .m-slots { max-height: min(52vh, 460px); }
.rc-hoja-cita .m-dialog__actions .rc-hoja__agenda { margin-right: auto; }
.rc-hoja-envio .rc-envio__corregir .m-field { margin-top: 6px; }
.rc-hoja-envio .rc-envio__corregir .m-field[hidden], .rc-hoja-envio [data-rc-aviso][hidden] { display: none; }
.rc-hoja-envio .m-field__warn .m-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--m-link, #0e5ca8); text-decoration: underline; }
.rc-hoja-envio .m-dialog__actions { flex-wrap: wrap; }
/* El modo índice de components.css (≤ 760 px de página) esconde el botón de la fila: en el panel comercial no hay cajón al
   lado que lo sustituya, así que la fila se apila con su botón (como «Sin cajón y estrecho» del prototipo) */
@container pagina (max-width: 760px) {
  .rd-com .m-row .m-row__act { display: flex !important; justify-content: flex-start; flex-wrap: wrap; }
  .rd-com .m-row:not(.rc-row) { grid-template-areas: "ic who due" "ic state state" "ic next next" "ic act act"; }
  .rd-com .m-row:not(.rc-row) .m-row__next { display: flex !important; }
}

/* Presupuesto VE en una pantalla (presupuesto-rd.js; solo con REDISENO_UX: body.rd-pres): los pasos 1 y 2 a la vez y la
   columna del precio fija a la derecha con «Generar y enviar» y «⋯». «Ajustar precio y partidas» (rd-pres--ajustes)
   enseña el paso 3 de siempre. */
body.rd-pres:not(.rd-pres--ajustes) #portal-workflow, body.rd-pres:not(.rd-pres--ajustes) #main-action-dock { display: none !important; }
body.rd-pres:not(.rd-pres--ajustes) #step-1, body.rd-pres:not(.rd-pres--ajustes) #step-2 { display: block !important; }
body.rd-pres:not(.rd-pres--ajustes) #step-3 { display: none !important; }
body.rd-pres #step-2 > h2 { font-size: 1.125rem; }
body.rd-pres .rd-pres-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 24px; align-items: start; }
body.rd-pres .rd-pres-grid > * { grid-column: 1; }
body.rd-pres .rd-pres-grid > #rd-pres-precio { grid-column: 2; grid-row: 1 / span 40; position: sticky; top: 16px; }
body.rd-pres.rd-pres--ajustes .rd-pres-grid { display: block; }
body.rd-pres.rd-pres--ajustes #rd-pres-precio, body:not(.rd-pres) #rd-pres-precio, body:not(.rd-pres) #rd-pres-volver { display: none; }
body.rd-pres:not(.rd-pres--ajustes) #rd-pres-volver { display: none; }
.rd-pres-precio__caja { background: var(--m-surface, #fff); border: 1px solid var(--m-line, #dde2e0); border-radius: 12px; padding: 16px; display: grid; gap: 8px; }
.rd-pres-precio__etq { margin: 0; font-size: 14px; color: var(--m-text-2, #4a5552); }
.rd-pres-precio__total { margin: 0; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--m-text, #121a17); }
.rd-pres-precio__nota { margin: 0; font-size: 14px; color: var(--m-text-2, #4a5552); min-height: 2.6em; }
.rd-pres-precio__acc { display: flex; gap: 8px; }
.rd-pres-precio__gen { flex: 1 1 auto; min-height: 48px; }
.rd-pres-precio__mas { width: 48px; height: 48px; font-size: 20px; }
.rd-pres-precio__estado { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--m-done-ink, #1f6b3a); }
.rd-pres-precio__estado.is-error { color: var(--m-block-ink, #a3262a); }
.rd-pres-precio__ajustar { justify-self: start; background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; color: var(--m-link, #0e5ca8); text-decoration: underline; cursor: pointer; }
.rd-pres-volver { margin: 0 0 12px; }
@media (max-width: 1100px) {
  body.rd-pres .rd-pres-grid { grid-template-columns: minmax(0, 1fr); }
  body.rd-pres .rd-pres-grid > #rd-pres-precio { grid-column: 1; grid-row: auto; position: sticky; bottom: 0; top: auto; z-index: 30; }
  body.rd-pres .rd-pres-precio__caja { grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 12px 12px 0 0; box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
  body.rd-pres .rd-pres-precio__etq, body.rd-pres .rd-pres-precio__nota { display: none; }
  body.rd-pres .rd-pres-precio__total { font-size: 22px; }
  body.rd-pres .rd-pres-precio__estado, body.rd-pres .rd-pres-precio__ajustar { grid-column: 1 / -1; }
}
