/* =========================================================
   08-components.invoices.css
   Invoices shell + modal
========================================================= */

.saas-h2 {
  margin: 0 0 var(--space-3);
  font-size: 20px;
}

.saas-muted {
  color: var(--muted);
  margin: 0 0 var(--space-4);
  font-size: 14px;
}

.saas-table-card {
  overflow-x: auto;
}

.saas-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.saas-table thead th {
  text-align: left;
  padding: 12px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.saas-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

#invoice-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: var(--space-4);
}

#invoice-modal {
  width: min(900px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
}

.invoice-modal-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.invoice-modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.invoice-modal-close {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 38px;
  height: 38px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--shadow-xs);
}

.invoice-modal-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  min-height: 320px;
  flex: 1;
  background: var(--surface);
}

#invoice-pdf-frame {
  border: none;
  width: 100%;
  min-height: 320px;
  background: var(--surface-2);
}

.invoice-modal-aside {
  border-left: 1px solid var(--border);
  padding: var(--space-4);
  overflow: auto;
}

.invoice-meta {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  color: var(--muted);
}

.invoice-download-btn {
  width: 100%;
  margin-top: var(--space-4);
}

@media (max-width: 860px) {
  .invoice-modal-body {
    grid-template-columns: 1fr;
  }
  .invoice-modal-aside {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
