:root {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --text-main: #1e293b;
  --text-sub: #64748b;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --accent: #1672E6;
  --accent-soft: rgba(22, 114, 230, 0.1);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --glass: rgba(255, 255, 255, 0.82);
}

.dark {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --header-bg: #1e293b;
  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --muted: #64748b;
  --border: #334155;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --glass: rgba(30, 41, 59, 0.82);
  --shadow: 0 4px 20px -8px rgba(0, 0, 0, 0.35);
}

/* Dark mode specific overrides for hardcoded white backgrounds/components */
.dark input:not([type="checkbox"]):not([type="radio"]),
.dark select,
.dark textarea {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

.dark option {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

/* Override inline JS injected white backgrounds on cards/rows */
.dark [style*="background:#fff"],
.dark [style*="background: #fff"],
.dark [style*="background:white"] {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
}

/* Override inline JS injected black text */
.dark [style*="color:#111"],
.dark [style*="color: #111"],
.dark .inv-item-info b {
  color: #f1f5f9 !important;
}

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

html,
body {
  height: 100%
}

body {
  font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 16px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow)
}

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

.btn-outline {
  background: transparent;
  border: 1px solid rgba(15, 116, 230, 0.12);
  color: var(--accent)
}

.btn-ghost {
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.06);
  color: var(--muted)
}

/* ── Sections & Grid ── */
.section {
  padding: 36px 0
}

.section.alt {
  background: #fbfdff
}

.section-title {
  font-size: 22px;
  margin-bottom: 14px
}

.section-tight {
  padding: 50px 0
}

.grid {
  display: grid;
  gap: 16px
}


/* ── Utilities ── */
.small {
  font-size: 13px
}

.muted {
  color: var(--muted)
}

.required {
  color: #d9534f
}

.checklist li {
  margin-bottom: 6px
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: all .6s ease-out;
}

.fade-in.in-view {
  opacity: 1;
  transform: none;
}

.lead {
  font-size: 17px;
  line-height: 1.5
}

.center {
  text-align: center
}

.max-680 {
  max-width: 680px;
  margin: 0 auto
}

.m-top-32 {
  margin-top: 32px
}

.m-top-20 {
  margin-top: 20px
}

.linklike {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600
}

.privacy {
  margin: 14px 0 0
}

.w-full {
  width: 100%
}

/* ── Disabled button ── */
.btn[disabled] {
  opacity: .4;
  cursor: not-allowed
}

/* ── btn-small ── */
.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}

/* Icon-only button tweaks */
.btn-small:has(svg:only-child) {
  padding: 6px 8px;
  min-width: 34px;
}

.invoice-pane {
  max-width: none !important;
  width: 100% !important;
}

/* Mini button style for toolbar */
.btn.mini {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px
}

/* ── Danger button ── */
.danger {
  background: #d9534f;
  color: #fff;
  border: none
}

.danger:disabled {
  background: #e5a3a0;
  cursor: not-allowed
}

.danger:hover:not(:disabled) {
  background: #c6403d
}