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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a26;
  --bg-input: #1a1a26;
  --border: #2a2a3a;
  --border-focus: #6366f1;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-bg: rgba(99,102,241,0.1);
  --success: #22c55e;
  --success-bg: rgba(34,197,94,0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245,158,11,0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239,68,68,0.1);
  --info: #3b82f6;
  --info-bg: rgba(59,130,246,0.1);
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === Navbar === */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 0.6rem; }
.logo-icon { width: 32px; height: 32px; }
.brand-text { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 0.4rem; align-items: center; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 0.4rem; }
.mobile-menu { display: none; flex-direction: column; gap: 0.2rem; padding: 0.5rem 1rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg); }
.mobile-menu button { background: none; border: none; color: var(--text); padding: 0.6rem; text-align: left; font-size: 0.95rem; font-family: inherit; cursor: pointer; border-radius: 8px; }
.mobile-menu button:hover { background: var(--bg-card); }

/* === Buttons === */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.87rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.87rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-success { background: var(--success); color: #fff; border: none; padding: 0.55rem 1.2rem; border-radius: var(--radius); font-weight: 600; font-size: 0.87rem; cursor: pointer; font-family: inherit; }

/* === Pages === */
.page { display: none; }
.page.active { display: block; }

/* === Section Headers === */
.section-header { text-align: center; max-width: 600px; margin: 0 auto; padding: 3rem 2rem 1.5rem; }
.section-header h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.section-header p { color: var(--text-muted); font-size: 1.05rem; }

/* === Hero === */
.hero {
  text-align: center;
  padding: 5rem 2rem 2rem;
  max-width: 760px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(99,102,241,0.2);
}
.hero h1 {
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}
.gradient-text {
  background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 3rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 3rem; justify-content: center; flex-wrap: wrap; }
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.8rem; font-weight: 800; color: var(--primary-hover); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* === Steps === */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}
.step-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.step-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* === Features === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  transition: all 0.2s;
  position: relative;
}
.feature-card:hover { border-color: rgba(99,102,241,0.4); transform: translateY(-2px); }
.feature-icon { margin-bottom: 0.6rem; }
.feature-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.feature-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.feature-badge {
  display: inline-block;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

/* === Testimonials === */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.testimonial-stars { color: #f59e0b; font-size: 0.9rem; margin-bottom: 0.5rem; letter-spacing: 2px; }
.testimonial-card > p { font-size: 0.88rem; color: var(--text); line-height: 1.6; margin-bottom: 1rem; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 0.6rem; }
.testimonial-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.testimonial-author strong { font-size: 0.85rem; }
.testimonial-author span { font-size: 0.75rem; color: var(--text-muted); }

/* === CTA Section === */
.cta-section {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(99,102,241,0.05));
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.cta-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.cta-section p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* === Footer === */
.footer { border-top: 1px solid var(--border); padding: 2rem; }
.footer-content { display: flex; justify-content: space-between; align-items: center; max-width: 960px; margin: 0 auto; }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; }
.footer-links { display: flex; gap: 0.5rem; }

/* === Pricing === */
.pricing-page { max-width: 900px; margin: 0 auto; padding: 0 2rem 4rem; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 3rem; }
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
}
.pricing-card-featured { border-color: var(--primary); box-shadow: 0 0 40px rgba(99,102,241,0.15); }
.pricing-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 0.2rem 1rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.pricing-tier { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.pricing-price { font-size: 2.8rem; font-weight: 900; letter-spacing: -0.03em; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.pricing-features { list-style: none; margin-bottom: 1.5rem; }
.pricing-features li {
  padding: 0.35rem 0;
  font-size: 0.87rem;
  padding-left: 1.5rem;
  position: relative;
}
.pricing-features li.included::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.pricing-features li.excluded {
  color: var(--text-dim);
}
.pricing-features li.excluded::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-dim);
}
.pricing-features li.highlight { font-weight: 600; color: var(--primary-hover); }
.pricing-guarantee { text-align: center; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.8rem; }
.pricing-faq { max-width: 600px; margin: 0 auto; }
.pricing-faq h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; text-align: center; }
.faq-item { margin-bottom: 1.2rem; }
.faq-item strong { font-size: 0.92rem; display: block; margin-bottom: 0.2rem; }
.faq-item p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* === Dashboard === */
.dashboard { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.dash-header h2 { font-size: 1.5rem; font-weight: 700; }
.dash-header-actions { display: flex; gap: 0.5rem; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
}
.stat-card-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.stat-card-value { display: block; font-size: 1.5rem; font-weight: 700; margin-top: 0.3rem; }
.stat-card-earned .stat-card-value { color: var(--success); }
.stat-card-warning .stat-card-value { color: var(--warning); }
.stat-card-danger .stat-card-value { color: var(--danger); }
.stat-card-info .stat-card-value { color: var(--info); }

/* Chart */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.chart-header h3 { font-size: 0.95rem; font-weight: 600; }
.chart-container { position: relative; }
.chart-bar-wrap { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 10px; }
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%;
  max-width: 60px;
  background: linear-gradient(180deg, var(--primary), rgba(99,102,241,0.4));
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
  position: relative;
}
.chart-bar:hover { opacity: 0.85; }
.chart-bar-label { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.4rem; }
.chart-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Filter */
.filter-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.filter-tabs { display: flex; gap: 0.3rem; }
.filter-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.filter-tab.active, .filter-tab:hover { background: var(--primary-bg); color: var(--primary); border-color: rgba(99,102,241,0.3); }
.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  font-family: inherit;
  width: 220px;
}
.search-input:focus { outline: none; border-color: var(--border-focus); }

/* === Invoice Table === */
.invoices-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.invoices-table { width: 100%; border-collapse: collapse; }
.invoices-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.invoices-table td { padding: 0.75rem 1rem; font-size: 0.87rem; border-bottom: 1px solid var(--border); }
.invoices-table tr:last-child td { border-bottom: none; }
.invoices-table tr:hover td { background: var(--bg-card-hover); }

.status-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.status-paid { background: var(--success-bg); color: var(--success); }
.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-overdue { background: var(--danger-bg); color: var(--danger); }

.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { margin-bottom: 0.8rem; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.2rem; }

.action-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 0.8rem; font-family: inherit; padding: 0.2rem 0.3rem; font-weight: 500; }
.action-link:hover { text-decoration: underline; }
.action-link.danger { color: var(--danger); }

/* === Clients Page === */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  transition: border-color 0.15s;
}
.client-card:hover { border-color: rgba(99,102,241,0.3); }
.client-card-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.client-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
}
.client-card-header h4 { font-size: 0.95rem; font-weight: 600; }
.client-card-header p { font-size: 0.78rem; color: var(--text-muted); }
.client-stats { display: flex; gap: 1rem; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--border); }
.client-stat { font-size: 0.78rem; }
.client-stat strong { display: block; font-size: 0.95rem; }
.client-card-actions { display: flex; gap: 0.3rem; margin-top: 0.6rem; }

/* === Create Invoice === */
.create-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 2rem;
  max-width: 1250px;
  margin: 0 auto;
  padding: 2rem;
}
.form-panel { min-width: 0; }
.form-panel h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
}
.form-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { margin-bottom: 0.7rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--text); }
.optional { color: var(--text-dim); font-weight: 400; }
.field-help { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.3rem; }
.field-help strong { color: var(--text-muted); }

input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="url"], select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--border-focus); }
textarea { resize: vertical; }
select { cursor: pointer; }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; cursor: pointer; color: var(--text-muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

.hidden { display: none !important; }

/* Logo Upload */
.logo-upload {
  width: 120px;
  height: 60px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
  overflow: hidden;
}
.logo-upload:hover { border-color: var(--primary); }
.logo-upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; color: var(--text-dim); font-size: 0.7rem; }
.logo-upload img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pro-badge-inline { display: inline-block; background: linear-gradient(135deg, #818cf8, #c084fc); color: #fff; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.6rem; font-weight: 700; margin-top: 0.3rem; }

/* Payment Options */
.payment-options { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-card { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.7rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color 0.15s; }
.radio-card:hover { border-color: var(--text-dim); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-bg); }
.radio-card input { margin-top: 0.15rem; }
.radio-card-content { display: flex; flex-direction: column; gap: 0.1rem; }
.radio-card-content strong { font-size: 0.88rem; }
.radio-card-content span { font-size: 0.78rem; color: var(--text-muted); }

/* Line Items */
.line-item {
  display: grid;
  grid-template-columns: 1fr 80px 100px 90px 36px;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
}
.line-item-header {
  display: grid;
  grid-template-columns: 1fr 80px 100px 90px 36px;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.line-item-header span { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.line-item .remove-item { background: none; border: none; color: var(--text-dim); font-size: 1.1rem; cursor: pointer; padding: 0.55rem 0; text-align: center; font-family: inherit; }
.line-item .remove-item:hover { color: var(--danger); }
.line-item .item-total { font-size: 0.88rem; padding: 0.55rem 0; text-align: right; color: var(--text-muted); font-weight: 500; }

.form-actions { display: flex; gap: 0.75rem; margin-top: 1rem; }

/* === Preview Panel === */
.preview-panel { min-width: 0; }
.preview-sticky { position: sticky; top: 70px; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.preview-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; }
.preview-header select { background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.5rem; font-size: 0.78rem; color: var(--text); font-family: inherit; }

/* Invoice Preview (white card) */
.invoice-preview {
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius-lg);
  padding: 2rem;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
}
.invoice-preview-full { max-width: 100%; }
.inv-logo { max-height: 40px; max-width: 150px; margin-bottom: 0.8rem; }
.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.inv-title { font-size: 1.6rem; font-weight: 800; color: #6366f1; letter-spacing: -0.02em; }
.inv-number { font-size: 0.85rem; color: #71717a; margin-top: 0.2rem; }
.inv-from-name { font-weight: 600; text-align: right; }
.inv-from-detail { font-size: 0.78rem; color: #71717a; text-align: right; }

.inv-meta-row { display: flex; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.inv-meta-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: #a1a1aa; font-weight: 600; margin-bottom: 0.1rem; }
.inv-meta-value { font-weight: 600; font-size: 0.88rem; }
.inv-meta-sub { font-size: 0.78rem; color: #71717a; white-space: pre-line; }

.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.inv-table th {
  text-align: left;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  padding: 0.5rem 0;
  border-bottom: 2px solid #e4e4e7;
  font-weight: 600;
}
.inv-table th:last-child, .inv-table td:last-child { text-align: right; }
.inv-table td { padding: 0.5rem 0; border-bottom: 1px solid #f4f4f5; font-size: 0.82rem; }
.inv-empty-row td { color: #a1a1aa; text-align: center !important; padding: 1rem; }

.inv-totals { border-top: 2px solid #e4e4e7; padding-top: 0.8rem; margin-left: auto; width: 220px; }
.inv-total-row { display: flex; justify-content: space-between; padding: 0.25rem 0; font-size: 0.85rem; }
.inv-total-row.discount { color: var(--success); }
.inv-total-grand { font-weight: 700; font-size: 1.1rem; border-top: 2px solid #1a1a2e; padding-top: 0.5rem; margin-top: 0.3rem; }

.inv-notes { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e4e4e7; font-size: 0.78rem; color: #71717a; white-space: pre-wrap; }
.inv-notes:empty { display: none; }

.inv-pay-btn {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}
.inv-pay-btn:hover { background: #818cf8; }

.inv-paid-stamp {
  display: inline-block;
  border: 3px solid #22c55e;
  color: #22c55e;
  padding: 0.3rem 1rem;
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  transform: rotate(-12deg);
  opacity: 0.6;
  margin-top: 1rem;
}

.inv-branding { text-align: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e4e4e7; font-size: 0.7rem; color: #a1a1aa; }

/* === View Invoice === */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.view-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.view-invoice-wrap { max-width: 820px; margin: 0 auto; padding: 0 2rem 3rem; }

/* === Share Page === */
.share-page { min-height: 100vh; background: #f4f4f5; }
.share-wrap { max-width: 820px; margin: 0 auto; padding: 2rem; }
.share-footer { text-align: center; padding: 2rem; color: #71717a; font-size: 0.85rem; }
.share-footer .btn-primary { margin-top: 0.5rem; }
#share-payment-section { margin-top: 1rem; }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; font-family: inherit; }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 1000;
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  box-shadow: var(--shadow);
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

/* === Responsive === */
@media (max-width: 1024px) {
  .create-layout { grid-template-columns: 1fr; }
  .preview-panel { display: none; }
}
@media (max-width: 900px) {
  .features-grid, .testimonials-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.4rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .mobile-menu:not(.hidden) { display: flex; }
  .features-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 3rem 1.5rem 2rem; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .line-item { grid-template-columns: 1fr 60px 80px 70px 30px; }
  .line-item-header { grid-template-columns: 1fr 60px 80px 70px 30px; }
  .dashboard, .create-layout, .view-header, .view-invoice-wrap, .share-wrap { padding: 1rem; }
  .view-actions { width: 100%; }
  .view-actions .btn-ghost, .view-actions .btn-primary { flex: 1; justify-content: center; font-size: 0.78rem; padding: 0.5rem 0.6rem; }
  .invoices-table th:nth-child(3), .invoices-table td:nth-child(3),
  .invoices-table th:nth-child(4), .invoices-table td:nth-child(4) { display: none; }
}
