/* Formulario de cotización rápido: franja de encabezado, líneas al centro, "Condiciones y notas" plegado y barra fija
   con totales y guardar. Escritorio: encabezado en una grilla de 12 columnas (dos filas); celular: apilado. */
.qform { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }   /* minmax: el resumen de una línea no ensancha la página */
.qhead { display: grid; gap: 8px 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qhead { padding-top: 10px; padding-bottom: 10px; }
.qhead > .field { grid-column: span 2; min-width: 0; }
.qhead .field label { line-height: 1.25; }
.qhead .qhead__date, .qhead .qhead__validity, .qhead .qhead__cphone, .qhead .qhead__seller { grid-column: span 1; }
@media (min-width: 1100px) {
    .qhead { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .qhead .qhead__client { grid-column: span 4; }

    .qhead .qhead__pick { grid-column: span 3; }
    .qhead .qhead__date { grid-column: span 2; }
    .qhead .qhead__validity { grid-column: span 1; }
    .qhead .qhead__seller { grid-column: span 2; }
    .qhead:not(:has(.qhead__seller)) .qhead__date { grid-column: span 3; }
    .qhead .qhead__cname { grid-column: span 4; }
    .qhead .qhead__cmail { grid-column: span 5; }
    .qhead .qhead__cphone { grid-column: span 3; }
    .qhead .qhead__folio, .qhead .qhead__status { grid-column: span 6; }
}

.qform__lines { padding: 6px var(--card-pad) 10px; }

/* Condiciones y notas: cerrado muestra un resumen de lo que va. */
.qcond { padding: 0; }
.qcond > summary {
    display: flex; align-items: baseline; gap: 12px; min-height: 36px; padding: 8px var(--card-pad);
    cursor: pointer; list-style-position: inside;
}
.qcond__title { flex: none; font: 700 .95rem/1.2 var(--f-display); color: var(--ink); }
.qcond__summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.qcond__grid { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); padding: 0 var(--card-pad) var(--card-pad); }
.qcond__notes { grid-column: 1 / -1; }
.qcond__notes textarea { min-height: 3.2em; }
.qcond__money { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 24px; }
.qcond__money .field { flex: 0 1 260px; }
.qcond__money .check { margin-top: 24px; }

/* Barra fija abajo: totales en línea y botones; siempre a la vista mientras se editan las líneas. */
.qbar {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
    padding: 8px var(--card-pad); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -6px 18px rgba(7, 17, 28, .09);
}
.qbar__totals { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; font-variant-numeric: tabular-nums; }
.qbar__totals div { display: grid; }
.qbar__totals dt { font-size: .8125rem; color: var(--muted); }
.qbar__totals dd { margin: 0; font-weight: 600; white-space: nowrap; }
.qbar__grand dd { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.qbar__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

@media (max-width: 600px) {
    /* En el celular, en la barra solo el total (el desglose de totales va arriba de ella al desplazarse). */
    .qbar__totals div:not(.qbar__grand) { display: none; }
    .qbar__actions { width: 100%; }
    .qbar__actions .btn { flex: 1 1 auto; }
}
/* Atención: selector + "Nuevo" en una fila; "Con copia a" plegado a todo el ancho. */
.qhead__pickrow { display: flex; gap: 6px; }
.qhead__pickrow select { flex: 1 1 auto; min-width: 0; }
.qhead .qhead__cc, .qhead .qhead__place { grid-column: 1 / -1; }
@media (min-width: 1100px) { .qhead .qhead__place { grid-column: span 5; } .qhead .qhead__cc { grid-column: span 7; align-self: end; } }
.qhead__cc > summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.qhead__cclist { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.qcontact-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.qcontact-dialog::backdrop { background: rgb(15 23 42 / .45); }
.qcontact-dialog form { padding: 14px 16px; }
.qcontact-dialog h2 { margin: 0 0 10px; font-size: 1.05rem; }
