/* INVOBILLING — templates.css : per-template visual variants on the invoice doc */
/* Templates apply CSS variables + small layout tweaks to .inv-doc via .tpl-* class */

/* Template tokens */
.inv-doc {
  --tpl-primary: #0F172A;
  --tpl-accent: #6366F1;
  --tpl-bg: #FFFFFF;
  --tpl-surface: #FFFFFF;
  --tpl-text: #1A1A1A;
  --tpl-muted: #6B7280;
  --tpl-border: #E5E7EB;
  --tpl-font: 'Inter', sans-serif;
  --tpl-head-bg: #F9FAFB;
  background: var(--tpl-bg);
  color: var(--tpl-text);
  font-family: var(--tpl-font);
}

/* 1. Minimal White — pure, clean */
.tpl-minimal-white { --tpl-primary: #111827; --tpl-accent: #6366F1; --tpl-head-bg: #FFFFFF; }
.tpl-minimal-white .inv-items-table thead th { background: transparent; border-bottom: 2px solid #111827; }

/* 2. Modern Blue */
.tpl-modern-blue { --tpl-primary: #1E3A8A; --tpl-accent: #3B82F6; --tpl-head-bg: #EFF6FF; }
.tpl-modern-blue .inv-items-table thead th { background: #1E3A8A; color: #fff; }

/* 3. Executive Black */
.tpl-executive-black { --tpl-primary: #000000; --tpl-accent: #525252; --tpl-head-bg: #111111; }
.tpl-executive-black .inv-items-table thead th { background: #111111; color: #fff; }
.tpl-executive-black .inv-brand-name { color: #000; }
.tpl-executive-black .inv-title-block .inv-title { color: #000; }

/* 4. Elegant Gold */
.tpl-elegant-gold { --tpl-primary: #78350F; --tpl-accent: #D97706; --tpl-head-bg: #FEF3C7; font-family: 'Manrope', serif; }
.tpl-elegant-gold .inv-title-block .inv-title { color: #78350F; }
.tpl-elegant-gold .inv-items-table thead th { background: #FEF3C7; color: #78350F; border-bottom: 2px solid #D97706; }
.tpl-elegant-gold .inv-totals-row.grand { border-top-color: #D97706; }

/* 5. Corporate Grey */
.tpl-corporate-grey { --tpl-primary: #374151; --tpl-accent: #6B7280; --tpl-head-bg: #F3F4F6; }
.tpl-corporate-grey .inv-items-table thead th { background: #374151; color: #fff; }

/* 6. Creative Violet */
.tpl-creative-violet { --tpl-primary: #5B21B6; --tpl-accent: #8B5CF6; --tpl-head-bg: #F5F3FF; }
.tpl-creative-violet .inv-items-table thead th { background: #5B21B6; color: #fff; }
.tpl-creative-violet .inv-title-block .inv-title { color: #5B21B6; }

/* 7. Retail Classic */
.tpl-retail-classic { --tpl-primary: #991B1B; --tpl-accent: #DC2626; --tpl-head-bg: #FEF2F2; font-family: 'Manrope', sans-serif; }
.tpl-retail-classic .inv-items-table thead th { background: #FEF2F2; color: #991B1B; border-bottom: 2px solid #991B1B; }

/* 8. Professional Green */
.tpl-professional-green { --tpl-primary: #064E3B; --tpl-accent: #059669; --tpl-head-bg: #ECFDF5; }
.tpl-professional-green .inv-items-table thead th { background: #064E3B; color: #fff; }

/* 9. Luxury Dark — dark background template */
.tpl-luxury-dark { --tpl-primary: #1E293B; --tpl-accent: #D4AF37; --tpl-bg: #0F172A; --tpl-text: #E5E7EB; --tpl-muted: #94A3B8; --tpl-border: #334155; --tpl-head-bg: #1E293B; font-family: 'Manrope', sans-serif; }
.tpl-luxury-dark .inv-items-table thead th { background: #1E293B; color: #D4AF37; border-bottom-color: #D4AF37; }
.tpl-luxury-dark .inv-items-table tbody td { border-bottom-color: #1E293B; color: #E5E7EB; }
.tpl-luxury-dark .inv-brand-name { color: #fff; }
.tpl-luxury-dark .inv-title-block .inv-title { color: #D4AF37; }
.tpl-luxury-dark .inv-meta-strip { border-color: #334155; }
.tpl-luxury-dark .inv-totals-row { color: #94A3B8; }
.tpl-luxury-dark .inv-totals-row .val { color: #fff; }
.tpl-luxury-dark .inv-totals-row.grand { border-top-color: #D4AF37; color: #fff; }
.tpl-luxury-dark .inv-totals-row.grand .val { color: #D4AF37; }
.tpl-luxury-dark .inv-footer { color: #64748B; border-top-color: #1E293B; }

/* 10. Simple Thermal — minimal receipt look, always white */
.tpl-simple-thermal { --tpl-primary: #000000; --tpl-accent: #000000; --tpl-head-bg: #FFFFFF; font-family: 'JetBrains Mono', monospace; }
.tpl-simple-thermal .inv-items-table thead th { background: #FFFFFF; color: #000; border-bottom: 1px dashed #000; }

/* 11. Freelancer Minimal */
.tpl-freelancer-minimal { --tpl-primary: #0F766E; --tpl-accent: #14B8A6; --tpl-head-bg: #F0FDFA; }
.tpl-freelancer-minimal .inv-items-table thead th { background: transparent; border-bottom: 2px solid #0F766E; color: #0F766E; }

/* 12. International Business */
.tpl-international-business { --tpl-primary: #1E40AF; --tpl-accent: #2563EB; --tpl-head-bg: #F8FAFC; }
.tpl-international-business .inv-items-table thead th { background: #1E40AF; color: #fff; text-transform: none; }
.tpl-international-business .inv-brand-name { letter-spacing: -0.01em; }

/* 13. Modern Retail */
.tpl-modern-retail { --tpl-primary: #BE123C; --tpl-accent: #F43F5E; --tpl-head-bg: #FFF1F2; }
.tpl-modern-retail .inv-items-table thead th { background: #BE123C; color: #fff; }

/* 14. Clean Typography — focus on type */
.tpl-clean-typography { --tpl-primary: #18181B; --tpl-accent: #18181B; --tpl-head-bg: #FFFFFF; font-family: 'Manrope', sans-serif; }
.tpl-clean-typography .inv-items-table thead th { background: transparent; color: #18181B; border-bottom: 1px solid #18181B; font-weight: 800; }
.tpl-clean-typography .inv-brand-name { font-family: 'Manrope', sans-serif; font-weight: 800; }
.tpl-clean-typography .inv-title-block .inv-title { font-family: 'Manrope', sans-serif; }

/* 15. Compact Receipt — like a store receipt */
.tpl-compact-receipt { --tpl-primary: #000000; --tpl-accent: #000000; --tpl-head-bg: #FFFFFF; font-family: 'JetBrains Mono', monospace; }
.tpl-compact-receipt .inv-items-table thead th { background: #FFFFFF; color: #000; border-bottom: 1px dashed #000; font-family: 'JetBrains Mono', monospace; }
.tpl-compact-receipt .inv-totals-row { font-family: 'JetBrains Mono', monospace; }

/* 16. Royal Indigo */
.tpl-royal-indigo { --tpl-primary: #312E81; --tpl-accent: #6366F1; --tpl-head-bg: #E0E7FF; }
.tpl-royal-indigo .inv-items-table thead th { background: #312E81; color: #fff; }

/* 17. Warm Sand */
.tpl-warm-sand { --tpl-primary: #7C2D12; --tpl-accent: #C2410C; --tpl-head-bg: #FFFBEB; }
.tpl-warm-sand .inv-items-table thead th { background: #FFFBEB; color: #7C2D12; border-bottom: 2px solid #C2410C; }

/* 18. Slate Pro */
.tpl-slate-pro { --tpl-primary: #334155; --tpl-accent: #0EA5E9; --tpl-head-bg: #F8FAFC; }
.tpl-slate-pro .inv-items-table thead th { background: #334155; color: #fff; }

/* 19. Mint Fresh */
.tpl-mint-fresh { --tpl-primary: #166534; --tpl-accent: #22C55E; --tpl-head-bg: #F0FDF4; }
.tpl-mint-fresh .inv-items-table thead th { background: #F0FDF4; color: #166534; border-bottom: 2px solid #22C55E; }

/* 20. Midnight Plum */
.tpl-midnight-plum { --tpl-primary: #581C87; --tpl-accent: #A855F7; --tpl-head-bg: #FAF5FF; }
.tpl-midnight-plum .inv-items-table thead th { background: #581C87; color: #fff; }

/* Apply template tokens */
.inv-doc .inv-items-table thead th { background: var(--tpl-head-bg); color: var(--tpl-primary); }
.inv-doc .inv-brand-name { color: var(--tpl-primary); }
.inv-doc .inv-title-block .inv-title { color: var(--tpl-primary); }
.inv-doc .inv-accent-bar { background: var(--tpl-accent); }
.inv-doc .inv-totals-row.grand { border-top-color: var(--tpl-primary); }

/* Accent color override (user-selected) */
.inv-doc[data-accent] .inv-accent-bar { background: var(--user-accent, var(--tpl-accent)); }
.inv-doc[data-accent] .inv-totals-row.grand .val { color: var(--user-accent, var(--tpl-primary)); }
.inv-doc[data-accent] .inv-status-stamp { border-color: var(--user-accent, var(--tpl-primary)); color: var(--user-accent, var(--tpl-primary)); }
