/* ============================================================
   Waypenny — Design System
   Light theme, deep green accent, Playfair + Inter typography.
   ============================================================ */

/* ---------- CSS variables (Section 5) ---------- */
:root {
  --white: #ffffff;
  --off-white: #f8f9fa;
  --light-gray: #f1f3f5;
  --border: #e9ecef;
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --accent: #2d6a4f;
  --accent-light: #40916c;
  --accent-pale: #d8f3dc;
  --gold: #e9c46a;
  --gold-pale: #fdf4d4;
  --danger: #e63946;
  --danger-pale: #fde8ea;
  --warning: #f4a261;
  --warning-pale: #fdecd9;
  --success: #2d6a4f;
  --info: #457b9d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --sidebar-w: 240px;
  --bottom-nav-h: 64px;
}

/* ---------- Base reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--off-white);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  cursor: pointer;
}

img { max-width: 100%; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  font-weight: 600;
  line-height: 1.2;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }

p { margin: 0 0 12px 0; }

.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }

.serif { font-family: 'Playfair Display', Georgia, serif; }

.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ---------- App layout (sidebar + main) ---------- */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar-nav a:hover {
  background: var(--off-white);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--accent-pale);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-nav a.nav-disabled {
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.55;
}
.sidebar-nav a.nav-disabled:hover { background: transparent; }

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 14px 12px 6px;
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  justify-content: center;
  font-size: 14px;
  opacity: 0.8;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-user {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.sidebar-legal {
  display: flex;
  gap: 6px;
  justify-content: center;
  font-size: 11px;
  color: var(--text-tertiary, #8a8a8a);
  margin-top: 4px;
}
.sidebar-legal a {
  color: var(--text-tertiary, #8a8a8a);
  text-decoration: none;
}
.sidebar-legal a:hover { text-decoration: underline; }

/* ---------- Workspace switcher (MU-2) ---------- */
.ws-switcher {
  position: relative;
  padding: 10px 10px 4px;
  border-bottom: 1px solid var(--border);
}
.ws-switcher-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
  flex-wrap: wrap;
}
.ws-switcher-trigger:hover { background: var(--light-gray); }
.ws-switcher-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1 1 100%;
  line-height: 1.25;
}
.ws-switcher-meta {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: capitalize;
  flex: 1 1 auto;
}
.ws-switcher-caret {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
}
.ws-switcher-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 10px;
  right: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
.ws-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  cursor: pointer;
}
.ws-option:hover { background: var(--off-white); }
.ws-option.is-active {
  background: var(--accent-pale);
  color: var(--accent);
}
.ws-option-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.ws-option-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-option-meta {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: capitalize;
}
.ws-option-check {
  color: var(--accent);
  font-weight: 700;
}

.main-content {
  margin-left: var(--sidebar-w);
  padding: 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  margin: 0;
  font-size: 2rem;
}
.page-subtitle {
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 24px 0 12px;
}

/* ---------- Stat tile (Section 5) ---------- */
.stat-tile {
  text-align: center;
}
.stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
}
.stat-value.muted { color: var(--text-secondary); }
.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}
.stat-trend {
  font-size: 12px;
  margin-top: 6px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-primary);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  text-decoration: none;
}

.btn-outline {
  background: var(--white);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-pale);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--off-white); text-decoration: none; }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn-danger:hover { opacity: 0.9; text-decoration: none; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-help {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- Tables ---------- */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--off-white);
}
.table tbody tr:hover { background: var(--off-white); }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: var(--light-gray);
  color: var(--text-secondary);
}
.badge-trial   { background: var(--accent-pale); color: var(--accent); }
.badge-active  { background: var(--accent-pale); color: var(--accent); }
.badge-warning { background: var(--warning-pale); color: #b45309; }
.badge-danger  { background: var(--danger-pale);  color: var(--danger); }
.badge-gold    { background: var(--gold-pale);    color: #92740b; }
.badge-info    { background: #e6eef5;             color: var(--info); }

/* ---------- Progress bar ---------- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--light-gray);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.progress-fill.warning { background: var(--gold); }
.progress-fill.danger  { background: var(--danger); }

/* ---------- Banners / alerts ---------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 20px;
}
.banner-warning { background: var(--warning-pale); color: #92400e; border: 1px solid #fcd9b6; }
.banner-danger  { background: var(--danger-pale);  color: var(--danger); border: 1px solid #f8c8cc; }
.banner-info    { background: #e6eef5;             color: var(--info); border: 1px solid #c5d6e3; }

/* WAYMARK P4 (2026-07-14) — workspace banner refined header treatment.
   Refined from the WS-UNIFY block-fill: replaced the solid green
   with a hairline rule so it reads as a page header, not a badge.
   Kept centered + serif so the workspace context is still
   impossible to miss. Tokens only — no hex, no theme drift. */
.workspace-banner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  padding: 4px 0 12px 0;
  border-bottom: 1px solid var(--border, #eee);
  margin-bottom: 20px;
  text-align: center;
}
.workspace-banner-label {
  /* WAYMARK P4 — the "Workspace" prefix is muted small-caps that
     defers to the workspace name. Kept for scannability but no
     longer competes visually with the name. */
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.7;
}
.workspace-banner-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.005em;
  line-height: 1.15;
}
.workspace-banner-type {
  /* WAYMARK P4 — small-caps muted badge, no fill. Sits alongside the
     name as an inline qualifier rather than a colored chip. */
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  opacity: 0.75;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-secondary);
}
.empty-state-icon {
  font-size: 32px;
  opacity: 0.5;
  margin-bottom: 8px;
}
.empty-state-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ---------- Auth pages (signup/login) ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--off-white);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
  text-align: center;
}
.auth-card .auth-sub {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-error {
  background: var(--danger-pale);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-error.visible { display: block; }
.auth-success {
  background: var(--accent-pale);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-success.visible { display: block; }

.btn-google {
  background: var(--white);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-google:hover { background: var(--off-white); text-decoration: none; }

/* ----------------------------------------------------------------
   WAYMARK CLICKWRAP (2026-07-17) — Terms acceptance modal.
   Used by signup.html and accept-terms.html. Blocking overlay.
   ---------------------------------------------------------------- */
.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.terms-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 25, 0.55);
}
.terms-modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--white, #fff);
  border-radius: var(--radius-lg, 10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 32px 32px 24px;
  font-size: 15px;
  line-height: 1.55;
}
.terms-modal-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 4px;
  color: #2d6a4f;
}
.terms-modal-sub {
  font-size: 14px;
  color: #444;
  margin-bottom: 16px;
}
.terms-modal-summary {
  border: 1px solid var(--border, #eee);
  background: #fafaf7;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.55;
  max-height: 260px;
  overflow-y: auto;
}
.terms-modal-summary strong { color: #2d6a4f; }
.terms-modal-summary ul { padding-left: 20px; margin: 8px 0; }
.terms-modal-summary li { margin-bottom: 6px; }
.terms-modal-summary-fine {
  font-size: 12px;
  color: #6b6b6b;
  margin-top: 8px;
}
.terms-modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.terms-modal-links a {
  color: #2d6a4f;
  font-weight: 500;
  text-decoration: underline;
}
.terms-modal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  margin-bottom: 16px;
  font-size: 14px;
}
.terms-modal-check input[type="checkbox"] {
  margin-top: 3px;
  transform: scale(1.15);
  cursor: pointer;
  flex-shrink: 0;
}
.terms-modal-check span a { color: #2d6a4f; text-decoration: underline; }
.terms-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.terms-modal-version {
  font-size: 12px;
  color: #8a8a8a;
  text-align: center;
  margin-top: 6px;
}

/* ---------- Onboarding wizard ---------- */
.wizard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--off-white);
}
.wizard-card {
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
}
.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.wizard-dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
.wizard-dot.active { background: var(--accent); }
.wizard-dot.done   { background: var(--accent-light); }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.choice-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.choice {
  display: block;
  padding: 18px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}
.choice:hover { border-color: var(--accent-light); }
.choice.selected {
  border-color: var(--accent);
  background: var(--accent-pale);
}
.choice-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.choice-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
}

/* ---------- Landing page ---------- */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.landing-nav .brand-name { font-size: 1.25rem; }
.landing-nav .nav-actions { display: flex; gap: 12px; align-items: center; }

.hero {
  padding: 80px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--white) 0%, var(--off-white) 100%);
}
.hero h1 {
  font-size: 3rem;
  max-width: 800px;
  margin: 0 auto 16px;
  line-height: 1.15;
}
.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 28px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.section {
  padding: 64px 32px;
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 8px;
}
.section-sub {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}
.feature h3 {
  font-size: 1.125rem;
  margin-bottom: 6px;
}
.feature p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.price-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.price-card.featured {
  border-color: var(--accent);
  border-width: 2px;
  position: relative;
}
.price-card.featured::before {
  content: 'BEST VALUE';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.price-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.price-amount {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.price-period {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 18px;
}
.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  flex: 1;
}
.price-features li {
  padding: 6px 0;
  font-size: 14px;
}
.price-features li::before {
  content: '✓ ';
  color: var(--accent);
  font-weight: 700;
}

.cta-section {
  text-align: center;
  padding: 80px 32px;
  background: var(--accent);
  color: var(--white);
}
.cta-section h2 {
  color: var(--white);
  margin-bottom: 12px;
}
.cta-section p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 24px;
}
.cta-section .btn-primary {
  background: var(--white);
  color: var(--accent);
  border-color: var(--white);
}
.cta-section .btn-primary:hover {
  background: var(--accent-pale);
  border-color: var(--accent-pale);
}

.landing-footer {
  padding: 24px 32px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ---------- Loader ---------- */
.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent-pale);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--text-secondary);
  gap: 10px;
}

/* ---------- Page additions (Phase 2) ---------- */
.row-flex {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row-spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.stack > * + * { margin-top: 16px; }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}
.chart-wrap.tall { height: 340px; }

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
}
.btn-icon:hover { background: var(--off-white); color: var(--text-primary); }
.btn-icon.danger:hover { background: var(--danger-pale); color: var(--danger); }

.table td.amount,
.table th.amount { text-align: right; font-variant-numeric: tabular-nums; }

.table tr.row-warning td { background: var(--warning-pale); }
.table tr.row-danger  td { background: var(--danger-pale); }

.kv-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  font-size: 14px;
}
.kv-list dt { color: var(--text-secondary); }
.kv-list dd { margin: 0; font-weight: 600; }

.bucket-row {
  display: grid;
  grid-template-columns: 110px 1fr 140px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.bucket-row .bucket-label { font-weight: 600; }
.bucket-row .bucket-meta { text-align: right; color: var(--text-secondary); font-size: 13px; }

.cat-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cat-row:last-child { border-bottom: none; }
.cat-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  gap: 12px;
  flex-wrap: wrap;
}
.cat-row-name { font-weight: 600; }
.cat-row-meta { color: var(--text-secondary); font-size: 13px; }

.input-inline {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 140px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
}
.input-inline:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.15);
}

.tab-row {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab-row button {
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.tab-row button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ---------- Kanban (Phase 4: pipeline) ---------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban-col {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 200px;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.kanban-col-head .count {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-primary);
}
.kanban-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.kanban-card.priority::before {
  content: '★ ';
  color: var(--gold);
}
.kanban-card h4 {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px 0;
}
.kanban-card .kc-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.kanban-card .kc-amount {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
}
.kanban-card select,
.kanban-card .kc-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ---------- Responsive (≤768px) ---------- */
@media (max-width: 768px) {
  .sidebar {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: var(--bottom-nav-h);
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
    align-items: center;
    padding: 0;
  }
  .sidebar-brand,
  .sidebar-footer,
  .nav-section-label {
    display: none;
  }
  .sidebar-nav {
    flex: 1;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
    gap: 4px;
  }
  .sidebar-nav a {
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 8px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .sidebar-nav a.active {
    border-bottom-color: var(--accent);
    border-left-color: transparent;
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 20px);
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .form-row { grid-template-columns: 1fr; }
  .bucket-row { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }

  .hero h1 { font-size: 2rem; }
  .hero { padding: 48px 20px; }
  .section { padding: 48px 20px; }
  .feature-grid,
  .pricing-grid { grid-template-columns: 1fr; }

  .auth-card,
  .wizard-card { padding: 24px; }
}

/* ============================================================
   BUILD 3 (2026-07-18) — Projects kanban board + generic modal.
   Board is a horizontally-scrolling flex layout so 1-12 columns
   all fit on the same page. Existing `.kanban` grid class is
   biz-pipeline-specific (fixed 4 columns) so a separate class
   avoids collision.
   ============================================================ */
.kanban-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 320px;
}
.kanban-board .kanban-col {
  flex: 0 0 300px;
  max-width: 300px;
}
.kanban-col-name {
  font-weight: 600;
  letter-spacing: 0.05em;
}
.kanban-col-count {
  background: var(--white, #fff);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: var(--radius-pill, 999px);
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-primary, #333);
}
.kanban-col-cards {
  min-height: 60px;
  padding: 4px 0;
}
.kanban-col-cards.kanban-drop-hint {
  outline: 2px dashed var(--accent, #2d6a4f);
  outline-offset: -2px;
  border-radius: var(--radius-md, 6px);
  background: var(--accent-pale, #d8f3dc);
}
.kanban-add-card-btn {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-top: 8px;
  border: 1px dashed var(--border, #d0d0d0);
  border-radius: var(--radius-md, 6px);
  background: transparent;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.kanban-add-card-btn:hover,
.kanban-add-card-btn:focus {
  background: var(--accent-pale, #d8f3dc);
  color: var(--accent, #2d6a4f);
  outline: none;
}
.kanban-card {
  cursor: pointer;
  position: relative;
  transition: box-shadow 120ms, transform 60ms;
}
.kanban-card[draggable="true"]:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.09);
}
.kanban-card.dragging { opacity: 0.4; }
.kanban-card-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}
.kanban-card-desc {
  font-size: 12.5px;
  color: #555;
  line-height: 1.4;
  margin-bottom: 6px;
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.kanban-card-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #f0f0f0;
  color: #555;
}

/* Generic modal shell. Same shape as .terms-modal but decoupled so
   pages that need a non-clickwrap modal can drop it in without
   dragging the clickwrap-specific inner styles. */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 25, 0.5);
}
.cc-modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--white, #fff);
  border-radius: var(--radius-lg, 10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 28px 28px 20px;
}
.cc-modal-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--accent, #2d6a4f);
}
.cc-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}

.col-editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.col-editor-row .form-input { flex: 1; }
.col-editor-row .btn-icon { flex-shrink: 0; }

/* ============================================================
   BUILD 2 (2026-07-18) — Setup milestone journey card.
   Horizontal path of circular milestone nodes with a progress
   line. Deep green accent (--accent), warm accent-pale for the
   current-node halo + "Next up" pill.
   ============================================================ */
.setup-journey {
  padding: 24px 28px;
  --setup-progress: 0%;
}
.setup-journey-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.setup-journey-header .card-title {
  font-family: 'Playfair Display', serif;
}
.setup-dismiss-btn {
  background: transparent;
  border: 0;
  padding: 0 8px;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  border-radius: 4px;
  transition: color 120ms, background 120ms;
}
.setup-dismiss-btn:hover,
.setup-dismiss-btn:focus {
  color: #333;
  background: var(--off-white, #f8f9fa);
  outline: none;
}

.milestone-track-wrap {
  padding: 20px 12px 8px;
}
.milestone-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}
/* Base connector line — muted; sits behind the nodes. */
.milestone-track::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: #e6e6e6;
  border-radius: 999px;
  z-index: 0;
}
/* Progress fill — width driven by --setup-progress custom property
   (set by JS in dashboard.js renderSetupProgress). */
.milestone-track::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  height: 3px;
  background: var(--accent, #2d6a4f);
  border-radius: 999px;
  z-index: 1;
  width: calc((100% - 40px) * var(--setup-progress) / 100);
  transition: width 320ms ease-out;
}

.milestone-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
}
.milestone-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #d0d0d0;
  color: #999;
  transition: background 200ms, border-color 200ms, color 200ms, box-shadow 200ms;
}
.milestone-node.complete .milestone-circle {
  background: var(--accent, #2d6a4f);
  border-color: var(--accent, #2d6a4f);
  color: #fff;
}
.milestone-node.current .milestone-circle {
  background: #fff;
  border-color: var(--accent, #2d6a4f);
  color: var(--accent, #2d6a4f);
  box-shadow: 0 0 0 4px var(--accent-pale, #d8f3dc);
}
.milestone-node.future .milestone-circle {
  opacity: 0.7;
}
.milestone-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-align: center;
  letter-spacing: 0.02em;
}
.milestone-node.complete .milestone-label,
.milestone-node.current  .milestone-label {
  color: var(--accent, #2d6a4f);
}
.milestone-node.future   .milestone-label { color: #999; }

.setup-next-up {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--accent-pale, #d8f3dc);
  border-radius: 8px;
  margin-top: 8px;
}
.setup-next-label {
  font-weight: 600;
  color: var(--accent, #2d6a4f);
  flex-shrink: 0;
}
.setup-next-text {
  flex: 1 1 auto;
  min-width: 0;
  color: #2b3a2e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.setup-next-btn { flex-shrink: 0; }

@media (max-width: 640px) {
  .setup-journey { padding: 20px 16px; }
  .milestone-track-wrap { padding: 16px 4px 4px; }
  .milestone-circle { width: 32px; height: 32px; }
  .milestone-track::before,
  .milestone-track::after { top: 16px; height: 2px; }
  .milestone-label { font-size: 10px; }
  .setup-next-up { flex-wrap: wrap; }
  .setup-next-text { white-space: normal; }
}
