/* ── Base ───────────────────────────────────────────────────────────────── */
body { font-family: Arial, sans-serif; margin: 0; background: #f6f8fb; color: #1f2937; }
header { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: #1e3a5f; color: white; }
header a { color: white; text-decoration: none; }
.header-logo-link { display: flex; align-items: center; }
.header-logo { height: 95px; width: auto; display: block; }
main { max-width: 1060px; margin: 20px auto; padding: 0 16px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card { background: white; border-radius: 10px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

/* ── Forms ──────────────────────────────────────────────────────────────── */
form { display: grid; gap: 10px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { display: grid; gap: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid .span2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
label { display: grid; gap: 4px; font-size: 14px; }
input, select { padding: 8px; border-radius: 6px; border: 1px solid #d1d5db; font-size: 14px; }
small { color: #6b7280; font-size: 12px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
button, .btn {
  background: #6abf2e; color: white; border: none; cursor: pointer;
  text-decoration: none; display: inline-block; padding: 8px 14px;
  border-radius: 6px; font-size: 14px; white-space: nowrap;
}
.btn.secondary, button.secondary { background: #4b5563; }
.btn.btn-sm, button.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn.btn-danger, button.btn-danger { background: #dc2626; }
button:hover, .btn:hover { opacity: 0.88; }

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flashes { list-style: none; padding: 0 16px; margin: 8px 0; }
.flashes li { padding: 10px 14px; margin-bottom: 6px; border-radius: 6px; font-size: 14px; }
.flashes .error { background: #fee2e2; color: #991b1b; }
.flashes .success { background: #dcfce7; color: #166534; }
.flashes .info { background: #dbeafe; color: #1e40af; }
.flashes .warning { background: #fef3c7; color: #92400e; }

/* ── Email verification banner ───────────────────────────────────────────── */
.email-verify-banner {
  background: #fef3c7; color: #92400e; padding: 8px 20px; font-size: 13px;
  text-align: center; border-bottom: 1px solid #fde68a;
}
.email-verify-banner a { color: #92400e; font-weight: 600; }

/* ── Table ──────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 8px 6px; text-align: left; }
th { background: #f9fafb; font-weight: 600; }
td.amount { font-variant-numeric: tabular-nums; }
td.actions { vertical-align: middle; }
.actions-wrap { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
td.actions form { display: inline; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; font-size: 15px; border-radius: 6px; border: 1px solid; cursor: pointer; line-height: 1; background: transparent; }
.btn-icon.edit { color: #2563eb; border-color: rgba(37,99,235,0.35); text-decoration: none; }
.btn-icon.edit:hover { background: rgba(37,99,235,0.12); }
.btn-icon.delete { color: #dc2626; border-color: rgba(220,38,38,0.35); }
.btn-icon.delete:hover { background: rgba(220,38,38,0.12); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-admin { background: #e6f5d8; color: #3d7a0f; }
.badge-member { background: #f3f4f6; color: #374151; }
.badge-accountant { background: #f3e8ff; color: #7c3aed; }
.badge-accounted { background: #dcfce7; color: #166534; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-partial { background: #fef9c3; color: #854d0e; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-income { background: #dcfce7; color: #166534; display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-expense { background: #fee2e2; color: #991b1b; display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }

/* ── OneDrive status ────────────────────────────────────────────────────── */
.onedrive-status { font-size: 13px; font-weight: 600; }
.onedrive-status.connected { color: #16a34a; }
.onedrive-status.disconnected { color: #dc2626; }

/* ── Dashboard company cards ────────────────────────────────────────────── */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 16px; }
.company-card {
  background: white; border-radius: 10px; padding: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-decoration: none; color: #1f2937;
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 12px;
}
.company-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.13); transform: translateY(-2px); }
.company-card-header { display: flex; justify-content: space-between; align-items: center; }
.company-name { font-weight: 700; font-size: 16px; }
.company-card-stats { display: flex; gap: 16px; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-weight: 700; font-size: 18px; }
.stat-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }

/* ── Company detail header ──────────────────────────────────────────────── */
.company-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.onedrive-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.receipts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.receipts-header h3 { margin: 0; }

/* ── Filter form ────────────────────────────────────────────────────────── */
.filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.filter-form input, .filter-form select { padding: 6px 8px; }
.filter-date { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }

/* ── Invitations ────────────────────────────────────────────────────────── */
.invitations-details { margin-top: 12px; }
.invitations-details summary { cursor: pointer; font-size: 14px; color: #4b5563; }
.invitation-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.invitation-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.inv-status { padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.inv-status.accepted { background: #dcfce7; color: #166534; }
.inv-status.expired { background: #fee2e2; color: #991b1b; }
.inv-status.pending { background: #fef9c3; color: #854d0e; }
.inv-expires { color: #9ca3af; font-size: 12px; }

/* ── Role select ────────────────────────────────────────────────────────── */
.role-select { padding: 4px 6px; font-size: 13px; }

/* ── Loading spinner overlay ────────────────────────────────────────────── */
.upload-spinner-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.upload-spinner-overlay.hidden { display: none; }
.upload-spinner-img {
  width: 80px; height: 80px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Scanner upload ─────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.file-input-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.file-btn { cursor: pointer; }
.file-name-display { font-size: 13px; color: #6b7280; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin-top: 10px; border: 2px dashed #d1d5db; border-radius: 8px; padding: 20px 16px; background: #f9fafb; cursor: pointer; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.drag-over { border-color: #6abf2e; background: #f0fae8; }
.drop-zone-icon { font-size: 28px; line-height: 1; }
.drop-zone-text { font-size: 14px; font-weight: 600; color: #374151; }
.drop-zone-hint { font-size: 12px; color: #9ca3af; }

/* Scan preview panel */
.scan-preview { margin-top: 8px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; background: #f9fafb; }
.scan-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.scan-col { display: flex; flex-direction: column; gap: 8px; }
.scan-preview-label { margin: 0; font-size: 13px; color: #4b5563; font-weight: 600; }

/* Canvases */
.scan-canvas { width: 100%; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; display: block; }
.interactive-canvas { cursor: crosshair; touch-action: none; user-select: none; }

/* Corner control buttons */
.scan-corner-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-corner-btns button { font-size: 13px; padding: 5px 10px; }

/* Mode selector */
.scan-mode-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scan-mode-label { font-size: 13px; color: #4b5563; white-space: nowrap; }
.scan-mode-btn { background: #e5e7eb; color: #374151; font-size: 13px; padding: 4px 12px; border-radius: 99px; border: none; cursor: pointer; }
.scan-mode-btn.active { background: #6abf2e; color: white; }
.scan-mode-btn:hover { opacity: 0.85; }

/* Sliders */
.scan-sliders { display: grid; gap: 6px; }
.scan-sliders label { display: grid; gap: 2px; font-size: 13px; color: #374151; }
.scan-sliders input[type=range] { width: 100%; accent-color: #6abf2e; cursor: pointer; height: 4px; }

.scan-checkbox { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }


/* ── Envelopes ──────────────────────────────────────────────────────────── */
.envelope-create-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.envelope-create-form input { flex: 1; min-width: 160px; }

.envelope-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.envelope-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.envelope-card:hover { border-color: #6abf2e; box-shadow: 0 2px 8px rgba(106,191,46,.15); }
.envelope-name { font-weight: 600; font-size: 15px; color: #1e3a5f; }
.envelope-meta { font-size: 12px; color: #6b7280; }
.envelope-desc-small { font-size: 12px; color: #9ca3af; }

.envelope-badge { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #e6f5d8; color: #3d7a0f; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.envelope-badge:hover { background: #d0ecb0; }

.envelope-select { font-size: 13px; padding: 3px 6px; }

/* ── Accounted state ────────────────────────────────────────────────────── */
.accounted-row { background: #f0fdf4; }
.accounted-cell { white-space: nowrap; }
.btn-accounted { background: #22c55e; color: #fff; border: none; }
.btn-accounted:hover { background: #16a34a; }
.btn-unaccounted { background: #e5e7eb; color: #374151; border: none; }
.btn-unaccounted:hover { background: #d1d5db; }

/* ── Envelope detail stats ──────────────────────────────────────────────── */
.envelope-stats { font-size: 14px; color: #4b5563; margin-bottom: 12px; }
.envelope-desc { color: #6b7280; margin: 4px 0 0; }
.text-muted { color: #9ca3af; font-size: 14px; }

/* ── Modal overlay ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 1000; overflow-y: auto; padding: 24px 16px;
}
.modal-box {
  background: white; border-radius: 12px; width: 100%; max-width: 740px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22); display: flex; flex-direction: column;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 12px; border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: #6b7280; padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: #f3f4f6; color: #111827; }
.modal-body { padding: 16px 20px; overflow-y: auto; max-height: calc(100vh - 120px); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid #e5e7eb; margin-top: 14px; }

/* ── AI extraction banner ────────────────────────────────────────────────── */
.ai-extraction-banner { border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.ai-extraction-banner.hidden { display: none; }
.ai-extraction-banner.loading { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ai-extraction-banner.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ai-extraction-banner.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Company detail header actions ─────────────────────────────────────── */
.company-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Envelope actions row ───────────────────────────────────────────────── */
.envelope-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-success { background: #16a34a; color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #d97706; color: white; }
.btn-warning:hover { background: #b45309; }

/* ── Closed envelope badges ─────────────────────────────────────────────── */
.badge-closed { background: #fef3c7; color: #92400e; font-size: 11px; padding: 1px 6px; border-radius: 99px; }
.badge-closed-pill { background: #fef3c7; color: #92400e; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; margin-left: 8px; }

/* ── Settings tabs ──────────────────────────────────────────────────────── */
.settings-tabs { display: flex; gap: 6px; margin-bottom: 0; padding: 0 0 0 2px; }
.tab-btn {
  background: #e5e7eb; color: #374151; border: none; cursor: pointer;
  padding: 9px 20px; border-radius: 8px 8px 0 0; font-size: 14px; font-weight: 600;
  border-bottom: 3px solid transparent;
}
.tab-btn.active { background: white; color: #6abf2e; border-bottom-color: #6abf2e; box-shadow: 0 2px 6px rgba(0,0,0,0.07); }
.tab-btn:hover:not(.active) { background: #d1d5db; }
.tab-panel { border-radius: 0 10px 10px 10px; margin-top: 0; }

/* ── Presets grid ───────────────────────────────────────────────────────── */
.presets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.preset-group h4 { margin: 0 0 10px; font-size: 14px; color: #374151; }
.preset-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 5px; }
.preset-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; background: #f9fafb; border-radius: 6px; font-size: 14px; }
.preset-list li form { display: inline; }
.preset-add-form { margin-top: 4px; }
.preset-add-form input { flex: 1; }

/* ── Responsive table wrapper ───────────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 600px; }

/* ── Header nav buttons ─────────────────────────────────────────────────── */
header nav { display: flex; align-items: center; gap: 10px; }
.header-username { font-size: 14px; color: rgba(255,255,255,0.85); }
.header-nav-btn { font-size: 13px; padding: 6px 14px; }

/* ── Language switcher ──────────────────────────────────────────────────── */
.lang-switcher { display: flex; gap: 0; border: 1px solid rgba(255,255,255,0.35); border-radius: 5px; overflow: hidden; margin-left: 6px; }
.lang-btn { font-size: 12px; font-weight: 700; padding: 4px 10px; color: rgba(255,255,255,0.65); text-decoration: none; transition: background 0.15s, color 0.15s; letter-spacing: 0.03em; }
.lang-btn + .lang-btn { border-left: 1px solid rgba(255,255,255,0.35); }
.lang-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.lang-btn.active { background: rgba(255,255,255,0.22); color: #fff; }

/* ── Landing page — layout overrides ───────────────────────────────────── */
.lp-full { max-width: 100%; padding: 0; margin: 0; }

/* When the landing page is active, remove the main padding restriction */
body:has(.lp-hero) main { max-width: 100%; padding: 0; margin: 0; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.lp-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
  background: linear-gradient(135deg, #1e3a5f 0%, #25507f 100%);
  padding: 72px clamp(20px, 6vw, 120px);
  color: white;
}
.lp-hero-inner { flex: 1; min-width: 260px; max-width: 560px; }
.lp-hero-title {
  font-size: clamp(32px, 5vw, 54px); font-weight: 800;
  line-height: 1.15; margin: 0 0 20px; letter-spacing: -0.02em;
}
.lp-hero-sub {
  font-size: clamp(15px, 2vw, 18px); line-height: 1.65;
  color: rgba(255,255,255,0.82); margin: 0 0 32px;
}
.lp-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-btn-primary { background: #6abf2e; font-size: 15px; padding: 12px 28px; }
.lp-btn-secondary { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.4); font-size: 15px; padding: 12px 28px; }
.lp-btn-secondary:hover { background: rgba(255,255,255,0.25); opacity: 1; }

/* Receipt mockup visual */
.lp-hero-visual { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.lp-receipt-mockup {
  background: white; border-radius: 12px; padding: 28px 32px;
  width: 220px; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; gap: 10px;
}
.lp-receipt-line { height: 10px; border-radius: 4px; background: #e5e7eb; }
.lp-line-title { width: 80%; background: #1e3a5f; height: 13px; }
.lp-line-long { width: 90%; }
.lp-line-med { width: 65%; }
.lp-line-short { width: 45%; }
.lp-line-label { width: 40%; }
.lp-line-amount { width: 30%; background: #6abf2e; }
.lp-receipt-divider { height: 1px; background: #e5e7eb; margin: 4px 0; }
.lp-receipt-total { display: flex; justify-content: space-between; align-items: center; }

/* ── Generic section ────────────────────────────────────────────────────── */
.lp-section {
  padding: 72px clamp(20px, 6vw, 120px);
  max-width: 1200px; margin: 0 auto;
}
.lp-section-alt {
  background: #f0f4f8;
  max-width: 100%;
  padding: 72px clamp(20px, 6vw, 120px);
}
.lp-section-alt > * { max-width: 800px; margin-left: auto; margin-right: auto; }
.lp-section-title {
  font-size: clamp(22px, 3vw, 32px); font-weight: 700;
  color: #1e3a5f; text-align: center; margin: 0 0 48px;
}

/* ── Feature cards ──────────────────────────────────────────────────────── */
.lp-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.lp-feature-card {
  background: white; border-radius: 12px; padding: 28px 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  transition: box-shadow .2s, transform .2s;
}
.lp-feature-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.12); transform: translateY(-3px); }
.lp-feature-icon { font-size: 36px; margin-bottom: 14px; }
.lp-feature-card h3 { font-size: 17px; font-weight: 700; color: #1e3a5f; margin: 0 0 10px; }
.lp-feature-card p { font-size: 14px; color: #4b5563; line-height: 1.6; margin: 0; }

/* ── Steps ──────────────────────────────────────────────────────────────── */
.lp-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 28px; }
.lp-step { display: flex; gap: 20px; align-items: flex-start; }
.lp-step-num {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: #6abf2e; color: white; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.lp-step strong { display: block; font-size: 16px; color: #1e3a5f; margin-bottom: 6px; }
.lp-step p { font-size: 14px; color: #4b5563; line-height: 1.6; margin: 0; }

/* ── CTA banner ─────────────────────────────────────────────────────────── */
.lp-cta-banner {
  background: #6abf2e; color: white;
  text-align: center; padding: 60px clamp(20px, 6vw, 120px);
}
.lp-cta-banner h2 { font-size: clamp(22px, 3vw, 32px); margin: 0 0 12px; }
.lp-cta-banner p { font-size: 16px; margin: 0 0 28px; opacity: 0.9; }
.lp-cta-banner .lp-btn-primary { background: white; color: #3d7a0f; font-weight: 700; font-size: 16px; padding: 14px 36px; }
.lp-cta-banner .lp-btn-primary:hover { opacity: 0.92; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.lp-footer {
  background: #1e3a5f; color: rgba(255,255,255,0.75);
  padding: 56px clamp(20px, 6vw, 120px) 0;
}
.lp-footer-inner {
  display: flex; flex-wrap: wrap; gap: 40px;
  max-width: 1200px; margin: 0 auto 40px;
}
.lp-footer-brand { flex: 1; min-width: 200px; }
.lp-footer-logo { height: 52px; width: auto; display: block; margin-bottom: 12px; }
.lp-footer-tagline { font-size: 14px; margin: 0; }
.lp-footer-links, .lp-footer-contact { flex: 0 0 auto; min-width: 160px; }
.lp-footer h4 { color: white; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 14px; }
.lp-footer-links ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lp-footer-links a, .lp-footer-contact a { color: rgba(255,255,255,0.75); font-size: 14px; text-decoration: none; }
.lp-footer-links a:hover, .lp-footer-contact a:hover { color: white; text-decoration: underline; }
.lp-footer-contact address { font-style: normal; font-size: 14px; line-height: 1.7; }
.lp-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 18px 0; text-align: center; font-size: 13px;
  max-width: 1200px; margin: 0 auto;
}

/* ── Legal pages ─────────────────────────────────────────────────────────── */
.lp-legal-page h3 { font-size: 16px; color: #1e3a5f; margin: 24px 0 8px; }
.lp-legal-page p, .lp-legal-page li { font-size: 14px; line-height: 1.7; color: #374151; }
.lp-legal-page ul { padding-left: 20px; }
.lp-legal-updated { color: #9ca3af; font-size: 13px; margin: 0 0 20px; }
.lp-legal-page a { color: #1e3a5f; }

/* ── Mobile (≤ 640 px) ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 0 10px; }

  /* Upload modal drag & drop */
  .drop-zone { display: none; }

  /* Header */
  header { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
  .header-logo { height: 90px; }
  header nav { font-size: 13px; display: flex; gap: 8px; align-items: center; }
  .header-username { display: none; }
  .header-nav-btn { font-size: 12px; padding: 5px 10px; }

  /* Landing page — hero */
  body:has(.lp-hero) main { padding: 0; }
  .lp-hero { padding: 48px 20px; flex-direction: column; }
  .lp-hero-visual { display: none; }
  .lp-section { padding: 48px 20px; }
  .lp-section-alt { padding: 48px 20px; }
  .lp-cta-banner { padding: 48px 20px; }
  .lp-footer { padding: 40px 20px 0; }
  .lp-footer-inner { gap: 28px; }

  /* Cards */
  .card { padding: 14px; }

  /* Company header */
  .company-header { flex-direction: column; align-items: flex-start; }
  .company-header-actions { width: 100%; }
  .company-header-actions .btn { flex: 1; text-align: center; }

  /* Receipts header */
  .receipts-header { flex-wrap: wrap; gap: 8px; }

  /* Filter form — stack vertically */
  .filter-form { flex-direction: column; align-items: stretch; }
  .filter-form input,
  .filter-form select { width: 100%; box-sizing: border-box; }
  .filter-date { flex-direction: row; align-items: center; gap: 8px; }
  .filter-date input { flex: 1; min-width: 0; }
  .filter-form .btn { align-self: flex-start; }

  /* Envelope create form — stack vertically */
  .envelope-create-form { flex-direction: column; }
  .envelope-create-form input,
  .envelope-create-form select,
  .envelope-create-form button { width: 100%; box-sizing: border-box; min-width: unset; }

  /* Envelope actions */
  .envelope-actions { width: 100%; }
  .envelope-actions .btn,
  .envelope-actions button { flex: 1; text-align: center; }

  /* Form grid — single column */
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }

  /* Form actions */
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn,
  .form-actions button { flex: 1; text-align: center; }

  /* Settings tabs */
  .settings-tabs { flex-wrap: wrap; }
  .tab-btn { flex: 1; text-align: center; padding: 8px 10px; font-size: 13px; }

  /* Table: force horizontal scroll, compact padding */
  .table-scroll table { min-width: 520px; }
  th, td { padding: 6px 5px; font-size: 13px; }
  .btn.btn-sm, button.btn-sm { font-size: 12px; padding: 4px 8px; }
}
