/* InvoiceGenerator - light theme inspired by invoice-generator.com
   Primary color: deep green (#1a7f37)
   Background: very light gray (#f8f9fa)
   Cards: white with subtle shadow
*/

:root {
  --bg:        #f8f9fa;
  --bg-2:      #f1f3f5;
  --card:      #ffffff;
  --ink:       #0f172a;
  --ink-2:     #1f2937;
  --muted:     #6b7280;
  --line:      #e5e7eb;
  --line-2:    #d1d5db;
  --primary:   #1a7f37;
  --primary-2: #166c2e;
  --primary-3: #2c9c4a;
  --primary-soft: #e6f4ea;
  --accent:    #f59e0b;
  --ok:        #10b981;
  --warn:      #f59e0b;
  --err:       #dc2626;
  --shadow:    0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius:    8px;
  --radius-sm: 6px;
  --font-display: "Michroma", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--ink); }
body.ig-body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }

/* ------ Navbar (light, like invoice-generator.com) ------ */
.ig-nav {
  position: sticky; top: 0; z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.ig-nav-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
}
.ig-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 17px; flex-shrink: 0; }
.ig-brand:hover { color: var(--ink); }
.ig-logo { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--primary); color: white; border-radius: 8px; box-shadow: 0 2px 6px rgba(26, 127, 55, 0.3); }
.ig-logo svg { width: 26px; height: 26px; }
.ig-brand-name {
    letter-spacing: -0.2px;
    line-height: 40px;
    padding-bottom: 8px;
}
.ig-brand-name .tld { color: var(--muted); font-weight: 500; }
.ig-links { display: flex; gap: 24px; margin-left: 32px; align-items: center; flex-shrink: 0; }
.ig-links a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 40px; white-space: nowrap; }
.ig-links a:hover { color: var(--primary); }
.ig-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.ig-cta { background: var(--primary); color: white !important; padding: 8px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; font-size: 14px; border: 0; cursor: pointer; }
.ig-cta:hover { background: var(--primary-2); color: white !important; }
.ig-cta-outline { background: white; color: var(--ink) !important; padding: 8px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; font-size: 14px; border: 1px solid var(--line-2); }
.ig-cta-outline:hover { background: var(--bg-2); color: var(--ink) !important; }
.ig-link-quiet { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.ig-link-quiet:hover { color: var(--primary); }
.ig-pill { color: var(--ink); background: var(--bg-2); padding: 6px 12px; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* User menu (replaces the separate "username" + "logout" links in the
   navbar). The trigger shows the user's display name + a caret; clicking
   it toggles a popup with the account email, Account settings, and
   Logout. The popup is keyboard-accessible (Escape closes, items are
   role="menuitem"). */
.ig-user-menu { position: relative; }
.ig-user-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 160px;
  padding: 6px 10px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, border-color 0.15s;
}
.ig-user-menu-btn:hover { background: var(--bg-2); border-color: var(--line); }
.ig-user-menu-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.15);
}
.ig-user-menu-btn[aria-expanded="true"] {
  background: var(--bg-2);
  border-color: var(--line);
}
.ig-user-menu-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 130px;
}
.ig-user-menu-caret {
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
  transition: transform 0.15s;
}
.ig-user-menu-btn[aria-expanded="true"] .ig-user-menu-caret {
  transform: rotate(180deg);
}
.ig-user-menu-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
  padding: 6px;
  z-index: 80;
}
.ig-user-menu-popup[hidden] { display: none; }
.ig-user-menu-header {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.ig-user-menu-name-full {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ig-user-menu-email {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ig-user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
}
.ig-user-menu-item:hover { background: var(--primary-soft); color: var(--primary); }
.ig-user-menu-item:focus-visible {
  outline: none;
  background: var(--primary-soft);
  color: var(--primary);
}
.ig-user-menu-icon {
  width: 16px;
  text-align: center;
  color: var(--muted);
}
.ig-user-menu-item:hover .ig-user-menu-icon { color: var(--primary); }

/* Language switcher */
.ig-lang details { position: relative; }
.ig-lang summary { list-style: none; cursor: pointer; color: var(--ink-2); display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 14px; }
.ig-lang summary::-webkit-details-marker { display: none; }
.ig-lang summary:hover { background: var(--bg-2); }
.ig-lang .caret { font-size: 10px; color: var(--muted); }
.ig-lang .flag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; padding: 1px 5px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px; color: var(--ink-2);
}
.ig-lang-menu { position: absolute; right: 0; top: 110%; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; min-width: 180px; box-shadow: var(--shadow-lg); z-index: 60; }
.ig-lang-menu a { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14px; }
.ig-lang-menu a:hover { background: var(--bg-2); }
.ig-lang-menu a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ------ Company switcher (navbar) ------ */
.ig-company details { position: relative; }
.ig-company summary, .ig-company-static { list-style: none; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 14px; }
.ig-company summary::-webkit-details-marker { display: none; }
.ig-company summary:hover { background: var(--bg-2); }
.ig-company-static { cursor: default; }
.ig-company .caret { font-size: 10px; color: var(--muted); }
.ig-company .name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ig-company-menu { position: absolute; right: 0; top: 110%; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; min-width: 220px; box-shadow: var(--shadow-lg); z-index: 60; }
.ig-company-menu a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14px; }
.ig-company-menu a:hover { background: var(--bg-2); }
.ig-company-menu a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.ig-company-menu a .name { flex: 1; max-width: 220px; }
.ig-company-menu a .tick { display: inline-flex; color: var(--primary); }
.ig-company-menu a.ig-company-manage { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; color: var(--ink-2); font-size: 13px; }

/* ------ Main ------ */
.ig-main { min-height: 70vh; }
.ig-page { max-width: 1400px; margin: 0 auto; padding: 32px 24px 60px; }

/* ------ Toasts ------ */
.ig-toast { max-width: 720px; margin: 16px auto; padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.ig-toast.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.ig-toast.ok  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

/* Upsell banner */
.ig-banner-up {
  max-width: 1080px; margin: 16px auto; padding: 14px 18px;
  background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  color: #065f46; font-size: 14px;
}
.ig-banner-up strong { color: #064e3b; }
.ig-banner-up a { color: var(--primary); font-weight: 600; text-decoration: none; }
.ig-banner-up a:hover { color: var(--primary-2); }

/* ------ Hero (homepage) ------ */
.ig-hero-wrap { max-width: 1600px; margin: 0 auto; padding: 48px 24px 28px; background: linear-gradient(180deg, #ffffff, #f3faf5); }
.ig-hero-text { min-width: 0; max-width: 860px; margin: 0 auto; text-align: center; }

.ig-hero-text h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.ig-hero-text .ig-subtitle { font-size: 20px; color: var(--muted); font-weight: 400; margin: 0 0 20px; }
.ig-hero-text p.ig-lede { color: var(--ink-2); font-size: 16px; margin: 0 0 14px; line-height: 1.65; }
.ig-hero-text p.ig-lede strong { color: var(--ink); font-weight: 600; }
.ig-hero-text p.ig-cta-text { margin: 20px 0 0; color: var(--ink-2); font-size: 16px; }

/* Hero call-to-action buttons + reassurance + capability pills */
.ig-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0 12px; }
.ig-btn-hero {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: var(--radius); text-decoration: none;
  box-shadow: 0 2px 8px rgba(26,127,55,.25);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.ig-btn-hero:hover { background: var(--primary-2); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,127,55,.3); }
.ig-btn-hero.ghost { background: #fff; color: var(--primary); border: 1px solid var(--line-2); box-shadow: none; }
.ig-btn-hero.ghost:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-2); }
.ig-btn-hero.google { background: #fff; color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
.ig-btn-hero.google:hover { background: var(--bg-2); border-color: var(--line-2); color: var(--ink); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.12); }
.ig-hero-guest { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.ig-hero-guest .ig-icon { color: var(--ok); }
.ig-hero-pills { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ig-hero-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow);
}
.ig-hero-pill .ig-icon { color: var(--primary); }

/* ------ Feature showcase (homepage) ------ */
.ig-features { max-width: 1600px; margin: 0 auto; padding: 40px 24px 8px; }
.ig-features-head { text-align: center; max-width: 760px; margin: 0 auto 32px; }
.ig-features-head h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 10px; }
.ig-features-head p { font-size: 16px; color: var(--muted); margin: 0; line-height: 1.6; }
.ig-feature-group { margin-bottom: 28px; }
.ig-feature-group-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary-2); margin: 0 0 14px;
}
.ig-feature-group-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.ig-feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ig-feature-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.ig-feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #cde9d3; }
.ig-feature-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary); border-radius: 10px;
  transition: background .18s, color .18s;
}
.ig-feature-card:hover .ig-feature-ic { background: var(--primary); color: #fff; }
.ig-feature-body { min-width: 0; }
.ig-feature-body h4 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.ig-feature-body p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* Trust strip + final CTA band */
.ig-trust { max-width: 1600px; margin: 0 auto; padding: 18px 24px 8px; text-align: center; }
.ig-trust p { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 0; }
.ig-trust .ig-icon { color: var(--primary); }
.ig-cta-band {
  max-width: 1600px; margin: 24px auto 40px; padding: 40px 24px;
  background: linear-gradient(120deg, var(--primary-2), var(--primary) 55%, var(--primary-3));
  border-radius: var(--radius); text-align: center; color: #fff; box-shadow: var(--shadow-lg);
}
.ig-cta-band h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.01em; color: #fff; margin: 0 0 20px; }
.ig-btn-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--primary-2); font-weight: 700; font-size: 15px;
  padding: 13px 26px; border-radius: var(--radius); text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transition: transform .15s, box-shadow .15s;
}
.ig-btn-cta:hover { color: var(--primary-2); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.24); }

/* Scroll reveal (progressive enhancement — visible without JS) */
#editor { scroll-margin-top: 80px; }
html.js-reveal .ig-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
html.js-reveal .ig-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js-reveal .ig-reveal { opacity: 1; transform: none; transition: none; }
  .ig-feature-card, .ig-btn-hero, .ig-btn-cta { transition: none; }
}

/* Feature grid responsive: 4 cols → 2 → 1 */
@media (max-width: 1100px) {
  .ig-feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ig-feature-grid { grid-template-columns: 1fr; }
  .ig-hero-wrap { padding: 36px 18px 24px; }
  .ig-features { padding: 32px 18px 8px; }
  .ig-cta-band { margin: 20px 18px 32px; padding: 32px 20px; }
}

/* Logo widget in hero — 130x90 (logo) or 130x100 (placeholder) */
.ig-hero-logo {
  width: 130px; height: 100px; position: relative; margin-top: 4px;
}
.ig-hero-logo-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 130px; height: 100px; padding: 6px;
  border: 2px dashed var(--line-2); border-radius: 8px;
  color: var(--muted); font-size: 12px; text-align: center;
  background: #fafafa; cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.ig-hero-logo-empty:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ig-hero-logo-empty .ic { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.ig-hero-logo-empty .lbl { font-weight: 600; }
.ig-hero-logo-empty .sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

.ig-hero-logo-filled {
  position: relative; width: 130px; height: 100px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: white; box-shadow: var(--shadow);
}
.ig-hero-logo-filled img { display: block; width: 130px; height: 100px; object-fit: contain; padding: 4px; }
.ig-hero-logo-filled .ig-logo-actions {
  position: absolute; top: 4px; right: 4px; display: flex; gap: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.ig-hero-logo-filled:hover .ig-logo-actions { opacity: 1; }
.ig-hero-logo-filled .ig-logo-actions button,
.ig-hero-logo-filled .ig-logo-actions label {
  background: rgba(255,255,255,0.95); border: 1px solid var(--line);
  border-radius: 4px; padding: 2px 6px; font-size: 11px; cursor: pointer;
  font-weight: 600; color: var(--ink-2);
}
.ig-hero-logo-filled .ig-logo-actions button:hover,
.ig-hero-logo-filled .ig-logo-actions label:hover { color: var(--primary); border-color: var(--primary); }
.ig-hero-logo-filled .ig-logo-actions .rm { color: var(--err); }
.ig-hero-logo-filled .ig-logo-actions .rm:hover { color: var(--err); border-color: var(--err); }

/* ------ Editor card (the main form, light) ------ */
.ig-editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px auto 0;
  max-width: 1600px;
  box-shadow: var(--shadow);
}
.ig-editor h2 { color: var(--ink); font-size: 18px; margin: 0; font-weight: 600; }
.ig-editor h2 .date { color: var(--muted); font-weight: 400; font-size: 16px; }

.ig-paid-warning {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff7ed;
  border: 1px solid #fb923c;
  color: #7c2d12;
  padding: 14px 16px; border-radius: var(--radius);
  margin-bottom: 18px; font-size: 14px; line-height: 1.5;
}
.ig-paid-warning strong { color: #9a3412; }

/* Editor header: title (left) + logo widget (right) */
.ig-editor .ig-editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.ig-editor .ig-editor-header .ig-hero-logo { margin-top: 0; flex-shrink: 0; }
.ig-editor .ig-editor-header h2 { padding-top: 32px; }

.ig-editor label { display: block; color: var(--ink-2); font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.ig-editor .ig-helper { font-size: 12px; color: var(--muted); margin-left: 4px; font-weight: 400; }

.ig-input, .ig-editor input[type=text], .ig-editor input[type=email], .ig-editor input[type=number],
.ig-editor input[type=date], .ig-editor textarea, .ig-editor select {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 10px; font-size: 14px; background: white; color: var(--ink);
  font-family: inherit;
}
.ig-input:focus, .ig-editor input:focus, .ig-editor textarea:focus, .ig-editor select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.15);
}
.ig-editor textarea { resize: vertical; min-height: 60px; }

.ig-editor .ig-section-title {
  font-size: 14px; font-weight: 600; margin: 22px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line); color: var(--ink-2);
  text-transform: none; letter-spacing: 0;
}
.ig-editor .ig-section-title:first-child { margin-top: 0; }

.ig-editor .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ig-editor .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .ig-editor .grid-2, .ig-editor .grid-3 { grid-template-columns: 1fr; } }

/* Two-column "From" / "Bill To" block (and the Notes/Totals block below it). */
.ig-editor .ig-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 720px) {
  .ig-editor .ig-cols-2 { grid-template-columns: 1fr; gap: 8px; }
}

/* Inner 2-col grid for each side (name/email full-width, phone/tax side-by-side). */
.ig-editor .ig-from-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.ig-editor .ig-from-grid .span-2 { grid-column: span 2; }
.ig-editor .ig-from-grid label { margin-bottom: 0; }
@media (max-width: 720px) {
  .ig-editor .ig-from-grid { grid-template-columns: 1fr; }
  .ig-editor .ig-from-grid .span-2 { grid-column: span 1; }
}

/* Invoice-details block (number, status, issue date, due date). */
.ig-editor .ig-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 860px) { .ig-editor .ig-details-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ig-editor .ig-details-grid { grid-template-columns: 1fr; } }
/* Free (homepage) editor: number + issue + due, no status column. */
.ig-editor .ig-details-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .ig-editor .ig-details-grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ig-editor .ig-details-grid.three { grid-template-columns: 1fr; } }

.ig-editor .ig-due-past        { border-color: #dc2626; background: #fef2f2; color: #991b1b; }
.ig-editor .ig-due-soon-input   { border-color: #f59e0b; background: #fffbeb; color: #92400e; }

.ig-editor table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ig-editor th { text-align: left; font-size: 12px; color: var(--ink-2); padding: 8px 6px; font-weight: 600; border-bottom: 1px solid var(--line); }
.ig-editor td { padding: 4px 6px; vertical-align: top; }
.ig-editor .ig-num { text-align: right; }
.ig-editor .item-row .ig-input { font-size: 14px; width: 100%; min-width: 0; box-sizing: border-box; }
.ig-editor .item-row td { padding-bottom: 8px; }

.ig-editor .ig-item-header { background: var(--primary); color: white; font-weight: 600; }
.ig-editor .ig-item-header th { color: white; padding: 10px 8px; border-bottom: 0; font-size: 13px; }
.ig-editor .ig-item-header th.ig-num { text-align: right; }

/* Item table column widths — applies to both first row and JS-added rows */
.ig-editor .ig-items-table th.col-desc, .ig-editor .ig-items-table td.col-desc { width: auto; }
.ig-editor .ig-items-table th.col-qty,  .ig-editor .ig-items-table td.col-qty  { width: 90px; }
.ig-editor .ig-items-table th.col-price,.ig-editor .ig-items-table td.col-price{ width: 110px; }
.ig-editor .ig-items-table th.col-tax,  .ig-editor .ig-items-table td.col-tax  { width: 105px; }
.ig-editor .ig-items-table th.col-total,.ig-editor .ig-items-table td.col-total{ width: 100px; }
.ig-editor .ig-items-table th.col-act,  .ig-editor .ig-items-table td.col-act  { width: 40px; }
.ig-editor .ig-items-table input[type=number],
.ig-editor .ig-items-table input[type=text] { width: 100%; min-width: 0; box-sizing: border-box; }

/* Mobile item table — the row has to reflow because the fixed
 * widths above (70+110+80+100+40=400px) leave the description
 * column with 0px on a 360px-wide phone. CSS Grid keeps the
 * 3 numeric inputs on one row (which an earlier inline-block
 * attempt got wrong when the description pushed things off
 * baseline). We also add tiny per-cell labels since the
 * thead is hidden on mobile. */
@media (max-width: 720px) {
  .ig-editor .ig-items-table,
  .ig-editor .ig-items-table thead,
  .ig-editor .ig-items-table tbody,
  .ig-editor .ig-items-table tr,
  .ig-editor .ig-items-table th,
  .ig-editor .ig-items-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  .ig-editor .ig-items-table thead { display: none; }
  .ig-editor .ig-items-table tbody tr.item-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
      "desc desc desc"
      "qty  price tax"
      "tot  tot  tot"
      "act  act  act";
    gap: 10px 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
  }
  .ig-editor .ig-items-table .item-row td {
    padding: 0;
    margin: 0;
  }
  .ig-editor .ig-items-table .item-row td.col-desc    { grid-area: desc; }
  .ig-editor .ig-items-table .item-row td.col-qty     { grid-area: qty; }
  .ig-editor .ig-items-table .item-row td.col-price   { grid-area: price; }
  .ig-editor .ig-items-table .item-row td.col-tax     { grid-area: tax; }
  .ig-editor .ig-items-table .item-row td.col-total   { grid-area: tot; }
  .ig-editor .ig-items-table .item-row td.col-act     { grid-area: act; }
  /* Description: full width, prominent */
  .ig-editor .ig-items-table .item-row td.col-desc .ig-input {
    min-height: 44px;
    font-size: 15px;
  }
  /* Tiny per-cell label for the numeric inputs — replaces the
   * hidden thead row. */
  .ig-editor .ig-items-table .item-row td.col-qty::before,
  .ig-editor .ig-items-table .item-row td.col-price::before,
  .ig-editor .ig-items-table .item-row td.col-tax::before {
    display: block;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    font-weight: 600;
  }
  .ig-editor .ig-items-table .item-row td.col-qty::before   { content: "Qty"; }
  .ig-editor .ig-items-table .item-row td.col-price::before { content: "Unit price"; }
  .ig-editor .ig-items-table .item-row td.col-tax::before   { content: "Tax %"; }
  .ig-editor .ig-items-table .item-row td.col-qty .ig-input,
  .ig-editor .ig-items-table .item-row td.col-price .ig-input,
  .ig-editor .ig-items-table .item-row td.col-tax .ig-input {
    text-align: center;
    min-height: 40px;
  }
  /* Total: a separate row with label on the left, value on the right. */
  .ig-editor .ig-items-table .item-row td.col-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 2px;
  }
  .ig-editor .ig-items-table .item-row td.col-total::before {
    content: "Total";
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
  }
  .ig-editor .ig-items-table .item-row td.col-total span[data-line] {
    font-weight: 700;
    font-size: 16px;
  }
  /* Delete: small button on its own line, right-aligned */
  .ig-editor .ig-items-table .item-row td.col-act {
    text-align: right;
  }
}
/* Tablet breakpoint — squeeze the fixed columns a bit but keep
 * the table layout so the row stays a single line. */
@media (max-width: 860px) and (min-width: 721px) {
  .ig-editor .ig-items-table th.col-desc, .ig-editor .ig-items-table td.col-desc { width: auto; }
  .ig-editor .ig-items-table th.col-qty,  .ig-editor .ig-items-table td.col-qty  { width: 56px; }
  .ig-editor .ig-items-table th.col-price,.ig-editor .ig-items-table td.col-price{ width: 90px; }
  .ig-editor .ig-items-table th.col-tax,  .ig-editor .ig-items-table td.col-tax  { width: 69px; }
  .ig-editor .ig-items-table th.col-total,.ig-editor .ig-items-table td.col-total{ width: 80px; }
  .ig-editor .ig-items-table th.col-act,  .ig-editor .ig-items-table td.col-act  { width: 36px; }
}
/* Center the line-total span (and the FX warning below it) on the
   vertical axis of the row, so the value sits in the middle of the
   textboxes to its left instead of being pinned to the top of the
   cell. The whole row uses middle alignment so the delete button
   and the FX warning both stay optically aligned with the inputs. */
.ig-editor .ig-items-table .item-row td { vertical-align: middle; }
.ig-editor .ig-row-del {
  background: transparent; border: 0; color: var(--err); cursor: pointer;
  font-size: 20px; line-height: 1; width: 28px; height: 28px;
  border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.ig-editor .ig-row-del:hover { background: #fee2e2; }

/* Add Line Item button: full-width dashed outline. Lives both
   inside .ig-editor (invoice editor) and on the standalone stock-
   receipt editor, so the selector is unscoped. */
.ig-add-row {
  width: 100%; margin-top: 10px; background: white; color: var(--primary);
  border: 1px dashed var(--primary); padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; font-size: 14px;
}
.ig-add-row:hover { background: var(--primary-soft); }

/* Currency / Tax / Discount row layout — compact, fixed widths */
.ig-editor .ig-totals-row { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.ig-editor .ig-totals-row > div { display: flex; flex-direction: column; gap: 4px; }
.ig-editor .ig-totals-row .ig-currency { min-width: 100px; }
@media (max-width: 480px) { .ig-editor .ig-totals-row > div { flex: 1 1 100%; } }

.ig-editor .ig-money-input {
  display: inline-flex; align-items: stretch; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); overflow: hidden; background: white;
  width: 140px; height: 36px;
}
.ig-editor .ig-money-input input {
  width: 90px; min-width: 0; flex: 0 0 90px; border: 0; padding: 0 10px;
  font-size: 14px; text-align: right; outline: none; background: transparent;
  color: var(--ink); height: 100%;
}
.ig-editor .ig-money-input input:focus { background: #f9fafb; }
.ig-editor .ig-money-input select {
  flex: 0 0 50px; width: 50px; border: 0; border-left: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink-2); font-size: 13px; font-weight: 600;
  padding: 0; cursor: pointer; outline: none; height: 100%;
  text-align: center;
}
.ig-editor .ig-money-input:focus-within { box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.15); border-color: var(--primary); }

.ig-editor .totals { width: 320px; margin-left: auto; margin-top: 10px; }
.ig-editor .totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: var(--ink-2); }
.ig-editor .totals .grand { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 16px; color: var(--ink); }
.ig-editor .totals .balance { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; font-weight: 700; font-size: 15px; }

.ig-editor .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.btn-save {
  background: var(--primary); color: white; padding: 12px 24px; border-radius: var(--radius-sm);
  font-weight: 600; border: 0; cursor: pointer; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.btn-save:hover { background: var(--primary-2); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-download {
  background: white; color: var(--ink); padding: 12px 24px; border-radius: var(--radius-sm);
  font-weight: 600; border: 1px solid var(--line-2); cursor: pointer; font-size: 15px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.btn-download:hover { background: var(--bg-2); color: var(--ink); }
.ig-editor .btn-save,
.ig-editor .btn-download { /* keep editor-specific padding override if needed */ }

/* ------ Toolbar buttons (used on list pages: New / Stock / Dashboard / etc.) ------
   Previously these classes weren't styled at all, so the links rendered with
   browser defaults (blue underline) and visually glued together. The 12px
   gap and explicit 1px border on the ghost variant are what make them read
   as separate buttons. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-2); color: white; }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--line-2);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--line); color: var(--ink); }

/* Destructive action button (cancel subscription, delete account, etc).
   Same chrome as .btn-primary so destructive actions sit naturally in a
   row of other toolbar buttons, but the red colour signals intent. */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dc2626;
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-danger:hover { background: #b91c1c; color: white; }
.btn-danger:disabled,
.btn-danger[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* ------ Auth pages ------ */
.ig-auth {
  max-width: 460px; margin: 60px auto; padding: 36px;
  background: white; border-radius: 12px; box-shadow: var(--shadow-lg); color: var(--ink);
  border: 1px solid var(--line);
}
.ig-auth h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.ig-auth p.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.ig-auth label { display: block; font-size: 13px; color: var(--ink-2); margin: 14px 0 4px; font-weight: 500; }
.ig-auth input { width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; }
.ig-auth input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.15); }
.ig-auth button.ig-submit { width: 100%; margin-top: 20px; padding: 12px; background: var(--primary); color: white; border: 0; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; cursor: pointer; }
.ig-auth button.ig-submit:hover { background: var(--primary-2); }
.ig-auth .ig-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.ig-auth .ig-foot a { color: var(--primary); text-decoration: none; font-weight: 500; }
.ig-auth .ig-terms { font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center; }
.ig-auth .err-msg { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 8px; }
.ig-auth .ok-msg { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 8px; }
.ig-auth .divider { display: flex; align-items: center; gap: 8px; margin: 20px 0; color: var(--muted); font-size: 12px; }
.ig-auth .divider:before, .ig-auth .divider:after { content: ''; flex: 1; height: 1px; background: var(--line); }
.ig-auth .gbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; background: white; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; text-decoration: none; }
.ig-auth .gbtn:hover { background: var(--bg-2); color: var(--ink); }
.ig-auth .gbtn svg { width: 18px; height: 18px; }

/* ------ Pricing ------ */
.ig-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; max-width: 1600px; margin: 0 auto; }
@media (max-width: 860px) { .ig-pricing-grid { grid-template-columns: 1fr; } }
.ig-plan-card {
  background: white; color: var(--ink); border-radius: 20px; padding: 30px 26px 26px;
  display: flex; flex-direction: column; gap: 10px; position: relative;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ig-plan-badge {
  position: absolute; top: -1px; right: 22px;
  padding: 4px 16px 5px; border-radius: 0 0 6px 6px; font-size: 12px; font-weight: 700;
  white-space: nowrap; letter-spacing: .2px; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.ig-plan-badge.best { background: #fbbf24; color: #451a03; }
.ig-plan-badge.used { background: #7c3aed; color: #fff; }
.ig-plan-sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; min-height: 42px; }
.ig-plan-card.featured { border: 2px solid var(--primary); transform: scale(1.02); }
.ig-plan-card h3 { font-size: 20px; font-weight: 700; margin: 0; }
.ig-plan-card .price { font-size: 40px; font-weight: 800; color: var(--ink); }
.ig-plan-card .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.ig-plan-card ul { list-style: none; padding: 12px 0 0; margin: 8px 0 0; font-size: 14px; color: var(--ink-2); border-top: 1px dashed var(--line-2); }
.ig-plan-card ul li { padding: 6px 0; display: flex; gap: 8px; align-items: center; }
.ig-plan-card form { display: flex; width: 100%; }
.ig-plan-card button { border-radius: 8px; }
.ig-plan-card .tag { display: inline-block; background: var(--primary); color: white; font-size: 11px; padding: 10px 10px; border-radius: 3px; text-transform: uppercase; letter-spacing: 1px; }
.ig-plan-card button { width: 100%; padding: 12px; border-radius: var(--radius-sm); border: 0; font-weight: 600; font-size: 15px; cursor: pointer; }
.ig-plan-card button.primary { background: var(--primary); color: white; }
.ig-plan-card button.primary:hover { background: var(--primary-2); }
.ig-plan-card button.gray { background: #e5e7eb; color: #6b7280; cursor: default; }
.ig-plan-card button.outline { background: white; border: 1px solid var(--line-2); color: var(--ink); }
.ig-plan-card button.outline:hover { background: var(--bg-2); }

/* ------ Dashboard ------ */
.ig-dash-header { max-width: 1600px; margin: 24px auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.ig-dash-header h1 { color: var(--ink); font-size: 24px; margin: 0; }
.ig-card { background: white; color: var(--ink); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.ig-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ig-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.ig-table td { padding: 0 12px; border-bottom: 1px solid var(--line); }
.ig-table .num { text-align: right; }
.ig-table .num.ig-total { font-weight: 700; }
/* Dashboard: wider client column on desktop. */
@media (min-width: 721px) {
  .ig-inv-table .ig-col-client { min-width: 220px; }
}
/* Dashboard: the 8-column invoice table can outgrow its card on
   narrower desktops — scroll it inside the card instead of letting
   cells (and their borders) spill past the frame. No min-width here:
   on mobile the table becomes stacked cards and must stay fluid. */
.ig-dash-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Dashboard: Date + Due columns a touch wider so "Sep 30, 2026"
   never wraps — desktop only; on mobile the card cells are narrow
   and wrapping is exactly what we want there. */
@media (min-width: 721px) {
  .ig-inv-table .ig-col-date,
  .ig-inv-table .ig-col-due { white-space: nowrap; min-width: 122px; }
}
/* Dashboard download dropdown (↓ arrow → PDF / CSV menu). */
.ig-dl { position: relative; display: inline-block; }
.ig-dl summary {
  cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1.2;
  padding: 6px 8px; min-height: 32px; box-sizing: border-box;
  border-radius: 6px; color: inherit;
}
.ig-dl summary svg { display: block; }
.ig-dl summary::-webkit-details-marker { display: none; }
.ig-dl summary::marker { content: ''; }
.ig-dl summary:hover { background: var(--bg-2); }
.ig-dl-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 190px; background: #fff;
  border: 1px solid #e6e8ec; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.ig-dl-menu a,
.ig-dl-menu button.ig-dl-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 7px; border: 0;
  background: none; cursor: pointer; text-align: left;
  font-size: 14px; font-weight: 500; color: var(--ink);
  font-family: inherit;
}
.ig-dl-menu a:hover,
.ig-dl-menu button.ig-dl-item:hover { background: #f4f5f7; }
.ig-dl-menu a svg { flex: none; color: #667085; }
.ig-dl-menu a:hover { background: #f4f5f7; }
.ig-dl-menu a:hover svg { color: var(--ink); }
/* usage-meter caption ("Paid X · Due Y") in purple. Higher
   specificity than the control's injected .um-meta rule. */
.um .um-meta { color: #1e40af; }
/* Dashboard paybar: badge above the bar, caption under it.
   display:contents flattens the top row so badge / track / meta
   become direct flex items we can order freely. */
.um-below .um-row { display: flex; flex-direction: column; }
.um-below .um-top { display: contents; }
.um-below .um-badge { order: 1; align-self: flex-start; margin-bottom: 6px; }
.um-below .um-track { order: 2; margin-top: 0; }
.um-below .um-meta { order: 3; margin-top: 6px; margin-left: 0; }

/* ------ Custom design card + modal (template galleries) ------ */
.ig-tpl-card-custom { border-style: dashed; cursor: default; }
.ig-tpl-preview-custom {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px; color: var(--muted);
  background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px);
}
.ig-custom-open { margin-top: 10px; }
.ig-custom-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.ig-custom-modal[hidden] { display: none; }
.ig-custom-box {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.25);
}
.ig-custom-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ig-custom-title { font-size: 16px; font-weight: 800; }
.ig-custom-close {
  border: 0; background: none; font-size: 22px; line-height: 1;
  cursor: pointer; color: var(--muted); padding: 4px 8px;
}
.ig-custom-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.ig-custom-box .ig-input { margin-top: 4px; font-weight: 400; }
.ig-custom-box textarea.ig-input { resize: vertical; }
.ig-custom-err {
  background: #fef2f2; color: #991b1b; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 10px;
}
.ig-custom-ok {
  background: #f0fdf4; color: #065f46; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin-bottom: 10px;
}
.ig-custom-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* On narrow viewports the data tables (products, stock, payments)
   grow wider than the screen because of long text in the name
   column or the action buttons. Wrap them in a horizontally
   scrollable container so the action column never gets clipped
   off-screen — the user can swipe to reach Edit / Delete. */
.ig-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ig-table-scroll .ig-table { min-width: 560px; }
.ig-badge { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; text-transform: uppercase; }
.ig-badge.draft     { background: #e5e7eb; color: #374151; }
.ig-badge.sent      { background: rgba(26, 127, 55, 0.1); color: #1a7f37; }
.ig-badge.paid      { background: #d1fae5; color: #065f46; }
.ig-badge.overdue   { background: #fee2e2; color: #991b1b; }
.ig-badge.cancelled { background: #f3f4f6; color: #6b7280; }
.ig-badge.new       { background: #fef3c7; color: #92400e; }
/* Estimate statuses (views/estimates/index.php). Same muted palette
   as the invoice badges so the two lists read consistently. */
.ig-badge.pending   { background: #fef3c7; color: #92400e; }
.ig-badge.accepted   { background: #d1fae5; color: #065f46; }
.ig-badge.declined   { background: #f3f4f6; color: #6b7280; }
.ig-badge.expired    { background: #fee2e2; color: #991b1b; }
.ig-badge.converted  { background: #dbeafe; color: #1e40af; }
.ig-badge.read      { background: #e0e7ff; color: #3730a3; }
.ig-badge.replied   { background: #d1fae5; color: #065f46; }
.ig-badge.closed    { background: #f3f4f6; color: #6b7280; }

/* Due-date pill under the status badge */
.ig-due { margin-top: 4px; font-size: 11px; color: var(--muted); }
.ig-due-soon        { color: #b45309; font-weight: 600; }
.ig-due-overdue     { color: #b91c1c; font-weight: 700; }
/* Pulsing overdue due-date (dashboard Due column). Motion is
   decorative — disabled for prefers-reduced-motion. */
.ig-due-pulse {
  display: inline-block;
  border-radius: 6px;
  padding: 1px 6px;
  animation: ig-due-pulse 1.6s ease-in-out infinite;
}
@keyframes ig-due-pulse {
  0%, 100% { background-color: transparent; }
  50%      { background-color: #fecaca; }
}
@media (prefers-reduced-motion: reduce) {
  .ig-due-pulse { animation: none; }
}
.ig-due-overdue-days {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 999px;
  font-size: 10px;
  padding: 1px 6px;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Payment-status pill under the total */
.ig-pay { margin-top: 4px; font-size: 11px; color: var(--muted); }
.ig-pay-partial { color: #b45309; font-weight: 600; }
.ig-pay-paid    { color: #065f46; font-weight: 700; }

/* Payment form */
.ig-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 860px) { .ig-payment-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ig-payment-grid { grid-template-columns: 1fr; } }
.ig-payment-grid label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
.ig-row-actions { display: flex; gap: 6px; align-items: stretch; }
.ig-row-actions a, .ig-row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1.2;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}
.ig-row-actions a:hover, .ig-row-actions button:hover { background: var(--bg-2); }
.ig-row-actions .danger { color: #b91c1c; border-color: #fecaca; }
.ig-row-actions .danger:hover { background: #fee2e2; }
.ig-row-actions .ig-row-locked {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; min-height: 32px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: #f9fafb; color: var(--muted); font-size: 14px;
}

/* ------ Settings ------ */
.ig-settings { max-width: 1600px; margin: 24px auto; padding: 0 24px; color: var(--ink); }

/*
   Settings tab strip. The previous version used hard-coded
   inline grey (`color:#cbd5e1`) which made every tab look
   disabled. We now use the theme primary color, an underline on
   the active tab, and a subtle hover lift. Active state is
   controlled by the `is-active` class which the JS toggles on
   click / hash change.
*/
.ig-settings-tabs {
  display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.ig-settings-tab {
  background: transparent; border: 0;
  color: var(--primary);
  font-size: 14px; font-weight: 500;
  cursor: pointer; padding: 10px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 6px 6px 0 0;
}
.ig-settings-tab:hover {
  background: var(--bg-2);
  color: #0d5a26;
}
.ig-settings-tab.is-active {
  color: var(--primary);
  font-weight: 700;
  border-bottom-color: var(--primary);
  background: var(--bg-2);
}
.ig-settings-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.ig-settings h1 { font-size: 24px; margin: 0 0 18px; }
.ig-settings .ig-card { color: var(--ink); margin-bottom: 18px; }
.ig-settings h2 { font-size: 17px; margin: 0 0 12px; }

/* ------ Footer (light, like invoice-generator.com) ------ */
.ig-footer { padding: 50px 24px 24px; margin-top: 60px; border-top: 1px solid var(--line); background: white; color: var(--ink-2); font-size: 14px; }
.ig-footer-inner { max-width: 1400px; margin: 0 auto; }
.ig-footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-bottom: 32px; }
@media (max-width: 720px) { .ig-footer-cols { grid-template-columns: repeat(2, 1fr); } }
.ig-footer-cols h4 { color: var(--ink); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 14px; }
.ig-footer-cols ul { list-style: none; padding: 0; margin: 0; }
.ig-footer-cols li { margin: 8px 0; }
.ig-footer-cols a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.ig-footer-cols a:hover { color: var(--primary); }
.ig-footer-bottom { border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13px; }
.ig-footer-bottom .ig-socials a { color: var(--muted); margin-right: 10px; font-size: 16px; text-decoration: none; }
.ig-footer-bottom .ig-socials a:hover { color: var(--primary); }

/* ------ Misc ------ */
.ig-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.ig-pill-ok { background: var(--primary-soft); color: var(--primary); font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.ig-pill-warn { background: #fef3c7; color: #92400e; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.ig-pill-err  { background: #fee2e2; color: #991b1b; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; letter-spacing: .5px; }
.dev-note { background: #eef2ff; border: 1px dashed #818cf8; padding: 10px 12px; border-radius: var(--radius-sm); color: #3730a3; font-size: 13px; margin: 10px 0; word-break: break-all; }

/* Mobile / narrow-desktop refinements — hamburger menu.
   The full horizontal nav (9 links + brand + company/lang/plan/user
   cluster) needs ~1160px to sit on one line without wrapping. Below
   1200px it collapses behind a hamburger button instead of squeezing
   the multi-word "Products & Services" label into a vertical stack.
   Tapping the hamburger adds `.ig-nav-open` to the navbar, which
   reveals the links as a full-width vertical dropdown. The user menu
   stays visible on the right at all times. */
.ig-nav-toggle {
  display: none;
  background: white;
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.ig-nav-toggle:hover { background: var(--bg-2); border-color: var(--line); }
.ig-nav-toggle[aria-expanded="true"] { background: var(--bg-2); border-color: var(--line); }
.ig-nav-toggle:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.15);
}

@media (max-width: 1200px) {
  .ig-nav-inner { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .ig-nav-toggle { display: inline-flex; }
  .ig-links {
    display: none;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 0;
    order: 99;
  }
  .ig-nav.ig-nav-open .ig-links { display: flex; }
  .ig-links a {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    width: 100%;
    box-sizing: border-box;
  }
  .ig-links a:hover { background: var(--bg-2); }
  .ig-right { gap: 6px; flex-shrink: 0; margin-left: auto; }
  .ig-user-menu-name { max-width: 90px; }
  .ig-user-menu-btn { padding: 6px 8px; }
}

/* Desktop (>=1201px): the horizontal nav only fits with tightened
   spacing and a compact right cluster (language code only, shorter
   company/user ellipsis). The container caps at 1400px, so the old
   "spacious above 1360px" tier overflowed at EVERY wide viewport once
   labels were realistic (17-char company + 14-char user + plan pill
   measured 1423px of content in a 1352px box, on all pages). The
   dropdown menus keep their full-length labels at every width. */
@media (min-width: 1201px) {
  .ig-nav-inner { gap: 10px; padding: 12px 16px; }
  .ig-links { gap: 14px; margin-left: 16px; }
  .ig-links a { font-size: 13px; }
  .ig-right { gap: 8px; }
  .ig-lang summary .name { display: none; }
  .ig-company summary .name, .ig-company-static .name { max-width: 90px; }
}

@media (max-width: 720px) {
  .ig-hero { padding: 24px 0 8px; }
  .ig-editor { padding: 18px; border-radius: var(--radius); }
  .ig-table .hide-sm { display: none; }
}

/* ------ Dashboard invoices as cards on mobile ------
   The 8-column table becomes one stacked card per invoice.
   Scoped to .ig-inv-table so desktop and all other tables
   (clients, products, …) are untouched. */
@media (max-width: 720px) {
  .ig-inv-table thead { display: none; }
  .ig-inv-table > tbody > tr:not(.ig-payments-row) {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border: 2px solid var(--line-2);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 4px 0;
  }
  .ig-inv-table > tbody > tr > td {
    display: block;
    border-bottom: 0;
    padding: 7px 16px;
    box-sizing: border-box;
    min-width: 0;
  }
  /* Row 1: number + client. Row 2: date + due + total.
     (nth-child: language-independent, unlike data-label.) */
  .ig-inv-table > tbody > tr > td:nth-child(1),
  .ig-inv-table > tbody > tr > td:nth-child(2) { flex: 1 1 40%; }
  .ig-inv-table > tbody > tr > td:nth-child(2) { font-weight: 700; }
  .ig-inv-table > tbody > tr > td:nth-child(3),
  .ig-inv-table > tbody > tr > td:nth-child(4),
  .ig-inv-table > tbody > tr > td:nth-child(5) { flex: 1 1 26%; }
  .ig-inv-table > tbody > tr > td:nth-child(6) { flex: 1 1 100%; }
  .ig-inv-table > tbody > tr > td:nth-child(7) { flex: 0 0 auto; }
  .ig-inv-table > tbody > tr > td:nth-child(8) { flex: 1 1 60%; }
  /* No info loss on mobile: date/due/status come back as card rows. */
  .ig-inv-table > tbody > tr > td.hide-sm { display: block; }
  .ig-inv-table > tbody > tr > td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .ig-inv-table > tbody > tr > td.num { text-align: left; }
  .ig-inv-table [data-usage] { max-width: none !important; min-width: 0 !important; }
  .ig-inv-table .ig-row-actions { flex-wrap: wrap; }
  .ig-inv-table .ig-status-select { max-width: 100%; }
  .ig-dash-actions { justify-content: center !important; text-align: center; }
  .ig-inv-table .ig-pay.ig-pay-partial { display: none; }
  .ig-inv-table > tbody > tr.ig-payments-row { display: block; padding: 0 4px 12px; }
}

/* ------ Estimates list as cards on mobile ------
   Same pattern as .ig-inv-table above: the 7-column table
   becomes one stacked card per estimate. Scoped to
   .ig-est-table so desktop and other tables are untouched. */
@media (max-width: 720px) {
  .ig-est-table thead { display: none; }
  .ig-est-table > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border: 2px solid var(--line-2);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 4px 0;
  }
  .ig-est-table > tbody > tr > td {
    display: block;
    border-bottom: 0;
    padding: 7px 16px;
    box-sizing: border-box;
    min-width: 0;
  }
  /* Row 1: number + client. Row 2: issue + valid + total.
     (nth-child: language-independent, unlike data-label.) */
  .ig-est-table > tbody > tr > td:nth-child(1),
  .ig-est-table > tbody > tr > td:nth-child(2) { flex: 1 1 40%; }
  .ig-est-table > tbody > tr > td:nth-child(2) { font-weight: 700; }
  .ig-est-table > tbody > tr > td:nth-child(3),
  .ig-est-table > tbody > tr > td:nth-child(4),
  .ig-est-table > tbody > tr > td:nth-child(5) { flex: 1 1 26%; }
  .ig-est-table > tbody > tr > td:nth-child(6),
  .ig-est-table > tbody > tr > td:nth-child(7) { flex: 1 1 100%; }
  /* No info loss on mobile: client/issue/valid/status come back as card rows. */
  .ig-est-table > tbody > tr > td.hide-sm { display: block; }
  .ig-est-table > tbody > tr > td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .ig-est-table > tbody > tr > td.num { text-align: left; }
  .ig-est-table .ig-row-actions { flex-wrap: wrap; }
  .ig-est-table .ig-status-select { max-width: 100%; }
}

/* ------ Clients list as cards on mobile ------
   Same pattern as .ig-inv-table / .ig-est-table above:
   the 7-column table becomes one stacked card per client. */
@media (max-width: 720px) {
  .ig-cli-table thead { display: none; }
  .ig-cli-table > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border: 2px solid var(--line-2);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 4px 0;
  }
  .ig-cli-table > tbody > tr > td {
    display: block;
    border-bottom: 0;
    padding: 7px 16px;
    box-sizing: border-box;
    min-width: 0;
  }
  /* Row 1: name + email. Row 2: tax id + currency + invoices + balance. */
  .ig-cli-table > tbody > tr > td:nth-child(1),
  .ig-cli-table > tbody > tr > td:nth-child(2) { flex: 1 1 40%; }
  .ig-cli-table > tbody > tr > td:nth-child(1) { font-weight: 700; }
  .ig-cli-table > tbody > tr > td:nth-child(3),
  .ig-cli-table > tbody > tr > td:nth-child(4),
  .ig-cli-table > tbody > tr > td:nth-child(5),
  .ig-cli-table > tbody > tr > td:nth-child(6) { flex: 1 1 22%; }
  .ig-cli-table > tbody > tr > td:nth-child(7) { flex: 1 1 100%; }
  /* No info loss on mobile: email/tax/currency come back as card rows. */
  .ig-cli-table > tbody > tr > td.hide-sm { display: block; }
  .ig-cli-table > tbody > tr > td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .ig-cli-table > tbody > tr > td.num { text-align: left; }
  .ig-cli-table .ig-row-actions { flex-wrap: wrap; }
}

/* ------ Payments list as cards on mobile ------
   Same pattern as .ig-inv-table / .ig-est-table / .ig-cli-table:
   the 7-column table becomes one stacked card per payment. */
@media (max-width: 720px) {
  .ig-pay-table thead { display: none; }
  .ig-pay-table > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border: 2px solid var(--line-2);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 4px 0;
  }
  .ig-pay-table > tbody > tr > td {
    display: block;
    border-bottom: 0;
    padding: 7px 16px;
    box-sizing: border-box;
    min-width: 0;
  }
  /* Row 1: date + number. Row 2: type + client + amount + invoices. */
  .ig-pay-table > tbody > tr > td:nth-child(1),
  .ig-pay-table > tbody > tr > td:nth-child(2) { flex: 1 1 40%; }
  .ig-pay-table > tbody > tr > td:nth-child(2) { font-weight: 700; }
  .ig-pay-table > tbody > tr > td:nth-child(3),
  .ig-pay-table > tbody > tr > td:nth-child(4),
  .ig-pay-table > tbody > tr > td:nth-child(5),
  .ig-pay-table > tbody > tr > td:nth-child(6) { flex: 1 1 22%; }
  .ig-pay-table > tbody > tr > td:nth-child(7) { flex: 1 1 100%; }
  .ig-pay-table > tbody > tr > td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .ig-pay-table > tbody > tr > td.num { text-align: left; }
  .ig-pay-table .ig-row-actions { flex-wrap: wrap; }
}

/* ------ Trial bar (top, sticky, slim) ------
   Sits above the navbar. The navbar is also `position: sticky; top: 0`,
   so this element naturally stacks above it without offsetting it.
   Only rendered for authenticated free-plan users (see partials/trial_bar.php).
*/
.ig-trial-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #ecfdf5;
  color: #065f46;
  border-bottom: 1px solid #a7f3d0;
  font-size: 13px;
  line-height: 1.2;
}
.ig-trial-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: rgba(16, 185, 129, 0.18);
  transition: width 0.3s ease;
  pointer-events: none;
}
.ig-trial-bar-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 7px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ig-trial-bar-text { font-weight: 500; }
.ig-trial-bar-cta {
  color: var(--primary-2);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.ig-trial-bar-cta:hover { color: var(--primary); text-decoration: underline; }

/* Tier: warning — last 2 days */
.ig-trial-bar--warn {
  background: #fffbeb;
  color: #92400e;
  border-bottom-color: #fde68a;
}
.ig-trial-bar--warn .ig-trial-bar-fill { background: rgba(245, 158, 11, 0.22); }
.ig-trial-bar--warn .ig-trial-bar-cta { color: #b45309; }
.ig-trial-bar--warn .ig-trial-bar-cta:hover { color: #92400e; }

/* Tier: critical — last day */
.ig-trial-bar--critical {
  background: #fef2f2;
  color: #991b1b;
  border-bottom-color: #fecaca;
}
.ig-trial-bar--critical .ig-trial-bar-fill { background: rgba(220, 38, 38, 0.18); }
.ig-trial-bar--critical .ig-trial-bar-cta { color: #b91c1c; }
.ig-trial-bar--critical .ig-trial-bar-cta:hover { color: #991b1b; }

/* Tier: expired — stronger, no progress fill */
.ig-trial-bar--expired {
  background: #fef2f2;
  color: #991b1b;
  border-bottom-color: #fecaca;
}
.ig-trial-bar--expired .ig-trial-bar-fill { display: none; }
.ig-trial-bar--expired .ig-trial-bar-cta {
  background: var(--err);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
}
.ig-trial-bar--expired .ig-trial-bar-cta:hover { background: #b91c1c; color: white; text-decoration: none; }

@media (max-width: 560px) {
  .ig-trial-bar-inner { padding: 6px 14px; font-size: 12px; }
  .ig-trial-bar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* List-page alignment: when a page has both a toolbar row (with btn-primary
   and btn-ghost) and a table below it, they should share the same left
   edge. The toolbar lives in a max-width:1200px container with no inline
   padding, and the table inside .ig-card gets a 20px left/right padding
   so its first column lines up with the first button. */
.ig-card > table.ig-table,
.ig-card > .ig-empty { margin: 0 20px; }
.ig-card > table.ig-table { width: calc(100% - 40px); }

/* Mini progress bar — used in the payment-detail table to show, for
   each allocated invoice, how much has been paid vs. the total. Three
   visual states: partial (default green), paid (full + check), and
   over-allocated (red, capped at 100% width but the meta line below
   explains the surplus). */
.ig-progress {
  position: relative;
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  min-width: 120px;
}
.ig-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--primary-3), var(--primary));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.ig-progress.is-paid .ig-progress-fill {
  background: var(--ok);
}
.ig-progress.is-over .ig-progress-fill {
  background: #ef4444;
}
.ig-progress-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}
.ig-progress-paid {
  color: var(--ok);
  font-weight: 600;
}
.ig-progress-over {
  color: #b91c1c;
  font-weight: 600;
}


.ig-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ig-product-grid .span-2 { grid-column: span 2; }
@media (max-width: 700px) {
  .ig-product-grid { grid-template-columns: 1fr; }
  .ig-product-grid .span-2 { grid-column: span 1; }
}
.ig-product-grid label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 4px;
  font-weight: 500;
}

/* Unit-of-measure picker: typeahead-style autocomplete. Renders as
   a single text input with a small × clear button on the right and a
   floating popup beneath. Same look-and-feel as the invoice editor's
   product/client autocomplete so the interaction is consistent. */
.ig-unit-picker {
  position: relative;
}
.ig-unit-input-wrap {
  position: relative;
}
.ig-unit-picker .ig-unit-input {
  width: 100%;
  padding-right: 32px;  /* room for the clear button */
}
.ig-unit-picker .ig-unit-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: transparent;
  border: 0;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.ig-unit-picker .ig-unit-clear:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.ig-unit-picker .ig-unit-clear[hidden] { display: none; }
.ig-unit-popup {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  max-height: 280px;
  overflow-y: auto;
  font-size: 14px;
}
.ig-unit-popup[hidden] { display: none; }
.ig-unit-group + .ig-unit-group {
  border-top: 1px solid var(--line);
}
.ig-unit-group-label {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}
.ig-unit-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.ig-unit-item:last-child { border-bottom: 0; }
.ig-unit-item:hover,
.ig-unit-item.active {
  background: var(--primary-soft);
}
.ig-unit-item.active {
  color: var(--primary);
}
.ig-unit-item-label {
  font-weight: 500;
}
.ig-unit-item-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}
.ig-unit-item-custom {
  background: #f0f9ff;
  border-top: 1px solid var(--line);
}
.ig-unit-item-custom .ig-unit-item-label {
  color: var(--primary);
  font-style: italic;
  font-weight: 600;
}
.ig-unit-item-custom:hover,
.ig-unit-item-custom.active {
  background: #dbeafe;
}
.ig-stock-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 700px) {
  .ig-stock-header { grid-template-columns: 1fr; }
}
.ig-stock-header label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 4px;
  font-weight: 500;
}
.ig-ac {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
}
.ig-ac-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}
.ig-ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ig-ac-item:last-child { border-bottom: 0; }
.ig-ac-item:hover,
.ig-ac-item.active {
  background: var(--primary-soft);
}
.ig-ac-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.ig-ac-sku {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}
.ig-ac-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.ig-ac-price { color: var(--ink-2); font-weight: 600; }
.ig-ac-stock {
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
}
.ig-ac-stock.ig-stock-ok  { background: #ecfdf5; color: #065f46; }
.ig-ac-stock.ig-stock-low { background: #fffbeb; color: #92400e; }
.ig-ac-stock.ig-stock-out { background: #fef2f2; color: #991b1b; }
.ig-ac-kind {
  font-weight: 600;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  white-space: nowrap;
}
.ig-ac-kind-service { background: #eff6ff; color: #1d4ed8; }

/* ------ Stock-receipt product typeahead (NIR) ------
   Mirrors the .ig-ac popup used on the invoice editor but kept as
   a separate class so the NIR-specific markup (rows, action
   buttons, "+ Create new" option) doesn't have to share CSS with
   the invoice editor's bigger, more elaborate autocomplete. */
.ig-pa-typeahead { position: relative; }
.ig-pa-popup {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
  max-height: 320px;
  overflow-y: auto;
}
.ig-pa-popup[hidden] { display: none; }
.ig-pa-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}
.ig-pa-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  background: white;
}
.ig-pa-item:last-child { border-bottom: 0; }
.ig-pa-item:hover,
.ig-pa-item.active {
  background: var(--primary-soft);
}
.ig-pa-line1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.ig-pa-line1 strong {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.ig-pa-price {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}
.ig-pa-line2 {
  display: flex;
  gap: 12px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.ig-pa-meta {
  font-size: 11px;
  color: var(--muted);
}
.ig-pa-item.ig-pa-new {
  background: #f9fafb;
  border-top: 2px solid var(--line);
}
.ig-pa-item.ig-pa-new .ig-pa-line1 strong {
  color: var(--primary);
}
   the workspace has products running below their min_stock threshold. */
.ig-nav-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: #fbbf24;
  color: #1f1300;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}
.ig-plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  background: rgba(26, 127, 55, 0.1);
  color: #1a7f37;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.ig-plan-pill:hover { background: rgba(26, 127, 55, 0.18); }
/* Expandable-row chevron: closed = right, open = down (rotated). */
.ig-invoice-toggle-arrow svg { transition: transform .15s ease; }
.ig-invoice-toggle-arrow.open svg { transform: rotate(90deg); }
/* Global icon chrome: inline SVGs from View::icon() align with text. */
.ig-icon { display: inline-block; vertical-align: -3px; flex: none; }
button > .ig-icon, a > .ig-icon, summary > .ig-icon, span > .ig-icon { vertical-align: -3px; }
.ig-ac-item.ig-ac-item-new {
  background: #f9fafb;
  border-bottom: 2px solid var(--line);
}
.ig-ac-item.ig-ac-item-new .ig-ac-name {
  color: var(--primary);
  font-weight: 600;
}
.ig-ac-item.ig-ac-item-new .ig-ac-meta span {
  font-style: italic;
  color: var(--ink-2);
}
.ig-helper {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ------ Template picker (invoice editor + settings) ------ */
.ig-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.ig-tpl-card {
  position: relative;
  display: block;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ig-tpl-card:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.ig-tpl-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26, 127, 55, .15);
}
.ig-tpl-card input[type=radio] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.ig-tpl-preview {
  height: 90px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ig-tpl-preview-mini {
  width: 70%;
  height: 70%;
  background: rgba(255, 255, 255, .85);
  border-radius: 4px;
  padding: 6px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ig-tpl-card.dark .ig-tpl-preview-mini {
  background: rgba(15, 23, 42, .35);
}
.ig-tpl-preview-mini .bar {
  height: 6px;
  width: 40%;
  background: currentColor;
  border-radius: 2px;
  opacity: .8;
}
.ig-tpl-card .ig-tpl-preview-mini .bar,
.ig-tpl-card .ig-tpl-preview-mini .lines div {
  background: rgba(0, 0, 0, .35);
}
.ig-tpl-card.dark .ig-tpl-preview-mini .bar,
.ig-tpl-card.dark .ig-tpl-preview-mini .lines div {
  background: rgba(255, 255, 255, .65);
}
.ig-tpl-preview-mini .lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.ig-tpl-preview-mini .lines div {
  height: 4px;
  border-radius: 2px;
  width: 100%;
  opacity: .5;
}
.ig-tpl-preview-mini .lines div:nth-child(2) { width: 90%; }
.ig-tpl-preview-mini .lines div:nth-child(3) { width: 70%; }
.ig-tpl-preview-mini .lines div:nth-child(4) { width: 50%; }
.ig-tpl-meta {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
}
.ig-tpl-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.2;
}
.ig-tpl-desc {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.ig-tpl-card.selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

/* Small template badge on the dashboard invoice list */
.ig-tpl-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  vertical-align: middle;
}

/* Currency-conversion warning shown under a line that was picked in
   a different currency than the invoice. Lives in a standalone
   table row (`<tr class="ig-fx-warning-row">` placed right under
   the affected line) so it never crowds the input boxes above; the
   cell spans all 6 columns of the items table. */
.ig-fx-warning-row > td { padding: 4px 8px 8px; }
.ig-fx-warning-row[hidden] { display: none; }
.ig-fx-note {
  margin-top: 4px;
  padding: 4px 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  font-size: 10px;
  color: #7c2d12;
  line-height: 1.3;
  max-width: 240px;
  text-align: left;
  font-weight: 500;
}
.ig-fx-note .ig-fx-arrow {
  display: inline-block;
  margin-right: 2px;
  color: #c2410c;
  font-weight: 700;
}
.ig-fx-note .ig-fx-stale {
  color: #b45309;
  font-weight: 700;
  margin-left: 4px;
}
.ig-fx-note .ig-fx-src,
.ig-fx-note .ig-fx-err {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: #92400e;
  font-weight: 400;
}
.ig-fx-note .ig-fx-err { color: #b91c1c; font-weight: 700; }

/* "Preview" button on each template card (opens the rendered PDF in a new tab) */
.ig-tpl-preview-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 3px 8px;
  background: rgba(255, 255, 255, .92);
  color: #1f2937;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: background .15s, transform .15s;
  line-height: 1.2;
}
.ig-tpl-preview-btn:hover {
  background: #ffffff;
  color: var(--primary);
  transform: translateY(-1px);
}
.ig-tpl-card.dark .ig-tpl-preview-btn {
  background: rgba(15, 23, 42, .7);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, .15);
}
.ig-tpl-card.dark .ig-tpl-preview-btn:hover {
  background: rgba(15, 23, 42, .9);
  color: #fff;
}

/* ------ Template autosave indicator ------
   Shown next to the template grid in the invoice editor and the
   Settings → Invoice template page. Lives in the layout flow so the
   user always sees the latest "Saved" / "Saving…" state when they
   pick a template or change the accent color. */
.ig-autosave-status {
  display: inline-block;
  margin: 6px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.ig-autosave-status.is-visible {
  opacity: 1;
}
.ig-autosave-status:empty {
  display: none;
}

/* ------ PDF preview modal (in-page overlay) ------ */
.ig-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  padding: 24px;
  animation: ig-preview-fade .15s ease-out;
}
@keyframes ig-preview-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ig-preview-modal[hidden] { display: none; }
.ig-preview-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  /* Stretch to fill the modal minus its 24px padding on each side.
     Without an explicit height, a flex item with `display:flex;
     flex-direction:column` and a child that has `flex:1` collapses to
     the height of its non-flex children (just the header) and the
     iframe ends up ~40px tall. */
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.ig-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #0f172a;
  color: white;
  flex-shrink: 0;
}
.ig-preview-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-preview-title .tpl-key {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ig-preview-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.ig-preview-btn {
  background: rgba(255, 255, 255, .1);
  color: white;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  font-family: inherit;
  transition: background .15s;
}
.ig-preview-btn:hover { background: rgba(255, 255, 255, .2); }
.ig-preview-close {
  background: transparent;
  border: 0;
  color: white;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  font-family: inherit;
}
.ig-preview-close:hover { color: #fca5a5; }
.ig-preview-body {
  flex: 1;
  min-height: 0;
  background: #f1f5f9;
  position: relative;
}
.ig-preview-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: white;
}
.ig-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #475569;
  font-size: 13px;
}
.ig-preview-loading::before {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid #cbd5e1;
  border-top-color: #1a7f37;
  border-radius: 50%;
  animation: ig-preview-spin .8s linear infinite;
}
@keyframes ig-preview-spin {
  to { transform: rotate(360deg); }
}
.ig-preview-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  text-align: center;
  color: #991b1b;
  font-size: 13px;
}
.ig-preview-error .err-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.ig-preview-error a {
  padding: 6px 12px;
  background: #1a7f37;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}

----------------------------------------------------------------------
Admin panel (F0/F1): shell, sidebar, stat cards, bar chart.
Uses the same design language as the user-facing pages but with a
darker sidebar so it's visually distinct from the regular app.
----------------------------------------------------------------------
.ig-body-admin {
  background: #f1f5f9;
  font-family: var(--font-body);
}
.ig-body-admin h1,
.ig-body-admin h2,
.ig-body-admin h3,
.ig-body-admin h4,
.ig-body-admin h5,
.ig-body-admin h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #0f172a;
}
.ig-admin-shell {
  display: flex;
  min-height: 100vh;
}
.ig-admin-sidebar {
  width: 240px;
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.ig-admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #1e293b;
}
.ig-admin-sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a7f37, #2c9c4a);
  color: white;
  font-weight: 700;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ig-admin-sidebar-title {
  color: #f1f5f9;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.ig-admin-sidebar-sub {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 4px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}
.ig-admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
  flex: 1;
}
.ig-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-family: var(--font-display);
  transition: background .12s, color .12s;
}
.ig-sidebar-link-label {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}
.ig-sidebar-link:hover {
  background: #1e293b;
  color: #f1f5f9;
}
.ig-sidebar-link.active {
  background: #1a7f37;
  color: white;
}
.ig-sidebar-link.active .ig-sidebar-link-icon {
  /* keep icons readable on green active background */
  opacity: 1;
}
.ig-sidebar-link-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  color: currentColor;
}
.ig-sidebar-link-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  color: currentColor;
}
.ig-sidebar-link-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.ig-sidebar-badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
  margin-left: auto;
}
.ig-sidebar-link.active .ig-sidebar-badge {
  background: white;
  color: #1a7f37;
}
.ig-admin-sidebar-foot {
  border-top: 1px solid #1e293b;
  padding: 12px 8px;
}
.ig-admin-sidebar-user {
  padding: 10px 12px 4px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.3;
}
.ig-admin-sidebar-user-name {
  color: #e2e8f0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ig-admin-sidebar-user-email {
  margin-top: 1px;
  word-break: break-all;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
}
.ig-admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ig-admin-content {
  padding: 24px 32px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.ig-admin-page-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #0f172a;
  text-transform: uppercase;
}
.ig-admin-page-sub {
  margin: 0 0 24px;
  color: #64748b;
  font-size: 14px;
}
.ig-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ig-admin-grid-full {
  grid-column: 1 / -1;
}
.ig-admin-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ig-admin-card-label {
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 8px;
}
.ig-admin-card-value {
  color: #1a7f37;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.1;
  margin: 0;
}
.ig-admin-card-value.muted {
  color: #0f172a;
}
.ig-admin-card-foot {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
}
.ig-admin-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  padding: 6px 4px 0;
  border-bottom: 1px solid #e2e8f0;
}
.ig-admin-bar-col {
  flex: 1;
  background: linear-gradient(180deg, #2c9c4a 0%, #1a7f37 100%);
  border-radius: 2px 2px 0 0;
  min-height: 1px;
  position: relative;
  transition: background .15s;
}
.ig-admin-bar-col:hover {
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
}
.ig-admin-bar-col[data-zero="1"] {
  background: #e2e8f0;
}
.ig-admin-bar-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
}
.ig-admin-bar-empty {
  text-align: center;
  color: #94a3b8;
  padding: 32px 8px;
  font-size: 13px;
  font-style: italic;
}
.ig-admin-coming-soon {
  background: white;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 60px 24px;
  text-align: center;
  color: #475569;
}
.ig-admin-coming-soon h2 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 18px;
}
.ig-admin-coming-soon p {
  margin: 0;
  font-size: 14px;
}
@media (max-width: 720px) {
  .ig-admin-shell { flex-direction: column; }
  .ig-admin-sidebar { width: 100%; height: auto; position: static; }
  .ig-admin-content { padding: 16px; }
  .ig-admin-grid { grid-template-columns: 1fr; }
}

/* ----- Admin Users list (F2) + Account detail (F3) ----- */
.ig-admin-table { width: 100%; border-collapse: collapse; }
.ig-admin-table th { text-align: left; padding: 10px 12px; background: #f1f5f9; color: #475569; font-size: 11px; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; }
.ig-admin-table td { padding: 10px 12px; border-top: 1px solid #e2e8f0; }
.ig-admin-table tr:hover td { background: #f8fafc; }
.ig-admin-pill { display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 10px; font-weight: 600; }
.ig-admin-pill.is-admin { background: #1a7f37; color: white; }
.ig-admin-pill.is-trial { background: #fef3c7; color: #92400e; }
.ig-admin-pill.is-past-due { background: #fee2e2; color: #991b1b; }
.ig-admin-pill.is-suspended { background: #fee2e2; color: #991b1b; font-weight: 700; }
.ig-admin-pill.is-disputed { background: #fee2e2; color: #991b1b; font-weight: 700; }
.ig-admin-pill.is-cancelled { background: #f1f5f9; color: #475569; }
.ig-admin-pill.is-active { background: #d1fae5; color: #065f46; }
.ig-admin-filters { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.ig-admin-filters input, .ig-admin-filters select { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 6px; }
.ig-admin-pagination { display: flex; gap: 12px; align-items: center; margin-top: 16px; justify-content: center; }
.ig-admin-pagination a { padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 6px; text-decoration: none; color: #1a7f37; }
.ig-admin-pagination a.disabled { color: #94a3b8; pointer-events: none; }

/* Status tags for the settings page — colour-coded pill that
   shows where the value is coming from (DB / config.php / missing). */
.ig-status-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 10px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.ig-status-tag[data-status="db"]      { background: #d1fae5; color: #065f46; }
.ig-status-tag[data-status="env"]     { background: #fef3c7; color: #92400e; }
.ig-status-tag[data-status="missing"] { background: #fee2e2; color: #991b1b; }

/* ----- Inline edit on stock receipt (NIR) line items ----- */
.ig-btn-link {
  background: transparent;
  border: 0;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.ig-btn-link:hover { color: var(--primary-2); }

/* Inline edit row on the stock receipt detail page. The row gets a
   subtle background tint and a left border so the user can tell at
   a glance which line they're editing. The form is a small grid that
   stays readable down to 360px on a phone. */
.ig-line-edit-row {
  background: #f0f9ff;
  border-left: 3px solid var(--primary);
}
.ig-line-edit-row .ig-line-edit-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  padding: 12px;
  align-items: end;
}
.ig-line-edit-row .ig-line-edit-form > * { margin: 0; }
.ig-line-edit-row .ig-line-edit-form label {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 4px;
  display: block;
}
.ig-line-edit-row .ig-line-edit-form .ig-helper {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.ig-line-edit-row .ig-line-edit-actions {
  grid-column: span 3;
  display: flex; gap: 8px; align-items: center;
  /* Buttons always anchored to the right edge so they don't jump when
     the feedback row above appears/disappears. */
  justify-content: flex-end;
  padding-top: 8px; border-top: 1px solid var(--line);
}
/*
   Feedback row sits ABOVE the actions row and takes the same full
   width (grid-column: span 3). The error/success messages live here
   so the buttons in .ig-line-edit-actions can stay pinned to the
   right regardless of whether a message is currently shown. The
   container is hidden by default and only revealed when one of its
   children is shown.
*/
.ig-line-edit-row .ig-line-edit-feedback {
  grid-column: span 3;
  padding-top: 4px;
}
.ig-line-edit-row .ig-line-edit-feedback:empty,
.ig-line-edit-row .ig-line-edit-feedback[hidden] { display: none; }
.ig-line-edit-row .ig-line-edit-actions > [data-cancel-line] {
  background: white; color: var(--ink); border: 1px solid var(--line-2);
  padding: 8px 14px; border-radius: 6px; cursor: pointer; font: inherit;
}
.ig-line-edit-row .ig-line-edit-actions > [data-cancel-line]:hover { background: var(--bg-2); }
.ig-line-edit-row .ig-markup-preview {
  font-size: 13px; color: var(--primary); font-weight: 600;
  padding: 8px 0 0; min-height: 1.4em;
}
/*
   The markup cell collapses the markup input + the live "→ {price}"
   preview into a single grid column. The helper sentence that used
   to live in this cell was a long paragraph that overlapped the
   preview and the neighbour column on narrow screens; it's now a
   `title` tooltip on the input (shown on hover) so the cell stays
   short and the preview sits directly under the input where the
   user expects it.
*/
.ig-line-edit-row .ig-line-edit-markup-cell { min-width: 0; }
.ig-line-edit-row .ig-line-edit-markup-cell .ig-markup-preview { padding: 4px 0 0; }
.ig-line-edit-row .ig-line-error  { color: #dc2626; font-size: 13px; padding: 6px 0 0; }
.ig-line-edit-row .ig-line-success { color: var(--primary); font-size: 13px; padding: 6px 0 0; }
.ig-line-edit-row .ig-unit-picker .ig-helper { display: none; }

/* Read-only product-name header at the top of the inline edit form.
   Tells the user which line they're editing without scrolling back
   up to the (now hidden) display row. */
.ig-line-edit-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0 12px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ig-line-edit-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ig-line-edit-product {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.ig-line-edit-sku {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* The product name on a NIR line used to be a link to /products/{id}
   (the product editor), which pulled the user out of the receipt
   context. It's now a clickable span that triggers the same inline
   edit as the [data-edit-line] button — visually it still looks like
   a link (green, bold) so the affordance is obvious. */
.ig-line-name {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 2px;
  margin: -1px -2px;
  transition: background 0.15s;
}
.ig-line-name:hover { background: #f0f9ff; text-decoration: underline; }
.ig-line-name:focus-visible {
  outline: none;
  background: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(26, 127, 55, 0.3);
}

/* Input + helper on the same row.
   Used throughout the product editor (and any other form) when the
   helper text is short enough to fit on the right of the input.
   Long helpers wrap to a new line automatically (flex-wrap). The
   helper gets a `flex: 0 1 auto` so the input keeps its natural
   width and the helper takes whatever space is left. */
.ig-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ig-input-row .ig-input {
  flex: 0 1 auto;
  min-width: 120px;
  width: auto;
}
.ig-input-row .ig-helper {
  flex: 0 1 auto;
  font-size: 12px;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.4;
}

/* Live preview span for the markup helper. Mirrors the look used on
   the NIR inline edit form so the visual language is consistent
   across the app: green, bold, padded. */
.ig-markup-preview {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  padding: 0 4px;
  min-height: 1.4em;
  display: inline-flex;
  align-items: center;
}
.ig-markup-preview:empty { display: none; }

@media (max-width: 720px) {
  .ig-line-edit-row .ig-line-edit-form { grid-template-columns: 1fr; }
  .ig-line-edit-row .ig-line-edit-actions { grid-column: 1; }
}

/* New columns on the new-NIR editor's items table. We set explicit
   widths so the sale price + markup inputs get enough room without
   pushing the line total off-screen. The preview line below the
   markup input gets a tiny font + primary color so it reads as a
   hint, not a label. The preview is absolutely positioned under
   the input so the row height doesn't jump when the user types a
   markup value (the row used to expand and push the line total
   column off-screen). */
.ig-items-table .col-sale-price,
.ig-items-table .col-markup { width: 130px; }
.ig-items-table .col-markup { position: relative; }
.ig-items-table .col-markup-preview {
  font-size: 11px; color: var(--primary); font-weight: 600;
  padding: 2px 4px; line-height: 1.2;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: white;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
}

/* ==========================================================================
   Navbar active-page state.
   The current page is marked with .is-active by app.js on page load,
   based on matching the current URL path against [data-nav-link].
   The active link gets:
     - primary color text
     - bold weight
     - a 3px green underline directly under the text
   The underline is placed with padding-bottom (so it sits clearly under
   the baseline) and a bottom border (so the line is crisp and visible
   even on hi-DPI screens). All other links are plain ink-colored text.
   ========================================================================== */
.ig-links a {
  /* Reserve room at the bottom so the active-state underline has
     breathing room under the text. The line still only shows when
     .is-active is applied — this just guarantees the layout doesn't
     shift when navigation happens. */
  padding-bottom: 4px;
}
.ig-links a.is-active {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 3px solid var(--primary);
}
.ig-links a.is-active:hover {
  color: var(--primary);
}

/* ==========================================================================
   Public /help center
   - responsive card grid (3 col → 2 col → 1 col)
   - chapter body styles (rendered HTML)
   ========================================================================== */
.ig-help-wrap { max-width: 1600px; margin: 0 auto; padding: 24px 16px 64px; }
.ig-help-header { margin: 0 0 24px; }
.ig-help-header h1 { margin: 0 0 6px; font-size: 28px; color: var(--ink); }
.ig-help-sub { color: var(--ink-2); margin: 0; font-size: 16px; }

.ig-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.ig-help-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.ig-help-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
  border-color: var(--primary);
  text-decoration: none;
}
.ig-help-card-cover {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
}
.ig-help-card-cover-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--muted);
}
.ig-help-card-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.ig-help-card-title { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.ig-help-card-summary { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.5; flex: 1; }
.ig-help-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.ig-help-card-arrow { font-size: 18px; color: var(--primary); font-weight: 600; }

.ig-help-show .ig-help-header { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.ig-help-chapters { display: flex; flex-direction: column; gap: 28px; }
.ig-help-children { display: flex; flex-direction: column; gap: 20px; margin-top: 18px; padding-left: 22px; border-left: 2px solid var(--line-2); }
.ig-help-chapter-title { margin: 0 0 10px; color: var(--ink); }
.ig-help-chapter-body { color: var(--ink); line-height: 1.65; font-size: 15px; }
.ig-help-chapter-body p { margin: 0 0 12px; }
.ig-help-chapter-body p:last-child { margin-bottom: 0; }
.ig-help-chapter-body h1, .ig-help-chapter-body h2, .ig-help-chapter-body h3 { margin: 18px 0 10px; }
.ig-help-chapter-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.ig-help-chapter-body video { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.ig-help-chapter-body a { color: var(--primary); text-decoration: underline; }
.ig-help-chapter-body blockquote {
  margin: 12px 0; padding: 10px 16px;
  border-left: 3px solid var(--primary);
  background: var(--bg-2);
  color: var(--ink-2);
  border-radius: 0 6px 6px 0;
}
.ig-help-chapter-body pre, .ig-help-chapter-body code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
}
.ig-help-chapter-body pre { background: #0b1220; color: #e2e8f0; padding: 12px 16px; border-radius: 6px; overflow-x: auto; }
.ig-help-chapter-body code { background: var(--bg-2); padding: 2px 6px; border-radius: 3px; }
.ig-help-chapter-body pre code { background: none; padding: 0; color: inherit; }
.ig-help-chapter-body ul, .ig-help-chapter-body ol { margin: 0 0 12px; padding-left: 26px; }
.ig-help-divider { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ==========================================================================
   Admin: guide editor — chapter list + per-chapter Quill instance
   ========================================================================== */
.ig-admin-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.ig-admin-header h1 { margin: 0; font-size: 22px; }
.ig-admin-header-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }

.ig-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ig-admin-table th, .ig-admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.ig-admin-table th {
  background: var(--bg-2);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ig-admin-table tr:last-child td { border-bottom: 0; }
.ig-admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.ig-form-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
}

.ig-guide-chapters { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 14px; }
.ig-guide-chapter {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  padding: 12px;
}
.ig-guide-chapter-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.ig-guide-chapter-title { flex: 1; font-weight: 600; }
/* The Summernote editor replaces the <textarea> by inserting a
   .note-editor wrapper as a sibling. Style the wrapper so it looks
   like the previous Quill editor block. */
.ig-guide-chapter-editor {
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 180px;
  display: none; /* Summernote replaces this with .note-editor; the textarea stays in the DOM for form fallback but is hidden. */
}
/* Summernote wrapper: scrollable, with the toolbar on top and the
   editing area below. */
.ig-guide-chapter .note-editor {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  margin-bottom: 4px;
}
.ig-guide-chapter .note-editor .note-toolbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  padding: 6px 8px;
}
.ig-guide-chapter .note-editor .note-editing-area {
  background: white;
  border-radius: 0 0 6px 6px;
}
.ig-guide-chapter .note-editor .note-editable {
  min-height: 180px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}
.ig-guide-chapter .note-editor .note-editable p { margin: 0 0 10px; }
.ig-guide-chapter .note-editor .note-editable img { max-width: 100%; height: auto; border-radius: 4px; }
.ig-guide-chapter .note-editor .note-editable video { max-width: 100%; border-radius: 4px; }
.ig-guide-chapter-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; font-size: 12px; color: var(--muted);
}
.ig-guide-chapter-status[data-kind="ok"] { color: var(--primary); }
.ig-guide-chapter-status[data-kind="err"] { color: #dc2626; }

.ig-guide-add-chapter {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
}
.ig-guide-add-chapter .ig-input { flex: 1; }


/* ==========================================================================
   Inline status <select> on the dashboard
   Sits under the status badge, mirrors its colour so the user can read
   the current value at a glance. The form auto-submits on `change` (see
   dashboard JS) so picking a new value is a single click.
   ========================================================================== */
.ig-status-form {
  margin: 0;
  display: inline-flex;
  align-items: stretch;
}
.ig-status-select {
  font-size: 13px;
  line-height: 1.2;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  box-sizing: border-box;
  min-width: 96px;
  appearance: auto;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ig-status-select:hover { border-color: var(--primary); background: var(--bg-2); }
.ig-status-select:focus { outline: 2px solid rgba(26, 127, 55, 0.3); outline-offset: 1px; }
.ig-status-select.ig-status-draft    { color: #64748b; }
.ig-status-select.ig-status-sent     { color: #1a7f37; border-color: #b7dfc2; background: rgba(26, 127, 55, 0.08); }
.ig-status-select.ig-status-paid     { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.ig-status-select.ig-status-overdue  { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.ig-status-select.ig-status-cancelled{ color: #6b7280; border-color: #e5e7eb; background: #f9fafb; text-decoration: line-through; }
/* Estimate pipeline statuses (views/estimates/index.php reuses the
   same inline-select pattern as the invoice dashboard). */
.ig-status-select.ig-status-pending  { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.ig-status-select.ig-status-accepted { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.ig-status-select.ig-status-declined { color: #6b7280; border-color: #e5e7eb; background: #f9fafb; }
.ig-status-select.ig-status-expired  { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
/* Auto-managed status pill (shown instead of a dropdown when the
   invoice is currently in a status the user cannot pick manually:
   `paid` and `overdue` are owned by the system, not by the dropdown).
   Reuses the same height/padding/font-size as the .ig-status-select
   so it sits flush with the surrounding action buttons. */
.ig-status-locked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  font-family: inherit;
  box-sizing: border-box;
  cursor: help;
  user-select: none;
}
.ig-status-locked[data-auto-status="paid"]     { color: #166534; border-color: #bbf7d0; background: #f0fdf4; border-style: solid; }
.ig-status-locked[data-auto-status="overdue"]  { color: #991b1b; border-color: #fecaca; background: #fef2f2; border-style: solid; }
.ig-status-locked[data-auto-status="expired"]   { color: #991b1b; border-color: #fecaca; background: #fef2f2; border-style: solid; }
.ig-status-locked[data-auto-status="converted"] { color: #1e40af; border-color: #bfdbfe; background: #eff6ff; border-style: solid; }
.ig-btn-tiny {
  margin-top: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 4px;
  cursor: pointer;
}
.ig-btn-tiny:hover { background: var(--bg-2); }

/* Dashboard — expandable "Show payments" rows.
   The invoice number becomes a button when the invoice has at
   least one allocation. Clicking it toggles a hidden <tr> with
   the payments-breakdown table. */
.ig-invoice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 6px 2px 2px;
  border-radius: 6px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.ig-invoice-toggle:hover {
  background: var(--bg-2);
  border-color: var(--line);
}
.ig-invoice-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.ig-invoice-toggle-arrow {
  display: inline-block;
  width: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.12s;
}
.ig-invoice-toggle[aria-expanded="true"] .ig-invoice-toggle-arrow {
  transform: rotate(0deg); /* arrow flips char from ▸ to ▾ in JS */
  color: var(--primary);
}
.ig-invoice-toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border-radius: 9px;
  line-height: 1;
}
.ig-payments-row > .ig-payments-cell {
  padding: 0 !important;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ig-payments-cell { padding: 14px 18px 16px; }
.ig-payments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.ig-payments-title {
  font-weight: 600;
  color: var(--ink);
}
.ig-payments-summary {
  color: var(--muted);
  font-size: 12px;
}
.ig-payments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.ig-payments-table th, .ig-payments-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--bg-2);
}
.ig-payments-table thead th {
  background: var(--bg-2);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ig-payments-table tbody tr:last-child td { border-bottom: none; }
.ig-payments-table tbody tr:hover { background: #f9fafb; }
.ig-payments-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ig-payments-table a { color: var(--primary); text-decoration: none; }
.ig-payments-table a:hover { text-decoration: underline; }

/* Dashboard — filter chips (top right of the action bar). */
.ig-dash-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ig-dash-filter-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.ig-dash-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ig-dash-filter-chip:hover {
  background: white;
  color: var(--ink);
  border-color: var(--ink-2);
}
.ig-dash-filter-chip.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.ig-dash-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  background: white;
  border-radius: 9px;
  line-height: 1;
}
.ig-dash-filter-chip.is-active .ig-dash-filter-count {
  color: white;
  background: var(--primary);
}

/* Dashboard — paginator (below the table). */
.ig-dash-paginator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 0 0 12px 12px;
}
.ig-dash-paginator-info {
  font-size: 12px;
  color: var(--muted);
}
.ig-dash-paginator-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.ig-dash-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ig-dash-page-link:hover {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--ink-2);
}
.ig-dash-page-link.is-current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  cursor: default;
}
.ig-dash-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: var(--muted);
  font-size: 14px;
}

/* Navbar — admin link. Kept inline with the other nav items
   (no box / padding / border) so the row stays on a single
   baseline. A muted accent color still differentiates it from
   the regular links without breaking vertical alignment. */
.ig-nav-admin {
  color: #92400e;
  font-weight: 600;
}
.ig-nav-admin:hover {
  color: #78350f;
}
.ig-nav-admin.is-active,
.ig-links a.is-active.ig-nav-admin {
  color: #92400e;
}

/* Recurring-invoices toolbar button (dashboard + recurring list).
   Same chrome as .btn-primary, pale-red fill so it reads as
   related to invoices but distinct from the green primary. */
.btn-recurrent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8d7da;
  color: #842029;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #f5c2c7;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-recurrent:hover { background: #f5c2c7; color: #842029; }

/* ===========================================================================
   Support hub (/support) — public. Brand green, light theme.
   =========================================================================== */
.ig-support { --sup-max: 1160px; }
.ig-support-hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #1a7f37 0%, #166c2e 52%, #0f5132 100%);
  padding: 64px 24px 72px; text-align: center;
}
.ig-support-hero-glow {
  position: absolute; inset: -40% -10% auto; height: 120%; pointer-events: none;
  background:
    radial-gradient(60% 55% at 18% 12%, rgba(44,156,74,.55), transparent 60%),
    radial-gradient(50% 50% at 85% 8%, rgba(245,158,11,.20), transparent 62%);
  filter: blur(6px);
}
.ig-support-hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.ig-support-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  color: #eafff0; padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px; margin-bottom: 20px;
}
.ig-support-hero h1 { font-size: 42px; line-height: 1.1; margin: 0 0 14px; font-weight: 800; letter-spacing: -.5px; }
.ig-support-sub { font-size: 18px; line-height: 1.6; color: rgba(255,255,255,.9); margin: 0 auto 28px; max-width: 600px; }
.ig-support-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ig-support-hero .ig-btn-hero { display: inline-flex; align-items: center; gap: 8px; }
.ig-support-hero .ig-btn-hero.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }
.ig-support-hero .ig-btn-hero.ghost:hover { background: #fff; color: var(--primary-2); border-color: #fff; }

.ig-support-body { max-width: var(--sup-max); margin: 0 auto; padding: 0 24px 72px; }
.ig-support-h2 { display: flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 6px; letter-spacing: -.3px; }
.ig-support-h2 .ig-icon { color: var(--primary); }
.ig-support-section-sub { color: var(--muted); font-size: 15px; margin: 0 0 20px; line-height: 1.6; }
.ig-support-quick, .ig-support-articles, .ig-support-faq, .ig-support-contact { margin-top: 52px; scroll-margin-top: 90px; }

/* Quick cards */
.ig-support-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 18px; }
.ig-support-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 20px 20px; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ig-support-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-3); }
.ig-support-card-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px;
  border-radius: 12px; background: var(--primary-soft); color: var(--primary);
  transition: background .18s ease, color .18s ease;
}
.ig-support-card:hover .ig-support-card-icon { background: var(--primary); color: #fff; }
.ig-support-card-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.ig-support-card-desc { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.ig-support-card-go { position: absolute; top: 22px; right: 18px; color: var(--line-2); transition: color .18s, transform .18s; }
.ig-support-card:hover .ig-support-card-go { color: var(--primary); transform: translateX(3px); }

/* Popular articles */
.ig-support-articles-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ig-support-all { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--primary); }
.ig-support-all:hover { color: var(--primary-2); }
.ig-support-article-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ig-support-article {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; text-decoration: none;
  transition: border-color .16s, background .16s, transform .16s;
}
.ig-support-article:hover { border-color: var(--primary-3); background: #fbfefc; transform: translateX(3px); }
.ig-support-article-icon { display: inline-flex; color: var(--primary); flex-shrink: 0; }
.ig-support-article-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ig-support-article-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.ig-support-article-summary { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-support-article-meta { font-size: 12px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }

/* FAQ */
.ig-support-faq-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.ig-support-faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .16s, box-shadow .16s; }
.ig-support-faq-item[open] { border-color: var(--primary-3); box-shadow: var(--shadow); }
.ig-support-faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  cursor: pointer; list-style: none; padding: 16px 20px; font-size: 15.5px; font-weight: 600; color: var(--ink);
}
.ig-support-faq-item summary::-webkit-details-marker { display: none; }
.ig-support-faq-item summary:hover { color: var(--primary-2); }
.ig-support-faq-chev { display: inline-flex; color: var(--muted); transition: transform .22s ease, color .16s; flex-shrink: 0; }
.ig-support-faq-item[open] .ig-support-faq-chev { transform: rotate(180deg); color: var(--primary); }
.ig-support-faq-a { padding: 0 20px 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }
.ig-support-faq-more { margin-top: 18px; color: var(--muted); font-size: 14.5px; }
.ig-support-faq-more a { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--primary); }

/* Contact + form */
.ig-support-contact-grid { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; margin-top: 18px; }
.ig-support-aside { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }
.ig-support-contact-row { display: flex; gap: 12px; align-items: flex-start; }
.ig-support-contact-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.ig-support-contact-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.ig-support-contact-value { display: block; font-size: 15px; color: var(--ink); font-weight: 600; margin-top: 2px; word-break: break-word; }
a.ig-support-contact-value:hover { color: var(--primary-2); }
.ig-support-contact-note { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.6; margin: 4px 0 0; }
.ig-support-contact-note .ig-icon { color: var(--primary-3); flex-shrink: 0; margin-top: 2px; }
.ig-support-track { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 10px 14px; border-radius: 10px; }
.ig-support-track:hover { background: #d8efe0; color: var(--primary-2); }
.ig-support-loginhint { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ig-support-loginhint p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.ig-support-logincta { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--primary); }

.ig-support-formcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.ig-support-field { margin-bottom: 16px; }
.ig-support-field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.ig-support-field .ig-input { width: 100%; }
.ig-support-field textarea.ig-input { resize: vertical; min-height: 130px; line-height: 1.6; }
.ig-support-fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ig-support-charcount { text-align: right; font-size: 12px; color: var(--muted); margin-top: 5px; }
.ig-support-submit { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; padding: 12px 24px; }
.ig-support-submit.is-sending { opacity: .7; cursor: progress; }
.ig-support-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Brand scrollbar inside the message box */
.ig-support-field textarea.ig-input::-webkit-scrollbar { width: 10px; }
.ig-support-field textarea.ig-input::-webkit-scrollbar-track { background: var(--bg-2); border-radius: 8px; }
.ig-support-field textarea.ig-input::-webkit-scrollbar-thumb { background: var(--primary-3); border-radius: 8px; border: 2px solid var(--bg-2); }
.ig-support-field textarea.ig-input::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Staged entrance */
@keyframes ig-sup-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.ig-support-hero-inner > * { animation: ig-sup-rise .6s cubic-bezier(.2,.7,.3,1) both; }
.ig-support-hero-inner > *:nth-child(2) { animation-delay: .07s; }
.ig-support-hero-inner > *:nth-child(3) { animation-delay: .14s; }
.ig-support-hero-inner > *:nth-child(4) { animation-delay: .21s; }
.ig-support-card { animation: ig-sup-rise .5s ease both; }
.ig-support-card:nth-child(2) { animation-delay: .06s; }
.ig-support-card:nth-child(3) { animation-delay: .12s; }
.ig-support-card:nth-child(4) { animation-delay: .18s; }

@media (max-width: 980px) {
  .ig-support-grid { grid-template-columns: repeat(2, 1fr); }
  .ig-support-contact-grid { grid-template-columns: 1fr; }
  .ig-support-aside { position: static; }
  .ig-support-hero h1 { font-size: 34px; }
}
@media (max-width: 560px) {
  .ig-support-hero { padding: 48px 20px 56px; }
  .ig-support-hero h1 { font-size: 28px; }
  .ig-support-sub { font-size: 16px; }
  .ig-support-grid { grid-template-columns: 1fr; }
  .ig-support-fieldrow { grid-template-columns: 1fr; gap: 0; }
  .ig-support-formcard { padding: 20px; }
  .ig-support-body { padding: 0 16px 56px; }
  .ig-support-article-summary { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ig-support-hero-inner > *, .ig-support-card { animation: none; }
  .ig-support-card, .ig-support-article, .ig-support-faq-chev { transition: none; }
}

/* ------ Settings page: form grid + mobile layout ------
   .grid-2 above is scoped to .ig-editor, so settings needs its own
   two-column rule. On mobile the Team and Company tables become
   stacked cards (same pattern as .ig-inv-table on the dashboard)
   and every form drops to one column. Placed at the end of the
   file so it wins over .ig-card > table.ig-table (width/margin). */
.ig-settings .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ig-team-email-field { flex: 1; min-width: 240px; }

@media (max-width: 720px) {
  .ig-settings { margin: 16px auto; padding: 0 12px; }
  .ig-settings h1 { font-size: 20px; margin-bottom: 14px; }
  .ig-settings .ig-card { padding: 14px; }
  .ig-settings-tabs { gap: 2px; }
  .ig-settings-tab { padding: 8px 10px; font-size: 13px; }
  .ig-settings .grid-2 { grid-template-columns: 1fr; }
  .ig-team-email-field { min-width: 160px; }
  .ig-template-accent { flex-wrap: wrap; }
  .ig-card > table.ig-team-table,
  .ig-card > table.ig-company-table,
  .ig-card > table.ig-stripe-table { width: 100%; margin: 0; table-layout: fixed; }
  .ig-team-table thead, .ig-company-table thead, .ig-stripe-table thead { display: none; }
  .ig-team-table > tbody > tr, .ig-company-table > tbody > tr, .ig-stripe-table > tbody > tr {
    display: flex; flex-wrap: wrap; background: #fff;
    border: 2px solid var(--line-2); border-radius: 12px;
    margin-bottom: 12px; padding: 4px 0;
  }
  .ig-team-table > tbody > tr > td, .ig-company-table > tbody > tr > td, .ig-stripe-table > tbody > tr > td {
    display: block; flex: 1 1 100%; border-bottom: 0;
    padding: 7px 12px; box-sizing: border-box; min-width: 0;
    overflow-wrap: anywhere;
  }
  .ig-team-table > tbody > tr > td[data-label]::before,
  .ig-company-table > tbody > tr > td[data-label]::before,
  .ig-stripe-table > tbody > tr > td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--muted); margin-bottom: 2px;
  }
  .ig-company-table input[type=file] { min-width: 0; }
}

/* ------ Navbar on phones ------
   The logged-in right cluster (company + language + plan + user)
   is ~390px wide with full labels — wider than a 390px viewport
   once padding is counted, which pushed every authenticated page
   into horizontal overflow. Compact labels keep it on one row;
   long names ellipsize and the cluster still wraps gracefully. */
@media (max-width: 720px) {
  .ig-nav-inner { padding: 10px 12px; gap: 6px; }
  .ig-brand-name { display: none; }
  .ig-lang summary .name { display: none; }
  .ig-company .name { max-width: 80px; }
  .ig-user-menu-name { max-width: 70px; }
  .ig-right { gap: 4px; }
}
@media (max-width: 480px) {
  .ig-nav-inner { gap: 4px; }
  .ig-company .name { max-width: 56px; }
  .ig-user-menu-name { max-width: 44px; }
  .ig-user-menu-btn { padding: 6px; }
  .ig-company summary, .ig-company-static { padding: 6px 8px; }
  .ig-lang summary { padding: 6px 8px; }
  /* Icon-only plan pill: the name lives in Settings > Plan and on
     /pricing; the pill keeps its link + tooltip. font-size 0 hides
     the bare text node without a markup wrapper. */
  .ig-plan-pill { padding: 4px 7px; font-size: 0; gap: 0; }
  .ig-plan-pill svg { width: 15px; height: 15px; }
}
/* One shared box for both team row actions; danger colours mirror .ig-row-actions .danger. */
.ig-team-btn { padding: 4px 10px; font-size: 12px; }
.ig-team-btn.danger { color: #b91c1c; border-color: #fecaca; }
.ig-team-btn.danger:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
/* -------------------------------------------------------------------- */
/* Public pay pages (/pay/{token}) — guest checkout via Stripe Connect.  */
/* -------------------------------------------------------------------- */
.ig-pay-body { background: linear-gradient(180deg, #ffffff, #f3faf5); min-height: 100vh; margin: 0; display: flex; flex-direction: column; }
.ig-pay-wrap { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 40px 16px 24px; box-sizing: border-box; }
.ig-pay-card { padding: 24px; }
.ig-stripe-table th, .ig-stripe-table td { padding-top: 3px; padding-bottom: 3px; }
.ig-pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ig-pay-issuer { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ig-pay-title { margin: 0; font-size: 22px; line-height: 1.25; color: var(--ink); }
.ig-pay-sub { color: var(--ink-2); font-size: 15px; margin: 8px 0 18px; }
.ig-pay-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.ig-pay-label { color: var(--muted); font-size: 12px; display: block; }
.ig-pay-totals { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 18px; }
.ig-pay-totals td { padding: 6px 0; color: var(--ink-2); }
.ig-pay-totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ig-pay-due-row td { border-top: 1px solid var(--line); padding-top: 10px; font-weight: 700; font-size: 17px; color: var(--ink); }
.ig-pay-btn { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 16px; }
.ig-pay-secure { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; margin: 10px 0 0; text-align: center; }
.ig-pay-state { display: flex; gap: 12px; align-items: flex-start; border-radius: 10px; padding: 14px 16px; font-size: 14px; }
.ig-pay-state p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.ig-pay-state.ok { background: var(--primary-soft); color: var(--primary); }
.ig-pay-state.ok p { color: #2f6b40; }
.ig-pay-state.muted { background: var(--bg-2); color: var(--ink-2); }
.ig-pay-success-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.ig-pay-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
@media (max-width: 480px) {
  .ig-pay-wrap { padding: 20px 12px 16px; }
  .ig-pay-card { padding: 18px 16px; }
  .ig-pay-title { font-size: 19px; }
}
