/* Futkar — Professional Invoice (Print & PDF)
   Doc component styles stay on-screen for live preview.
   Global html/body remaps are print-only so they do not shrink the whole page. */
*, *::before, *::after { box-sizing: border-box; }

@media print {
  html, body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #1e293b;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10.5pt;
    line-height: 1.5;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@page { size: A4; margin: 12mm 14mm; }

body { padding: 0; }

.invoice-doc {
  max-width: 100%;
  margin: 0 auto;
}

/* Top accent */
.invoice-doc-accent {
  height: 4px;
  background: linear-gradient(90deg, #C45A10 0%, #E06A12 50%, #C45A10 100%);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

/* Header */
.invoice-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.invoice-doc-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.invoice-doc-logo {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #C45A10, #4338ca);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.375rem;
}

.invoice-doc-logo-img {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.375rem;
}

.invoice-doc-biz-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}

.invoice-doc-meta {
  font-size: 9.5pt;
  color: #475569;
  margin: 0.1rem 0;
  line-height: 1.4;
}

.invoice-doc-empty {
  color: #94a3b8;
}

.invoice-doc-invoice-box {
  flex-shrink: 0;
  text-align: right;
  min-width: 11rem;
}

.invoice-doc-title {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #C45A10;
  margin: 0 0 0.75rem;
}

.invoice-doc-meta-row {
  font-size: 9.5pt;
  color: #334155;
  margin: 0.2rem 0;
}

.invoice-doc-meta-row .invoice-doc-label {
  color: #64748b;
  display: inline-block;
  min-width: 5.5rem;
  text-align: left;
}

.invoice-doc-strong {
  font-weight: 600;
  color: #0f172a;
}

/* Info cards */
.invoice-doc-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.invoice-doc-info-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  background: #f8fafc;
}

.invoice-doc-section-title {
  font-size: 8pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #C45A10;
  margin: 0 0 0.5rem;
}

.invoice-doc-info-card p {
  margin: 0.15rem 0;
  font-size: 10pt;
  color: #334155;
}

/* Table */
.invoice-doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 10pt;
}

.invoice-doc-table thead th {
  background: #C45A10;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 8.5pt;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
}

.invoice-doc-table thead th:first-child { border-radius: 0.375rem 0 0 0; }
.invoice-doc-table thead th:last-child { border-radius: 0 0.375rem 0 0; }

.invoice-doc-table tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  vertical-align: top;
}

.invoice-doc-table tbody tr:last-child td { border-bottom: 2px solid #e2e8f0; }

.invoice-doc-table td:nth-child(2),
.invoice-doc-table td:nth-child(3),
.invoice-doc-table td:nth-child(4),
.invoice-doc-table th:nth-child(2),
.invoice-doc-table th:nth-child(3),
.invoice-doc-table th:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.invoice-doc-table tbody tr:nth-child(even) td { background: #fafbfc; }

/* Totals */
.invoice-doc-bottom {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.invoice-doc-total {
  width: 100%;
  max-width: 17rem;
  border-collapse: collapse;
  font-size: 10pt;
}

.invoice-doc-total td {
  padding: 0.35rem 0;
  border: none;
  color: #475569;
}

.invoice-doc-total td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #334155;
}

.invoice-doc-total tr.invoice-doc-total-final td {
  padding-top: 0.625rem;
  border-top: 2px solid #C45A10;
  font-weight: 700;
  font-size: 11.5pt;
  color: #0f172a;
}

.invoice-doc-total tr.invoice-doc-total-final td:last-child {
  color: #C45A10;
  font-weight: 800;
}

/* Footer */
.invoice-doc-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.invoice-doc-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.invoice-doc-payment-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
}

.invoice-doc-payment-item .invoice-doc-section-title {
  margin-bottom: 0.25rem;
  color: #64748b;
  font-size: 7.5pt;
}

.invoice-doc-payment-item p {
  margin: 0;
  font-size: 9.5pt;
  color: #334155;
  font-weight: 500;
}

.invoice-doc-payment-link {
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.invoice-doc-payment-link .invoice-doc-section-title {
  margin-bottom: 0.25rem;
  color: #64748b;
  font-size: 7.5pt;
}

.invoice-doc-payment-link p {
  margin: 0;
  font-size: 9.5pt;
  color: #334155;
  word-break: break-all;
}

.invoice-doc-pay-link {
  color: #C45A10;
  text-decoration: underline;
  font-weight: 500;
}

.invoice-doc-notes {
  font-size: 9.5pt;
  color: #475569;
  margin: 0.5rem 0 0;
  padding: 0.625rem 0.75rem;
  background: #f8fafc;
  border-radius: 0.375rem;
  border-left: 3px solid #C45A10;
}

.invoice-doc-notes strong { color: #334155; }

@media print {
  .invoice-doc-accent { margin-bottom: 1.25rem; }
}
