/* Cotizaciones (/cotizaciones/): on top of ../editor.css */
.req { color: var(--red); }
.grid2 { display: grid; gap: 0 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid2 > div { min-width: 0; }
.tabpanel .card + .card { margin-top: 14px; }
.stripe { margin: 12px 0 0; }
.stripe ul { margin: 4px 0 0; padding-left: 18px; }
.field-error { color: var(--red); font-size: .82rem; margin: 2px 0 0; min-height: 0; }
.field-error:empty { display: none; }
input.invalid, textarea.invalid, select.invalid { border-color: var(--red); }
.tag.pend { cursor: default; }

/* ---- history ---- */
table.hist { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.hist th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.hist td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.hist .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.hist tr.gone td { opacity: .55; }
table.hist .folio { font-weight: 600; white-space: nowrap; }
table.hist .acts { display: flex; gap: 6px; flex-wrap: wrap; }
table.hist select { width: auto; padding: 4px 8px; }
.st { display: inline-block; font-size: .78rem; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.st.sent { color: #8fc0ff; border-color: rgba(42, 134, 255, .7); }
.st.accepted { color: var(--green); border-color: rgba(34, 177, 76, .7); }
.st.rejected { color: var(--red); border-color: rgba(240, 57, 47, .6); }

/* ---- editor ---- */
.ed-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.ed-form, .ed-side { min-width: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.ed-side .card { position: sticky; top: 8px; }
.pv-wrap { margin-top: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #e6e9f2; }
#pv-frame { display: block; width: 900px; height: 1250px; border: 0; transform-origin: top left; background: #e6e9f2; }
ul.qitems { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
li.qitem { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px 12px; grid-template-columns: minmax(0, 1fr) 6.5rem 9rem; background: rgba(255, 255, 255, .02); }
li.qitem .wide { grid-column: 1 / -1; }
li.qitem label { margin-top: 4px; }
li.qitem .tools { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
li.qitem .line { color: var(--muted); font-variant-numeric: tabular-nums; }
dl.totals { margin: 14px 0 0; display: grid; gap: 2px; max-width: 22rem; margin-left: auto; }
dl.totals div { display: flex; justify-content: space-between; gap: 12px; }
dl.totals dt { color: var(--muted); }
dl.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
dl.totals .grand { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; font-weight: 700; }
dl.totals .grand dt { color: var(--text); }
details.ai { margin-top: 12px; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px 12px; }
details.ai > summary { cursor: pointer; font-weight: 600; }
ul.revs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
ul.revs li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.sig-box { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sig-box img { max-width: 220px; max-height: 80px; background: #fff; border-radius: 6px; padding: 4px; }
.actions { z-index: 6; }

/* ---- a phone ---- */
@media (max-width: 960px) {
  .ed-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-side .card { position: static; }
}
@media (max-width: 640px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  li.qitem { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  li.qitem .concept { grid-column: 1 / -1; }
  .actions { position: static; }
  /* the history turns into cards */
  table.hist, table.hist tbody, table.hist tr, table.hist td { display: block; width: 100%; }
  table.hist thead { display: none; }
  table.hist tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; }
  table.hist td { border: 0; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; align-items: center; text-align: right; }
  table.hist td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; flex: none; }
  table.hist td.acts-cell { flex-wrap: wrap; justify-content: flex-start; }
  table.hist td.acts-cell::before { display: none; }
  #h-q { width: 100% !important; }
}

/* ---- the anonymize dialog ---- */
dialog#anon-dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; width: min(34rem, calc(100% - 24px)); }
dialog#anon-dialog::backdrop { background: rgba(0, 0, 0, .6); }
button.danger-fill { background: var(--red); color: #fff; }
