/* Invoice Generator — page-specific styles */

textarea { min-height: 110px; }

/* Hidden until data is ready */
.preview-hidden { display: none; }

/* ── Field group (two-column grid) ──────────────────────────────────────── */
.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 560px) { .field-group { grid-template-columns: 1fr; } }

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 0.93rem;
  box-sizing: border-box;
  font-family: inherit;
}
.field input:focus,
.field textarea:focus { outline: none; border-color: #0c6e78; box-shadow: 0 0 0 3px rgba(12,110,120,.12); }
.field textarea { resize: vertical; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-success { background: #276749; color: #fff; }
.btn-success:hover:not(:disabled) { background: #22543d; }

/* ── Line items table ────────────────────────────────────────────────────── */
.items-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.items-table th {
  background: #0c6e78;
  color: #fff;
  font-size: 0.8rem;
  padding: 9px 12px;
  text-align: left;
}
.items-table td { padding: 8px 12px; border-bottom: 1px solid #e2e8f0; font-size: 0.93rem; }
.items-table tr:nth-child(even) td { background: #f7fafc; }
.items-table .qty-cell  { text-align: center; width: 60px; }
.items-table .cost-cell { text-align: right; width: 110px; }
.items-table input { border: 1px solid #cbd5e0; border-radius: 4px; padding: 4px 7px; font-size: 0.9rem; width: 100%; }
.items-table .qty-input  { text-align: center; width: 50px; }
.items-table .cost-input { text-align: right; width: 90px; }

/* ── VAT toggle ──────────────────────────────────────────────────────────── */
.vat-toggle {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #4a5568;
}
.vat-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #0c6e78; }
.vat-toggle label { cursor: pointer; user-select: none; }

/* ── Totals summary ──────────────────────────────────────────────────────── */
.totals-summary { border: 1px solid #e2e8f0; border-radius: 6px; overflow: hidden; margin-bottom: 0; }
.totals-summary .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.93rem;
  border-bottom: 1px solid #e2e8f0;
  color: #4a5568;
}
.totals-summary .summary-row:last-child { border-bottom: none; }
.totals-summary .summary-row.summary-total {
  background: #0c6e78;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ── Add item button ─────────────────────────────────────────────────────── */
.add-item-btn {
  font-size: 0.82rem;
  padding: 6px 14px;
  background: #e6f5f6;
  color: #0c6e78;
  border: 1px solid #a8dde2;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 10px;
}
.add-item-btn:hover { background: #a8dde2; }

/* ── Remove row button ───────────────────────────────────────────────────── */
.remove-btn { color: #e53e3e; background: none; border: none; cursor: pointer; font-size: 1.1rem; padding: 0 4px; line-height: 1; }

/* ── Invoice preview (A4 iframe) ─────────────────────────────────────────── */
.preview-wrapper { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.preview-iframe { display: block; width: 794px; height: 1123px; border: 0; transform-origin: top left; }
.preview-hint { font-size: 0.82rem; color: #718096; margin-bottom: 12px; }
