/**
 * YourSellerTeam - High-Performance Minimalist Design System
 * Inspired by ihatepdf.cv (Fast, clean, zero-bloat, system UI fonts)
 */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Light Palette */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: #eff6ff;
  
  --accent-emerald: #16a34a;
  --accent-emerald-light: #f0fdf4;
  --accent-amber: #d97706;
  --accent-red: #dc2626;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);

  /* Unified Mappings */
  --bg: var(--bg-primary);
  --ink: var(--text-primary);
  --muted: var(--text-muted);
  --panel: var(--bg-surface);
  --card: var(--bg-surface);
  --line: var(--border);
  --accent: var(--accent-blue);
  --good: var(--accent-emerald);
  --warn: var(--accent-amber);
  --bad: var(--accent-red);
  --radius: 8px;
}

body.dark-theme,
html.dark body {
  --bg-primary: #09090b;
  --bg-surface: #18181b;
  --bg-surface-hover: #1c1c1f;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-light: rgba(59, 130, 246, 0.15);

  --accent-emerald: #22c55e;
  --accent-emerald-light: rgba(34, 197, 94, 0.15);
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);

  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* ==========================================================================
   Universal Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   ihatepdf.cv Signature Minimalist Cards & Grid
   ========================================================================== */
.ihp-card,
.page-card {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ihp-card:hover,
.page-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.ihp-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.ihp-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.ihp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.ihp-category {
  margin: 0 0 40px;
}

.ihp-category h2,
.ihp-category-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* Badges & Trust Dots */
.ihp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.ihp-badge,
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ihp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* ==========================================================================
   Clean Buttons
   ========================================================================== */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.2;
}

.btn-primary,
.btn.primary {
  background: var(--accent-blue);
  color: #ffffff !important;
  border-color: var(--accent-blue);
}

.btn-primary:hover,
.btn.primary:hover {
  background: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
}

.btn-secondary,
.btn.ghost,
.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-primary) !important;
  border-color: var(--border);
}

.btn-secondary:hover,
.btn.ghost:hover,
.btn-ghost:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

/* ==========================================================================
   Tool Workspace Components (Panels, Tables, Inputs)
   ========================================================================== */
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.topbar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-top: 14px;
}

.metric {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.metric .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.metric .value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

.metric .note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th, td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--bg-surface-hover);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

tbody tr:hover {
  background: var(--bg-surface-hover);
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="file"],
input[type="search"],
select,
textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-blue);
}

/* ==========================================================================
   Unified Minimalist Shell Header & Dropdown
   ========================================================================== */
.site-header,
.yst-shell-navbar,
#yst-shell-header {
  position: sticky;
  top: 0;
  z-index: 2100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  height: 54px;
  display: flex;
  align-items: center;
}

.site-nav,
.yst-nav-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.yst-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-mark,
.yst-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.yst-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.yst-links a:hover {
  color: var(--text-primary);
}

/* Tools Menu Dropdown (Floating Modal) */
.yst-tools-menu-wrap,
.nav-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.yst-tools-toggle,
.nav-tools button {
  background: transparent;
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.yst-tools-toggle:hover,
.nav-tools button:hover {
  color: var(--text-primary);
}

.yst-tools-menu,
.tools-dropdown {
  display: none !important;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 6px;
  z-index: 2500;
}

.yst-tools-menu-wrap:hover .yst-tools-menu,
.yst-tools-menu-wrap.is-open .yst-tools-menu,
.nav-tools:hover .tools-dropdown,
.nav-tools.is-open .tools-dropdown {
  display: flex !important;
  flex-direction: column;
}

.yst-tools-menu a,
.tools-dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.1s ease;
}

.yst-tools-menu a:hover,
.tools-dropdown a:hover {
  background: var(--bg-surface-hover);
}

.yst-tools-menu a strong,
.tools-dropdown a strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
}

.yst-tools-menu a small,
.tools-dropdown a small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Suppression rules */
[hidden],
[aria-hidden="true"],
.yst-mobile-menu,
#yst-mobile-menu,
.nav-spacer,
.yst-shell-spacer,
.navbar:not(.yst-shell-navbar),
nav.navbar:not(.yst-shell-navbar),
nav.yst-nav:not(.yst-shell-navbar),
.yst-nav:not(.yst-shell-navbar),
.auth-bar,
.auth-gate,
#authGate,
.yst-account-mini,
#yst-account-mini,
#logoutBtn,
#yst-logout-btn,
.whatsapp-float,
[class*="whatsapp"] {
  display: none !important;
}

/* Shell Banner & Right CTA */
.yst-announcement-banner {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-secondary);
}

.yst-banner-link {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: underline;
  margin-left: 6px;
}

.yst-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yst-shell-cta {
  background: var(--accent-blue);
  color: #ffffff !important;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.yst-shell-cta:hover {
  background: var(--accent-blue-hover);
}

#yst-shell-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 32px 16px;
  margin-top: 60px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.yst-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.yst-footer-inner h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.yst-footer-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

.yst-footer-tools a {
  color: var(--text-muted);
  text-decoration: none;
}

.yst-footer-tools a:hover {
  color: var(--accent-blue);
}


/* ==========================================================================
   InvoiceFlow Additions
   ========================================================================== */

/**
 * InvoiceFlow - Professional Corporate Edition
 * Styled with LinkedIn-inspired B2B Executive Aesthetic
 */

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --soft: #f1f5f9;
  --blue: #0a66c2;
  --blue-dark: #004182;
  --blue-light: #e8f3fc;
  --blue-border: #cbe4f9;
  --green: #059669;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 500px at 15% 5%, rgba(10, 102, 194, 0.06), transparent 28rem),
    radial-gradient(800px 400px at 90% 10%, rgba(37, 99, 235, 0.04), transparent 24rem),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

/* ==========================================================================
   Header (LinkedIn Executive Bar)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1.2rem, 4vw, 3.5rem);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.brand, .app-header nav, .pill-row, .hero-actions, .preview-toolbar, .app-footer, .app-footer nav {
  display: flex;
  align-items: center;
}

.brand { gap: 0.75rem; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.brand span {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 6px;
  color: white;
  background: var(--blue);
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(10, 102, 194, 0.3);
}

.app-header nav { gap: 1.2rem; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.app-header nav a:not(.nav-cta):hover { color: var(--blue); }
.nav-cta {
  color: white;
  background: var(--blue);
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(10, 102, 194, 0.25);
  transition: all 0.18s ease;
}
.nav-cta:hover {
  background: var(--blue-dark);
  color: white;
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 6vw, 5.5rem) clamp(1.2rem, 4vw, 3.5rem) 2.5rem;
}

.hero h1 {
  margin: 1.2rem 0 1rem;
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--ink);
}

.hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.65;
}

.pill-row { flex-wrap: wrap; gap: 0.7rem; }
.pill-row span, .eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--blue-border);
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 9999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-actions { flex-wrap: wrap; gap: 0.85rem; margin-top: 1.8rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: 9999px;
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover { transform: translateY(-1px); }

.primary {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25);
}
.primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: white;
  box-shadow: 0 4px 14px rgba(10, 102, 194, 0.35);
}

.secondary, .ghost {
  color: var(--blue);
  background: white;
  border: 1.5px solid var(--blue);
}
.secondary:hover {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.ghost {
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
}
.ghost:hover {
  background: var(--soft);
  color: var(--ink);
}

/* ==========================================================================
   Hero Preview Card (Corporate Mockup)
   ========================================================================== */
.hero-card {
  min-height: 400px;
  border-radius: 1.25rem;
  padding: 1.2rem;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: perspective(1000px) rotateY(-6deg) rotateX(3deg);
  border-top: 3px solid var(--blue);
}

.mini-invoice {
  height: 100%;
  border-radius: 0.85rem;
  padding: 1.8rem;
  background: #f8fafc;
  border: 1px solid var(--line);
}
.mini-invoice div { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.mini-invoice span { width: 3.5rem; height: 3.5rem; border-radius: 8px; background: var(--blue); box-shadow: 0 2px 8px rgba(10, 102, 194, 0.25); }
.mini-invoice i { display: block; height: 0.75rem; border-radius: 4px; background: var(--line); margin: 0.9rem 0; }
.mini-invoice i:nth-child(3) { width: 70%; }
.mini-invoice b { display: block; margin-top: 3.5rem; color: var(--blue); font-size: 2.2rem; font-weight: 800; }

/* ==========================================================================
   Builder Shell (Executive Form & Live Sheet)
   ========================================================================== */
.builder-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 1.5rem;
  padding: 1rem clamp(1.2rem, 4vw, 3.5rem) 4rem;
  align-items: start;
}

.builder-panel, .preview-panel, .price-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: var(--shadow);
}
.builder-panel { padding: 1.5rem; }
.panel-heading h2, .section-copy h2 {
  margin: 0.6rem 0 1rem;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
}

fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 1.2rem 0;
}
legend { padding-right: 0.8rem; font-weight: 700; color: var(--ink); font-size: 0.95rem; }
label { display: grid; gap: 0.45rem; color: var(--ink); font-size: 0.82rem; font-weight: 600; margin-bottom: 0.85rem; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0.7rem 0.85rem;
  outline: none;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.15);
}
textarea { resize: vertical; }

.two-col, .three-col, .four-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
.three-col { grid-template-columns: repeat(3, 1fr); }
.four-col { grid-template-columns: repeat(4, 1fr); }

.upload-box input { padding: 0.55rem; background: var(--soft); }
.cloud-save {
  border-radius: 8px;
  border: 1px solid var(--blue-border);
  padding: 1rem;
  background: var(--blue-light);
}
.cloud-save p { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.cloud-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

.line-item {
  display: grid;
  grid-template-columns: 1.2fr 0.45fr 0.7fr auto;
  gap: 0.6rem;
  align-items: end;
}
.remove-item {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 6px;
  border: 1px solid #fecaca;
  color: #dc2626;
  background: #fff1f2;
  cursor: pointer;
  transition: background 0.15s ease;
}
.remove-item:hover { background: #fee2e2; }

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
  font-size: 0.88rem;
}
.text-button:hover { text-decoration: underline; }

.signature-block {
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.signature-block div { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.82rem; }
canvas { width: 100%; height: 120px; background: white; border: 1px dashed var(--line-strong); border-radius: 6px; touch-action: none; }

/* ==========================================================================
   Preview Panel
   ========================================================================== */
.preview-panel { position: sticky; top: 5rem; padding: 1.2rem; }
.preview-toolbar { justify-content: space-between; align-items: end; gap: 0.8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar-field { min-width: 145px; margin: 0; color: var(--muted); font-size: 0.76rem; font-weight: 700; }
.toolbar-field select { margin-top: 0.35rem; min-width: 145px; max-width: 180px; }
#planBadge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
  border-radius: 9999px;
  padding: 0.4rem 0.8rem;
}

.invoice-preview {
  position: relative;
  min-height: 720px;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.pdf-export-wrap {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  background: #ffffff;
  opacity: 1;
  pointer-events: none;
  overflow: hidden;
  box-sizing: border-box;
}
.invoice-preview.pdf-export {
  min-height: auto;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  transform: none;
  font-family: "Inter", Arial, sans-serif;
  box-sizing: border-box;
  max-width: none;
}
.invoice-preview.pdf-export,
.invoice-preview.pdf-export * {
  color-adjust: exact;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.invoice-preview.pdf-export .invoice-title { font-size: 32px; }
.invoice-preview.pdf-export .watermark {
  left: 50%;
  top: 72%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%) rotate(-18deg);
  color: rgba(10, 102, 194, 0.06);
  font-size: 44px;
  line-height: 1;
  white-space: nowrap;
}
.invoice-preview.pdf-export .invoice-top,
.invoice-preview.pdf-export .invoice-parties,
.invoice-preview.pdf-export .invoice-table,
.invoice-preview.pdf-export .invoice-totals,
.invoice-preview.pdf-export .invoice-notes {
  position: relative;
  z-index: 1;
}
.invoice-preview.pdf-export .invoice-parties { gap: 24px; }
.invoice-preview.pdf-export .invoice-parties p,
.invoice-preview.pdf-export .invoice-notes,
.invoice-preview.pdf-export .invoice-table td {
  overflow-wrap: anywhere;
  word-break: normal;
}
.invoice-preview.pdf-export .invoice-table {
  table-layout: fixed;
  width: 100%;
}
.invoice-preview.pdf-export .item-col { width: 46%; }
.invoice-preview.pdf-export .qty-col { width: 11%; }
.invoice-preview.pdf-export .price-col,
.invoice-preview.pdf-export .total-col { width: 21.5%; }
.invoice-preview.pdf-export .item-name {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.invoice-preview.pdf-export .invoice-table th,
.invoice-preview.pdf-export .invoice-table td { padding: 10px 8px; }

.invoice-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 1.4rem; }
.invoice-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 8px; background: var(--soft); }
.invoice-title { margin: 0; font-size: 2rem; letter-spacing: -0.02em; font-weight: 800; color: var(--ink); }
.invoice-meta { text-align: right; color: var(--muted); line-height: 1.65; font-size: 0.9rem; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin: 1.5rem 0; }
.invoice-parties h4, .invoice-table th { color: var(--muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em; font-weight: 700; }
.invoice-parties p { white-space: pre-line; color: var(--ink); line-height: 1.55; }
.invoice-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.invoice-table .item-col { width: 46%; }
.invoice-table .qty-col { width: 11%; }
.invoice-table .price-col,
.invoice-table .total-col { width: 21.5%; }
.invoice-table th { background: #f8fafc; padding: 0.75rem 0.6rem; border-bottom: 2px solid var(--line-strong); text-align: left; }
.invoice-table td { padding: 0.85rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.88rem; }
.invoice-table .item-name { white-space: normal; overflow-wrap: anywhere; word-break: break-word; font-weight: 600; }
.invoice-table td:nth-child(2), .invoice-table td:nth-child(3), .invoice-table td:nth-child(4),
.invoice-table th:nth-child(2), .invoice-table th:nth-child(3), .invoice-table th:nth-child(4) { text-align: right; }
.invoice-totals { width: min(100%, 320px); margin-left: auto; margin-top: 1.2rem; display: grid; gap: 0.65rem; }
.invoice-totals div { display: flex; justify-content: space-between; font-size: 0.9rem; }
.invoice-totals .grand { border-top: 2px solid var(--line); padding-top: 0.7rem; font-size: 1.3rem; font-weight: 800; color: var(--blue); }
.invoice-notes { margin-top: 1.5rem; color: var(--muted); line-height: 1.6; white-space: pre-line; font-size: 0.85rem; }
.signature-image { max-width: 160px; max-height: 70px; margin-top: 1.2rem; object-fit: contain; }

.watermark {
  position: absolute;
  left: 50%;
  top: 74%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%) rotate(-18deg);
  color: rgba(10, 102, 194, 0.06);
  font-size: clamp(2rem, 8vw, 4.4rem);
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
}

.template-stripe { border-top: 6px solid var(--blue); }
.template-notion { font-family: Georgia, "Times New Roman", serif; }
.template-ledger { background: linear-gradient(#fff 31px, #f8fafc 32px); background-size: 100% 32px; }
.template-studio .invoice-title, .template-studio .grand { color: #0a66c2; }
.template-executive { color: #0f172a; border-color: #0a66c2; }
.template-executive .invoice-title { color: #0f172a; }

.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.action-grid .primary { grid-column: 1 / -1; }
.action-status { min-height: 1.35rem; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.action-status.error { color: #dc2626; }
.action-status.success { color: var(--green); }

/* ==========================================================================
   Templates & Pricing
   ========================================================================== */
.templates, .pricing {
  padding: 4rem clamp(1.2rem, 4vw, 3.5rem);
}
.section-copy { max-width: 680px; }
.section-copy p { color: var(--muted); line-height: 1.7; }
.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; gap: 1.2rem; }

.template-grid button {
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.18s ease;
}
.template-grid button:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.template-grid button.active {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.15);
}

.price-card { padding: 1.5rem; }
.price-card h3 { margin: 0.6rem 0; font-size: 1.8rem; letter-spacing: -0.02em; font-weight: 800; color: var(--ink); }
.price-card p { color: var(--muted); line-height: 1.6; }
.price-card.featured { border-color: var(--blue); border-width: 2px; box-shadow: var(--shadow); }

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1.2rem, 4vw, 3.5rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #ffffff;
  font-size: 0.88rem;
}
.app-footer span { font-weight: 700; color: var(--ink); }
.app-footer nav { gap: 1.2rem; flex-wrap: wrap; }
.app-footer nav a:hover { color: var(--blue); }

@media (max-width: 980px) {
  .hero, .builder-shell, .pricing { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
}

@media (max-width: 680px) {
  .app-header { align-items: flex-start; flex-direction: column; }
  .app-header nav { width: 100%; overflow-x: auto; padding-bottom: 0.2rem; }
  .hero { min-height: auto; padding-top: 2rem; }
  .hero-card { display: none; }
  .two-col, .three-col, .four-col, .line-item, .invoice-parties, .template-grid, .action-grid { grid-template-columns: 1fr; }
  .cloud-actions { grid-template-columns: 1fr; }
  .invoice-top { flex-direction: column; }
  .invoice-meta { text-align: left; }
  .invoice-preview { min-height: 680px; }
  .app-footer { align-items: flex-start; flex-direction: column; }
}

@media print {
  body { background: white; }
  .app-header, .hero, .builder-panel, .preview-toolbar, .action-grid, .templates, .pricing, .app-footer { display: none !important; }
  .builder-shell { display: block; padding: 0; }
  .preview-panel { border: 0; box-shadow: none; padding: 0; }
  .invoice-preview { border: 0; border-radius: 0; min-height: auto; }
}
