/* =========================
   BASE / CONTENEDOR
========================= */

.crm-purchase-invoice-modern {
  background: #f6f8fb;
  border-radius: 20px;
  padding: 1.25rem;
}

/* =========================
   HEADER / SUMMARY
========================= */

.crm-modern-header {
  padding: .5rem 0 0;
}

.crm-eyebrow {
  letter-spacing: .08em;
  font-weight: 700;
}

.crm-modern-card,
.crm-summary-card {
  border-radius: 18px;
  overflow: hidden;
}

.crm-summary-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.crm-summary-total strong {
  letter-spacing: -0.02em;
}

/* =========================
   DROPZONE
========================= */

.crm-dropzone {
  border: 2px dashed #cfd8e3;
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: #fbfcfe;
}

.crm-dropzone:hover {
  border-color: #0d6efd;
  transform: translateY(-1px);
}

.crm-dropzone.dragover {
  border-color: #0d6efd;
  background: #eef6ff;
}

/* =========================
   FILE PREVIEW
========================= */

.crm-file-preview-wrap {
  min-height: 100%;
}

.crm-file-preview {
  min-height: 220px;
}

.crm-file-preview img,
.crm-file-preview iframe {
  width: 100%;
  border-radius: 16px;
  background: #fff;
}

/* =========================
   QUEUE / CARDS
========================= */

.crm-card {
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transition: all .2s ease;
}

.crm-card:hover {
  transform: translateY(-1px);
}

.queue-item.active {
  border: 2px solid #0d6efd;
  background: #eef6ff;
}

/* =========================
   TABLA FACTURAS
========================= */

.crm-invoice-lines-table {
  margin-bottom: 0;
}

.crm-invoice-lines-table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6c757d;
  background: #f8fafc;
  border-bottom: 1px solid #e5ebf2;
}

.crm-invoice-lines-table td {
  background: #fff;
  transition: background .15s ease;
}

.crm-invoice-lines-table tr:hover td {
  background: #fafcff;
}

/* estados */
.crm-invoice-lines-table tr.table-danger td {
  background: #ffe5e5;
}

.crm-invoice-lines-table tr.table-warning td {
  background: #fff3cd;
}

/* =========================
   EDICIÓN INLINE
========================= */

td[contenteditable] {
  cursor: text;
  border-radius: 6px;
  padding: 4px 6px;
  transition: all .15s ease;
}

td[contenteditable]:focus {
  background: #eef6ff;
  outline: 1px solid #0d6efd;
}

td[contenteditable].is-invalid {
  background: #f8d7da;
}

td[contenteditable].is-valid {
  background: #d1e7dd;
}

/* =========================
   SUGERENCIAS
========================= */

.suggestion-item {
  cursor: pointer;
  margin: 2px;
  padding: 3px 6px;
  transition: all .15s ease;
}

.suggestion-item:hover {
  background: #0d6efd!important;
  color: #fff!important;
}

/* =========================
   FORM CONTROLS
========================= */

.crm-purchase-invoice-modern .form-control,
.crm-purchase-invoice-modern .form-select {
  border-radius: 12px;
  border-color: #dbe3ec;
}

.crm-purchase-invoice-modern .form-control:focus,
.crm-purchase-invoice-modern .form-select:focus {
  border-color: #86b7fe;
}

/* =========================
   SUPPLIER SELECT (TomSelect)
========================= */

.crm-supplier-field .ts-control {
  min-height: 46px;
  border-radius: 12px;
  border-color: #dbe3ec;
}

.crm-supplier-field .ts-dropdown {
  border-radius: 12px;
  border-color: #dbe3ec;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* =========================
   TAX BOX
========================= */

.crm-line-tax-box {
  background: #f8fafc;
  border: 1px solid #e5ebf2;
  border-radius: 14px;
  padding: .75rem;
}

.crm-line-tax-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
}

/* =========================
   PIPELINE (KANBAN)
========================= */

.crm-pipeline-card {
  border-radius: 14px;
  background: #fff;
  transition: all .2s ease;
}

.crm-pipeline-card.dragging {
  opacity: .55;
}

.crm-pipeline-column {
  min-height: 120px;
}

.crm-pipeline-stage.is-over {
  outline: 2px dashed #0d6efd;
  outline-offset: -6px;
}

/* =========================
   LISTA FACTURAS
========================= */

.crm-purchase-invoices-page .table th {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6c757d;
}

/* =========================
   DATE PICKER FLOAT
========================= */

.crm-date-floating-panel {
  position: absolute;
  top: 50%;
  left: .5rem;
  z-index: 1080;
  width: min(320px, calc(100vw - 2rem));
}

.crm-date-floating-panel__card {
  background: #fff;
  border: 1px solid #e5ebf2;
  border-radius: .75rem;
  box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.12);
  padding: 1rem;
}

/* =========================
   STATS
========================= */

.crm-stat-card .card-body {
  min-height: 110px;
}

/* =========================
   ANIMACIONES
========================= */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rowFlash {
  0% { background: #e8f3ff; }
  100% { background: transparent; }
}

tr.row-updated td {
  animation: rowFlash .6s ease;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 767.98px) {

  .crm-invoice-lines-table,
  .crm-invoice-lines-table thead,
  .crm-invoice-lines-table tbody,
  .crm-invoice-lines-table th,
  .crm-invoice-lines-table td,
  .crm-invoice-lines-table tr {
    display: block;
  }

  .crm-invoice-lines-table thead {
    display: none;
  }

  .crm-invoice-lines-table tr {
    border: 1px solid #e5ebf2;
    border-radius: .75rem;
    padding: .75rem;
    margin-bottom: .75rem;
  }

  .crm-invoice-lines-table td {
    margin-bottom: .75rem;
  }

  .crm-invoice-lines-table td::before {
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 600;
    color: #6c757d;
    display: block;
  }

}

.crm-row-actions .dropdown-toggle::after {
  display: none;
}

.crm-row-actions .dropdown-menu {
  min-width: 220px;
}

.crm-row-actions .btn.crm-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crm-purchase-invoices-view-list tbody tr:has(.crm-purchase-invoice-check:checked) {
  background: #eef6ff;
}

[data-bulk-bar] {
  min-height: 38px;
}

.crm-supplier-dashboard-card {
  border-radius: 18px;
}

.crm-supplier-invoices-table-wrap {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid #edf2f7;
  border-radius: 16px;
  padding: 1rem;
}

.crm-supplier-invoices-table {
  margin-bottom: 0;
}

.crm-supplier-invoices-table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6c757d;
  border-bottom: 1px solid #e9eef5;
  background: #f8fafc;
  white-space: nowrap;
}

.crm-supplier-invoices-table tbody td {
  vertical-align: middle;
  background: #fff;
}

.crm-supplier-invoices-table tbody tr {
  transition: all .15s ease;
}

.crm-supplier-invoices-table tbody tr:hover td {
  background: #fafcff;
}

.crm-supplier-invoices-table tbody tr td:first-child {
  border-left: 3px solid transparent;
}

.crm-supplier-invoices-table tbody tr:hover td:first-child {
  border-left-color: #0d6efd;
}

.crm-inline-invoice-status {
  min-width: 150px;
  border-radius: 10px;
}

.crm-invoice-status-badge .badge {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.crm-supplier-invoices-table tr.row-updated td {
  animation: rowFlash .6s ease;
}


.crm-inline-invoice-status {
  min-width: 140px;
}