/* © 2026 ToolsFlash.com — Invoice Generator styles. All rights reserved. */

.inv-h { font-size: 1rem; font-weight: 700; margin: 22px 0 12px; color: var(--text, #0f172a); }
.tool-workspace .inv-h:first-of-type { margin-top: 18px; }
[data-theme="dark"] .inv-h { color: var(--text, #e2e8f0); }

.inv-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.form-group textarea {
  width: 100%;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  background: var(--bg-card, #fff);
  color: inherit;
  resize: vertical;
}
[data-theme="dark"] .form-group textarea { background: var(--bg-card, #1e293b); border-color: var(--border, #334155); }

/* Line item rows */
.inv-items-head,
.inv-item-row { display: grid; grid-template-columns: 1fr 70px 110px 110px 32px; gap: 8px; align-items: center; }
.inv-items-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted, #64748b); margin-bottom: 6px; }
.inv-item-row { margin-bottom: 8px; }
.inv-item-row input { min-width: 0; }
.ii-amt { font-size: 0.85rem; font-weight: 700; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ii-del {
  border: none; background: transparent; color: var(--text-muted, #94a3b8);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.ii-del:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.inv-add-btn {
  border: 1px dashed var(--border, #cbd5e1); background: transparent; color: var(--primary, #4f46e5);
  border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 0.85rem; cursor: pointer;
  width: 100%; transition: border-color 0.15s, background 0.15s; margin-top: 2px;
}
.inv-add-btn:hover { border-color: var(--primary, #4f46e5); background: rgba(79, 70, 229, 0.05); }

.inv-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.inv-dl-btn {
  border: none; background: var(--primary, #4f46e5); color: #fff; border-radius: 8px;
  padding: 12px 22px; font-weight: 700; font-size: 0.95rem; cursor: pointer; transition: opacity 0.15s;
}
.inv-dl-btn:hover { opacity: 0.9; }
.inv-dl-hint { font-size: 0.76rem; color: var(--text-muted, #64748b); }

.notice { display: none; margin-top: 12px; }

/* ── Invoice sheet preview ───────────────────────────── */
.inv-preview-wrap { margin-top: 28px; }
.inv-preview-title { margin-bottom: 12px; }
.inv-sheet {
  background: #fff; color: #1e293b;
  border: 1px solid var(--border, #e2e8f0); border-radius: 12px;
  padding: 34px 36px; box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  max-width: 820px;
}
[data-theme="dark"] .inv-sheet { border-color: #334155; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4); }

.inv-sheet-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.inv-sheet-brand { font-size: 1.3rem; font-weight: 800; color: #0f172a; }
.inv-sheet-addr { font-size: 0.78rem; color: #64748b; margin-top: 4px; line-height: 1.5; }
.inv-sheet-title { text-align: right; }
.inv-sheet-word { font-size: 1.5rem; font-weight: 800; letter-spacing: 3px; color: #4f46e5; }
.inv-sheet-meta { font-size: 0.78rem; color: #475569; margin-top: 2px; }
.inv-sheet-billto { margin-top: 24px; }
.inv-sheet-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 1px; color: #94a3b8; }
.inv-sheet-client { font-weight: 700; margin-top: 3px; }

.inv-sheet-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 0.85rem; }
.inv-sheet-table th {
  text-align: left; background: #4f46e5; color: #fff; padding: 8px 10px; font-size: 0.74rem;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.inv-sheet-table th:nth-child(n+2), .inv-sheet-table td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.inv-sheet-table td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; }
.pv-empty { color: #94a3b8; font-style: italic; text-align: left !important; }

.inv-sheet-totals { margin-top: 14px; margin-left: auto; max-width: 300px; font-size: 0.85rem; }
.inv-sheet-totals > div { display: flex; justify-content: space-between; padding: 5px 10px; color: #475569; }
.inv-sheet-grand {
  border-top: 2px solid #0f172a; margin-top: 4px; font-weight: 800; font-size: 1rem !important;
  color: #0f172a !important;
}
.inv-sheet-notes { margin-top: 22px; font-size: 0.78rem; color: #64748b; border-top: 1px solid #e2e8f0; padding-top: 12px; line-height: 1.55; }

/* ── Print: only the invoice sheet ───────────────────── */
@media print {
  body * { visibility: hidden; }
  .inv-sheet, .inv-sheet * { visibility: visible; }
  .inv-sheet {
    position: absolute; left: 0; top: 0; width: 100%; max-width: none;
    border: none; border-radius: 0; box-shadow: none; padding: 10mm 12mm;
  }
  .site-header, .site-footer, .tool-page-header, .tool-sidebar { display: none !important; }
}

/* Responsive */
@media (max-width: 680px) {
  .inv-row3 { grid-template-columns: 1fr; }
  .inv-items-head { display: none; }
  .inv-item-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; padding: 8px; }
  .inv-item-row .ii-desc { grid-column: 1 / -1; }
  .ii-amt { text-align: left; align-self: center; }
  .ii-del { justify-self: end; }
  .inv-item-row { grid-template-columns: 1fr 1fr auto; }
  .inv-sheet { padding: 20px 16px; }
  .inv-sheet-title { text-align: left; }
}
