:root {
  --bg-body: #0A0A0A;
  --bg-surface: #141414;
  --bg-surface-alt: #111111;
  --bg-elevated: #1A1A1A;
  --bg-inset: #0A0A0A;
  --text-primary: #FFFFFF;
  --text-body: #E0E0E0;
  --text-secondary: #848484;
  --text-dim: #666666;
  --text-muted: #4A4A4A;
  --text-table: #C0C0C0;
  --border-primary: #2A2A2A;
  --border-subtle: #1E1E1E;
  --accent: #0D6E6E;
  --accent-hover: #0B5C5C;
  --bg-matched: #0F1514;
  --bg-matched-alt: #0C1211;
  --border-matched: #1A2A28;
  --accent-unmatched: #C97A2E;
  --accent-unmatched-subtle: rgba(201, 122, 46, 0.08);
  --accent-unmatched-bg: rgba(201, 122, 46, 0.12);
  --accent-unmatched-border: rgba(201, 122, 46, 0.3);
  --bg-unmatched: #1A1408;
  --border-unmatched: #2A1E0F;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-dropzone-active: #0F1A1A;
  --text-on-accent: #FFFFFF;
  --accent-success: #4ade80;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

[data-theme="light"] {
  --bg-body: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F5F5F5;
  --bg-elevated: #F0F0F0;
  --bg-inset: #FFFFFF;
  --text-primary: #111111;
  --text-body: #333333;
  --text-secondary: #666666;
  --text-dim: #888888;
  --text-muted: #AAAAAA;
  --text-table: #444444;
  --border-primary: #E0E0E0;
  --border-subtle: #ECECEC;
  --accent: #0D6E6E;
  --accent-hover: #0B5C5C;
  --bg-matched: #EBF5F0;
  --bg-matched-alt: #F2FAF6;
  --border-matched: #C8E8E0;
  --accent-unmatched: #C97A2E;
  --accent-unmatched-subtle: rgba(201, 122, 46, 0.08);
  --accent-unmatched-bg: rgba(201, 122, 46, 0.12);
  --accent-unmatched-border: rgba(201, 122, 46, 0.3);
  --bg-unmatched: #FFF5EB;
  --border-unmatched: #F0E0D0;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-dropzone-active: #E8F5F5;
  --text-on-accent: #FFFFFF;
  --accent-success: #16a34a;
}

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

body {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-body);
  min-height: 100vh;
}

/* ── Loading screen ───────────────────────────────────── */

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: calc(100vh - 64px);
  gap: 32px;
}

.loading-pulse {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-pulse svg {
  animation: loading-spin 3s linear infinite;
}

.loading-ring {
  color: var(--text-secondary);
}

.loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loading-heading {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.loading-subtext {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

@keyframes loading-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Onboarding ──────────────────────────────────────── */

.onboarding-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: calc(100vh - 64px);
  gap: 48px;
  padding: 0 80px;
}

.onboarding-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.onboarding-headline {
  font-family: "Playfair Display", serif;
  font-size: 48px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

.onboarding-subtitle {
  font-family: "Geist", sans-serif;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  max-width: 560px;
}

.onboarding-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  padding: 16px 20px;
  background: rgba(201, 122, 46, 0.06);
  border: 1px solid rgba(201, 122, 46, 0.19);
  border-radius: 8px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--accent-unmatched);
  line-height: 1.5;
}

.onboarding-steps {
  display: flex;
  gap: 24px;
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
}

.step-number span {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.step-title {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.step-desc {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.onboarding-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}

.onboarding-cta:hover {
  background: var(--accent-hover);
}

.onboarding-headline--sm {
  font-size: 36px;
}

.onboarding-subtitle--sm {
  font-size: 16px;
  max-width: 480px;
  line-height: 1.5;
}

.stepper {
  display: flex;
  gap: 8px;
}

.stepper-dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-primary);
}

.stepper-dot--active {
  background: var(--accent);
}

.step-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 420px;
  max-width: 100%;
}

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

.field-label {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
}

.field-input {
  height: 48px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: "Geist", sans-serif;
  font-size: 15px;
}

.field-input::placeholder {
  color: var(--text-dim);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
}

.role-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 12px 16px;
  background: rgba(13, 110, 110, 0.08);
  border: 1px solid rgba(13, 110, 110, 0.25);
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--accent);
}

.form-error {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--accent-unmatched);
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.form-actions .onboarding-cta {
  width: 100%;
}

.skip-link {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

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

.invite-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.example-cards {
  display: flex;
  gap: 24px;
}

.example-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.example-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.example-card-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.example-card-file {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

.example-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-primary);
  text-decoration: none;
}

.example-download:hover {
  text-decoration: underline;
}

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

.example-secondary {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 14px 24px;
}

.example-secondary:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.add-another {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  padding: 0;
}

.add-another-icon {
  font-size: 16px;
  line-height: 1;
}

.add-another:hover {
  opacity: 0.8;
}

.invite-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(13, 110, 110, 0.06);
  border: 1px solid rgba(13, 110, 110, 0.15);
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--accent);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .onboarding-content {
    padding: 0 24px;
    gap: 32px;
  }

  .onboarding-headline {
    font-size: 32px;
  }

  .onboarding-subtitle {
    font-size: 16px;
  }

  .onboarding-steps {
    flex-direction: column;
  }

  .onboarding-step {
    width: 100%;
  }

  .onboarding-headline--sm {
    font-size: 28px;
  }

  .onboarding-form {
    width: 100%;
  }

  .example-cards {
    flex-direction: column;
  }

  .example-card {
    width: 100%;
  }

  .example-actions {
    flex-direction: column;
    gap: 16px;
  }
}

/* ── Admin panel ─────────────────────────────────────── */

.admin-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 240px;
  min-width: 240px;
  padding: 24px 16px;
  background: var(--bg-surface-alt);
  border-right: 1px solid var(--border-subtle);
}

.admin-sidebar-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 4px;
}

.admin-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.admin-sidebar-item--active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 500;
}

.admin-sidebar-item:hover {
  background: var(--bg-elevated);
}

.admin-sidebar-icon {
  font-size: 16px;
  width: 16px;
  text-align: center;
}

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 40px;
}

.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-title {
  font-family: "Geist", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-title--sm {
  font-size: 18px;
}

.pending-invitations {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.invite-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.invite-cancel:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.admin-subtitle {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  overflow: hidden;
}

.admin-table-header {
  background: var(--bg-surface);
}

.admin-table-th {
  text-align: left;
  padding: 12px 20px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table-row {
  border-top: 1px solid var(--border-subtle);
}

.admin-table-row:hover {
  background: var(--bg-hover);
}

.admin-table-cell {
  padding: 16px 20px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-body);
}

.admin-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-success);
  background: rgba(74, 222, 128, 0.1);
}

.admin-stats {
  display: flex;
  gap: 16px;
}

.admin-stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.admin-stat-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-stat-label {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-error {
  padding: 12px 16px;
  background: rgba(217, 60, 21, 0.1);
  border: 1px solid rgba(217, 60, 21, 0.3);
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--destructive);
}

.admin-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.admin-delete-btn:hover {
  opacity: 1;
}

.admin-env-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(201, 122, 46, 0.06);
  border: 1px solid rgba(201, 122, 46, 0.19);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-unmatched);
}

/* ── Shared nav ───────────────────────────────────────── */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 16px 80px;
}

.site-nav .logo {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 4px;
  text-decoration: none;
}

.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.site-nav .nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav .nav-links a:hover {
  color: var(--text-primary);
}

/* ── Org switcher ────────────────────────────────────── */

.nav-left {
  display: flex;
  align-items: center;
  gap: 0;
}

.org-switcher-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border-primary);
  margin-left: 24px;
}

.org-switcher {
  position: relative;
}

.org-switcher summary {
  list-style: none;
}

.org-switcher summary::-webkit-details-marker {
  display: none;
}

.org-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.org-switcher-btn:hover {
  background: var(--bg-elevated);
}

.org-switcher-chevron {
  font-size: 12px;
  color: var(--text-secondary);
}

.org-switcher-single {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.org-switcher-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 100;
}

.org-switcher-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: left;
}

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

.org-switcher-item--active {
  color: var(--text-primary);
  font-weight: 500;
}

.org-switcher-check {
  color: var(--accent);
  font-size: 14px;
  width: 14px;
}

.org-switcher-spacer {
  width: 14px;
}

[data-theme="light"] .org-switcher-dropdown {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── Join banner ─────────────────────────────────────── */

.join-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 56px;
  padding: 0 80px;
  background: rgba(13, 110, 110, 0.08);
  border-bottom: 1px solid rgba(13, 110, 110, 0.19);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.join-banner-switch {
  padding: 4px 12px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.join-banner-switch:hover {
  background: var(--accent-hover);
}

/* ── Org members ─────────────────────────────────────── */

.org-members-content {
  flex: 1;
  min-width: 0;
  padding: 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.org-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
}

.org-tab {
  padding: 10px 20px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.org-tab--active {
  color: var(--text-primary);
  font-weight: 500;
  border-bottom: 2px solid var(--accent);
}

.role-badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(13, 110, 110, 0.12);
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.role-badge-member {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--bg-hover);
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.role-cards {
  display: flex;
  gap: 16px;
}

.role-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.role-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-card-desc {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Sign-in button ──────────────────────────────────── */

.sign-in-menu {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.sign-in-btn {
  display: inline-block;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1f1f1f;
  background: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  list-style: none;
}

.sign-in-btn::-webkit-details-marker {
  display: none;
}

.sign-in-btn:hover {
  background: #f0f0f0;
  color: #1f1f1f;
}

.sign-in-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 100;
  padding: 0;
}

.sign-in-dropdown .dropdown-item {
  color: #e0e0e0;
  white-space: nowrap;
}

.sign-in-dropdown .dropdown-item:hover {
  color: #ffffff;
}

[data-theme="light"] .sign-in-dropdown {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── User menu ───────────────────────────────────────── */

.user-menu {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.user-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0d6e6e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Geist", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-name {
  font-size: 14px;
  color: #e0e0e0;
  font-weight: 500;
}

.user-arrow {
  font-size: 12px;
  color: #848484;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 100;
  padding: 0;
}

.dropdown-item {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: #e0e0e0;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.dropdown-item--admin {
  color: #C97A2E;
}

.dropdown-item--admin:hover {
  color: #C97A2E;
}

.org-badge-nav {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(13, 110, 110, 0.12);
  border: 1px solid rgba(13, 110, 110, 0.25);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
}

[data-theme="light"] .org-badge-nav {
  background: rgba(13, 110, 110, 0.08);
  border-color: rgba(13, 110, 110, 0.2);
}

.admin-badge-nav {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(201, 122, 46, 0.12);
  border: 1px solid rgba(201, 122, 46, 0.25);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #C97A2E;
  margin-left: 4px;
}

[data-theme="light"] .admin-badge-nav {
  background: rgba(201, 122, 46, 0.08);
  border-color: rgba(201, 122, 46, 0.2);
}

[data-theme="light"] .user-name {
  color: #333333;
}

[data-theme="light"] .user-arrow {
  color: #888888;
}

[data-theme="light"] .user-dropdown {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item {
  color: #333333;
}

[data-theme="light"] .dropdown-item:hover {
  background: #f0f0f0;
  color: #111111;
}

/* ── Hero (landing page) ─────────────────────────────── */

/* --- Legal pages --- */

.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  font-family: "Geist", sans-serif;
  color: var(--text-body);
  line-height: 1.7;
}

.legal-title {
  font-family: "Playfair Display", serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.legal-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-content p {
  margin-bottom: 12px;
}

.legal-content ul {
  margin-bottom: 12px;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 4px;
}

.legal-content a {
  color: var(--accent);
}

.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero h1,
.hero .subline,
.hero > form,
.hero .success,
.hero .trust {
  padding: 0 80px;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: 60px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -1px;
  max-width: 800px;
  margin: auto auto 0;
  padding-bottom: 32px;
}

.hero .subline {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero .success {
  font-size: 18px;
  color: var(--accent);
  text-align: center;
  margin: 0 auto 32px;
}

.hero > form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: 0 auto 32px;
}

.hero > form input {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 0;
  padding: 12px 16px;
  width: 320px;
  height: 48px;
  outline: none;
}

.hero > form input::placeholder {
  color: var(--text-dim);
}

.hero > form input:focus {
  border-color: var(--accent);
}

.hero > form button {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-on-accent);
  background: var(--accent);
  border: none;
  border-radius: 0;
  padding: 12px 28px;
  height: 48px;
  cursor: pointer;
}

.hero > form button:hover {
  background: var(--accent-hover);
}

.hero .trust {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 auto auto;
  padding-top: 0;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .site-nav {
    padding: 16px 24px;
  }

  .site-nav .nav-links {
    gap: var(--space-4);
  }

  .user-name {
    display: none;
  }

  .user-arrow {
    display: none;
  }

  .hero h1,
  .hero .subline,
  .hero > form,
  .hero .success,
  .hero .trust {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero .subline {
    font-size: 16px;
  }

  .hero > form {
    flex-direction: column;
  }

  .hero > form input {
    width: 100%;
    max-width: 320px;
  }

  .hero > form button {
    width: 100%;
    max-width: 320px;
  }

  .hero .trust {
    padding-bottom: 40px;
  }
}

/* ── Reconciliation ─────────────────────────────────────── */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reconcile {
  min-height: 100vh;
}

.reconcile .content > div {
  animation: fadeSlideIn 300ms ease-out;
}

.reconcile .content {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 80px;
}

.reconcile h1 {
  font-family: "Playfair Display", serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 32px;
}

.reconcile .subline,
.reconcile .help-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
}


.theme-toggle {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.drop-zones {
  display: flex;
  gap: var(--space-8);
  margin-bottom: 32px;
  justify-content: center;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 400px;
  min-height: 240px;
  padding: 32px;
  border: 2px dashed var(--border-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--bg-surface-alt);
}

.drop-zone.active {
  border-color: var(--accent);
  background: var(--bg-dropzone-active);
}

.drop-zone .drop-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.drop-zone .hint {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.drop-zone .file-name {
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 8px;
}

.drop-zone.processing {
  pointer-events: none;
  cursor: default;
  opacity: 0.7;
  border-color: var(--accent);
  border-style: solid;
}

.drop-zone-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Reconciling (loading state) ──────────────────────── */

.reconciling-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: 400px;
}

.pulse-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(13, 110, 110, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 2s ease-in-out infinite;
}

.pulse-icon-inner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(13, 110, 110, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-icon-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.reconciling-status .status-text {
  font-size: 15px;
  color: var(--text-body);
}

.reconciling-details {
  display: flex;
  gap: var(--space-4);
}

.reconciling-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 32px;
  text-align: center;
}

.reconciling-card .value {
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.reconciling-card .label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}

.preview-table {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
}

.preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table thead {
  background: var(--bg-elevated);
}

.preview-table th,
.preview-table td {
  min-width: 80px;
}

.preview-table th {
  padding: 10px 16px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.preview-table thead tr.filter-row th {
  padding: 6px 16px;
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-subtle);
}

.preview-table .column-filter {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-inset);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}

.preview-table .column-filter::placeholder {
  color: var(--text-muted);
}

.preview-table .column-filter:focus {
  border-color: var(--accent);
}

.preview-table td {
  padding: 8px 16px;
  color: var(--text-table);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background 0.15s;
}

.matched-section .preview-table tbody tr:hover td,
.unmatched-section .preview-table tbody tr:hover td {
  background: var(--bg-hover);
}

.matched-section .preview-table table {
  table-layout: fixed;
}

.matched-section .preview-table th:nth-child(1) { width: 36px; }
.matched-section .preview-table th:nth-child(2),
.matched-section .preview-table th:nth-child(3) { width: 12%; }
.matched-section .preview-table th:nth-child(4) { width: 10%; }
.matched-section .preview-table th:nth-child(5),
.matched-section .preview-table th:nth-child(6) { width: 26%; }
.matched-section .preview-table th:nth-child(7) { width: 8%; }

.matched-section.has-multi .preview-table th:nth-child(1) { width: 36px; }
.matched-section.has-multi .preview-table th:nth-child(2),
.matched-section.has-multi .preview-table th:nth-child(3) { width: 11%; }
.matched-section.has-multi .preview-table th:nth-child(4),
.matched-section.has-multi .preview-table th:nth-child(5) { width: 9%; }
.matched-section.has-multi .preview-table th:nth-child(6),
.matched-section.has-multi .preview-table th:nth-child(7) { width: 23%; }
.matched-section.has-multi .preview-table th:nth-child(8) { width: 7%; }

.preview-table tr:nth-child(even) td {
  background: var(--bg-surface-alt);
}

.column-mapping {
  display: flex;
  gap: var(--space-4);
  margin-bottom: 20px;
}

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

.column-mapping label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.column-mapping select {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  height: 36px;
  min-width: 180px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23848484' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.column-mapping select:focus {
  border-color: var(--accent);
}

.actions {
  display: flex;
  align-items: flex-end;
  gap: var(--space-6);
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-primary);
  margin-bottom: 40px;
}

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

.actions label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.actions select {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.actions select:focus {
  border-color: var(--accent);
}

.reconcile h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.result-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  height: 44px;
  width: fit-content;
  margin: 0 auto 40px;
}

.result-tab {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.result-tab:hover {
  color: var(--text-secondary);
}

.result-tab.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.results {
  margin-top: 0;
}

.match-rate {
  text-align: center;
  margin-bottom: 40px;
}

.match-rate .number {
  font-family: "JetBrains Mono", monospace;
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.match-rate .caption {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.matched-section {
  margin-bottom: 40px;
}

.matched-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
}

.matched-section h3::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.matched-section .preview-table td {
  background: var(--bg-matched);
  border-top-color: var(--border-matched);
}

.matched-section .preview-table tr:nth-child(even) td {
  background: var(--bg-matched-alt);
}

.matched-section .preview-table tr.multi-match td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}

.matched-section .preview-table tr.multi-match-first td {
  border-top: 1px solid var(--border-matched);
}

.match-type {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.unmatched-section {
  margin-bottom: 40px;
}

.unmatched-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-primary);
}

.unmatched-section h3::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--accent-unmatched);
  border-radius: 2px;
  flex-shrink: 0;
}

.unmatched-section .preview-table td {
  background: var(--bg-unmatched);
  border-top-color: var(--border-unmatched);
}

.unmatched-section .note {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination button {
  font-size: 13px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
}

.pagination button:disabled {
  color: var(--text-muted);
  cursor: default;
  border-color: var(--border-subtle);
}

.btn,
.btn-secondary,
.btn-unmatch,
.btn-review,
.btn-apply,
.btn-match,
.btn-dismiss,
.btn-confirm-match {
  font-family: "Geist", sans-serif;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-on-accent);
  background: var(--accent);
  width: 160px;
  height: 44px;
  transition: background 0.2s;
}

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

.btn-secondary {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  width: 160px;
  height: 44px;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--text-on-accent);
}

@media (max-width: 768px) {
  .reconcile .content {
    padding: 32px 16px;
  }

  .reconcile h1 {
    font-size: 28px;
  }

  .drop-zones {
    flex-direction: column;
  }

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

  .column-mapping select {
    width: 100%;
  }

  .drop-zone {
    width: 100%;
  }

  .match-rate .number {
    font-size: 40px;
  }

  /* Card layout for results tables on mobile */
  .matched-section .preview-table,
  .unmatched-section .preview-table {
    border: none;
    border-radius: 0;
  }

  .matched-section .preview-table table,
  .unmatched-section .preview-table table {
    table-layout: auto;
  }

  .matched-section .preview-table thead,
  .unmatched-section .preview-table thead {
    display: none;
  }

  .matched-section .preview-table tbody tr,
  .unmatched-section .preview-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .matched-section .preview-table td,
  .unmatched-section .preview-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 16px;
    text-align: right;
  }

  /* Override desktop fixed width so checkbox td fills the card */
  .matched-section .preview-table td.checkbox-col,
  .unmatched-section .preview-table td.checkbox-col {
    width: auto;
    justify-content: flex-start;
  }

  .matched-section .preview-table td::before,
  .unmatched-section .preview-table td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 16px;
    flex-shrink: 0;
    text-align: left;
  }

  .matched-section .preview-table tr:nth-child(even) td {
    background: var(--bg-matched-alt);
  }

  .unmatched-section .preview-table tr:nth-child(even) td {
    background: var(--bg-unmatched);
  }

  /* Result tabs: compact on mobile to fit all tabs */
  .result-tabs {
    width: auto;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 3px;
    gap: 2px;
    height: 38px;
  }

  .result-tabs::-webkit-scrollbar {
    display: none;
  }

  .result-tab {
    padding: 0 8px;
    font-size: 11px;
    height: 32px;
  }

  /* Hide empty Type cells on mobile cards */
  .matched-section .preview-table td.match-type:empty,
  .matched-section .preview-table td.checkbox-col:empty {
    display: none;
  }

}

/* --- Checkbox column --- */

.checkbox-col {
  width: 36px;
  text-align: center;
}

.preview-table tr.selected td {
  background: var(--accent-unmatched-subtle);
}

/* --- Action bars --- */

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-size: 13px;
  background: var(--accent-unmatched-bg);
  border: 1px solid var(--accent-unmatched-border);
  color: var(--accent-unmatched);
}

.action-bar span {
  font-weight: 500;
}

.btn-unmatch,
.btn-review,
.btn-apply {
  background: var(--accent-unmatched);
  color: var(--text-on-accent);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
}

.btn-unmatch:hover,
.btn-review:hover,
.btn-apply:hover {
  opacity: 0.9;
}

/* --- Review tab badge --- */

.result-tab-review {
  gap: 6px;
}

.review-badge {
  background: var(--accent-unmatched);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
}

/* --- Review tab content --- */

.review-section {
  padding: 0;
}

.review-section h2 {
  margin-bottom: 12px;
}

.review-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.review-column h3,
.pending-matches-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.review-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.review-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.review-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.review-row-actions {
  display: flex;
  gap: 6px;
}

.btn-dismiss {
  background: none;
  border: 1px solid var(--border-primary);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-dismiss:hover {
  border-color: var(--text-dim);
  color: var(--text-body);
}

.empty-review {
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
  padding: 20px 0;
  text-align: center;
}

.action-bar-apply {
  margin-top: 20px;
}

.action-bar-buttons {
  display: flex;
  gap: var(--space-2);
}

.btn-apply {
  padding: 6px 20px;
}

.btn-match {
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 4px 12px;
  font-size: 12px;
}

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

/* --- Pending matches --- */

.pending-matches-section {
  margin-top: 20px;
}

.pending-matches-section h3 {
  margin-bottom: 8px;
}

.pending-match {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: var(--accent-unmatched-subtle);
  border: 1px solid var(--accent-unmatched-border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--accent-unmatched);
}

/* --- Match picker modal --- */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.match-picker {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  width: min(480px, calc(100vw - 32px));
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-primary);
}

.picker-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.picker-source {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.picker-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}

.picker-close:hover {
  color: var(--text-secondary);
}

.picker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
}

.picker-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.picker-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.picker-search {
  padding: 8px 16px;
}

.picker-search input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-body);
  font-family: "Geist", sans-serif;
  box-sizing: border-box;
}

.picker-search input::placeholder {
  color: var(--text-dim);
}

.picker-candidates {
  padding: 0 16px;
  overflow-y: auto;
  max-height: 300px;
}

.picker-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.picker-candidate:hover {
  border-color: var(--text-dim);
}

.picker-candidate.selected {
  background: rgba(13, 110, 110, 0.08);
  border-color: var(--accent);
}

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

.candidate-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.candidate-detail {
  font-size: 11px;
  color: var(--text-secondary);
}

.candidate-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-on-accent);
}

.candidate-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.picker-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border-top: 1px solid var(--border-primary);
}

.picker-total {
  font-size: 12px;
  color: var(--text-secondary);
}

.total-match {
  color: var(--accent-success);
  font-weight: 600;
}

.total-mismatch {
  color: var(--accent-unmatched);
  font-weight: 600;
}

.btn-confirm-match {
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 500;
}

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

.btn-confirm-match.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   Mobile overrides for review, action bars, and match picker.
   Placed AFTER all desktop rules so source order wins.
   ============================================================ */
@media (max-width: 768px) {
  .review-columns {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .review-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .review-row-info {
    min-width: 0;
    flex: 1;
  }

  .review-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .action-bar {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .action-bar-buttons {
    width: 100%;
  }

  .action-bar-buttons .btn-apply,
  .action-bar-buttons .btn-secondary {
    flex: 1;
  }

  .picker-header > div {
    min-width: 0;
    overflow: hidden;
  }

  .picker-total {
    min-width: 0;
  }
}

/* --- Disambiguation modal --- */

.disambig-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.67);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.disambig-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  width: min(480px, calc(100vw - 32px));
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.5);
}

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

.disambig-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.disambig-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  background: rgba(13, 110, 110, 0.15);
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.disambig-anchor {
  padding: 16px 20px;
}

.disambig-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.disambig-bank-card {
  background: var(--bg-matched);
  border: 1px solid var(--border-matched);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.disambig-bank-card .disambig-desc {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disambig-bank-card .disambig-date {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.disambig-bank-card .disambig-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  color: var(--accent);
  white-space: nowrap;
}

.disambig-candidates {
  padding: 0 20px 16px;
  overflow-y: auto;
  flex: 1;
}

.disambig-candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  margin-top: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.disambig-candidate:hover {
  background: var(--bg-hover);
}

.disambig-candidate.selected {
  border-color: var(--accent);
  background: rgba(13, 110, 110, 0.1);
}

.disambig-candidate.selected .disambig-candidate-info .disambig-desc {
  color: var(--text-primary);
}

.disambig-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.disambig-candidate.selected .disambig-radio {
  border-color: var(--accent);
}

.disambig-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.disambig-candidate.selected .disambig-radio-dot {
  background: var(--accent);
}

.disambig-candidate-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.disambig-candidate-info .disambig-desc {
  font-size: 14px;
  color: var(--text-table);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disambig-candidate-info .disambig-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.disambig-candidate .disambig-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--text-table);
  white-space: nowrap;
}

.disambig-candidate.selected .disambig-amount {
  color: var(--text-primary);
}

.disambig-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: flex-end;
}

.disambig-confirm {
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.disambig-confirm:hover:not(:disabled) {
  background: var(--accent-hover);
}

.disambig-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- PDF Review Step --- */

.reconcile .content:has(.pdf-review) {
  max-width: 1600px;
}

.pdf-review {
  width: 100%;
}

.pdf-review h1 {
  text-align: center;
}

.pdf-review .subline {
  text-align: center;
  margin-bottom: 24px;
}

.pdf-review-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.page-indicators {
  display: flex;
  gap: 8px;
  align-items: center;
}

.page-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  font-family: "Geist", sans-serif;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.page-dot.active {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}

.page-dot.confirmed {
  background: var(--bg-matched);
  color: var(--accent);
  border-color: var(--accent);
}

.page-dot.confirmed.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.pdf-review-split {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}

.pdf-review-image {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pdf-review-image .pdf-page-label {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  padding-bottom: 12px;
  line-height: 24px;
}

.pdf-review-image img {
  width: 100%;
  flex: 1;
  object-fit: contain;
  object-position: top;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.pdf-review-table {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pdf-review-table-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
}

.pdf-review-table-header .table-title {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.pdf-review-table-header .row-count {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 10px;
  border-radius: 999px;
}

.pdf-review-table .preview-table {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.pdf-review-table .preview-table table {
  width: 100%;
}

.pdf-review-table .preview-table td,
.pdf-review-table .preview-table th {
  white-space: normal;
  word-break: break-word;
}

.pdf-review-table .preview-table td:first-child,
.pdf-review-table .preview-table th:first-child {
  white-space: nowrap;
  min-width: 110px;
}

.pdf-review-table .preview-table td:nth-last-child(2),
.pdf-review-table .preview-table td:nth-last-child(3),
.pdf-review-table .preview-table th:nth-last-child(2),
.pdf-review-table .preview-table th:nth-last-child(3) {
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
}

.pdf-review-table .preview-table td {
  font-size: 14px;
}

.pdf-review-table .preview-table th {
  font-size: 13px;
}

.pdf-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* Editable cells */
.pdf-review-table td {
  cursor: pointer;
  transition: background 0.1s ease;
}

.pdf-review-table td:hover {
  background: var(--bg-secondary);
}

.pdf-review-table td.editing {
  padding: 0;
}

.pdf-review-table td.editing input {
  width: 100%;
  height: 100%;
  padding: 8px 16px;
  text-align: inherit;
  border: none;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  background: inherit;
  color: var(--text-primary);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.btn-undo-remove {
  margin-left: 0;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

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

.btn-add-row {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

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

.row-actions {
  width: 32px;
  text-align: center;
}

.btn-delete-row {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}

.btn-delete-row:hover {
  color: var(--error);
  background: var(--bg-secondary);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .pdf-review-split {
    flex-direction: column;
  }

  .pdf-review-image {
    flex: none;
    max-height: 250px;
    overflow: hidden;
  }

  .pdf-review-image img {
    max-height: 230px;
    object-fit: cover;
    object-position: top;
  }

  .pdf-review-nav {
    flex-wrap: wrap;
  }

  .pdf-review-actions {
    flex-direction: column;
  }

  .pdf-review-actions button {
    width: 100%;
  }
}

/* --- App sidebar --- */

.app-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 220px;
  min-width: 220px;
  padding: 24px 16px;
  background: var(--bg-surface-alt);
  border-right: 1px solid var(--border-subtle);
}

.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.app-sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.app-sidebar-item--active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 500;
}

.app-sidebar-icon {
  width: 16px;
  text-align: center;
  font-size: 14px;
}

.app-content {
  flex: 1;
  min-width: 0;
}

/* --- Tour overlay --- */

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: auto;
}

.tour-spotlight {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  background: transparent;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

.tour-tooltip {
  position: fixed;
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
  z-index: 2;
  transition: all 0.3s ease;
}

.tour-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-step-counter {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
}

.tour-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.tour-close:hover {
  color: var(--text-primary);
}

.tour-tooltip-title {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.tour-tooltip-desc {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
}

.tour-tooltip-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-skip {
  background: none;
  border: none;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
}

.tour-skip:hover {
  color: var(--text-primary);
}

.tour-tooltip-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tour-back {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.tour-back:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.tour-next {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-accent);
  cursor: pointer;
}

.tour-next:hover {
  background: var(--accent-hover);
}

.tour-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
  transition: all 0.2s ease;
}

.tour-dot--active {
  width: 8px;
  height: 8px;
  background: var(--accent);
}

/* --- PDF to Excel converter --- */

.review-pagination {
  display: flex;
  align-items: center;
  gap: 16px;
}

.review-page-info {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-secondary);
}

.review-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Geist", sans-serif;
  font-size: 13px;
}

.review-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  padding: 10px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-primary);
}

.review-table td {
  padding: 10px 16px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

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