/* ---------------------------------------------------------------------------
   CSS Variables — Refined palette
   --------------------------------------------------------------------------- */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-ring: rgba(37,99,235,.12);
  --sidebar-bg: #0f172a;
  --sidebar-hover: rgba(255,255,255,.05);
  --text: #1e293b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg: #f8fafc;
  --bg-card: #fff;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
  --transition: .2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: .9375rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* ---------------------------------------------------------------------------
   Public layout — navbar (login / signup / landing)
   --------------------------------------------------------------------------- */
.navbar {
  background: #1e293b;
  color: #fff;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.logo-icon {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: #cbd5e1; text-decoration: none; font-size: .95rem; transition: color .2s; }
.nav-links a:hover { color: #fff; }

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ---------------------------------------------------------------------------
   Sidebar layout
   --------------------------------------------------------------------------- */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---------------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand {
  padding: 1.5rem 1.5rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo { font-size: 1.4rem; letter-spacing: -.03em; }

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
  overflow-y: auto;
}
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.sidebar-nav .nav-item:hover {
  background: rgba(255,255,255,.05);
  color: #e2e8f0;
}
.sidebar-nav .nav-item.active {
  color: #fff;
  background: rgba(37,99,235,.1);
  border-left-color: var(--primary);
}

/* Navigation section labels */
.nav-section-label {
  padding: .6rem 1.5rem .4rem;
  color: #64748b;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: .5rem;
}
.nav-section-label:first-child {
  margin-top: 0;
}

/* ── Sidebar dropdown menus ── */
.nav-dropdown {
  margin: .15rem 0;
}
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .7rem 1.5rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: .9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s;
  text-align: left;
}
.nav-dropdown-toggle:hover {
  background: rgba(255,255,255,.05);
  color: #e2e8f0;
}
.nav-dropdown.open > .nav-dropdown-toggle {
  color: #e2e8f0;
  background: rgba(255,255,255,.03);
}
.nav-dropdown-label {
  flex: 1;
}
.nav-dropdown-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}
.nav-dropdown.open > .nav-dropdown-toggle .nav-dropdown-chevron {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.nav-dropdown.open > .nav-dropdown-menu {
  max-height: 300px;
}
.nav-sub-item {
  padding-left: 2.6rem !important;
  font-size: .85rem !important;
}

/* SVG icons inside sidebar */
.sidebar .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-dropdown-toggle .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 1rem 1.5rem;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .88rem;
  flex-shrink: 0;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-name  { color: #e2e8f0; font-size: .82rem; font-weight: 600; }
.sidebar-email { color: #64748b; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #64748b;
  text-decoration: none;
  font-size: .82rem;
  padding: .4rem 0;
  transition: color .15s;
  cursor: pointer;
}
.sidebar-logout:hover { color: #f87171; }
.sidebar-logout .nav-icon { width: 16px; height: 16px; }

/* overlay for mobile */
.sidebar-overlay        { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 250; }
.sidebar-overlay.active { display: block; }

/* ---------------------------------------------------------------------------
   Topbar (mobile hamburger)
   --------------------------------------------------------------------------- */
.topbar {
  display: none;                          /* hidden on desktop */
  align-items: center;
  gap: .75rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .6rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: #1e293b;
  display: flex;
  align-items: center;
  padding: .15rem;
}
.hamburger svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ---------------------------------------------------------------------------
   Main content area
   --------------------------------------------------------------------------- */
.main-content {
  flex: 1;
  padding: 2rem 2.5rem 3rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------------
   Messages (toast overlay)
   --------------------------------------------------------------------------- */
.messages-wrap {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  max-width: 420px;
  width: calc(100% - 2rem);
  pointer-events: none;
}
.message {
  padding: .75rem 1.25rem;
  border-radius: 10px;
  margin-bottom: .5rem;
  font-size: .875rem;
  font-weight: 500;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  animation: toast-in .35s ease;
  cursor: pointer;
  transition: opacity .25s ease, transform .25s ease;
}
.message.toast-out {
  opacity: 0;
  transform: translateX(30px);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.message.success  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.message.error    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.message.warning  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---------------------------------------------------------------------------
   Auth box (login / signup)
   --------------------------------------------------------------------------- */
.auth-box {
  background: #fff;
  border-radius: 16px;
  padding: 2.75rem 2.5rem;
  max-width: 440px;
  margin: 3rem auto;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  border: 1px solid var(--border);
}
.auth-logo       { font-size: 1.2rem; font-weight: 700; color: var(--primary); letter-spacing: -.02em; margin-bottom: 1.25rem; }
.auth-box h2     { margin-bottom: .15rem; font-size: 1.4rem; font-weight: 700; color: #0f172a; letter-spacing: -.02em; }
.auth-subtitle   { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; margin-bottom: 1.75rem; }
.auth-box p      { margin-top: 1rem; font-size: .875rem; color: var(--text-muted); }
.auth-link       { text-align: center; }
.auth-link a     { color: var(--primary); text-decoration: none; font-size: .875rem; font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }
.auth-legal      { font-size: .78rem; color: var(--text-muted); text-align: center; margin: .75rem 0 .25rem; line-height: 1.5; }
.auth-legal a    { color: var(--primary); text-decoration: none; font-weight: 500; }
.auth-legal a:hover { text-decoration: underline; }
.btn-full        { display: flex; width: 100%; justify-content: center; padding: .65rem 1rem; margin-top: .25rem; }
.auth-divider    { display: flex; align-items: center; margin: 1.5rem 0 1rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.auth-divider span { padding: 0 .75rem; color: #94a3b8; font-size: .82rem; }
.form-group-check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.form-group-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3b82f6; flex-shrink: 0; }
.form-group-check label { margin-bottom: 0; font-weight: 500; font-size: .88rem; color: #374151; }

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
  user-select: none;
  white-space: nowrap;
  letter-spacing: -.01em;
  line-height: 1.5;
}
.btn:hover          { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn:active         { box-shadow: none; }
.btn:disabled       { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; pointer-events: none; }
.btn-secondary      { background: #f8fafc; color: #475569; border: 1px solid var(--border); }
.btn-secondary:hover{ background: #f1f5f9; box-shadow: none; }
.btn-danger         { background: var(--danger-light); color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover   { background: #fecaca; box-shadow: none; }
.btn-sm             { padding: .4rem .85rem; font-size: .8125rem; border-radius: 7px; }
.btn-outline        { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover  { background: var(--primary-light); box-shadow: none; }

/* Ensure all interactive elements get pointer cursor */
a, button, [role="button"], input[type="submit"], input[type="button"], select, .nav-item, .tab-btn, .column-chip, .naming-chip { cursor: pointer; }

/* ---------------------------------------------------------------------------
   Page header
   --------------------------------------------------------------------------- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.page-header h2 { font-size: 1.5rem; font-weight: 700; color: #0f172a; letter-spacing: -.025em; }
.page-header .text-muted { font-size: .875rem; }

/* ---------------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  transition: box-shadow .25s ease;
}
.card:hover       { box-shadow: var(--shadow-md); }
.card-header      { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.card-title       { font-size: 1rem; font-weight: 650; color: #0f172a; margin: 0 0 1rem; letter-spacing: -.01em; }

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
.form-group       { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: .45rem; font-weight: 550; font-size: .8125rem; color: #374151; letter-spacing: .01em; }
.form-group input,
.form-group select {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:hover,
.form-group select:hover {
  border-color: #94a3b8;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-group input::placeholder { color: #9ca3af; }
.form-group .help   { font-size: .8rem; color: var(--text-muted); margin-top: .35rem; line-height: 1.5; }
.form-group .errors { color: var(--danger); font-size: .8rem; margin-top: .25rem; }
.form-actions       { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------------------------------------------------------------------------
   Preview table
   --------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  margin-top: .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.preview-table th {
  background: #f8fafc;
  text-align: left;
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.preview-table td {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-secondary);
}
.preview-table tr:last-child td { border-bottom: none; }
.preview-table tr:hover         { background: #f8fafc; }

.preview-table .skip-cell {
  text-align: center;
  width: 48px;
  padding: 0;
}
.preview-table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #3b82f6;
}

/* editable cell input — looks flat until focused */
.cell-input {
  width: 100%;
  padding: .32rem .45rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: .86rem;
  background: transparent;
  transition: border-color .15s, background .15s;
}
.cell-input:hover {
  border-color: #d1d5db;
  background: #fff;
}
.cell-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(59,130,246,.18);
}

.row-skipped             { opacity: .4; }
.row-skipped .cell-input { color: #94a3b8; }

/* ---------------------------------------------------------------------------
   Status badges
   --------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.5;
}
.badge-pending    { background: #f1f5f9; color: #475569; }
.badge-preview    { background: #dbeafe; color: #1d4ed8; }
.badge-generating { background: #fef3c7; color: #92400e; }
.badge-done       { background: #dcfce7; color: #166534; }
.badge-failed     { background: #fee2e2; color: #991b1b; }
.badge-processing { background: #dbeafe; color: #1d4ed8; }
.badge-completed  { background: #dcfce7; color: #166534; }
.badge-partial    { background: #fef3c7; color: #92400e; }
.badge-mapping    { background: #fef3c7; color: #92400e; }

/* ---------------------------------------------------------------------------
   Hero (landing page)
   --------------------------------------------------------------------------- */
.hero { text-align: center; padding: 5rem 1rem 3rem; }
.hero h1 { font-size: 2.6rem; font-weight: 700; color: #0f172a; margin-bottom: .75rem; }
.hero p  { font-size: 1.05rem; color: #64748b; max-width: 560px; margin: 0 auto 2rem; line-height: 1.6; }

/* ---------------------------------------------------------------------------
   File list (results page)
   --------------------------------------------------------------------------- */
.file-list        { list-style: none; }
.file-list li     { display: flex; justify-content: space-between; align-items: center; padding: .6rem 0; border-bottom: 1px solid #f1f5f9; }
.file-list li:last-child { border-bottom: none; }

/* ---------------------------------------------------------------------------
   Spinner
   --------------------------------------------------------------------------- */
.spinner        { display: none; width: 28px; height: 28px; border: 3px solid #e2e8f0; border-top-color: #3b82f6; border-radius: 50%; animation: spin .6s linear infinite; margin: 1rem auto; }
.spinner.active { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   Document naming pattern section
   --------------------------------------------------------------------------- */
.naming-section        { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem 1.1rem; }
.naming-label          { display: block; font-weight: 600; font-size: .88rem; color: #374151; margin-bottom: .25rem; }
.naming-hint           { font-size: .8rem; color: #64748b; margin-bottom: .6rem; line-height: 1.5; }
.naming-hint code      { background: #eef2ff; color: #4f46e5; padding: .1rem .35rem; border-radius: 3px; font-size: .78rem; }
.naming-chips          { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .65rem; }
.naming-chip           {
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
  padding: .25rem .6rem; border-radius: 14px;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.naming-chip:hover     { background: #dbeafe; border-color: #93c5fd; }
.naming-input          {
  width: 100%; padding: .5rem .7rem;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: .9rem; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.naming-input:focus    { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.naming-preview-label  { display: block; font-size: .78rem; color: #64748b; margin-top: .55rem; margin-bottom: .15rem; }
.naming-preview        { font-size: .87rem; font-weight: 600; color: #0f172a; }

/* ---------------------------------------------------------------------------
   Utility
   --------------------------------------------------------------------------- */
.mt-1       { margin-top: .5rem; }
.mt-2       { margin-top: 1rem; }
.text-muted { color: #64748b; font-size: .87rem; }
.flex-gap   { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------------------
   Responsive — mobile
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .sidebar            { transform: translateX(-100%); width: 260px; }
  .sidebar.open       { transform: translateX(0); }
  .main-wrapper       { margin-left: 0; }
  .topbar             { display: flex; }
  .main-content       { padding: 1.25rem 1rem; }
  .messages-wrap      { right: .5rem; top: .5rem; max-width: 340px; }
  .page-header h2     { font-size: 1.2rem; }
  .subscription-grid  { grid-template-columns: 1fr; max-width: 400px; }
}

/* ---------------------------------------------------------------------------
   Logout form (sidebar)
   --------------------------------------------------------------------------- */
.sidebar-logout-form { margin: 0; }
.sidebar-logout      { background: none; border: none; width: 100%; text-align: left; font-family: inherit; }

/* ---------------------------------------------------------------------------
   Profile page
   --------------------------------------------------------------------------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.profile-name { font-size: 1.1rem; color: #0f172a; margin-bottom: .2rem; }
.divider      { border: none; border-top: 1px solid #e2e8f0; margin: 1.25rem 0; }

/* textarea inside .form-group */
.form-group textarea {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: .92rem;
  font-family: inherit;
  background: #fff;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

/* subscription tier badges */
.badge-free       { background: #f1f5f9; color: #475569; }
.badge-starter    { background: #f1f5f9; color: #475569; }
.badge-pro        { background: #dbeafe; color: #1d4ed8; }
.badge-enterprise { background: var(--purple-light); color: #6d28d9; }
.badge-business   { background: var(--purple-light); color: #6d28d9; }

/* ---------------------------------------------------------------------------
   Subscription sections (per-tool)
   --------------------------------------------------------------------------- */
.sub-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.sub-section:last-of-type {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
}
.sub-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.sub-section-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sub-section-icon.doc-icon {
  background: #dbeafe;
  color: var(--primary);
}
.sub-section-icon.bg-icon {
  background: var(--purple-light);
  color: var(--purple);
}
.sub-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -.01em;
}
.sub-section-desc {
  font-size: .825rem;
  color: var(--text-muted);
  margin: .15rem 0 0;
}

/* Tier badge inside card */
.sub-tier-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .65rem;
  border-radius: 20px;
  margin-bottom: .5rem;
}
.sub-tier-badge.free       { background: #f1f5f9; color: #475569; }
.sub-tier-badge.pro        { background: #dbeafe; color: #1d4ed8; }
.sub-tier-badge.enterprise { background: #ede9fe; color: #6d28d9; }

/* Current plan button */
.sub-current-btn {
  width: 100%;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid var(--border) !important;
}

/* ---------------------------------------------------------------------------
   Subscription grid (authenticated area)
   --------------------------------------------------------------------------- */
.subscription-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.subscription-card           { text-align: center; position: relative; padding: 2rem 1.5rem 1.5rem; display: flex; flex-direction: column; }
.subscription-card h3        { font-size: 1.05rem; font-weight: 650; margin-bottom: .2rem; }
.subscription-price          { font-size: 1.85rem; font-weight: 800; color: #0f172a; margin: .5rem 0 1rem; letter-spacing: -.02em; }
.subscription-price span     { font-size: .85rem; color: var(--text-muted); font-weight: 500; }
.subscription-features       { list-style: none; text-align: left; margin: 0 0 1.25rem; flex: 1; }
.subscription-features li    { padding: .45rem 0; font-size: .85rem; color: var(--text-secondary); display: flex; align-items: center; gap: .5rem; border-bottom: 1px solid var(--border-light); }
.subscription-features li:last-child { border-bottom: none; }
.subscription-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.subscription-current        { border-color: var(--primary) !important; box-shadow: 0 0 0 2px var(--primary-ring) !important; }
.subscription-popular        { border-color: var(--purple); }
.subscription-pop-badge {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: .28rem 1rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Usage / quota bar
   --------------------------------------------------------------------------- */
.usage-card          { margin-bottom: 1.25rem; }
.usage-row           { display: flex; align-items: center; gap: 1rem; }
.usage-text          { white-space: nowrap; font-size: .85rem; color: var(--text-secondary); }
.usage-text strong   { color: #0f172a; font-weight: 600; }
.usage-unlimited     { color: var(--success); font-weight: 600; }
.usage-bar           { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; min-width: 80px; }
.usage-bar-fill      { height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s ease; }
.usage-bar-fill.warn { background: var(--warning); }
.usage-bar-fill.danger { background: var(--danger); }
.usage-warning       { margin-top: .75rem; font-size: .83rem; color: var(--danger); }
.usage-warning a     { color: var(--primary); text-decoration: none; }
.usage-warning a:hover { text-decoration: underline; }
.usage-inline        { background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 6px; padding: .55rem .75rem; }
.usage-inline-text   { font-size: .87rem; color: #1e40af; }
.usage-inline-warn   { display: block; font-size: .82rem; color: #dc2626; margin-top: .2rem; }
.usage-inline-warn a { color: #2563eb; text-decoration: none; }
.usage-inline-warn a:hover { text-decoration: underline; }

/* Subscription date rows */
.sub-dates-row       { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1rem; padding-top: .85rem; border-top: 1px solid #e2e8f0; }
.sub-date-item       { display: flex; align-items: center; gap: .4rem; font-size: .83rem; color: #64748b; }
.sub-date-item svg   { flex-shrink: 0; color: #94a3b8; }
.sub-date-item strong { color: #334155; font-weight: 600; }
.sub-days-badge      { display: inline-block; margin-left: .35rem; padding: .1rem .45rem; border-radius: 4px; font-size: .72rem; font-weight: 600; background: #e0f2fe; color: #0369a1; }
.sub-days-badge.warn { background: #fef3c7; color: #b45309; }

/* ---------------------------------------------------------------------------
   Landing page — full-width override
   --------------------------------------------------------------------------- */
body.landing > main.container {
  max-width: none;
  margin: 0;
  padding: 0;
}

.lp-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Hero ── */
.lp-hero {
  background-color: #0f172a;
  background-image: none;
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
  padding: 5.5rem 0 0;
  position: relative;
  overflow: visible;
}
.lp-hero[style*="background-image"] {
  background-color: transparent;
  background-size: cover;
  background-position: center center;
}
.lp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.92) 0%, rgba(15,23,42,.7) 45%, rgba(15,23,42,.35) 100%);
  z-index: 0;
}
.lp-hero::before {
  content: '';
  position: absolute;
  top: -30%;  right: -15%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}
.lp-hero::after {
  content: '';
  position: absolute;
  bottom: -40%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}
.lp-hero .lp-container { position: relative; z-index: 2; text-align: center; padding-bottom: 3rem; }
.lp-hero h1 {
  font-size: 3.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.12;
  max-width: 780px;
  margin: 0 auto 1.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.lp-highlight { color: #60a5fa; }
.lp-highlight-purple { color: #a78bfa; }
.lp-hero .lp-container > p {
  font-size: 1.15rem;
  color: #cbd5e1;
  max-width: 600px;
  margin: 0 auto 2.75rem;
  line-height: 1.75;
  text-shadow: 0 1px 8px rgba(0,0,0,.3);
}
.lp-hero-cta { display: inline-flex; gap: 1rem; justify-content: center; align-items: center; }

.lp-btn-primary {
  display: inline-flex; align-items: center;
  padding: .78rem 2rem;
  background: var(--primary); color: #fff;
  border-radius: 8px;
  font-size: 1rem; font-weight: 600;
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
}
.lp-btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.lp-btn-ghost {
  display: inline-flex; align-items: center;
  padding: .78rem 2rem;
  color: #cbd5e1;
  border-radius: 8px;
  font-size: 1rem; font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.15);
  transition: color .2s, border-color .2s, background .2s;
}
.lp-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.05); }

/* Hero banner showcase */
.lp-hero-banner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
  margin-bottom: -3rem;
}
.lp-banner-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 1.5rem;
  object-fit: contain;
}

/* ── Stats bar ── */
.lp-stats {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  padding: 5.5rem 0 2.75rem;
}
.lp-stats-grid  { display: flex; justify-content: center; gap: 3.5rem; flex-wrap: wrap; }
.lp-stat        { text-align: center; }
.lp-stat-num    { display: block; font-size: 2.1rem; font-weight: 800; color: #0f172a; line-height: 1; }
.lp-stat-label  { display: block; font-size: .82rem; color: #64748b; text-transform: uppercase; letter-spacing: .06em; margin-top: .35rem; }

/* ── Generic section ── */
.lp-section     { padding: 5.5rem 0; background: #fff; }
.lp-section-alt { background: #f8fafc; }
.lp-section-header { text-align: center; margin-bottom: 3.5rem; }

.lp-badge {
  display: inline-block;
  background: #eff6ff; color: #3b82f6;
  font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: .32rem .85rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.lp-section-header h2 { font-size: 2.25rem; font-weight: 800; color: #0f172a; margin-bottom: .75rem; }
.lp-section-header p  { font-size: 1.05rem; color: #64748b; max-width: 560px; margin: 0 auto; line-height: 1.65; }

/* ── Feature cards ── */
.lp-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.75rem; }
.lp-feature-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 2rem;
  transition: box-shadow .25s, transform .2s;
}
.lp-feature-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,.07); transform: translateY(-3px); }
.lp-feature-icon {
  width: 50px; height: 50px;
  background: #eff6ff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.lp-feature-icon svg {
  width: 24px; height: 24px;
  stroke: #3b82f6; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.lp-feature-card h3 { font-size: 1.08rem; font-weight: 700; color: #0f172a; margin-bottom: .45rem; }
.lp-feature-card p  { font-size: .9rem; color: #64748b; line-height: 1.6; }

/* ── Steps / How-it-works ── */
.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  position: relative;
}
.lp-steps::before {
  content: '';
  position: absolute;
  top: 25px;
  left: calc(16.67% + 30px);
  right: calc(16.67% + 30px);
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 2px;
}
.lp-step      { text-align: center; position: relative; }
.lp-step-num  {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800;
  margin: 0 auto 1.25rem;
  position: relative; z-index: 1;
  box-shadow: 0 4px 12px rgba(59,130,246,.3);
}
.lp-step h3 { font-size: 1.08rem; font-weight: 700; color: #0f172a; margin-bottom: .5rem; }
.lp-step p  { font-size: .9rem; color: #64748b; line-height: 1.65; max-width: 270px; margin: 0 auto; }

/* ── Pricing ── */
.lp-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  max-width: 980px;
  margin: 0 auto;
  align-items: start;
  padding-top: 1rem;
}
.lp-pricing-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  transition: box-shadow .25s, transform .2s;
}
.lp-pricing-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,.07); transform: translateY(-2px); }
.lp-pricing-card.lp-pricing-popular {
  border-color: #3b82f6;
  box-shadow: 0 6px 24px rgba(59,130,246,.18);
  transform: scale(1.04);
}
.lp-pricing-card.lp-pricing-popular:hover {
  box-shadow: 0 12px 36px rgba(59,130,246,.22);
  transform: scale(1.04) translateY(-2px);
}
.lp-pricing-pop-badge {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: .3rem 1.25rem;
  border-radius: 20px;
  white-space: nowrap;
}
.lp-pricing-tier   { font-size: 1rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem; }
.lp-pricing-price  { font-size: 3.2rem; font-weight: 800; color: #0f172a; line-height: 1; margin-bottom: .25rem; }
.lp-pricing-period { font-size: 1rem; color: #64748b; font-weight: 500; }

.lp-pricing-features       { list-style: none; text-align: left; margin: 1.75rem 0; }
.lp-pricing-features li    { padding: .55rem 0; color: #475569; font-size: .92rem; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; gap: .6rem; }
.lp-pricing-features li:last-child { border-bottom: none; }
.lp-pricing-features li::before    { content: '✓'; color: #22c55e; font-weight: 700; flex-shrink: 0; font-size: .95rem; }

.lp-pricing-cta {
  display: block; width: 100%;
  padding: .7rem 1rem;
  border-radius: 8px;
  font-size: .92rem; font-weight: 600;
  text-decoration: none; text-align: center;
  border: 2px solid #e2e8f0;
  color: #475569; background: #fff;
  transition: border-color .2s, color .2s, background .2s;
}
.lp-pricing-cta:hover            { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }
.lp-pricing-cta-primary          { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.lp-pricing-cta-primary:hover    { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ── Pricing Tabs ── */
.lp-pricing-tabs {
  display: inline-flex;
  gap: 0;
  margin: 0 auto 2.5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  padding: 5px;
  max-width: 520px;
}
.lp-pricing-tabs-wrap {
  display: flex;
  justify-content: center;
}
.lp-pricing-tab {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem 1.75rem;
  border-radius: 50px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
}
.lp-pricing-tab svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.lp-pricing-tab:hover {
  color: #1e293b;
}
.lp-pricing-tab.active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}
.lp-pricing-tab.active svg {
  stroke: var(--primary);
}
.lp-pricing-panel {
  display: none;
}
.lp-pricing-panel.active {
  display: block;
}

/* ── Final CTA ── */
.lp-cta {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 5rem 0;
  text-align: center;
}
.lp-cta .lp-container { position: relative; z-index: 1; }
.lp-cta h2 { font-size: 2.25rem; font-weight: 800; color: #fff; margin-bottom: 1rem; }
.lp-cta p  { font-size: 1.05rem; color: #94a3b8; max-width: 540px; margin: 0 auto 2.25rem; line-height: 1.65; }

/* ── Services section ── */
.lp-services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.lp-service-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.5rem;
  transition: box-shadow .25s, transform .2s;
}
.lp-service-card:hover { box-shadow: 0 12px 36px rgba(0,0,0,.08); transform: translateY(-3px); }
.lp-service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.lp-service-icon svg {
  width: 26px; height: 26px;
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.lp-service-icon-blue  { background: #eff6ff; }
.lp-service-icon-blue svg { stroke: #3b82f6; }
.lp-service-icon-purple { background: #f5f3ff; }
.lp-service-icon-purple svg { stroke: #7c3aed; }
.lp-service-card h3 { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin-bottom: .6rem; }
.lp-service-desc { font-size: .95rem; color: #64748b; line-height: 1.7; margin-bottom: 1.25rem; }
.lp-service-features { list-style: none; margin-bottom: 1.75rem; }
.lp-service-features li {
  padding: .4rem 0;
  color: #475569;
  font-size: .9rem;
  display: flex; align-items: center; gap: .6rem;
}
.lp-service-features li::before { content: '✓'; color: #22c55e; font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.lp-service-cta {
  display: inline-flex; align-items: center;
  padding: .65rem 1.5rem;
  border-radius: 8px;
  font-size: .92rem; font-weight: 600;
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
}
.lp-service-cta-blue { background: #3b82f6; color: #fff; }
.lp-service-cta-blue:hover { background: #2563eb; box-shadow: 0 4px 14px rgba(37,99,235,.3); }
.lp-service-cta-purple { background: #7c3aed; color: #fff; }
.lp-service-cta-purple:hover { background: #6d28d9; box-shadow: 0 4px 14px rgba(124,58,237,.3); }

/* ── Feature icon purple variant ── */
.lp-feature-icon-purple { background: #f5f3ff; }
.lp-feature-icon-purple svg { stroke: #7c3aed; }

/* ── How-it-works blocks ── */
.lp-how-block { margin-bottom: 3.5rem; }
.lp-how-block:last-child { margin-bottom: 0; }
.lp-how-title {
  display: flex; align-items: center; gap: .75rem;
  font-size: 1.2rem; font-weight: 700; color: #0f172a;
  margin-bottom: 2rem;
  justify-content: center;
}
.lp-how-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.lp-how-icon svg { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lp-how-icon-blue { background: #eff6ff; }
.lp-how-icon-blue svg { stroke: #3b82f6; }
.lp-how-icon-purple { background: #f5f3ff; }
.lp-how-icon-purple svg { stroke: #7c3aed; }

/* Purple step number variant */
.lp-step-num-purple {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
}
.lp-steps-purple::before {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

/* ── Use cases section ── */
.lp-usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
}
.lp-usecase {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 2rem;
  transition: box-shadow .25s, transform .2s;
}
.lp-usecase:hover { box-shadow: 0 8px 30px rgba(0,0,0,.07); transform: translateY(-3px); }
.lp-usecase-icon {
  width: 48px; height: 48px;
  background: #eff6ff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.lp-usecase-icon svg {
  width: 22px; height: 22px;
  stroke: #3b82f6; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.lp-usecase-icon-purple { background: #f5f3ff; }
.lp-usecase-icon-purple svg { stroke: #7c3aed; }
.lp-usecase h4 { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin-bottom: .4rem; }
.lp-usecase p  { font-size: .88rem; color: #64748b; line-height: 1.6; }

/* ── Enhanced Footer ── */
.lp-footer       { background: #0f172a; padding: 3.5rem 0 2rem; }
.lp-footer-top   {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #1e293b;
}
.lp-footer-brand { }
.lp-footer-logo  { color: #fff; font-size: 1.1rem; display: block; margin-bottom: .75rem; }
.lp-footer-tagline { font-size: .85rem; color: #64748b; line-height: 1.6; max-width: 280px; }
.lp-footer-col h4 { color: #94a3b8; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .85rem; }
.lp-footer-col a { display: block; color: #64748b; text-decoration: none; font-size: .85rem; padding: .25rem 0; transition: color .2s; }
.lp-footer-col a:hover { color: #fff; }
.lp-footer-bottom { padding-top: 1.5rem; text-align: center; }
.lp-footer-copy  { font-size: .8rem; color: #475569; }
/* keep old .lp-footer-inner for backwards compat if used elsewhere */
.lp-footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.lp-footer-links { display: flex; gap: 1.75rem; flex-wrap: wrap; justify-content: center; }
.lp-footer-links a { color: #64748b; text-decoration: none; font-size: .85rem; transition: color .2s; }
.lp-footer-links a:hover { color: #fff; }

/* navbar btn override (Get Started pill in public nav) */
.nav-links a.nav-btn { background: #3b82f6; color: #fff; padding: .35rem .9rem; border-radius: 6px; font-weight: 600; }
.nav-links a.nav-btn:hover { background: #2563eb; color: #fff; }

/* ── Landing-page mobile hamburger ── */
.lp-hamburger {
  display: none;
  background: none; border: none;
  cursor: pointer; color: #cbd5e1;
  padding: .25rem; align-items: center; justify-content: center;
}
.lp-hamburger svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.lp-nav-links {
  display: flex; align-items: center; gap: 1.25rem;
}
.lp-nav-links a { color: #cbd5e1; text-decoration: none; font-size: .95rem; transition: color .2s; }
.lp-nav-links a:hover { color: #fff; }
.lp-nav-links a.nav-btn { background: #3b82f6; color: #fff; padding: .35rem .9rem; border-radius: 6px; font-weight: 600; }
.lp-nav-links a.nav-btn:hover { background: #2563eb; color: #fff; }

/* ---------------------------------------------------------------------------
   Landing-page responsive
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .lp-hero            { padding: 4rem 0 0; }
  .lp-hero h1         { font-size: 2.1rem; }
  .lp-hero-cta        { flex-wrap: wrap; }
  .lp-hero-banner     { max-width: 100%; padding: 0 1rem; }
  .lp-pricing-tabs    { max-width: 100%; }
  .lp-pricing-tab     { padding: .55rem 1rem; font-size: .82rem; gap: .35rem; }
  .lp-section         { padding: 3.5rem 0; }
  .lp-section-header h2 { font-size: 1.7rem; }
  .lp-steps           { grid-template-columns: 1fr; gap: 2rem; }
  .lp-steps::before   { display: none; }
  .lp-pricing-grid    { grid-template-columns: 1fr; max-width: 380px; margin-left: auto; margin-right: auto; }
  .lp-pricing-card.lp-pricing-popular        { transform: scale(1); }
  .lp-pricing-card.lp-pricing-popular:hover  { transform: translateY(-2px); }
  .lp-stats-grid      { gap: 1.5rem; }
  .lp-services-grid   { grid-template-columns: 1fr; }
  .lp-service-card    { padding: 1.75rem; }
  .lp-how-block       { margin-bottom: 2.5rem; }
  .lp-steps-purple::before { display: none; }
  .lp-usecases-grid   { grid-template-columns: 1fr 1fr; }
  .lp-footer-top      { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
  .lp-footer-tagline  { max-width: none; margin: 0 auto; }
  .lp-footer-inner    { flex-direction: column; text-align: center; }

  /* mobile landing nav */
  .navbar             { position: relative; height: auto; padding: .75rem 1rem; }
  .lp-hamburger       { display: flex; }
  .lp-nav-links       {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #1e293b;
    flex-direction: column; align-items: stretch;
    padding: 1rem; gap: .5rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
  }
  .lp-nav-links.open  { display: flex; }
  .lp-nav-links a     { padding: .65rem 1rem; border-radius: 6px; font-size: .92rem; }
  .lp-nav-links a.nav-btn { text-align: center; }

  /* hide bare .nav-links links on landing mobile (they live inside .lp-nav-links) */
  .navbar > .nav-links > a { display: none; }
}

/* ---------------------------------------------------------------------------
   Visual Mapping Interface
   --------------------------------------------------------------------------- */

/* Mapping container - two-panel layout */
.mapping-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  min-height: calc(100vh - 200px);
}

/* Sidebar */
.mapping-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.mapping-sidebar-section {
  margin-bottom: 1.5rem;
}
.mapping-sidebar-section:last-child {
  margin-bottom: 0;
}

.mapping-sidebar-title {
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #e2e8f0;
}

.mapping-sidebar-hint {
  font-size: .82rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: .75rem;
}

/* Column chips */
.column-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.column-chip {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: .35rem .7rem;
  border-radius: 16px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.column-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}
.column-chip:active {
  transform: translateY(0);
}

/* First row preview */
.first-row-preview {
  max-height: 200px;
  overflow-y: auto;
  font-size: .82rem;
}
.preview-row {
  display: flex;
  padding: .3rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.preview-row:last-child {
  border-bottom: none;
}
.preview-label {
  font-weight: 600;
  color: #475569;
  width: 40%;
  flex-shrink: 0;
}
.preview-value {
  color: #0f172a;
  word-break: break-word;
}

/* Instructions */
.mapping-instructions {
  font-size: .82rem;
  color: #64748b;
  padding-left: 1.25rem;
  line-height: 1.6;
}
.mapping-instructions li {
  margin-bottom: .4rem;
}

/* Main panel */
.mapping-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mapping-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: .65rem 1rem;
}

.mapping-status {
  font-size: .87rem;
  color: #64748b;
  transition: color .2s;
}
.mapping-status.ready {
  color: #059669;
  font-weight: 500;
}
.mapping-status.warning {
  color: #dc2626;
}

/* Document preview wrapper */
.document-preview-wrapper {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 2rem;
  min-height: 400px;
  flex: 1;
  overflow-y: auto;
}

/* Document preview content */
.doc-preview {
  max-width: 700px;
  margin: 0 auto;
  font-family: 'Times New Roman', Times, serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1e293b;
}

.doc-para {
  margin-bottom: 1rem;
  padding: .5rem .75rem;
  border-radius: 4px;
  cursor: text;
  transition: background .15s;
  position: relative;
}
.doc-para:hover {
  background: #f8fafc;
}
.doc-para.selected {
  background: #eff6ff;
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.doc-para-empty {
  min-height: 1.5rem;
  background: #fafafa;
  border: 1px dashed #e2e8f0;
}

/* Placeholder badges */
.placeholder-badge {
  display: inline-block;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  color: #4f46e5;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid #c7d2fe;
}
.placeholder-badge:hover {
  background: #fecaca;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Tables in document preview */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.doc-table td {
  border: 1px solid #e2e8f0;
  padding: .5rem;
  vertical-align: top;
}

/* Mapping actions */
.mapping-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding: .5rem 0;
}

/* Error message */
.error-message {
  color: #dc2626;
  font-size: .87rem;
  margin-top: .5rem;
}

/* Workflow steps indicator */
.workflow-steps {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #94a3b8;
  font-size: .85rem;
}
.workflow-step.active {
  color: #3b82f6;
}
.workflow-step.active .step-number {
  background: #3b82f6;
  color: #fff;
}
.workflow-step.completed {
  color: #059669;
}
.workflow-step.completed .step-number {
  background: #059669;
  color: #fff;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
}

.step-label {
  font-weight: 500;
}

/* Responsive mapping layout */
@media (max-width: 900px) {
  .mapping-container {
    grid-template-columns: 1fr;
  }

  .mapping-sidebar {
    position: static;
    order: -1;
  }

  .document-preview-wrapper {
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .workflow-steps {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .mapping-actions {
    flex-direction: column;
  }

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

/* ---------------------------------------------------------------------------
   PDF Viewer Interface
   --------------------------------------------------------------------------- */

.pdf-toolbar-left,
.pdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.pdf-page-info {
  font-size: .85rem;
  color: #64748b;
  min-width: 100px;
  text-align: center;
}

#zoom-level {
  font-size: .85rem;
  color: #64748b;
  min-width: 50px;
  text-align: center;
}

/* PDF viewer wrapper */
.pdf-viewer-wrapper {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  min-height: 500px;
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  position: relative;
}

/* PDF canvas container */
.pdf-canvas-container {
  position: relative;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

#pdf-canvas {
  display: block;
}

/* PDF loading state */
.pdf-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #64748b;
}

.pdf-loading p {
  margin-top: .75rem;
  font-size: .9rem;
}

/* Markers layer overlay */
.pdf-markers-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Individual marker */
.pdf-marker {
  position: absolute;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  padding: .25rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  cursor: move;
  pointer-events: auto;
  user-select: none;
  box-shadow: 0 2px 6px rgba(59,130,246,.3);
  display: flex;
  align-items: center;
  gap: .35rem;
  z-index: 10;
  transition: transform .1s, box-shadow .1s;
}

.pdf-marker:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(59,130,246,.4);
}

.pdf-marker.dragging {
  opacity: .8;
  transform: scale(1.1);
  z-index: 100;
}

.marker-label {
  white-space: nowrap;
}

.marker-delete {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: .7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.marker-delete:hover {
  background: #dc2626;
}

/* Click hint tooltip */
.pdf-click-hint {
  position: absolute;
  background: #1e293b;
  color: #fff;
  padding: .35rem .65rem;
  border-radius: 4px;
  font-size: .75rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-100%) translateX(-50%);
  margin-top: -8px;
  white-space: nowrap;
  z-index: 20;
  transition: opacity .15s;
}

.pdf-click-hint.visible {
  opacity: 1;
}

.pdf-click-hint::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1e293b;
}

/* Column chips awaiting state */
.column-chip.awaiting {
  animation: pulse-chip 1s infinite;
}

@keyframes pulse-chip {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.4); }
  50% { box-shadow: 0 0 0 6px rgba(37,99,235,0); }
}

/* Markers list in sidebar */
.markers-list-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.marker-item {
  display: flex;
  align-items: center;
  padding: .4rem .5rem;
  background: #f8fafc;
  border-radius: 4px;
  margin-bottom: .35rem;
  font-size: .82rem;
}

.marker-item-label {
  flex: 1;
  font-weight: 600;
  color: #3b82f6;
}

.marker-item-page {
  color: #94a3b8;
  font-size: .75rem;
  margin-right: .5rem;
}

.marker-item-delete {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.marker-item-delete:hover {
  color: #dc2626;
}

/* Responsive PDF viewer */
@media (max-width: 900px) {
  .pdf-viewer-wrapper {
    min-height: 400px;
  }

  .mapping-toolbar {
    flex-direction: column;
    gap: .75rem;
  }

  .pdf-toolbar-left,
  .pdf-toolbar-right {
    width: 100%;
    justify-content: center;
  }
}

/* ---------------------------------------------------------------------------
   Job Cards - Dashboard
   --------------------------------------------------------------------------- */
.jobs-grid {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.job-card {
  padding: 1.25rem;
}
.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.job-info {
  flex: 1;
  min-width: 0;
}
.job-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 .375rem;
}
.job-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.job-template {
  font-size: .8rem;
  color: #64748b;
}
.job-date {
  font-size: .8rem;
  color: #94a3b8;
  white-space: nowrap;
}
.job-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.job-error {
  font-size: .85rem;
  color: #dc2626;
}

/* ---------------------------------------------------------------------------
   Admin Panel Styles
   --------------------------------------------------------------------------- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.admin-stat-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.stat-icon svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  flex-shrink: 0;
}
.stat-icon.users-icon {
  background: #dbeafe;
  color: var(--primary);
}
.stat-icon.docs-icon {
  background: #dcfce7;
  color: var(--success);
}
.stat-icon.jobs-icon {
  background: #fef3c7;
  color: var(--warning);
}
.stat-icon.bg-stat-icon {
  background: var(--purple-light);
  color: var(--purple);
}
.stat-icon.activity-icon {
  background: #fce7f3;
  color: #db2777;
}
.stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.stat-change {
  font-size: .75rem;
  color: var(--success);
  font-weight: 500;
  margin-top: .15rem;
}

.tier-breakdown {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.tier-item {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.tier-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.admin-filters {
  margin-bottom: 0;
}
.filter-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.filter-search {
  flex: 1;
  min-width: 200px;
  padding: .55rem .875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
}
.filter-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.filter-select {
  padding: .55rem .875rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  min-width: 120px;
}
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.admin-table .user-cell {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .8rem;
  flex-shrink: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}
.page-info {
  font-size: .85rem;
  color: #64748b;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
  .admin-user-grid {
    grid-template-columns: 1fr;
  }
}
.user-info-grid {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.info-row {
  display: flex;
  padding: .5rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.info-row:last-child {
  border-bottom: none;
}
.info-label {
  width: 120px;
  font-size: .85rem;
  color: #64748b;
  flex-shrink: 0;
}
.info-value {
  font-size: .9rem;
  color: #0f172a;
}
.usage-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}
.text-danger {
  color: var(--danger);
}
.text-center {
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Admin Statistics Panel
   --------------------------------------------------------------------------- */

/* Filter bar */
.stats-filters {
  padding: 1.25rem 1.75rem;
  margin-bottom: 1.5rem;
}
.stats-filter-form {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.stats-filter-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.stats-filter-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stats-filter-chips {
  display: flex;
  gap: .375rem;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: .35rem .75rem;
  border-radius: 6px;
  font-size: .8125rem;
  font-weight: 550;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all .15s;
}
.filter-chip:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}
.filter-chip.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

/* Charts row */
.stats-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.stats-chart-card {
  padding: 1.5rem 1.75rem;
}
.stats-chart-card .card-title {
  margin-bottom: .75rem;
}
.stats-chart-card canvas {
  width: 100% !important;
  max-height: 220px;
}

/* Breakdown row */
.stats-breakdown-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Tier breakdown grid */
.tier-breakdown-grid {
  display: flex;
  gap: 1.5rem;
  margin-top: .75rem;
  margin-bottom: 1.25rem;
}
.tier-breakdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex: 1;
  padding: 1rem .5rem;
  background: var(--bg);
  border-radius: 10px;
}
.tier-breakdown-count {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

/* Status breakdown */
.status-breakdown {
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  margin-top: .5rem;
}
.status-breakdown-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .75rem;
}
.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .65rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: .8125rem;
}
.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-pill-dot.status-pending    { background: #94a3b8; }
.status-pill-dot.status-processing { background: var(--primary); }
.status-pill-dot.status-completed  { background: var(--success); }
.status-pill-dot.status-done       { background: var(--success); }
.status-pill-dot.status-partial    { background: var(--warning); }
.status-pill-dot.status-failed     { background: var(--danger); }
.status-pill-dot.status-generating { background: var(--warning); }
.status-pill-dot.status-mapping    { background: #60a5fa; }
.status-pill-dot.status-preview    { background: #818cf8; }
.status-pill-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.status-pill-count {
  font-weight: 700;
  color: #0f172a;
}

/* BG stats summary */
.bg-stats-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.bg-stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: .75rem .5rem;
  background: var(--bg);
  border-radius: 8px;
}
.bg-stats-num {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}
.bg-stats-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* Recent activity list */
.recent-activity-list {
  display: flex;
  flex-direction: column;
}
.recent-activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border-light);
}
.recent-activity-item:last-child {
  border-bottom: none;
}
.recent-activity-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.recent-activity-name {
  font-size: .875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-activity-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* Admin stats responsive */
@media (max-width: 900px) {
  .stats-charts-row,
  .stats-breakdown-row {
    grid-template-columns: 1fr;
  }
  .stats-filter-form {
    gap: 1rem;
  }
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  .tier-breakdown-grid {
    gap: .75rem;
  }
}

/* ---------------------------------------------------------------------------
   Legal Pages
   --------------------------------------------------------------------------- */
.legal-page {
  max-width: 720px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.legal-page h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: .25rem;
  letter-spacing: -.02em;
}
.legal-updated {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: .75rem;
}
.legal-page h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin-top: 1.25rem;
  margin-bottom: .5rem;
}
.legal-page p {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.legal-page ul, .legal-page ol {
  margin: .5rem 0 1rem 1.5rem;
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.legal-page li {
  margin-bottom: .35rem;
}
.legal-page a {
  color: var(--primary);
  text-decoration: none;
}
.legal-page a:hover {
  text-decoration: underline;
}
.legal-page code {
  background: #f1f5f9;
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .85rem;
  color: #334155;
}
@media (max-width: 768px) {
  .legal-page {
    margin: 1rem;
    padding: 1.5rem;
  }
  .legal-page h1 {
    font-size: 1.4rem;
  }
}
