/* Gerónimo Grillo · Marmolería — estilos de la aplicación.
   Piedra clara de fondo, azul del isotipo GG y un acento bronce. Superficies sólidas para trabajar. */
:root {
  --tinta: #0d1b31;
  --tinta-2: #162b4d;
  --marca: #13294b;
  --acento: #1f5aa6;
  --acento-suave: #e9f0fa;
  --bronce: #a47c48;
  --bronce-suave: #f6efe4;
  --fondo: #f3f1ec;
  --superficie: #ffffff;
  --superficie-2: #faf9f6;
  --texto: #172033;
  --suave: #5c6577;
  --tenue: #8a92a1;
  --borde: #e3e0d9;
  --borde-fuerte: #ccc8bf;
  --ok: #17703a; --ok-fondo: #e6f3ea;
  --aviso: #885700; --aviso-fondo: #fff4d9;
  --error: #b42318; --error-fondo: #fdecec;
  --radio: 14px;
  --radio-chico: 9px;
  --sombra: 0 1px 2px rgba(13, 27, 49, .05), 0 6px 20px rgba(13, 27, 49, .05);
  --sombra-alta: 0 2px 6px rgba(13, 27, 49, .08), 0 16px 40px rgba(13, 27, 49, .10);
  --lateral: 252px;
  --letra: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --letra-titulo: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* «hidden» gana aunque el elemento tenga display propio */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--letra); background: var(--fondo); color: var(--texto); line-height: 1.5;
       font-size: 15px; }
h1, h2, h3 { font-family: var(--letra-titulo); letter-spacing: -.015em; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 6px; font-weight: 650; }
h2 { font-size: 1.12rem; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 1rem; margin: 14px 0 6px; font-weight: 650; }
a { color: var(--acento); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; border-radius: 4px; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icono { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8;
         stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Menú lateral ---------- */
.lateral { position: fixed; inset: 0 auto 0 0; width: var(--lateral); z-index: 30; display: flex; flex-direction: column;
           color: #dfe6f1; padding: 18px 14px 14px;
           background:
             url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='700' fill='none' stroke='%23ffffff' stroke-opacity='.06'%3E%3Cpath d='M-20 120C60 90 90 170 160 150s110-60 140-40'/%3E%3Cpath d='M-10 420c50-30 120 10 170-20s70-90 120-80'/%3E%3Cpath d='M30 640c40-50 110-40 150-80'/%3E%3Cpath d='M80 -10c20 60 10 130 60 180s40 120 90 160' stroke-opacity='.04'/%3E%3C/svg%3E") no-repeat center / cover,
             linear-gradient(165deg, var(--tinta) 0%, var(--tinta-2) 100%); }
.lateral .marca { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; padding: 2px 6px 16px; }
.lateral .marca img { height: 40px; width: auto; background: #fff; border-radius: 10px; padding: 3px; }
.lateral .marca strong { display: block; font-size: .98rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 650; }
.lateral .marca small { display: block; font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; color: #c7b28f; }
.cta-lateral { width: 100%; justify-content: center; margin: 0 0 14px; background: var(--bronce); color: #fff;
               box-shadow: 0 6px 16px rgba(0, 0, 0, .25); font-weight: 600; }
.cta-lateral:hover { filter: brightness(1.08); }
.lateral nav.menu { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.lateral nav.menu a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: #cfd8e6;
                      text-decoration: none; font-size: .93rem; }
.lateral nav.menu a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.lateral nav.menu a.activo { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600;
                             box-shadow: inset 3px 0 0 var(--bronce); }
.lateral nav.menu a span:first-of-type { flex: 1; }
.insignia { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #e5484d; color: #fff;
            font-size: .75rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.lateral-pie { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 12px; padding-top: 12px; display: flex;
               align-items: center; gap: 8px; }
.lateral-pie > a.boton { margin-left: auto; padding: 8px; color: #cfd8e6; }
.lateral-pie form { margin: 0; }
.lateral-pie button { color: #cfd8e6; }
.persona { display: flex; align-items: center; gap: 10px; min-width: 0; }
.persona strong { display: block; font-size: .86rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona small { display: block; font-size: .74rem; color: #9fb0c8; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bronce-suave); color: var(--marca);
          display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.velo { position: fixed; inset: 0; background: rgba(13, 27, 49, .45); z-index: 25; }

.pagina { min-height: 100vh; }
.con-menu .pagina { margin-left: var(--lateral); }
.barra-movil { display: none; }
.demo { background: var(--bronce-suave); color: #6a4f26; padding: 5px 24px; font-size: .78rem; text-align: center;
        border-bottom: 1px solid #eadfcb; }
main { max-width: 1280px; margin: 0 auto; padding: 26px 32px 56px; }

/* ---------- Encabezados de página ---------- */
.encabezado { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; align-items: flex-end;
              margin-bottom: 18px; }
.encabezado h1 { margin: 0 0 4px; }
.encabezado p { margin: 0; }
.miga { font-size: .85rem; margin: 0 0 8px; color: var(--suave); }
.miga a { color: var(--suave); text-decoration: none; }
.miga a:hover { color: var(--acento); }
.subtitulo { color: var(--suave); }

/* ---------- Superficies ---------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px;
           margin-bottom: 18px; box-shadow: var(--sombra); }
.tarjeta > h2:first-child, .tarjeta > .tarjeta-cabeza:first-child { margin-top: 0; }
.tarjeta-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tarjeta-cabeza h2 { margin: 0; }
.grilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.dos-columnas { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.suave { color: var(--suave); }
.tenue { color: var(--tenue); font-size: .85rem; }
.vacio { color: var(--suave); font-style: italic; }
.aviso { color: var(--aviso); font-weight: 600; }
.falta { color: var(--aviso); font-weight: 600; margin: 6px 0; }

/* ---------- Indicadores ---------- */
.indicador .valor { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.indicador .sin-datos { color: var(--suave); font-style: italic; font-weight: 500; font-size: 1.1rem; }
a.indicador { text-decoration: none; color: inherit; display: block; }
a.indicador:hover { border-color: var(--acento); }
.indicador.activo { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento) inset; }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { color: var(--suave); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
     background: var(--superficie-2); }
thead th:first-child { border-top-left-radius: 8px; } thead th:last-child { border-top-right-radius: 8px; }
.tabla-scroll { overflow-x: auto; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: #f6f8fc; }
tr[data-href] td:first-child a { font-weight: 600; text-decoration: none; }
tr.reemplazado td { color: var(--suave); }
tr.fila-pendiente td { background: #fffaf0; }
tr.fila-alerta td { background: #fdf0f0; }
.celda-principal strong { display: block; }
.celda-principal small { color: var(--suave); }

/* ---------- Estados y etiquetas ---------- */
.estado { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem;
          font-weight: 600; background: #eef0f3; color: #3c4658; white-space: nowrap; }
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.estado-CANCELADO, .estado-PERDIDO, .estado-DESCARTADA, .estado-CANCELADA { background: var(--error-fondo); color: var(--error); }
.estado-ENTREGADO, .estado-ACEPTADO, .estado-GANADO, .estado-APROBADA, .estado-REALIZADA { background: var(--ok-fondo); color: var(--ok); }
.estado-EN_PRODUCCION, .estado-BORRADOR, .estado-POR_REVISAR, .estado-EN_ATENCION { background: var(--aviso-fondo); color: var(--aviso); }
.estado-ENVIADO, .estado-TERMINADO, .estado-PRESUPUESTADO, .estado-CONTACTADO, .estado-CONFIRMADO, .estado-AGENDADA { background: var(--acento-suave); color: var(--acento); }
.estado-NUEVO { background: var(--bronce-suave); color: #7a5a2c; }
.estado-DERIVADA { background: #fde7ea; color: #b4233a; }
.estado-RECHAZADO, .estado-REEMPLAZADO { background: #f0f0ee; color: var(--suave); }
.etiqueta { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: .74rem; background: #eef0f3;
            color: var(--suave); font-weight: 500; }
.etiqueta.ok { background: var(--ok-fondo); color: var(--ok); }
.etiqueta.pendiente { background: var(--aviso-fondo); color: var(--aviso); }
.etiqueta.error { background: var(--error-fondo); color: var(--error); }
.etiqueta.ia { background: #efe9fb; color: #5b3fa8; }
.estados { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.estado-area { border: 1px solid var(--borde); border-left-width: 4px; border-radius: 10px; padding: 9px 12px; background: #fff; }
.estado-area .area { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); }
.estado-area .texto { font-weight: 600; margin: 2px 0 4px; }
.estado-area .suave { font-size: .85rem; }
.nivel-ok { border-left-color: var(--ok); } .nivel-en_curso { border-left-color: var(--acento); }
.nivel-pendiente { border-left-color: #d29922; } .nivel-alerta { border-left-color: var(--error); }
.nivel-sin_datos { border-left-color: var(--borde); }

/* ---------- Botones y formularios ---------- */
.boton, button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--marca);
                 color: #fff; border: 1px solid transparent; border-radius: var(--radio-chico); padding: 9px 15px;
                 font: inherit; font-size: .93rem; font-weight: 550; cursor: pointer; text-decoration: none;
                 min-height: 40px; line-height: 1.2; transition: filter .15s, background .15s, box-shadow .15s; }
.boton:hover, button:hover { filter: brightness(1.15); }
.boton.secundario, button.secundario { background: #fff; color: var(--marca); border-color: var(--borde-fuerte); }
.boton.secundario:hover, button.secundario:hover { filter: none; background: var(--superficie-2); border-color: var(--marca); }
.boton.fantasma, button.fantasma { background: transparent; color: inherit; border-color: transparent; padding: 7px; min-height: 36px; }
.boton.fantasma:hover, button.fantasma:hover { background: rgba(127, 127, 127, .12); filter: none; }
.boton.bronce, button.bronce { background: var(--bronce); }
.boton.exito, button.exito { background: var(--ok); }
.boton.peligro, button.peligro { background: #fff; color: var(--error); border-color: #f1b8b8; }
.boton.whatsapp, button.whatsapp { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.boton.grande, button.grande { padding: 13px 22px; font-size: 1.02rem; min-height: 50px; border-radius: 12px; }
.boton.chico, button.chico { padding: 4px 10px; font-size: .84rem; min-height: 32px; }
.boton[aria-disabled="true"] { opacity: .5; pointer-events: none; }
form p { margin: 0 0 14px; }
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .88rem; color: #2a3446; }
input, select, textarea { width: 100%; max-width: 520px; padding: 9px 11px; border: 1px solid var(--borde-fuerte);
                          border-radius: var(--radio-chico); font: inherit; background: #fff; color: var(--texto);
                          transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px rgba(31, 90, 166, .15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--marca); }
.helptext { display: block; color: var(--suave); font-size: .82rem; margin-top: 3px; }
.errorlist { color: var(--error); margin: 4px 0; padding-left: 18px; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acciones form { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin: 0; }
.acciones input, .acciones select { width: auto; }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filtros p { margin: 0; flex: 1 1 220px; }
.buscador { position: relative; flex: 1 1 280px; max-width: 420px; }
.buscador .icono { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--tenue); }
.buscador input { padding-left: 36px; max-width: none; }
td form { display: inline-flex; gap: 4px; flex-wrap: wrap; margin: 0; }
td input, td select { width: auto; max-width: 160px; }
td.acciones-fila { min-width: 120px; }
td.acciones-fila label { display: block; font-weight: 400; margin: 4px 0; }
td.acciones-fila input:not([type=checkbox]) { max-width: 140px; }
form.en-linea { display: inline; margin-left: 8px; }
label.en-linea { display: inline-flex; gap: 6px; font-weight: 500; align-items: center; }
details summary { cursor: pointer; color: var(--acento); font-weight: 600; margin: 8px 0; }
.filtros-chip { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 1px solid var(--borde);
        border-radius: 999px; background: #fff; text-decoration: none; font-size: .86rem; color: var(--texto); cursor: pointer; }
.chip:hover { border-color: var(--borde-fuerte); }
.chip.activo, .chip[aria-pressed="true"] { background: var(--marca); color: #fff; border-color: var(--marca); }
.chip .cuenta { font-size: .75rem; opacity: .75; }

/* ---------- Mensajes ---------- */
.mensajes { list-style: none; padding: 0; margin: 0 0 16px; }
.mensajes li { padding: 11px 14px; border-radius: 10px; margin-bottom: 8px; background: var(--ok-fondo); border: 1px solid #b7dfc3;
               color: #134f29; }
.mensajes li.error { background: var(--error-fondo); color: var(--error); border-color: #f1b8b8; }
.mensajes li.warning { background: var(--aviso-fondo); color: var(--aviso); border-color: #ecd391; }
.alerta { border-color: #ecd391; background: #fffaf0; }
.alerta p { margin: 4px 0; }
.simulacion { background: #ede7f6; border: 1px dashed #6a4fb3; padding: 8px 12px; border-radius: 8px; font-weight: 600; }

/* ---------- Datos ---------- */
dl.datos { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 8px 16px; margin: 0 0 12px; }
dl.datos dt { color: var(--suave); font-weight: 600; font-size: .86rem; }
dl.datos dd { margin: 0; }
dl.datos.compacto { grid-template-columns: 100px 1fr; font-size: .92rem; gap: 4px 10px; }

/* ---------- Presupuesto ---------- */
.sugerencia { border-radius: 9px; padding: 9px 12px; margin: 8px 0 12px; border: 1px solid var(--borde); }
.sugerencia.ok { background: var(--ok-fondo); border-color: #b7dfc3; }
.sugerencia.pendiente { background: var(--aviso-fondo); border-color: #ecd391; }
.sugerencia.error { background: var(--error-fondo); border-color: #f1b8b8; }
.totales { display: flex; flex-direction: column; align-items: flex-end; margin-top: 10px; }
.totales table { width: auto; min-width: min(100%, 440px); }
.totales td { border-bottom: 0; padding: 5px 10px; }
.totales tr.total td { font-weight: 700; font-size: 1.12rem; border-top: 2px solid var(--texto); padding-top: 9px; }
.importe-grande { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }

/* ---------- Expediente y documentos ---------- */
.galeria { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
figure.documento { margin: 0; border: 1px solid var(--borde); border-radius: 10px; padding: 8px; background: #fff; }
figure.documento img { width: 100%; height: auto; max-height: 420px; object-fit: contain; display: block;
                       background: #f0f0ee; border-radius: 6px; }
figure.documento figcaption { margin-top: 6px; font-size: .9rem; }
.servicio h3 { margin: 0 0 4px; }
.aclaracion { border-left: 3px solid var(--borde); padding: 6px 10px; margin: 8px 0; background: #fafaf8; border-radius: 0 8px 8px 0; }
.aclaracion.abierta { border-left-color: #d29922; background: #fffaf0; }
.aclaracion textarea { max-width: 100%; }

/* ---------- Taller ---------- */
.cola { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.trabajo { margin: 0; border-top: 4px solid var(--acento); }
.trabajo.con-faltas { border-top-color: #d29922; }
.trabajo-cabecera { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.trabajo-titulo { margin: 6px 0 8px; font-weight: 600; }
.croquis { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); margin: 8px 0; }
.croquis a { text-decoration: none; display: block; }
.croquis img { width: 100%; height: 150px; object-fit: contain; background: #f0f0ee; border: 1px solid var(--borde);
               border-radius: 6px; display: block; }
.croquis .suave { font-size: .8rem; display: block; margin-top: 2px; }
.croquis .falta { grid-column: 1 / -1; }
.etapa { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }

/* ---------- Stock ---------- */
.placas { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.placa { display: flex; gap: 12px; margin: 0; }
.placa-dibujo { flex: 0 0 90px; display: flex; align-items: center; justify-content: flex-start; }
.placa-dibujo span { display: block; max-width: 100%; min-width: 8px; background: #cfd6de; border: 1px solid #9aa6b2; border-radius: 2px; }
.estado-placa-DISPONIBLE .placa-dibujo span { background: #d7ead9; border-color: #8fbf98; }
.estado-placa-RESERVADA .placa-dibujo span { background: #fbe7b5; border-color: #d9b25a; }
.placa-datos { flex: 1; font-size: .92rem; }
.placa-datos form { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.placa-datos input { width: 110px; }

/* ---------- Inicio ---------- */
.pendientes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 22px; }
.pendiente { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; margin: 0;
             transition: border-color .15s, transform .15s; }
.pendiente .cantidad { font-size: 1.8rem; font-weight: 700; color: var(--marca); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pendiente.cero .cantidad { color: var(--tenue); }
.pendiente:hover { border-color: var(--acento); transform: translateY(-1px); }
.bienvenida { position: relative; overflow: hidden; border-radius: 20px; padding: 30px 32px; margin-bottom: 22px; color: #fff;
              background:
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='260' fill='none' stroke='%23ffffff'%3E%3Cpath d='M380 -20c40 70 10 120 90 160s90 110 160 140' stroke-opacity='.10'/%3E%3Cpath d='M560 -10c-10 60 60 90 50 150s70 80 120 130' stroke-opacity='.07'/%3E%3Cpath d='M700 40c60 10 80 70 160 60' stroke-opacity='.08'/%3E%3Cpath d='M420 260c60-40 130-20 190-70s120-30 170-60' stroke-opacity='.06'/%3E%3C/svg%3E") no-repeat right center / cover,
                linear-gradient(120deg, var(--tinta) 0%, #1c3763 100%);
              box-shadow: var(--sombra-alta); }
.bienvenida h1 { font-size: 1.9rem; margin: 0 0 4px; }
.bienvenida p { margin: 0; color: #c9d4e6; }
.bienvenida .acciones { margin-top: 20px; }
.bienvenida .boton.secundario { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }
.bienvenida .boton.secundario:hover { background: rgba(255, 255, 255, .18); }
.seccion-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.seccion-titulo h2 { margin: 0; }
.lista-tarjetas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ficha { display: block; text-decoration: none; color: inherit; margin: 0; transition: border-color .15s, box-shadow .15s; }
.ficha:hover { border-color: var(--acento); box-shadow: var(--sombra-alta); }
.ficha-cabeza { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 8px; margin-bottom: 6px; }
.ficha-cabeza strong { font-size: 1rem; }
.ficha .total { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ficha.ia { border-left: 4px solid #7c5cd6; }
.ficha.derivada { border-left: 4px solid #e5484d; }

/* ---------- Clientes, leads e historial ---------- */
.contacto { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--suave); font-size: .92rem; margin-top: 4px; }
.contacto a { color: inherit; }
.contacto span { display: inline-flex; align-items: center; gap: 6px; }
.historial { display: flex; flex-direction: column; gap: 14px; }
.compra { border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; background: #fff; }
.compra-cabeza { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; background: var(--superficie-2);
                 border-bottom: 1px solid var(--borde); }
.compra-cabeza .total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.compra-cuerpo { padding: 12px 16px; }
.compra-cuerpo table { font-size: .9rem; }
.compra-cuerpo td, .compra-cuerpo th { padding: 6px 8px; }
.linea-tiempo { list-style: none; padding: 0; margin: 0; }
.linea-tiempo li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--borde); margin-left: 6px; }
.linea-tiempo li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
                           background: var(--superficie); border: 2px solid var(--bronce); }
.linea-tiempo li:last-child { border-left-color: transparent; }

/* ---------- Presupuestador ---------- */
.presupuestador { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.presupuestador .paso { position: relative; }
.paso-numero { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--marca); color: #fff;
               align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; margin-right: 10px; flex: 0 0 auto; }
.paso h2 { display: flex; align-items: center; margin-bottom: 16px; }
.campos { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.campos .ancho-2 { grid-column: span 2; }
.campos label { margin-bottom: 4px; }
.campos input, .campos select, .campos textarea { max-width: none; }
.campo-cliente { position: relative; }
.sugerencias { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff;
               border: 1px solid var(--borde-fuerte); border-radius: 10px; box-shadow: var(--sombra-alta); list-style: none;
               padding: 4px; max-height: 300px; overflow-y: auto; }
.sugerencias li { padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.sugerencias li:hover, .sugerencias li[aria-selected="true"] { background: var(--acento-suave); }
.sugerencias small { display: block; color: var(--suave); }
.cliente-elegido { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px;
                   background: var(--acento-suave); border-radius: 9px; font-size: .9rem; }
.bloque { border: 1px solid var(--borde); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: var(--superficie-2); }
.bloque-cabeza { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bloque-cabeza h3 { margin: 0; }
.bloque-cabeza .letra { background: var(--bronce); color: #fff; border-radius: 6px; padding: 1px 8px; font-weight: 700; font-size: .85rem; }
.selector-material { border: 1px solid var(--borde); border-radius: 10px; background: #fff; padding: 12px; }
.selector-material .tipos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.selector-material .resultados { max-height: 280px; overflow-y: auto; border-top: 1px solid var(--borde); margin-top: 10px; }
.material-opcion { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid #f0eee9; }
.material-opcion .nombre { flex: 1; min-width: 0; }
.material-opcion .nombre small { display: block; color: var(--suave); }
.material-opcion .variantes { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.variante { border: 1px solid var(--borde-fuerte); background: #fff; color: var(--texto); border-radius: 7px; padding: 4px 9px;
            font-size: .82rem; min-height: 30px; font-weight: 500; }
.variante:hover { border-color: var(--acento); filter: none; background: var(--acento-suave); }
.variante.sin-precio { color: var(--tenue); border-style: dashed; }
.material-elegido { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
                    padding: 12px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--borde); }
.material-elegido strong { font-size: 1.02rem; }
.material-elegido .precio { font-weight: 700; font-variant-numeric: tabular-nums; }
table.piezas, table.trabajos { table-layout: fixed; }
table.piezas td, table.trabajos td { padding: 5px 4px; border-bottom: 0; vertical-align: middle; }
table.piezas input, table.piezas select, table.trabajos input, table.trabajos select { min-width: 0; width: 100%; }
table.piezas th:nth-child(1) { width: 26%; } table.piezas th:nth-child(3) { width: 62px; }
table.piezas th:nth-child(4), table.piezas th:nth-child(5) { width: 84px; }
table.piezas th:nth-child(6) { width: 78px; } table.piezas th:nth-child(7) { width: 40px; }
table.piezas th, table.trabajos th { background: transparent; padding: 4px; }
table.piezas input, table.piezas select, table.trabajos input, table.trabajos select { max-width: none; padding: 7px 8px; }
table.piezas .m2 { text-align: right; color: var(--suave); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quitar { background: transparent; color: var(--tenue); border: 0; min-height: 32px; padding: 4px 8px; font-size: 1.1rem; }
.quitar:hover { color: var(--error); filter: none; background: var(--error-fondo); }
.agregar { background: transparent; color: var(--acento); border: 1px dashed #b8c8e0; min-height: 36px; font-weight: 600; }
.agregar:hover { background: var(--acento-suave); filter: none; }
.tarifa-info { font-size: .8rem; color: var(--suave); }
.tarifa-info.pendiente { color: var(--aviso); }
.opciones-servicio { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.servicio-caja { border: 1px solid var(--borde); border-radius: 10px; padding: 12px; background: #fff; }
.segmentos { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--borde-fuerte); border-radius: 9px; overflow: hidden; margin-bottom: 10px; }
.segmentos label { margin: 0; padding: 7px 11px; font-weight: 500; font-size: .85rem; cursor: pointer; border-right: 1px solid var(--borde); }
.segmentos label:last-child { border-right: 0; }
.segmentos input { position: absolute; opacity: 0; pointer-events: none; }
.segmentos label:has(input:checked) { background: var(--marca); color: #fff; }
.segmentos label:has(input:focus-visible) { outline: 3px solid #f0b429; outline-offset: -3px; }
.frases { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.frases button { background: #fff; color: var(--suave); border: 1px solid var(--borde); font-size: .8rem; min-height: 30px; padding: 4px 10px; font-weight: 500; }
.frases button:hover { color: var(--marca); border-color: var(--marca); filter: none; }
.resumen-fijo { position: sticky; top: 18px; }
.resumen-fijo .tarjeta { margin-bottom: 14px; }
.resumen-lineas { font-size: .88rem; }
.resumen-lineas td { padding: 5px 4px; border-bottom: 1px dashed var(--borde); }
.resumen-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 10px; padding-top: 10px;
                 border-top: 2px solid var(--texto); }
.resumen-total .importe-grande { font-size: 1.6rem; }
.guardar-barra { display: flex; flex-direction: column; gap: 8px; }
.guardar-barra button { width: 100%; }
.dibujo-croquis { width: 100%; height: auto; display: block; touch-action: none; user-select: none;
                  background:
                  repeating-linear-gradient(0deg, transparent 0 19px, rgba(31, 90, 166, .07) 19px 20px),
                  repeating-linear-gradient(90deg, transparent 0 19px, rgba(31, 90, 166, .07) 19px 20px), #fcfcfa;
                  border: 1px solid var(--borde); border-radius: 10px; }
.dibujo-croquis * { vector-effect: non-scaling-stroke; }
.dibujo-croquis text { font-family: var(--letra); fill: #1d2a44; stroke: none; }
.dibujo-croquis .cq-cuerpo { fill: #ece7dc; stroke: #13294b; stroke-width: 1.6; }
.dibujo-croquis .cq-medida { font-weight: 700; fill: #13294b; }
.dibujo-croquis .cq-nombre { fill: #7a8496; }
.dibujo-croquis .cq-simbolo { fill: none; stroke: #b42318; stroke-width: 1.5; }
.dibujo-croquis .cq-simbolo text { fill: #b42318; font-weight: 600; }
.dibujo-croquis .cq-triangulo polygon, .dibujo-croquis .cq-triangulo_doble polygon { fill: #b42318; }
.dibujo-croquis .cq-bacha rect, .dibujo-croquis .cq-bacha ellipse { fill: #fff; stroke: #13294b; }
.dibujo-croquis .cq-bacha text { fill: #13294b; }
.dibujo-croquis .cq-desague { fill: none; stroke: #13294b; }
.dibujo-croquis .cq-sin-medida { stroke-dasharray: 3 2; }
.dibujo-croquis .cq-cota path { stroke: #5c6577; stroke-width: 1; fill: none; }
.dibujo-croquis .cq-cota text { fill: #5c6577; font-weight: 600; }
.dibujo-croquis .cq-simbolo .cq-hit { fill: transparent; stroke: none; }
.dibujo-croquis.editable .cq-pieza { cursor: move; }
.dibujo-croquis.editable .cq-simbolo { cursor: grab; }
.dibujo-croquis .cq-elegida .cq-cuerpo { stroke: var(--bronce); stroke-width: 2.6; }
.dibujo-croquis .cq-elegido { stroke: var(--bronce); }
.dibujo-croquis .cq-simbolo.cq-elegido .cq-hit { stroke: var(--bronce); stroke-dasharray: 3 2; stroke-width: 1; }
.cq-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--suave); margin: 6px 0 0; }
.cq-leyenda b { color: #b42318; }
.cq-barra { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--superficie-2); border: 1px solid var(--borde);
            border-radius: 10px; margin-bottom: 6px; }
.cq-herramienta, .cq-accion { background: #fff; color: var(--texto); border: 1px solid var(--borde); min-height: 38px; padding: 4px 9px;
                              font-size: .82rem; font-weight: 500; gap: 6px; }
.cq-herramienta:hover, .cq-accion:hover { filter: none; border-color: var(--marca); }
.cq-herramienta[aria-pressed="true"] { background: var(--marca); color: #fff; border-color: var(--marca); }
.cq-icono { font-weight: 800; color: #b42318; min-width: 1.1em; text-align: center; letter-spacing: -.05em; }
.cq-herramienta[aria-pressed="true"] .cq-icono { color: #ffd7cf; }
.cq-separador { flex: 1; }
.cq-ayuda { min-height: 1.2em; margin: 0 0 6px; font-size: .85rem; color: var(--acento); }
/* El dibujo a la izquierda, los íconos de los trabajos a la derecha y el panel debajo del dibujo. */
.cq-cuerpo-editor { display: grid; grid-template-columns: minmax(0, 1fr) 178px; grid-template-rows: auto 1fr; gap: 10px 12px; align-items: start; }
.cq-cuerpo-editor .cq-lienzo { grid-column: 1; grid-row: 1; }
.cq-cuerpo-editor .cq-trabajos { grid-column: 2; grid-row: 1 / span 2; }
.cq-cuerpo-editor .cq-panel { grid-column: 1; grid-row: 2; }
@media (min-width: 1800px) { .cq-cuerpo-editor { grid-template-columns: minmax(0, 1fr) 270px 178px; }
  .cq-cuerpo-editor .cq-panel { grid-column: 2; grid-row: 1; } .cq-cuerpo-editor .cq-trabajos { grid-column: 3; grid-row: 1; } }
.cq-panel { border: 1px solid var(--borde); border-radius: 10px; padding: 12px; background: #fff; font-size: .9rem; }
.cq-panel h3 { margin-top: 0; }
.cq-panel input, .cq-panel select { max-width: none; }
.cq-panel > div { margin-bottom: 8px; }
.cq-pasos { padding-left: 18px; margin: 0; }
.cq-ubicar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.cq-ubicar button { background: #fff; color: var(--marca); border: 1px solid var(--borde-fuerte); min-height: 30px; padding: 3px 8px; font-size: .8rem; }
.descuento { display: grid; gap: 2px; margin-bottom: 10px; }
.descuento input { max-width: 160px; }

/* ---------- Bandeja del asistente ---------- */
.conversacion { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; padding: 12px;
                background: #efeae2; border-radius: 12px; }
.mensaje { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: .92rem; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); white-space: pre-wrap; }
.mensaje.cliente { background: #fff; align-self: flex-start; border-top-left-radius: 4px; }
.mensaje.asistente { background: #d9fdd3; align-self: flex-end; border-top-right-radius: 4px; }
.mensaje small { display: block; color: var(--tenue); font-size: .72rem; margin-top: 2px; text-align: right; }
.revision-ia { border-left: 4px solid #7c5cd6; }
.lista-control { list-style: none; padding: 0; margin: 0; }
.lista-control li { padding: 6px 0 6px 26px; position: relative; }
.lista-control li::before { content: "!"; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%;
                            background: var(--aviso-fondo); color: var(--aviso); font-weight: 700; font-size: .75rem;
                            display: flex; align-items: center; justify-content: center; }

/* ---------- Indicadores y gráficos ---------- */
.indicadores { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 18px; }
.indicador-tile { display: flex; flex-direction: column; gap: 2px; margin: 0; text-decoration: none; color: inherit; }
.indicador-tile.enlace:hover { border-color: var(--acento); }
.indicador-tile.atencion { border-top: 3px solid #d29922; }
.indicador-tile.alerta-tile { border-top: 3px solid var(--error); }
.tile-titulo { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--suave); font-weight: 600; }
.tile-valor { font-size: 2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--texto); }
.tile-valor.chico { font-size: 1.2rem; }
.tile-valor .sin-datos { font-size: 1.1rem; color: var(--tenue); font-weight: 500; font-style: italic; }
.tile-sub { font-size: .84rem; color: var(--suave); }
.indicador-tile details { margin-top: 6px; font-size: .85rem; }
.indicador-tile details summary { margin: 0; font-size: .82rem; }
.indicador-tile details p { margin: 6px 0 0; color: var(--suave); }
.grilla-graficos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.nota-fuente { font-size: .78rem; color: var(--tenue); margin: 10px 0 0; }
[data-grafico] { position: relative; }
.dona-fila { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.dona-lienzo { flex: 0 0 190px; max-width: 190px; }
.dona-lienzo svg { width: 100%; height: auto; display: block; }
.dona-porcion { stroke: var(--superficie); stroke-width: 2; cursor: pointer; transition: opacity .15s, transform .15s; transform-origin: 100px 100px; }
.dona-porcion:hover, .dona-porcion:focus-visible { opacity: .85; outline: none; }
.dona-porcion.atenuado { opacity: .22; }
.dona-porcion.elegido { transform: scale(1.04); }
.dona-centro-valor { font-size: 24px; font-weight: 700; fill: var(--texto); font-family: var(--letra); }
.dona-centro-texto { font-size: 11px; fill: var(--suave); font-family: var(--letra); }
.grafico-leyenda { list-style: none; padding: 0; margin: 0; flex: 1 1 180px; display: flex; flex-direction: column; gap: 2px; }
.leyenda-item { width: 100%; background: transparent; color: var(--texto); border: 1px solid transparent; justify-content: flex-start;
                gap: 8px; padding: 5px 8px; min-height: 32px; font-weight: 400; font-size: .86rem; text-align: left; }
.leyenda-item:hover { filter: none; background: var(--superficie-2); }
.leyenda-item.elegido { border-color: var(--borde-fuerte); background: var(--superficie-2); font-weight: 600; }
.leyenda-item .muestra { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.leyenda-item .leyenda-nombre { flex: 1; }
.leyenda-item .leyenda-valor { color: var(--suave); font-variant-numeric: tabular-nums; white-space: nowrap; }
.grafico-detalle { min-height: 1.4em; margin-top: 10px; font-size: .9rem; }
.grafico-detalle p { margin: 4px 0 0; color: var(--suave); }
.grafico-globo { position: absolute; z-index: 5; pointer-events: none; background: #fff; border: 1px solid var(--borde-fuerte);
                 border-radius: 8px; padding: 6px 10px; box-shadow: var(--sombra-alta); font-size: .82rem; max-width: 240px; }
.grafico-globo strong { display: block; font-size: .95rem; }
.grafico-globo span { color: var(--suave); }
.grafico-tabla { margin-top: 8px; font-size: .85rem; }
.grafico-tabla summary { font-size: .8rem; margin: 4px 0; }
.barras { display: flex; flex-direction: column; gap: 4px; }
.barra-fila { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; background: transparent;
              color: var(--texto); border: 1px solid transparent; padding: 4px 6px; min-height: 30px; font-weight: 400; font-size: .86rem; text-align: left; }
.barra-fila:hover { filter: none; background: var(--superficie-2); }
.barra-fila.elegido { border-color: var(--borde-fuerte); background: var(--superficie-2); }
.barra-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-pista { height: 14px; display: block; }
.barra-marca { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.barra-valor { color: var(--suave); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .84rem; }
svg.columnas { width: 100%; height: auto; display: block; overflow: visible; }
svg.columnas .grilla { stroke: var(--borde); stroke-dasharray: 2 3; }
svg.columnas .eje { stroke: var(--borde-fuerte); }
svg.columnas .columna-valor { font-size: 11px; fill: var(--texto); font-weight: 600; font-family: var(--letra); }
svg.columnas .columna-rotulo { font-size: 11px; fill: var(--suave); font-family: var(--letra); }
svg.columnas rect:focus { outline: none; }
.medidor-pista { height: 14px; border-radius: 7px; background: var(--acento-suave); overflow: hidden; }
.medidor-pista span { display: block; height: 100%; background: #2a78d6; border-radius: 7px; }

/* ---------- Colocaciones ---------- */
.lista-colocaciones { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.colocacion { margin: 0; border-left: 4px solid var(--acento); }
.colocacion.con-alerta { border-left-color: var(--error); }
.colocacion-cabeza { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.colocacion-espera { text-align: center; flex: 0 0 auto; }
.colocacion-espera .dias { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--marca); }
.colocacion-espera .dias.alerta { color: var(--error); }
.colocacion-espera small { color: var(--suave); font-size: .72rem; }
.controles summary { display: flex; align-items: center; gap: 10px; color: var(--texto); }
.progreso { flex: 1; max-width: 140px; height: 6px; border-radius: 3px; background: var(--borde); overflow: hidden; display: inline-block; }
.progreso span { display: block; height: 100%; background: var(--ok); }
.controles ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.controles li { display: flex; gap: 8px; align-items: center; }
.control { width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 6px; border: 2px solid var(--borde-fuerte);
           background: #fff; color: #fff; font-weight: 800; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.control.hecho { background: var(--ok); border-color: var(--ok); }
tr.propio td:first-child { box-shadow: inset 3px 0 0 var(--bronce); }

@media (max-width: 1100px) {
  .presupuestador, .dos-columnas { grid-template-columns: minmax(0, 1fr); }
  .cq-cuerpo-editor { grid-template-columns: minmax(0, 1fr); }
  .cq-cuerpo-editor .cq-lienzo, .cq-cuerpo-editor .cq-panel, .cq-cuerpo-editor .cq-trabajos { grid-column: 1; grid-row: auto; }
  .cq-trabajos { position: static; max-height: none; }
  .cq-trabajos .cq-iconos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .cq-trabajos .cq-trabajo + .cq-trabajo { border-top: 0; }
  .cq-trabajos .cq-trabajo { border-bottom: 3px double var(--borde); }
  .resumen-fijo { position: static; }
}
@media (max-width: 900px) {
  .con-menu .pagina { margin-left: 0; }
  .lateral { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--sombra-alta); }
  .lateral.abierto { transform: none; }
  .barra-movil { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 8px 16px;
                 background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
                 border-bottom: 1px solid var(--borde); }
  .marca-movil { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--marca); font-weight: 700;
                 letter-spacing: .04em; flex: 1; }
  main { padding: 16px 16px 40px; }
}
@media (max-width: 700px) {
  .cq-texto-boton { display: none; }
  dl.datos { grid-template-columns: 1fr; }
  dl.datos dd { margin-bottom: 6px; }
  h1 { font-size: 1.32rem; }
  .bienvenida { padding: 22px 20px; } .bienvenida h1 { font-size: 1.45rem; }
  .tarjeta { padding: 14px; }
  .campos .ancho-2 { grid-column: auto; }
  table.piezas, table.piezas tbody { display: block; }
  table.piezas thead { display: none; }
  table.piezas tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 6px; align-items: center;
                    padding: 8px 0; border-bottom: 1px solid var(--borde); }
  table.piezas td { padding: 0; }
  table.piezas td.pieza-tipo { grid-column: span 2; } table.piezas td.pieza-desc { grid-column: span 3; }
}
@media print {
  .lateral, .barra-movil, .demo, details, form, .no-imprimir { display: none !important; }
  .con-menu .pagina { margin-left: 0; }
  body { background: #fff; }
  main { padding: 0; }
  .tarjeta { box-shadow: none; border-color: #ddd; }
}

/* ---------- Ciclo 11: menú por secciones, agenda de mediciones, acciones rápidas ---------- */
.lateral nav.menu .menu-seccion { margin: 14px 10px 4px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
                                  color: #8fa0bb; font-weight: 600; }
.semana-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.semana-nav .rango { font-weight: 650; font-size: 1.02rem; min-width: 200px; }
.agenda-semana { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.agenda-dia { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px;
              min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.agenda-dia.hoy { border-color: var(--acento); box-shadow: 0 0 0 2px var(--acento-suave); }
.agenda-dia.pasado { background: var(--superficie-2); }
.agenda-dia h3 { margin: 0; font-size: .9rem; display: flex; justify-content: space-between; align-items: baseline; }
.agenda-dia h3 small { color: var(--tenue); font-weight: 500; }
.agenda-dia .vacio { margin: auto 0; font-size: .85rem; }
.visita { display: block; text-decoration: none; color: inherit; border-radius: 10px; padding: 9px 10px;
          border-left: 4px solid var(--acento); background: var(--acento-suave); }
.visita:hover { filter: brightness(.98); box-shadow: var(--sombra); }
.visita.REALIZADA { border-left-color: var(--ok); background: var(--ok-fondo); }
.visita.atrasada { border-left-color: var(--aviso); background: var(--aviso-fondo); }
.visita .hora { font-weight: 700; font-variant-numeric: tabular-nums; }
.visita .quien { font-size: .82rem; color: var(--suave); }
.visita .donde { font-size: .82rem; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.formulario-agenda { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .formulario-agenda { grid-template-columns: minmax(0, 1fr); } }
.campos-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .campos-3 { grid-template-columns: minmax(0, 1fr); } }
.atajos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.atajos button { font-size: .8rem; padding: 4px 10px; background: var(--superficie-2); color: var(--texto);
                 border: 1px solid var(--borde); box-shadow: none; }
.atajos button:hover, .atajos button.activo { border-color: var(--acento); color: var(--acento); background: var(--acento-suave); }
.ficha-visita { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.ficha-visita dt { color: var(--suave); font-size: .86rem; }
.ficha-visita dd { margin: 0; }
.cuando-grande { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.cuando-grande small { display: block; font-size: .95rem; font-weight: 500; color: var(--suave); }
.lista-requisitos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lista-requisitos li { display: flex; gap: 10px; align-items: flex-start; }
.acciones-rapidas { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acciones-rapidas form { margin: 0; }
.seguimiento { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 18px; padding: 0; list-style: none; }
.seguimiento li { position: relative; padding: 12px 12px 12px 14px; background: var(--superficie); border: 1px solid var(--borde);
                  border-right-width: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.seguimiento li:first-child { border-radius: var(--radio) 0 0 var(--radio); }
.seguimiento li:last-child { border-radius: 0 var(--radio) var(--radio) 0; border-right-width: 1px; }
.seguimiento .paso-t { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tenue); font-weight: 600;
                       display: flex; align-items: center; gap: 6px; }
.seguimiento .paso-t::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--borde-fuerte); }
.seguimiento li.hecho .paso-t::before { background: var(--ok); }
.seguimiento li.en-curso .paso-t::before { background: var(--acento); }
.seguimiento li.alerta .paso-t::before { background: var(--aviso); }
.seguimiento .paso-v { font-weight: 600; font-size: .92rem; }
.seguimiento .paso-s { font-size: .8rem; color: var(--suave); }
.seguimiento a.paso-a { font-size: .82rem; margin-top: 2px; }
@media (max-width: 900px) { .seguimiento { grid-template-columns: minmax(0, 1fr); }
  .seguimiento li { border-right-width: 1px; border-bottom-width: 0; }
  .seguimiento li:first-child { border-radius: var(--radio) var(--radio) 0 0; }
  .seguimiento li:last-child { border-radius: 0 0 var(--radio) var(--radio); border-bottom-width: 1px; } }
.tarjeta-ia { display: flex; flex-direction: column; gap: 8px; }
.tarjeta-ia .acciones-rapidas { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--borde); }
.tarjeta-ia details summary { font-size: .85rem; }
.buscador-grande { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 4px 6px 4px 14px;
                   max-width: 560px; margin-top: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.buscador-grande input { border: 0; box-shadow: none; padding: 10px 0; font-size: 1rem; background: transparent; }
.buscador-grande input:focus { outline: none; }
.buscador-grande .icono { color: var(--suave); }
.metricas-cliente { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; margin-bottom: 18px; }
.metrica { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; }
.metrica .m-t { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tenue); font-weight: 600; }
.metrica .m-v { font-size: 1.25rem; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.metrica .m-s { font-size: .8rem; color: var(--suave); }
.linea-tiempo { list-style: none; margin: 0; padding: 0; }
.linea-tiempo li { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--borde); }
.linea-tiempo li:last-child { border-bottom: 0; }
.linea-tiempo time { color: var(--tenue); font-size: .82rem; font-variant-numeric: tabular-nums; }
.linea-tiempo .tipo { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--suave); font-weight: 600; }
.etiqueta.cliente-si { background: var(--ok-fondo); color: var(--ok); }
.etiqueta.cliente-no { background: var(--superficie-2); color: var(--suave); border: 1px solid var(--borde); }
.condiciones-compactas { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.mas-opciones { margin-top: 12px; border-top: 1px dashed var(--borde); padding-top: 10px; }
.mas-opciones > summary { font-size: .9rem; color: var(--acento); cursor: pointer; font-weight: 600; }
.guardar-barra .fila-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.guardar-barra .fila-botones button { flex: 1 1 140px; }
@media (max-width: 640px) {
  .agenda-dia { min-height: 0; }
  .agenda-dia.pasado:not(:has(.visita)) { display: none; }   /* en el celular no se muestran días pasados vacíos */
}
@media (max-width: 640px) {
  .indicadores { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .indicadores .tile-valor { font-size: 1.5rem; }
  .indicadores .tile-titulo { font-size: .66rem; }
}
@media (max-width: 640px) {
  table.tabla-apilada, table.tabla-apilada tbody, table.tabla-apilada tr, table.tabla-apilada td { display: block; width: 100%; }
  table.tabla-apilada tr { padding: 10px 6px; border-bottom: 1px solid var(--borde); }
  table.tabla-apilada td { border: 0; padding: 2px 0; text-align: left !important; }
  table.tabla-apilada td.num { font-size: 1.05rem; }
}

/* ---------- Libro diario de caja ---------- */
.asiento { display: flex; flex-direction: column; gap: 14px; border-top: 4px solid var(--ok); }
.asiento.es-salida { border-top-color: var(--error); }
.tipo-asiento { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tipo-asiento label { display: flex; align-items: center; justify-content: center; padding: 12px; border-radius: 12px;
                      border: 2px solid var(--borde); font-weight: 700; font-size: 1.05rem; cursor: pointer; background: var(--superficie-2); }
.tipo-asiento input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-asiento label.ingreso:has(input:checked) { border-color: var(--ok); background: var(--ok-fondo); color: var(--ok); }
.tipo-asiento label.salida:has(input:checked) { border-color: var(--error); background: var(--error-fondo); color: var(--error); }
.tipo-asiento label:has(input:focus-visible) { outline: 3px solid #f0b429; outline-offset: 2px; }
.conceptos { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-radio { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--borde-fuerte);
              border-radius: 999px; cursor: pointer; font-size: .92rem; background: #fff; }
.chip-radio input { width: auto; margin: 0; accent-color: var(--marca); }
.chip-radio:has(input:checked) { background: var(--marca); color: #fff; border-color: var(--marca); }
.chip-radio[hidden] { display: none; }
.campos-asiento { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.campos-asiento .ancho-2 { grid-column: span 2; }
@media (max-width: 720px) { .campos-asiento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .campos-asiento .campo-motivo { grid-column: 1 / -1; } .campos-asiento .ancho-2 { grid-column: 1 / -1; } }
.campo-comprobante { padding: 12px; border: 1px dashed var(--borde-fuerte); border-radius: 12px; background: var(--superficie-2); }
.pie-asiento { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.marca-adeuda { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .78rem; font-weight: 700;
                color: #7a4b00; background: #fff4d0; border: 1px solid #eda100; white-space: nowrap; }
.totales-libro { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; color: var(--suave); }
table.libro td small { display: block; color: var(--suave); font-size: .8rem; margin-top: 2px; }
table.libro td.ingreso { color: var(--ok); font-weight: 600; }
table.libro td.salida { color: var(--error); font-weight: 600; }
table.libro td.saldo { font-variant-numeric: tabular-nums; }
table.libro tr.adeuda td { background: #fffaeb; border-top: 2px solid #eda100; border-bottom: 2px solid #eda100; }
table.libro tr.adeuda td:first-child { border-left: 4px solid #eda100; }
table.libro tr.adeuda td:last-child { border-right: 2px solid #eda100; }
table.libro form.adjuntar { display: inline-block; margin: 4px 0 0 6px; }
table.libro details.corregir summary { font-size: .78rem; color: var(--tenue); margin-top: 4px; }
table.libro details.corregir form { display: flex; gap: 6px; margin-top: 4px; }
@media (max-width: 720px) {
  table.libro thead { display: none; }
  table.libro, table.libro tbody, table.libro tr, table.libro td { display: block; width: 100%; }
  table.libro tr { padding: 10px 8px; border-bottom: 1px solid var(--borde); border-radius: 10px; margin-bottom: 8px; }
  table.libro td { border: 0 !important; padding: 2px 0; text-align: left !important; background: transparent !important; }
  table.libro td.num::before { content: attr(data-titulo) ": "; color: var(--tenue); font-weight: 400; }
  table.libro td.num:empty { display: none; }
  table.libro tr.adeuda { border: 2px solid #eda100; border-left-width: 6px; background: #fffaeb; }
}
table.libro tr.alerta-fila td { background: var(--error-fondo); }
table.libro tr.alerta-fila td:first-child { border-left: 4px solid var(--error); }
.verificacion-retiros ol { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.retiro-pendiente { border-left: 4px solid #eda100; }
/* Simulación con el material: la piedra rellena la pieza; bachas y perforaciones se ven como huecos. */
.dibujo-croquis .cq-cuerpo.cq-material { fill: url(#mat-piedra); stroke: #2b2b2b; stroke-width: 1; }
.dibujo-croquis.con-material .cq-nombre { fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width: 2.5px; font-weight: 600; }
.dibujo-croquis.con-material .cq-bacha rect, .dibujo-croquis.con-material .cq-bacha ellipse { fill: #3a3d42; stroke: #1b1d20; }
.dibujo-croquis.con-material .cq-bacha text { fill: #fff; }
.dibujo-croquis.con-material .cq-simbolo { stroke: #1b1d20; }
.dibujo-croquis.con-material { background: #f4f2ee; }
.dibujo-croquis.con-material .cq-simbolo circle, .dibujo-croquis.con-material .cq-simbolo > rect:not(.cq-hit) { fill: #2c2f33; fill-opacity: .9; stroke: #111; }
.dibujo-croquis.con-material .cq-simbolo text, .dibujo-croquis.con-material .cq-cota { display: none; }
.dibujo-croquis.con-material .cq-triangulo, .dibujo-croquis.con-material .cq-triangulo_doble, .dibujo-croquis.con-material .cq-radio, .dibujo-croquis.con-material .cq-texto, .dibujo-croquis.con-material .cq-cruz { display: none; }
.dibujo-croquis.con-material { background: transparent; }

/* ---------- Catálogo de bachas ---------- */
.catalogo-bachas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.tarjeta.bacha { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.bacha-foto { aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--borde); }
.bacha-foto img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.bacha-foto .sin-foto { color: var(--tenue); font-size: .85rem; }
.bacha-cuerpo { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bacha-cabeza { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bacha-cabeza .precio { font-weight: 700; color: var(--marca); white-space: nowrap; }
.bacha-datos { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; color: var(--suave); }
.bacha .acciones-rapidas { margin-top: auto; padding-top: 6px; }
.nota-interna summary { font-size: .78rem; color: var(--aviso); }
.nota-interna p { font-size: .8rem; margin: 4px 0 0; color: var(--suave); }
.dibujo-croquis.con-material .cq-bacha rect, .dibujo-croquis.con-material .cq-bacha ellipse { fill: url(#acero); stroke: #6b7178; }
.dibujo-croquis.con-material .cq-bacha text, .dibujo-croquis.con-material .cq-desague { display: none; }

/* ---------- Croquis: emparejar zócalos y forma de pieza ---------- */
.cq-accion[aria-pressed="true"] { background: var(--acento); color: #fff; border-color: var(--acento); }
.dibujo-croquis .cq-lado line { stroke: var(--acento); stroke-linecap: round; }
.dibujo-croquis .cq-lado line.cq-hit { stroke: transparent; cursor: pointer; }
.dibujo-croquis .cq-lado text { fill: var(--acento); font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.dibujo-croquis .cq-lado:hover line:not(.cq-hit) { stroke: var(--bronce); }
.cq-estado { margin: 0 0 8px; font-weight: 600; color: var(--aviso); }
.cq-estado.ok { color: var(--ok); }
.cq-bacha-elegida { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.cq-bacha-elegida img { width: 64px; height: 52px; object-fit: contain; background: #fff; border: 1px solid var(--borde); border-radius: 8px; }
.cq-bacha-elegida small { display: block; color: var(--suave); }

/* ---------- Catálogo de bachas dentro del croquis ---------- */
dialog.cq-catalogo { width: min(980px, 94vw); max-height: 88vh; padding: 0; border: 0; border-radius: var(--radio); box-shadow: var(--sombra-alta); overflow: auto; }
dialog.cq-catalogo::backdrop { background: rgba(13, 27, 49, .45); }
.cq-catalogo-cabeza { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 8px; background: #fff; }
.cq-catalogo-cabeza h3 { margin: 0; }
.cq-catalogo .cerrar { background: transparent; color: var(--suave); font-size: 1.5rem; min-height: 36px; padding: 0 10px; }
.cq-catalogo-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 0 18px; }
.cq-catalogo-filtros .buscador { max-width: none; }
.cq-catalogo-filtros select { width: auto; }
.cq-catalogo .filtros-chip { padding: 0 18px; margin: 8px 0 0; }
.cq-catalogo-cuenta { padding: 0 18px; margin: 8px 0; }
.cq-catalogo-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 0 18px 18px; }
.cq-ficha { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; background: #fff; color: var(--texto);
            border: 1px solid var(--borde); border-radius: 12px; text-align: left; font-weight: 400; min-height: 0; }
.cq-ficha:hover, .cq-ficha:focus-visible { filter: none; border-color: var(--marca); box-shadow: var(--sombra); }
.cq-ficha.elegida { border-color: var(--bronce); background: var(--bronce-suave); }
.cq-ficha-foto { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: #fff; margin-bottom: 4px; }
.cq-ficha-foto img { width: 100%; height: 100%; object-fit: contain; }
.cq-ficha-foto:empty::after { content: "Sin foto"; color: var(--tenue); font-size: .8rem; }
.cq-ficha strong { font-size: .9rem; }
.cq-ficha small { color: var(--suave); font-size: .78rem; }
.cq-ficha .etiqueta { align-self: flex-start; }
.cq-ficha-precio { font-weight: 700; color: var(--marca); margin-top: 2px; }
.cq-catalogo-medidas { margin: 0 18px 18px; padding: 12px; border: 1px solid var(--borde-fuerte); border-radius: 10px; background: var(--superficie-2); }
.cq-catalogo-medidas p { margin: 0 0 8px; }
.cq-medidas-fila { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }

/* ---------- Catálogo de bachas (pantalla) ---------- */
.filtros-bachas { align-items: center; }
.filtros-bachas select { width: auto; }
.cuenta-resultados { margin: 4px 0 12px; }

/* ---------- Respuesta del cliente: plegada hasta que conteste ---------- */
.respuesta-cliente details.respuesta { margin-top: 8px; }
.respuesta-cliente details.respuesta > summary { list-style: none; width: 100%; }
.respuesta-cliente details.respuesta > summary::-webkit-details-marker { display: none; }
.respuesta-cliente details.respuesta[open] > summary { margin-bottom: 8px; }
.error-campo { color: var(--error); margin: 4px 0 0; font-size: .85rem; }
/* ---------- Forma de la pieza en la tabla y en el croquis ---------- */
table.piezas td.pieza-tipo select { display: block; width: 100%; }
table.piezas .pieza-forma { margin-top: 4px; min-height: 30px; padding: 3px 6px; font-size: .8rem; color: var(--suave); }
.ayuda-forma { margin: 6px 0 0; font-size: .82rem; }
.cq-esquinas { display: grid; gap: 4px; margin-bottom: 8px; }

/* ---------- Bacha conformada y nervurado ---------- */
.dibujo-croquis .cq-boca { fill: #fff; stroke: #13294b; stroke-width: 1.2; }
.dibujo-croquis .cq-fina { fill: none; stroke: #13294b; stroke-width: .5; }
.dibujo-croquis .cq-ranura-bacha { stroke: #13294b; stroke-linecap: round; }
.dibujo-croquis .cq-flecha { fill: none; stroke: #b42318; stroke-width: .8; }
.dibujo-croquis .cq-zona { fill: rgba(180, 35, 24, .04); stroke: #b42318; stroke-width: .6; stroke-dasharray: 3 2; }
.dibujo-croquis .cq-ranura { fill: none; stroke: #b42318; stroke-width: .6; }
.dibujo-croquis.con-material .cq-nervurado .cq-zona { display: none; }
.dibujo-croquis.con-material .cq-ranura { stroke-linecap: round; stroke: #000; stroke-opacity: .5; stroke-width: .6; }
.cq-detalle { margin-top: 8px; border: 1px solid var(--borde); border-radius: 8px; padding: 6px; background: var(--superficie-2); }
.cq-corte { width: 100%; height: auto; display: block; font-family: var(--letra); fill: #13294b; }
.detalle-conformadas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.detalle-conformada { margin: 0; border: 1px solid #c9c4ba; border-radius: 6px; padding: 6px; break-inside: avoid; }
.detalle-conformada figcaption { font-size: .8rem; margin-top: 4px; }

/* ---------- Panel de trabajos de marmolería (íconos al costado del croquis) ---------- */
/* Grupos separados por una línea doble más marcada; cada trabajo, por una línea doble fina. Sin precios. */
.cq-trabajos { border: 1px solid var(--borde); border-radius: 10px; background: #fff; padding: 4px 4px; display: flex; flex-direction: column;
               position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.cq-grupo { padding: 6px 0; }
.cq-grupo + .cq-grupo { border-top: 4px double var(--borde-fuerte); }
.cq-grupo-titulo { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--bronce); margin: 0 6px 4px; }
.cq-iconos { display: flex; flex-direction: column; }
.cq-trabajo { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 8px; align-items: center; text-align: left; width: 100%;
              background: transparent; color: var(--texto); border: 0; border-radius: 0; padding: 6px; min-height: 38px; font-size: .78rem; font-weight: 600; line-height: 1.15; }
.cq-trabajo + .cq-trabajo { border-top: 3px double var(--borde); }
.cq-trabajo-nombre { overflow-wrap: anywhere; }
.cq-trabajo svg { width: 22px; height: 22px; fill: none; stroke: #b42318; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cq-trabajo:hover { filter: none; background: var(--superficie-2); }
.cq-trabajo[aria-pressed="true"] { background: var(--marca); color: #fff; }
.cq-trabajo[aria-pressed="true"] svg { stroke: #ffd7cf; }
.cq-trabajo.sin-lista { opacity: .6; }
.cq-suma { padding: 6px 4px 2px; }
.cq-suma ul { list-style: none; margin: 0; padding: 0 2px; font-size: .75rem; display: grid; gap: 2px; }
.cq-suma li { display: flex; justify-content: space-between; gap: 4px; }
.cq-precio { margin: -4px 0 8px; font-size: .82rem; font-weight: 600; color: var(--ok); }
.cq-precio.pendiente { color: var(--aviso); }
.cq-cobro { margin: 6px 0; font-size: .85rem; }
table.trabajos tr.del-croquis td:first-child strong { display: inline; }
table.trabajos .detalle-trabajo { display: block; }
table.trabajos input[readonly] { background: var(--superficie-2); color: var(--suave); }
table.trabajos .acciones-trabajo { white-space: nowrap; }
.ayuda-trabajos { margin-top: -4px; font-size: .82rem; }
/* Trabajos en el croquis de fábrica: el hierro es una línea recta; los de borde, una línea por dentro del borde. */
.dibujo-croquis .cq-hierro { stroke: #13294b; stroke-width: 3.2px; stroke-linecap: round; }
.dibujo-croquis .cq-trazo { fill: none; stroke: #b42318; stroke-width: 2.4px; }
.dibujo-croquis .cq-trazo-inglete { stroke-dasharray: 7 3; }
.dibujo-croquis .cq-trazo-marcas { stroke-width: 1.2px; stroke-dasharray: none; }
.dibujo-croquis .cq-trazo-frentin_rehundido { stroke-dasharray: 5 3; stroke: #13294b; }
.dibujo-croquis .cq-trazo-media_cana { stroke-dasharray: 1.5 3.5; stroke-linecap: round; stroke-width: 3px; }
.dibujo-croquis .cq-trazo-francesa { stroke-dasharray: 9 3 2 3; }
.dibujo-croquis .cq-glifo { fill: none; stroke: #13294b; stroke-width: 1.6px; }
.dibujo-croquis .cq-antideslizante .cq-lineas rect { fill: #b42318; stroke: none; }
.dibujo-croquis .cq-cuenco-borde { stroke-dasharray: 4 3; }
.dibujo-croquis.con-material .cq-antideslizante .cq-zona { display: none; }
.dibujo-croquis.con-material .cq-antideslizante .cq-lineas rect { fill: #000; fill-opacity: .45; }
.dibujo-croquis.con-material .cq-simbolo.cq-cuenco circle.cq-cuenco-borde { fill: #f7f7f5; fill-opacity: 1; stroke: #b9b9b6; stroke-dasharray: none; }
.dibujo-croquis.con-material .cq-simbolo.cq-anafe > rect:not(.cq-hit) { fill: #111214; fill-opacity: .95; }
.dibujo-croquis.con-material .cq-simbolo .cq-hit { fill: transparent !important; }   /* el área para tocar no se pinta */
.dibujo-croquis.con-material .cq-cuenco circle:not(.cq-cuenco-borde) { display: none; }   /* el cuenco tapa su desagüe */
.dibujo-croquis .cq-simbolo text.cq-rotulo-borde, .dibujo-croquis .cq-nervurado text { paint-order: stroke; stroke: #f6f3ec; stroke-width: 3px; stroke-linejoin: round; }
.cq-detalle .cq-corte { max-width: 340px; margin: 0 auto; }

/* Toallero: calado en el frentín, con su largo real (puntas redondeadas o rectas). */
.dibujo-croquis .cq-calado-toallero { fill: #fff; stroke: #b42318; stroke-width: 1.6px; }
.cq-especial { border-left: 3px solid var(--bronce); padding: 2px 0 2px 10px; margin: 6px 0 8px; }
.cq-especial .campos { margin-bottom: 6px; }
.cq-merma { margin: 8px 0; font-size: .84rem; color: #5b4a2f; background: #f7f1e6; border-radius: 6px; padding: 6px 8px; }

/* Referencias del croquis de fábrica: fina, a la derecha, el mismo dibujo del croquis y qué es. */
.cq-con-referencias { display: grid; grid-template-columns: minmax(0, 1fr) 184px; gap: 12px; align-items: start; }
.cq-referencias { border-left: 1px solid #d9d4ca; padding: 2px 0 2px 12px; font-size: .74rem; color: #2a3446; line-height: 1.2; }
.cq-referencias h4 { margin: 0 0 4px; font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bronce); font-weight: 700; }
.cq-referencias ul { list-style: none; margin: 0; padding: 0; }
.cq-referencias li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid #ece8e0;
                     break-inside: avoid; page-break-inside: avoid; }
.cq-referencias li:first-child { border-top: 0; }
.cq-referencias b { font-weight: 600; }
.cq-referencias i { font-style: normal; color: var(--suave); }
.cq-referencias small { display: block; color: var(--suave); font-size: .67rem; margin-top: 1px; }
.dibujo-croquis.cq-muestra { width: 40px; height: 22px; background: none; border: 0; border-radius: 0; }
.cq-muestra .cq-muestra-pieza { fill: none; stroke: #9aa6b2; stroke-width: 1.6px; }
@media (max-width: 640px) {
  .cq-con-referencias { grid-template-columns: minmax(0, 1fr); }
  .cq-referencias { border-left: 0; border-top: 1px solid #d9d4ca; padding: 8px 0 0; }
}

/* Colocación y entrega: los trabajos de la obra con su ícono (como los del croquis), separados por líneas dobles. */
.obra-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; background: #fff; }
.obra-tarjeta { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; align-items: center; text-align: left;
                background: #fff; color: var(--texto); border: 0; border-right: 3px double var(--borde); border-bottom: 3px double var(--borde); border-radius: 0;
                padding: 10px 12px; min-height: 60px; font-size: .86rem; font-weight: 600; line-height: 1.15; margin: 0 -3px -3px 0; }
.obra-tarjeta svg { grid-row: 1 / span 2; width: 24px; height: 24px; fill: none; stroke: #b42318; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.obra-tarjeta:hover { filter: none; background: var(--superficie-2); }
.obra-estado { font-size: .74rem; font-weight: 500; color: var(--suave); }
.obra-tarjeta.activa { background: #f2f7f3; }
.obra-tarjeta.activa .obra-estado { color: var(--ok); font-weight: 600; }
.obra-tarjeta.abierta { box-shadow: inset 0 -3px 0 var(--marca); }
.obra-detalle { margin-top: 10px; border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; background: #fff; }
.obra-detalle-cabeza { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.obra-detalle-cabeza h3 { margin: 0; flex: 1; }
.obra-detalle-cabeza svg { width: 22px; height: 22px; fill: none; stroke: #b42318; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.obra-detalle .segmentos { margin-bottom: 10px; }

/* Enviar al cliente: vista previa de lo que se manda (una imagen por opción de material). */
.envio-previa { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 4px 0 2px; }
.envio-previa figure { margin: 0; border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; background: #fff; }
.envio-previa .dibujo-croquis { border: 0; border-radius: 0; }
.envio-previa figcaption { font-size: .75rem; padding: 4px 8px; color: var(--suave); }
.envio-previa figcaption b { color: var(--bronce); }

/* Grifería en la vista del cliente: cromada, vista desde arriba. */
.dibujo-croquis.con-material .cq-simbolo .cq-cromo { fill: url(#acero) !important; fill-opacity: 1 !important; stroke: #6f757c !important; stroke-width: .6px; }

/* Bacha del catálogo en la vista del cliente: el borde, la cubeta honda (una o dos piletas) y el desagüe. */
.dibujo-croquis.con-material .cq-bacha .cq-cubeta { fill: url(#acero-hondo) !important; stroke: #6b7178; stroke-width: .6px; }
.dibujo-croquis.con-material .cq-bacha .cq-desague-cliente { fill: #2a2b2d !important; stroke: #8d939a; stroke-width: .5px; }
.dibujo-croquis.con-material .cq-simbolo .cq-hit { stroke: none !important; }   /* el área para tocar no tiene borde */

/* Anafes especiales: InvisaCook (zonas apenas marcadas: va debajo) y PITT (fuegos con parrilla sobre la piedra). */
.dibujo-croquis .cq-zona-ic { fill: none; stroke: #13294b; stroke-dasharray: 4 3; }
.dibujo-croquis.con-material .cq-simbolo .cq-zona-ic { fill: none !important; stroke: rgba(0,0,0,.35) !important; stroke-dasharray: 2 3; stroke-width: .8px; }
.dibujo-croquis.con-material .cq-simbolo .cq-fuego { fill: #1d1e20 !important; stroke: #000 !important; }
.dibujo-croquis.con-material .cq-simbolo .cq-fuego-corona { fill: #8d939a !important; stroke: #3a3d42 !important; }
.dibujo-croquis.con-material .cq-simbolo .cq-parrilla { fill: none; stroke: #0d0d0e; stroke-width: 1.6px; }
.cq-requisitos { font-size: .82rem; margin: 6px 0; } .cq-requisitos ul { padding-left: 18px; margin: 6px 0; }

/* ---------- Precios: la lista como la planilla, más ordenada y editable ---------- */
.precios-herramientas { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 10px; }
.precios-herramientas input[type=search] { flex: 1; min-width: 220px; max-width: 420px; }
.precios-ajuste { display: flex; align-items: center; gap: 6px; font-size: .88rem; flex-wrap: wrap; }
.precios-ajuste input { width: 70px; }
.precios-pestanas { display: flex; gap: 2px; overflow-x: auto; border-bottom: 2px solid var(--borde); margin: 0 -4px 10px; padding: 0 4px; scrollbar-width: thin; }
.precios-pestanas button { background: transparent; color: var(--suave); border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; padding: 9px 14px;
                           font-size: .88rem; font-weight: 600; white-space: nowrap; margin-bottom: -2px; min-height: 40px; }
.precios-pestanas button:hover { filter: none; background: var(--superficie-2); color: var(--texto); }
.precios-pestanas button[aria-selected="true"] { color: var(--marca); border-bottom-color: var(--marca); background: #fff; }
.precios-cuantos { font-size: .72rem; font-weight: 500; color: var(--suave); background: var(--superficie-2); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.precios-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.precios-tabla th { position: sticky; top: 0; background: #fff; z-index: 1; text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
                    color: var(--suave); padding: 8px 10px; border-bottom: 2px solid var(--borde); }
.precios-tabla td { padding: 5px 10px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.precios-tabla tbody tr:hover td { background: #fbfaf7; }
.precios-tabla .num { text-align: right; white-space: nowrap; }
.precios-tabla .precios-seccion th { position: static; background: var(--superficie-2); color: var(--bronce); font-size: .7rem; letter-spacing: .1em; padding: 6px 10px; border-bottom: 1px solid var(--borde); }
.precios-nuevo td { background: #f2f7f3; }
.precio-celda { display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 6px; padding: 0 0 0 6px; background: transparent; }
.precio-celda:hover, .precio-celda:focus-within { border-color: var(--borde-fuerte); background: #fff; }
.precio-celda input { width: 9.5em; border: 0; background: transparent; text-align: right; padding: 6px 6px; font-variant-numeric: tabular-nums; min-height: 32px; }
.precio-celda input:focus { outline: none; }
.precio-celda.cambiado { background: #fff4d6; border-color: #e3b341; }
.precio-moneda { font-size: .75rem; color: var(--suave); }
.precio-valor { font-variant-numeric: tabular-nums; }
.precios-origen { display: block; font-size: .72rem; }
.precios-agregar { margin-top: 12px; border: 1px dashed var(--borde-fuerte); border-radius: 10px; padding: 8px 12px; }
.precios-agregar summary { cursor: pointer; font-weight: 600; color: var(--marca); }
.precios-agregar .campos { margin: 10px 0; }
.precios-barra { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #13294b; color: #fff;
                 padding: 10px 16px; border-radius: 12px 12px 0 0; box-shadow: 0 -6px 20px rgba(0,0,0,.15); margin-top: 12px; }
.precios-barra input { flex: 1; min-width: 240px; }
.precios-guardado { margin: 0 0 8px; }
.precios-barra button[data-precios="guardar"] { background: var(--bronce); color: #fff; border-color: var(--bronce); font-weight: 700; }
.precios-barra button[data-precios="descartar"] { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.precio-celda input { width: 7.2em; }

/* Seña baja (menos del 20 %): el trabajo sigue, pero queda en revisión de gerencia (recuadro amarillo). */
.revision-sena { border: 2px solid #e3b341; background: #fff8e1; color: #5b4a2f; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.revision-sena.resuelta { border-color: var(--borde); background: #f7f6f2; }
tr.fila-revision-sena td { background: #fff8e1; }
tr.fila-revision-sena td:first-child { box-shadow: inset 4px 0 0 #e3b341; }
.etiqueta.sena-baja { background: #fff4d6; color: #6a4f26; border: 1px solid #e3b341; }
.sena-calculo { font-size: .88rem; margin: 4px 0 10px; color: var(--suave); }
.sena-calculo.ok { color: var(--ok); }
.sena-calculo.baja { color: #8a5a00; background: #fff4d6; border: 1px solid #e3b341; border-radius: 6px; padding: 6px 8px; }

/* Croquis de taller más liviano (pedido del usuario): líneas finas, textos suaves, nada pesado. */
.dibujo-croquis:not(.con-material) .cq-cuerpo { stroke-width: 1.1; }
.dibujo-croquis:not(.con-material) .cq-simbolo { stroke-width: 1; }
.dibujo-croquis:not(.con-material) .cq-simbolo text { font-weight: 500; }
.dibujo-croquis:not(.con-material) .cq-medida { font-weight: 600; }
.dibujo-croquis:not(.con-material) .cq-cota path { stroke: #9aa3b1; stroke-width: .7; }
.dibujo-croquis:not(.con-material) .cq-cota text { fill: #6b7486; font-weight: 500; }
.dibujo-croquis:not(.con-material) .cq-trazo { stroke-width: 1.4px; }
.dibujo-croquis:not(.con-material) .cq-trazo-media_cana { stroke-width: 1.8px; }
.dibujo-croquis:not(.con-material) .cq-trazo-marcas { stroke-width: .8px; }
.dibujo-croquis:not(.con-material) .cq-hierro { stroke-width: 2px; }
.dibujo-croquis:not(.con-material) .cq-glifo { stroke-width: 1.1px; }
.dibujo-croquis:not(.con-material) .cq-boca { stroke-width: .9; }

/* Ranurado: en el taller, la zona y líneas finas; en la vista del cliente, la textura sobre la piedra. */
.dibujo-croquis .cq-zona-ranurado { fill: none; stroke: #b42318; stroke-width: .6px; stroke-dasharray: 3 3; }
.dibujo-croquis .cq-ranuras path { fill: none; stroke: #b42318; stroke-width: .5px; stroke-opacity: .5; }
.dibujo-croquis.con-material .cq-ranurado .cq-ranuras path { stroke: #000 !important; stroke-opacity: .3; stroke-width: .7px; }

/* Fechas y avisos: atrasado (rojo), hoy (naranja), se acerca (amarillo), para atender (azul). */
.avisos-fecha h2 { margin-top: 0; }
.avisos-fecha ul, .avisos-inicio ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aviso-fecha { display: grid; gap: 2px; padding: 8px 12px; border-radius: 8px; background: var(--superficie-2, #f6f4f0); border-left: 4px solid #8a8a8a; }
.nivel-atrasado .aviso-fecha { border-left-color: #b42318; background: #fdf1ef; }
.nivel-hoy .aviso-fecha { border-left-color: #d9730d; background: #fff4e8; }
.nivel-pronto .aviso-fecha { border-left-color: #e3b341; background: #fffaeb; }
.nivel-aviso .aviso-fecha { border-left-color: #1f5aa6; }
.aviso-accion { font-size: .86rem; }
.avisos-inicio { border-left: 4px solid #d9730d; }
.avisos-inicio .tarjeta-cabeza { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.avisos-inicio h2 { margin: 0; font-size: 1.05rem; }
.avisos-inicio li { font-size: .92rem; }
.etiqueta.nivel-atrasado { background: #b42318; color: #fff; }
.etiqueta.nivel-hoy { background: #d9730d; color: #fff; }
.etiqueta.nivel-pronto { background: #fff1c2; color: #6a4f26; }
.etiqueta.nivel-aviso { background: #e5edf8; color: #1f5aa6; }

/* Despiece automático: dibujo de la placa (medidas en mm en el viewBox) */
.despiece-dibujo { display: block; width: 100%; max-height: 460px; margin: 4px 0 8px; }
.despiece-dibujo rect { vector-effect: non-scaling-stroke; }
.d-placa { fill: #b9c0c8; stroke: #6b7682; stroke-width: 1.5; }
.d-util { fill: #e6e9ed; stroke: #8a95a1; stroke-width: 1; stroke-dasharray: 5 4; }
.d-pieza { fill: #cfe0f5; stroke: #1f5aa6; stroke-width: 1.5; }
.d-retazo { fill: #d7ead9; stroke: #3c8a4b; stroke-width: 1.2; stroke-dasharray: 6 3; }
.d-recorte { fill: #f6d4d0; stroke: #b42318; stroke-width: 1; }
.d-texto { fill: var(--tinta); font-family: inherit; }
.d-texto.suave { fill: #3c6b45; }
.despiece-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: .82rem; color: var(--suave); margin: 0 0 10px; }
.despiece-leyenda span { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: -8px; }
.ley-pieza { background: #cfe0f5; border: 1px solid #1f5aa6; }
.ley-retazo { background: #d7ead9; border: 1px dashed #3c8a4b; }
.ley-recorte { background: #f6d4d0; border: 1px solid #b42318; }
.ley-borde { background: #b9c0c8; border: 1px solid #6b7682; }
.despiece-decision { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.despiece-decision form { margin: 0; }
.despiece-decision .filtros { margin: 0; flex: 1 1 360px; }
.etiqueta.despiece-PROPUESTO { background: var(--aviso-fondo); color: var(--aviso); }
.etiqueta.despiece-CONFIRMADO { background: #e5edf8; color: #1f5aa6; }
.etiqueta.despiece-CORTADO { background: var(--ok-fondo); color: var(--ok); }
.etiqueta.despiece-RECHAZADO { background: var(--error-fondo); color: var(--error); }
.etiqueta.despiece-REEMPLAZADO { background: var(--superficie-2); color: var(--suave); }
