:root {
  --bg: #f1f3f7;
  --surface: #ffffff;
  --text: #1a1d24;
  --text-muted: #6b7280;
  --border: #e3e7ee;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --input-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --paper-bg: #ffffff;
  --paper-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #181c24;
  --text: #e8eaed;
  --text-muted: #9aa0ab;
  --border: #2a2f3a;
  --accent: #7c83ff;
  --accent-hover: #9aa0ff;
  --input-bg: #1e222c;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  --paper-bg: #ffffff;
  --paper-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

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

.logo {
  font-size: 24px;
  color: var(--accent);
}

.brand h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

/* Buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Theme icon visibility */
.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 240px minmax(360px, 1fr) minmax(420px, 1.1fr);
  gap: 0;
  height: calc(100vh - 73px);
}

.hidden {
  display: none !important;
}

.editor {
  padding: 28px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.preview {
  padding: 28px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

/* Form */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 540px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-section > label,
.field > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.form-row {
  flex-direction: row !important;
  gap: 14px;
}

.form-row .field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Item rows */
.item-row {
  display: grid;
  grid-template-columns: 1fr 70px 90px 90px 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.item-row .input {
  padding: 8px 10px;
  font-size: 13px;
}

.item-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.item-remove:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ===== Invoice Paper (always white for print) ===== */
.invoice-paper {
  background: var(--paper-bg);
  color: #1a1d24;
  width: 100%;
  max-width: 720px;
  min-height: 920px;
  padding: 48px 52px;
  box-shadow: var(--paper-shadow);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}

.invoice-title {
  font-size: 30px;
  font-weight: 800;
  color: #4f46e5;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.invoice-meta {
  text-align: right;
  font-size: 13px;
  color: #6b7280;
}

.invoice-meta strong {
  color: #1a1d24;
  display: block;
  font-size: 14px;
}

.invoice-parties {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 36px;
}

.party-block {
  flex: 1;
}

.party-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9aa0ab;
  margin-bottom: 6px;
}

.party-block .party-content {
  white-space: pre-wrap;
  font-size: 13px;
  color: #1a1d24;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
}

.invoice-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  padding: 10px 12px;
  border-bottom: 2px solid #e3e7ee;
}

.invoice-table th:last-child,
.invoice-table td:last-child {
  text-align: right;
}

.invoice-table td {
  padding: 12px;
  font-size: 13px;
  border-bottom: 1px solid #f0f2f5;
  color: #1a1d24;
}

.invoice-table tr:last-child td {
  border-bottom: none;
}

.totals {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.totals-block {
  width: 260px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.totals-row.muted {
  color: #6b7280;
  font-size: 13px;
}

.totals-row.grand {
  border-top: 2px solid #e3e7ee;
  margin-top: 6px;
  padding-top: 14px;
  font-size: 17px;
  font-weight: 700;
  color: #1a1d24;
}

.invoice-notes {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e3e7ee;
  font-size: 12px;
  color: #6b7280;
  white-space: pre-wrap;
}

.notes-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  color: #9aa0ab;
}

/* Scrollbar styling */
.editor::-webkit-scrollbar,
.preview::-webkit-scrollbar {
  width: 8px;
}

.editor::-webkit-scrollbar-thumb,
.preview::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ===== Sidebar ===== */
.sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.saved-list {
  padding: 10px 10px;
  overflow-y: auto;
  flex: 1;
}

.empty-hint {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 8px;
  line-height: 1.5;
}

.saved-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.saved-item:hover {
  background: var(--bg);
}

.saved-item.active {
  background: rgba(79, 70, 229, 0.08);
}

.saved-item.active .saved-item-title {
  color: var(--accent);
}

.saved-item-info {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.saved-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-item-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.saved-item-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.saved-item-del:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ===== User info in topbar ===== */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.user-email {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost-sm:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ===== Form actions ===== */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ===== Auth Screen ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.app-screen {
  min-height: 100vh;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand .logo {
  font-size: 32px;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.auth-brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.auth-field .input {
  padding: 11px 14px;
  font-size: 14px;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-message {
  font-size: 13px;
  text-align: center;
  margin-top: 16px;
  padding: 0;
  min-height: 18px;
  transition: all 0.2s ease;
}

.auth-message.info {
  color: var(--accent);
}

.auth-message.success {
  color: #10b981;
  font-weight: 600;
}

.auth-message.error {
  color: #ef4444;
  font-weight: 600;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: #ef4444;
  color: #fff;
}

/* ===== Landing Page ===== */
.landing {
  min-height: 100vh;
  background: var(--bg);
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .landing-nav {
  background: rgba(24, 28, 36, 0.85);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand .logo {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 16px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-text {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.btn-text:hover {
  background: var(--border);
}

.btn-lg {
  padding: 13px 24px !important;
  font-size: 15px !important;
}

/* Hero */
.hero {
  max-width: 1140px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  margin-bottom: 24px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 480px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.hero-trust {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.trust-item svg {
  color: #10b981;
  flex-shrink: 0;
}

/* Hero mockup */
.hero-mockup {
  position: relative;
}

.mockup-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-4deg) rotateX(2deg);
  transition: transform 0.4s ease;
}

.mockup-window:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.mockup-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.mockup-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.mockup-dot.red { background: #ff5f57; }
.mockup-dot.yellow { background: #febc2e; }
.mockup-dot.green { background: #28c840; }

.mockup-body {
  padding: 28px;
}

.mockup-invoice {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  color: #1a1d24;
  font-size: 13px;
}

.mi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.mi-title {
  font-size: 22px;
  font-weight: 800;
  color: #4f46e5;
}

.mi-sub {
  font-size: 12px;
  color: #6b7280;
}

.mi-meta {
  text-align: right;
  font-size: 12px;
  color: #6b7280;
}

.mi-meta strong {
  display: block;
  color: #1a1d24;
  font-size: 13px;
}

.mi-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f5;
}

.mi-divider {
  height: 2px;
  background: #e3e7ee;
  margin: 12px 0;
}

.mi-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
}

/* Sections */
.section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-alt {
  max-width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-alt > .section-header,
.section-alt > .steps {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-title-lg {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  transition: all 0.25s ease;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.1);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent);
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Steps */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step {
  flex: 1;
  max-width: 280px;
  text-align: center;
  padding: 0 20px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 18px;
}

.step h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.step-connector {
  flex: 0 0 60px;
  height: 2px;
  background: var(--border);
  margin-top: 24px;
}

/* Security */
.security-wrap {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.security-list {
  list-style: none;
  padding: 0;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.security-list li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
}

.security-list li svg {
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

.security-list li strong {
  color: var(--text);
}

.security-visual {
  display: flex;
  justify-content: center;
}

.shield-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 320px;
  width: 100%;
}

.shield-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  margin-bottom: 18px;
}

.shield-label {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 24px;
}

.shield-stats {
  display: flex;
  justify-content: space-around;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.stat span {
  font-size: 11px;
  color: var(--text-muted);
}

/* CTA */
.cta-section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 80px 24px;
}

.cta-content {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: 24px;
  padding: 64px 40px;
  text-align: center;
  color: #fff;
}

.cta-content h2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta-content p {
  font-size: 17px;
  opacity: 0.9;
  margin-bottom: 32px;
}

.cta-content .btn-primary {
  background: #fff;
  color: var(--accent);
}

.cta-content .btn-primary:hover {
  background: #f0f0f0;
}

.cta-note {
  margin-top: 18px;
  font-size: 13px;
  opacity: 0.75;
  margin-bottom: 0 !important;
}

/* Footer */
.landing-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 48px 24px;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.footer-brand .logo {
  color: var(--accent);
}

.footer-tag {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.footer-link-btn {
  padding: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.footer-link-btn:hover {
  color: var(--text);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

/* Back to home button */
.back-home {
  position: absolute;
  top: 24px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-home:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Landing responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 48px;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-title {
    font-size: 38px;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .security-wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .steps {
    flex-direction: column;
    gap: 32px;
  }

  .step-connector {
    width: 2px;
    height: 32px;
    margin: 0 auto;
    margin-top: 0;
  }

  .nav-links {
    display: none;
  }

  .section-title-lg {
    font-size: 28px;
  }

  .cta-content {
    padding: 40px 24px;
  }

  .cta-content h2 {
    font-size: 26px;
  }
}

@media (max-width: 560px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 32px;
  }

  .nav-actions .btn-text {
    display: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 200px minmax(320px, 1fr) minmax(380px, 1fr);
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 200px;
  }

  .editor {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .preview {
    padding: 16px;
  }

  .user-email {
    display: none;
  }
}

@media (max-width: 560px) {
  .item-row {
    grid-template-columns: 1fr 60px 80px 80px 32px;
  }

  .invoice-paper {
    padding: 32px 24px;
  }

  .invoice-parties {
    flex-direction: column;
    gap: 20px;
  }

  .topbar {
    padding: 14px 16px;
  }

  .brand h1 {
    font-size: 16px;
  }
}
