/* ============================================================================
   COTIZACIONES — estilos (auto-contenido, prefijo cot-)
   Estética alineada a FE POS. Azul corporativo #1a3c8f.
   ============================================================================ */
.cot-shell { max-width: 1200px; margin: 0 auto; padding: 8px; }

/* Header */
.cot-header { display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.cot-title { font-size: 20px; font-weight: 800; color: #1a3c8f; margin: 0;
  display: flex; align-items: center; gap: 6px; }
.cot-info-btn { border: 0; background: transparent; cursor: pointer; font-size: 16px; }
.cot-subtitle { font-size: 12px; color: #64748b; margin-top: 2px; }
.cot-header-right { display: flex; gap: 8px; flex-wrap: wrap; }
.cot-vsw { border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.cot-vsw-on { background: #1a3c8f; color: #fff; border-color: #1a3c8f; }

/* Layout 2 columnas */
.cot-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
@media (max-width: 900px) { .cot-main { grid-template-columns: 1fr; } }
.cot-col-left, .cot-col-right { display: flex; flex-direction: column; gap: 12px; }

/* Cards */
.cot-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.cot-card-selected { border-color: #1a3c8f; box-shadow: 0 0 0 2px rgba(26,60,143,.1); }
.cot-card-head { display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; color: #1e293b; margin-bottom: 8px; font-size: 14px; }
.cot-badge { font-size: 11px; background: #eef2ff; color: #1a3c8f; padding: 2px 8px; border-radius: 999px; }

/* Inputs */
.cot-input { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px;
  font-size: 14px; box-sizing: border-box; }
.cot-input:focus { outline: none; border-color: #1a3c8f; box-shadow: 0 0 0 3px rgba(26,60,143,.12); }
.cot-lbl { display: block; font-size: 12px; color: #475569; font-weight: 600; margin: 8px 0 3px; }
textarea.cot-input { resize: vertical; font-family: inherit; }

/* Resultados búsqueda */
.cot-resultados { margin-top: 6px; max-height: 260px; overflow-y: auto; }
.cot-res-row { padding: 8px 10px; border: 1px solid #eef2f7; border-radius: 8px; margin-bottom: 4px;
  cursor: pointer; }
.cot-res-row:hover, .cot-res-active { background: #eff6ff; border-color: #1a3c8f; }
.cot-res-meta { font-size: 11px; color: #64748b; }
.cot-res-err { color: #b91c1c; font-size: 12px; padding: 6px; }

/* Cliente */
.cot-cliente-nombre { font-weight: 700; font-size: 15px; }
.cot-cliente-meta { font-size: 12px; color: #475569; margin-top: 2px; }
.cot-btn-link { border: 0; background: transparent; color: #1a3c8f; cursor: pointer;
  font-weight: 600; font-size: 12px; }

/* Selector de lista */
.cot-lista-sel { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cot-lista-btn { border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; padding: 6px 10px;
  cursor: pointer; font-size: 12px; font-weight: 600; color: #334155; }
.cot-lista-btn-on { background: #1a3c8f; color: #fff; border-color: #1a3c8f; }

/* Mini-barra */
.cot-minibar { border: 2px solid #1a3c8f; border-radius: 10px; padding: 8px; background: #f8fafc; margin-top: 6px; }
.cot-minibar-prod { font-size: 13px; margin-bottom: 6px; }
.cot-minibar-meta { display: block; font-size: 11px; color: #64748b; }
.cot-minibar-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.cot-minibar-lbl { font-size: 11px; color: #475569; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.cot-minibar-nota-lbl { flex: 1; min-width: 120px; }
.cot-minibar-inp { border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; font-size: 13px; width: 90px; }
.cot-minibar-nota-lbl .cot-minibar-inp { width: 100%; box-sizing: border-box; }

/* Tabla detalle */
.cot-table-wrap { overflow-x: auto; }
.cot-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cot-table th { text-align: left; font-size: 11px; text-transform: uppercase; color: #64748b;
  border-bottom: 2px solid #e2e8f0; padding: 6px 4px; }
.cot-table td { padding: 6px 4px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.cot-line-name { font-weight: 600; }
.cot-line-meta { font-size: 11px; color: #64748b; }
.cot-line-input { width: 64px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 6px; font-size: 13px; }
.cot-line-input-sm { width: 52px; }
.cot-line-price { white-space: nowrap; }
.cot-line-total { text-align: right; white-space: nowrap; }
.cot-btn-icon { border: 0; background: #fee2e2; color: #b91c1c; border-radius: 6px; width: 26px; height: 26px;
  cursor: pointer; font-weight: 700; }
/* Descuento por % o $ (toggle por línea) */
.cot-desc-cell { display: flex; align-items: center; gap: 3px; }
.cot-desc-toggle { border: 1px solid #1a3c8f; background: #eef2ff; color: #1a3c8f; border-radius: 6px;
  width: 26px; height: 30px; cursor: pointer; font-weight: 800; font-size: 14px; flex: 0 0 auto; }
.cot-desc-toggle:hover { background: #1a3c8f; color: #fff; }
.cot-desc-cell .cot-line-input-sm { width: 58px; }

/* Resumen */
.cot-resumen-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.cot-resumen-total { border-top: 2px solid #1a3c8f; margin-top: 6px; padding-top: 8px;
  font-size: 17px; font-weight: 800; color: #1a3c8f; }

/* Acciones */
.cot-acciones { display: flex; gap: 8px; }
.cot-btn-save { flex: 1; background: #16a34a; color: #fff; border: 0; border-radius: 8px; padding: 12px;
  cursor: pointer; font-weight: 700; font-size: 14px; }
.cot-btn-save:disabled { background: #94a3b8; cursor: not-allowed; }
.cot-btn-cancel { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; border-radius: 8px;
  padding: 12px 16px; cursor: pointer; font-weight: 600; }

/* Alertas */
.cot-alert { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.cot-alert-ok { background: #dcfce7; color: #166534; }
.cot-alert-warn { background: #fef3c7; color: #92400e; }
.cot-alert-err { background: #fee2e2; color: #991b1b; }
.cot-alert-info { background: #e0f2fe; color: #075985; }

/* Listado */
.cot-listado-wrap { margin-top: 6px; }
.cot-filtros { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.cot-fchip { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 6px 14px;
  cursor: pointer; font-size: 12px; font-weight: 600; color: #334155; }
.cot-fchip-on { background: #1a3c8f; color: #fff; border-color: #1a3c8f; }
.cot-table-list td { border-bottom: 1px solid #eef2f7; }
.cot-acc-cell { white-space: nowrap; }
.cot-tbtn { border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; padding: 4px 7px;
  cursor: pointer; font-size: 13px; margin-right: 3px; }
.cot-tbtn-go { border-color: #16a34a; background: #f0fdf4; }
.cot-tbtn-del { border-color: #fca5a5; background: #fef2f2; }
.cot-facref { font-size: 11px; color: #166534; background: #dcfce7; padding: 2px 6px; border-radius: 6px; }
.cot-loading, .cot-empty { padding: 24px; text-align: center; color: #64748b; }

/* Badges de estado */
.cot-badge-estado { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.cot-est-borr { background: #e0f2fe; color: #075985; }
.cot-est-conv { background: #dcfce7; color: #166534; }
.cot-est-anul { background: #f1f5f9; color: #64748b; }
.cot-est-vencida { background: #fef3c7; color: #92400e; }

/* Modales */
.cot-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.cot-modal-bg { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.cot-modal-card { position: relative; background: #fff; border-radius: 14px; padding: 20px;
  width: min(560px, 94vw); max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.cot-modal-card h3 { margin: 0 0 8px; color: #1a3c8f; font-size: 18px; }
/* Membrete (datos empresa) en el modal de detalle */
.cot-membrete { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 2px solid #1a3c8f; }
.cot-membrete-logo { max-height: 48px; max-width: 140px; }
.cot-membrete-nom { font-size: 16px; font-weight: 800; color: #1a3c8f; }
.cot-membrete-meta { font-size: 11px; color: #64748b; }
.cot-modal-meta { font-size: 13px; color: #475569; margin-bottom: 10px; }
.cot-modal-total { text-align: right; font-size: 16px; font-weight: 800; color: #1a3c8f; margin-top: 8px; }
.cot-modal-obs { margin-top: 8px; font-size: 12px; color: #475569; background: #f8fafc; padding: 6px; border-radius: 8px; }
.cot-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* Segmentos (tipo doc / pago) */
.cot-seg { display: flex; gap: 6px; margin-bottom: 4px; }
.cot-seg-wrap { flex-wrap: wrap; }
.cot-seg-btn { flex: 1; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; padding: 10px;
  cursor: pointer; font-weight: 600; font-size: 13px; color: #334155; }
.cot-seg-on { background: #1a3c8f; color: #fff; border-color: #1a3c8f; }
.cot-conv-nota { font-size: 12px; color: #075985; background: #e0f2fe; padding: 8px; border-radius: 8px; margin: 4px 0; }
.cot-conv-warn { font-size: 12px; color: #92400e; background: #fef3c7; padding: 8px; border-radius: 8px; margin: 10px 0 4px; }
