/* Documents sortable lists — Approvals-style headers + Dimensionamento-style thumbs */

.documents-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.documents-table {
  --documents-table-font-size: 0.92rem;
  --documents-table-line-height: 1.35;
  width: 100%;
  margin: 0;
  font-size: var(--documents-table-font-size);
  line-height: var(--documents-table-line-height);
  border-collapse: collapse;
}

.documents-table thead th {
  white-space: nowrap;
  font-weight: 600;
  font-size: calc(var(--documents-table-font-size) * 0.78);
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
}

.documents-table tbody td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

.documents-table tbody tr:last-child td {
  border-bottom: 0;
}

.documents-table tbody tr:hover td {
  background: #f8fafc;
}

.documents-table tbody tr.documents-invoice-row-clickable {
  cursor: pointer;
}

.documents-table tbody tr.documents-invoice-row-clickable:hover td {
  background: #f1f5f9;
}

.documents-table tbody tr.documents-invoice-row-clickable:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: -2px;
}

.documents-table tbody tr.invoice-due-future td {
  background: rgba(102, 126, 234, 0.04);
}

.documents-table-header-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.documents-table-sort-btn,
.admin-sent-quote-sort-btn.documents-table-sort-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 0;
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
  font-size: 0.72rem;
  cursor: pointer;
}

.documents-table-sort-btn:hover,
.documents-table-sort-btn.is-active,
.admin-sent-quote-sort-btn.documents-table-sort-btn:hover,
.admin-sent-quote-sort-btn.documents-table-sort-btn.is-active {
  color: #667eea;
}

.admin-sent-quote-delivery-channels {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.admin-sent-quote-channel {
  font-size: 1.25rem;
  line-height: 1;
}

button.admin-sent-quote-channel.is-retry {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.1rem 0.15rem;
  cursor: pointer;
  border-radius: 0.35rem;
}

button.admin-sent-quote-channel.is-retry:hover,
button.admin-sent-quote-channel.is-retry:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.admin-sent-quote-channel.is-delivered {
  opacity: 1;
}

.admin-sent-quote-channel.is-pending {
  opacity: 0.55;
  filter: grayscale(0.2);
}

.admin-sent-quote-channel.is-awaiting {
  opacity: 0.7;
}

.documents-table-thumb,
.documents-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  display: block;
}

.documents-table-thumb-icon {
  width: 44px;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #667eea;
}

.documents-table-thumb-icon.text-warning {
  color: #f0ad4e;
}

.documents-table-thumb-icon.text-info {
  color: #0dcaf0;
}

.documents-table-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.documents-table-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.documents-table-link:hover {
  text-decoration: underline;
  color: #764ba2;
}

.documents-generate-cta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.documents-generate-btn.generating {
  opacity: 0.65;
  pointer-events: none;
}

/* Full-width invoice dropzone above the table */
.documents-invoice-dropzone {
  width: 100%;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  background: #fafbff;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: center;
}

.documents-invoice-dropzone.dragover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.08);
}

.documents-invoice-dropzone .drop-zone-icon {
  font-size: 2rem;
  color: #667eea;
  margin: 0;
  flex-shrink: 0;
}

.documents-invoice-dropzone .drop-zone-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
}

.documents-invoice-dropzone .drop-zone-hint {
  color: #475569;
  font-weight: 500;
}

.documents-invoice-dropzone .status-line {
  width: 100%;
  margin: 0;
  flex-basis: 100%;
  text-align: center;
}

.documents-invoice-dropzone .report-provider-logo,
.documents-invoice-dropzone img.energy-provider-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.documents-invoice-chart-section {
  padding: 1rem 1rem 0.5rem;
  border-top: 1px solid #e5e7eb;
}

.documents-hub .documents-master-tabs {
  margin-bottom: 1rem;
}

.documents-hub-subtitle {
  text-align: center;
  margin-bottom: 0.75rem;
}

.documents-hub-dropzone {
  max-width: 100%;
}

.documents-hub .documents-master-tab {
  font-weight: 600;
}

.documents-section-pane {
  width: 100%;
}

.documents-invoice-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.documents-invoice-chart-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.documents-invoice-chart-header-actions {
  flex: 0 0 auto;
  margin-left: auto;
  padding-top: 0.125rem;
  padding-right: 0.25rem;
}

.documents-invoice-chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.documents-invoice-chart-tabs .year-chart-tab {
  margin-bottom: -1px;
}

.documents-invoice-chart-pane {
  width: 100%;
}

.chart-description {
  text-align: center;
}

.documents-invoice-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 280px;
  height: 320px;
  padding: 0.75rem 0.5rem 0.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.documents-invoice-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.documents-invoice-chart-empty {
  padding: 1.25rem 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  text-align: center;
}

.documents-invoice-chart-notes {
  text-align: center;
}

.documents-invoice-chart-notes .documents-invoice-chart-note {
  margin-left: auto;
  margin-right: auto;
  max-width: 40rem;
}
