* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #111827;
  background: #f4f6fb;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.auth-hero {
  background: linear-gradient(135deg, #0f172a, #1f2937);
  color: #e2e8f0;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-hero h1 {
  font-size: 36px;
  margin: 0 0 12px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-brand h1 {
  margin: 0;
}

.auth-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 14px;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.25);
}

.auth-hero p {
  line-height: 1.6;
  margin: 0;
  max-width: 440px;
}

.auth-panel {
  background: #ffffff;
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.card h2 {
  margin: 0 0 8px;
}

.muted {
  color: #6b7280;
  margin-bottom: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.field label {
  font-size: 14px;
  margin-bottom: 6px;
  color: #374151;
}

.field input,
.field select,
.field textarea {
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  width: 100%;
}

.field input[type="checkbox"],
.field input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: #111827;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.btn-block {
  width: 100%;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn-ghost {
  background: transparent;
  color: #111827;
  border: 1px solid #d1d5db;
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.alert {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 24px;
}

.sidebar h3 {
  margin: 0 0 20px;
  font-size: 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.sidebar-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.25);
}

.nav a,
.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(148, 163, 184, 0.08);
  color: inherit;
  font: inherit;
  text-align: left;
}

.nav a:hover,
.nav-link:hover {
  background: rgba(148, 163, 184, 0.18);
}

.nav-dropdown {
  margin-bottom: 8px;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-dropdown-icon {
  font-size: 12px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.nav-dropdown[open] .nav-dropdown-icon {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-left: 10px;
}

.nav-dropdown-menu a {
  margin-bottom: 0;
  background: rgba(148, 163, 184, 0.12);
}

.content {
  padding: 32px;
}

.content-standalone {
  max-width: 960px;
  margin: 0 auto;
}

/* SUDESKA visual system */
:root {
  --ink: #172033;
  --muted: #69758a;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --line: #e3e9f2;
  --navy: #10233f;
  --navy-deep: #09172b;
  --teal: #0e9f8d;
  --teal-dark: #087e71;
  --aqua: #d9f5ef;
  --amber: #f4a844;
  --shadow: 0 18px 45px rgba(24, 48, 84, 0.09);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

.auth-wrap { grid-template-columns: minmax(420px, 1.2fr) minmax(380px, .8fr); background: var(--canvas); }
.auth-hero { position: relative; overflow: hidden; padding: clamp(36px, 6vw, 88px); background: linear-gradient(140deg, #092039 0%, #10365b 52%, #087e71 150%); }
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 999px; pointer-events: none; }
.auth-hero::before { width: 450px; height: 450px; right: -150px; top: -115px; border: 70px solid rgba(113, 224, 203, .12); }
.auth-hero::after { width: 300px; height: 300px; left: -110px; bottom: -180px; background: rgba(66, 211, 184, .1); }
.auth-hero > * { position: relative; z-index: 1; }
.hero-eyebrow, .eyebrow, .topbar-kicker, .stat-label, .nav-label { display: block; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.hero-eyebrow { color: #8be2d4; margin-bottom: 20px; }
.auth-brand { gap: 16px; }
.auth-brand h1 { font-size: clamp(40px, 5vw, 62px); letter-spacing: -.055em; }
.auth-logo { width: 64px; height: 64px; border-radius: 18px; }
.auth-hero p { color: #d8e5ef; font-size: 17px; max-width: 520px; }
.hero-footer { display: flex; align-items: center; gap: 12px; }
.hero-footer p { font-size: 14px; }
.hero-orb { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #6fe1ce; box-shadow: 0 0 0 7px rgba(111, 225, 206, .14); }
.auth-panel { position: relative; padding: clamp(28px, 5vw, 72px); background: #f9fbfd; }
.card { max-width: 440px; padding: 36px; border: 1px solid #e7edf5; border-radius: 24px; box-shadow: var(--shadow); }
.card h2 { font-size: 28px; letter-spacing: -.03em; }
.card .muted { font-size: 14px; line-height: 1.6; }

.shell { grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: relative; min-height: 100vh; height: auto; padding: 28px 16px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); box-shadow: 8px 0 35px rgba(6, 20, 40, .12); display: flex; flex-direction: column; }
.sidebar-brand { padding: 0 10px 27px; margin: 0 0 18px; color: #fff; text-decoration: none; }
.sidebar-brand > span:last-child { display: grid; gap: 4px; font-size: 20px; letter-spacing: -.025em; }
.sidebar-brand small { color: #8be2d4; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.sidebar-brand img, .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.brand-mark { display: grid; place-items: center; background: linear-gradient(135deg, #31c5ad, #0f8d9a); color: #fff; font-size: 20px; font-weight: 800; box-shadow: 0 10px 22px rgba(14, 159, 141, .34); }
.nav-label { color: #7f94b1; padding: 0 12px 9px; }
.nav-label-spaced { margin-top: 18px; }
.nav { flex: 0 0 auto; min-height: 0; overflow: visible; padding-right: 0; }
.nav a, .nav-link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 4px; color: #b7c6da; background: transparent; border-radius: 10px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.nav a:hover, .nav-link:hover { color: #fff; background: rgba(127, 190, 207, .12); transform: translateX(2px); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(31, 184, 162, .28), rgba(31, 184, 162, .06)); box-shadow: inset 3px 0 0 #42d1ba; }
.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(146, 205, 183, 0.35);
  background: rgba(83, 152, 125, 0.17);
  color: #dff3e9;
}
.nav-icon svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: currentColor;
}
.nav a.active .nav-icon {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.2);
}
.nav-dropdown-toggle > span:first-child { display: flex; align-items: center; gap: 10px; }
.nav-dropdown-menu { margin: 3px 0 7px 11px; padding-left: 13px; border-left: 1px solid rgba(143, 177, 209, .2); }
.nav-dropdown-menu a { padding: 8px 10px; font-size: 13px; }
.nav-logout {
  margin-top: 20px !important;
  color: #ffe0d9 !important;
  border: 1px solid rgba(255, 174, 156, 0.3) !important;
  background: rgba(255, 122, 96, 0.14) !important;
}
.nav-logout:hover {
  color: #fff7f5 !important;
  border-color: rgba(255, 196, 182, 0.5) !important;
  background: rgba(255, 138, 110, 0.22) !important;
}
.theme-switcher {
  margin: 12px 10px 0;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(143, 177, 209, .22);
  background: rgba(125, 162, 191, .08);
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
}
.theme-switcher label {
  color: #9cb2c8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.theme-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(160, 198, 227, .25);
  background: rgba(13, 31, 52, .7);
  color: #d8e7f7;
  padding: 7px 8px;
}
.theme-apply-btn {
  width: 100%;
  margin-top: 2px;
}
.theme-palette-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.theme-palette-option {
  border: 1px solid rgba(160, 198, 227, .22);
  border-radius: 8px;
  background: rgba(17, 40, 65, .62);
  color: #d9e8f6;
  padding: 6px;
  display: grid;
  gap: 5px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.theme-palette-option:hover {
  transform: translateY(-1px);
  border-color: rgba(186, 222, 245, .34);
  background: rgba(28, 58, 89, .74);
}
.theme-palette-option.active {
  border-color: rgba(222, 244, 230, .6);
  box-shadow: 0 0 0 1px rgba(222, 244, 230, .25) inset;
}
.theme-palette-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}
.theme-palette-swatches i {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--sw);
}
.theme-palette-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.theme-active-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(183, 221, 199, .28);
  background: rgba(125, 180, 146, .12);
  color: #cfe7d9;
  font-size: 11px;
  font-weight: 700;
}
.theme-active-indicator::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7fd7ab;
  box-shadow: 0 0 0 4px rgba(127, 215, 171, .17);
  animation: themePulse 1.8s ease-in-out infinite;
}
.theme-active-hint {
  margin: 0;
  color: #b7d7c5;
  font-size: 11px;
  line-height: 1.45;
}
.theme-switcher[data-active-preset="earth"] .theme-active-indicator {
  border-color: rgba(236, 192, 138, .33);
  background: rgba(190, 132, 74, .16);
  color: #f0d9bf;
}
.theme-switcher[data-active-preset="earth"] .theme-active-indicator::before {
  background: #e4ab6a;
  box-shadow: 0 0 0 4px rgba(228, 171, 106, .17);
}
.theme-switcher[data-active-preset="ocean"] .theme-active-indicator {
  border-color: rgba(142, 194, 234, .35);
  background: rgba(74, 135, 188, .17);
  color: #c9e4f8;
}
.theme-switcher[data-active-preset="ocean"] .theme-active-indicator::before {
  background: #73b5e8;
  box-shadow: 0 0 0 4px rgba(115, 181, 232, .2);
}
.theme-switcher[data-active-preset="earth"] .theme-active-hint {
  color: #f3ddc3;
}
.theme-switcher[data-active-preset="ocean"] .theme-active-hint {
  color: #cae7fb;
}

@keyframes themePulse {
  0% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-active-indicator::before {
    animation: none;
  }

  body.theme-forest,
  body.theme-forest .panel,
  body.theme-forest .card,
  body.theme-forest .table,
  body.theme-forest .overlay-card,
  body.theme-forest .stat,
  body.theme-forest .field-card,
  body.theme-forest.theme-transitioning .content,
  body.theme-forest.theme-transitioning .sidebar,
  body.theme-forest.theme-transitioning .panel,
  body.theme-forest.theme-transitioning .card,
  body.theme-forest.theme-transitioning .table,
  body.theme-forest.theme-transitioning .overlay-card,
  body.theme-forest.theme-transitioning .stat,
  body.theme-forest.theme-transitioning .section-hero,
  body.theme-forest.theme-transitioning .theme-switcher,
  body.theme-forest.theme-transitioning .theme-palette-option {
    transition: none;
  }
}
.content { min-width: 0; padding: 0 clamp(22px, 4vw, 52px) 44px; }
.topbar { height: 94px; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.topbar > div:first-child { display: grid; gap: 4px; font-size: 14px; }
.topbar-kicker { color: var(--teal); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip { display: flex; align-items: center; gap: 9px; color: #556277; font-size: 13px; font-weight: 700; }
.user-chip > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--teal), #57c6ba); }

.dashboard-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 29px 0 28px; }
.eyebrow { color: var(--teal); margin-bottom: 8px; }
.dashboard-intro h1 { margin: 0; font-size: clamp(27px, 3vw, 36px); letter-spacing: -.045em; }
.dashboard-intro p { max-width: 590px; margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.btn { border-radius: 10px; padding: 11px 15px; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); box-shadow: 0 8px 18px rgba(14, 159, 141, .18); transition: transform .18s ease, box-shadow .18s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 23px rgba(14, 159, 141, .25); }
.btn-secondary { background: #e8f4f1; color: #0c766b; box-shadow: none; }
.btn-ghost { background: #fff; color: #43516a; border-color: #dce5ef; box-shadow: none; }
.btn-ghost:hover { background: #f7fbfa; }
.stat-grid { gap: 16px; }
.stat { position: relative; overflow: hidden; padding: 21px; border: 1px solid #e6edf4; border-radius: 18px; box-shadow: 0 9px 24px rgba(29, 61, 98, .055); }
.stat::after { content: ""; position: absolute; right: -9px; bottom: -16px; width: 68px; height: 68px; border-radius: 50%; background: var(--aqua); opacity: .65; }
.stat:nth-child(2)::after { background: #dcecff; }.stat:nth-child(3)::after { background: #fff0d7; }.stat:nth-child(4)::after { background: #eee3ff; }
.stat-label { color: #738098; margin-bottom: 12px; }.stat strong { position: relative; z-index: 1; display: block; font-size: 30px; line-height: 1; letter-spacing: -.04em; }.stat div { margin-top: 9px; color: var(--muted); font-size: 13px; }
.panel, .overlay-card { border: 1px solid #e6edf4; border-radius: 18px; box-shadow: var(--shadow); }
.panel { padding: 22px; }.panel-header h3 { margin: 0; letter-spacing: -.02em; }.muted { color: var(--muted); }
.panel,
.overlay-card,
.section-hero,
.stat,
.field-card,
.ba-download-group {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.panel:hover,
.overlay-card:hover,
.section-hero:hover,
.ba-download-group:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(31, 73, 55, 0.11);
}
.filter-grid .field,
.ba-filter-panel .field,
.overlay-form .field {
  transition: transform 0.16s ease;
}
.filter-grid .field:focus-within,
.ba-filter-panel .field:focus-within,
.overlay-form .field:focus-within {
  transform: translateY(-1px);
}
.field label { color: #42516a; font-weight: 650; }.field input, .field select, .field textarea { border-color: #dbe4ef; border-radius: 10px; background: #fbfcfe; transition: border-color .18s ease, box-shadow .18s ease; }.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #36b9aa; box-shadow: 0 0 0 4px rgba(54, 185, 170, .13); background: #fff; }
.table { border: 1px solid #e6edf4; border-radius: 16px; box-shadow: var(--shadow); }.table th { padding: 14px 16px; color: #718096; background: #f8fafc; }.table td { padding: 14px 16px; color: #3f4b60; }.table tbody tr { transition: background .16s ease; }.table tbody tr:hover { background: #f6fbfa; }
.page-header h1 { margin: 0; letter-spacing: -.035em; }.page-header .muted { margin: 6px 0 0; }.flash, .alert { border: 1px solid transparent; }.flash-success { border-color: #bdebdc; }.flash-error, .alert { border-color: #f9c8c8; }
.geo-map { border-color: #dbe5ed; border-radius: 14px; }.overlay-card { box-shadow: none; background: #fbfcfe; }
.project-setup-panel { overflow: hidden; margin-bottom: 24px; border: 1px solid #dce9f0; border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.project-setup-note { display: flex; align-items: flex-start; gap: 12px; padding: 15px 20px; color: #24536b; background: linear-gradient(90deg, #e9f8f5, #f6fbff); border-bottom: 1px solid #dcecef; }
.project-setup-note-icon { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--teal); font-size: 13px; font-weight: 800; }
.project-setup-note strong { font-size: 14px; }.project-setup-note p { margin: 3px 0 0; color: #607289; font-size: 13px; line-height: 1.45; }
.project-setup-frame,
.setup-project-frame {
  display: block;
  width: 100%;
  min-height: 0;
  height: 520px;
  border: 0;
  border-radius: 18px;
  background: #eef2f7;
  box-shadow: 0 16px 38px rgba(27, 58, 92, 0.08);
  transition: height .18s ease;
}
.saved-projects { overflow: hidden; border: 1px solid #e0e8f1; border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(29, 61, 98, .05); }.saved-projects > summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; font-weight: 750; list-style: none; }.saved-projects > summary::-webkit-details-marker { display: none; }.saved-projects > summary::after { content: '⌄'; margin-left: 10px; color: var(--teal); transition: transform .2s ease; }.saved-projects[open] > summary::after { transform: rotate(180deg); }.saved-projects-count { display: inline-grid; place-items: center; min-width: 25px; height: 25px; margin-left: auto; margin-right: 8px; border-radius: 50%; color: #087e71; background: #dcf5f0; font-size: 12px; }.saved-projects .table { border: 0; border-radius: 0; box-shadow: none; }

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }.auth-hero { min-height: 38vh; }.auth-panel { padding: 28px 20px; }
  .shell { grid-template-columns: 1fr; }.sidebar { position: static; height: auto; padding: 18px; }.sidebar-brand { padding-bottom: 15px; }.nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }.nav-label, .nav-dropdown { display: none; }.nav a { flex: 0 0 auto; margin: 0; }.nav-logout { margin-top: 0 !important; }.content { padding: 0 20px 32px; }.topbar { height: 74px; }.topbar > div:first-child { display: none; }.topbar { justify-content: flex-end; }.dashboard-intro { align-items: flex-start; flex-direction: column; margin-top: 24px; }.dashboard-intro .btn { width: 100%; }.dashboard-map { height: 380px; }.project-setup-frame, .setup-project-frame { min-height: 0; height: 640px; }
}

@media (max-width: 520px) { .card { padding: 26px; }.auth-hero { padding: 32px 28px; }.auth-brand h1 { font-size: 38px; }.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.stat { padding: 16px; }.stat strong { font-size: 26px; }.panel { padding: 16px; } }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.panel {
  background: #ffffff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-map .panel-header {
  margin-bottom: 6px;
}

.inline-help {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.inline-form {
  margin: 0;
}

.form-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
}

.rating-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  font-size: 13px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-row input[type="range"] {
  flex: 1;
  padding: 0;
  border: none;
}

.range-value {
  min-width: 48px;
  text-align: right;
  font-weight: 600;
}

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
}

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

.matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-table th,
.matrix-table td {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  text-align: center;
}

.matrix-row-label {
  text-align: left;
  font-weight: 600;
}

.note-block {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5f0;
  color: #374151;
  font-size: 14px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.file-input-wrap {
  position: relative;
  width: 100%;
}

.file-input-wrap input[type="file"] {
  padding-right: 46px;
}

.file-input-action {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.file-input-action:hover {
  background: #f3f4f6;
}

.file-input-action:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.file-input-icon {
  width: 16px;
  height: 16px;
  fill: #111827;
}

.settings-media {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.settings-preview {
  width: 120px;
  height: 120px;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
}

.settings-preview-sm {
  width: 64px;
  height: 64px;
}

.settings-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.settings-note {
  font-size: 12px;
  color: #6b7280;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.overlay-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr) minmax(260px, 1.1fr);
  gap: 16px;
  margin: 12px 0 8px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 4px;
}

.overlay-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 10px;
  align-content: start;
}

.overlay-card .field {
  margin-bottom: 0;
}


.overlay-form {
  display: grid;
  gap: 10px;
}

.overlay-saved {
  margin-top: 0;
}

.geo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.geo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.geo-map {
  margin-top: 10px;
  height: 260px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

.geo-map-inline {
  height: 200px;
}

.dashboard-map {
  height: 560px;
}

.panel-map .dashboard-map {
  margin-top: 6px;
}

.panel-map .inline-help {
  margin-top: 4px;
}

.panel-map .overlay-grid {
  margin-top: 10px;
}

.geo-map-fallback {
  padding: 12px;
  font-size: 13px;
  color: #6b7280;
}

.geo-popup {
  min-width: min(280px, 86vw);
  width: min(520px, 86vw);
  max-width: min(520px, 86vw);
  font-size: 12px;
  color: #111827;
  max-height: 70vh;
  overflow: hidden;
  padding-right: 2px;
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
}

.leaflet-popup-content {
  width: min(520px, 86vw) !important;
  max-width: min(520px, 86vw);
  margin: 10px 12px;
}

.geo-popup-title {
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.geo-popup-meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.geo-popup-status,
.geo-popup-empty {
  font-size: 12px;
  color: #6b7280;
}

.geo-popup-section {
  margin-top: 8px;
}

.geo-popup-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 4px;
}

.geo-popup-list {
  display: grid;
  gap: 8px;
  max-height: 44vh;
  overflow: auto;
  padding: 2px 6px 2px 0;
}

.geo-popup-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e7eb;
}

.geo-popup-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.geo-popup-label {
  font-weight: 600;
  color: #374151;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.geo-popup-value {
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.geo-popup-images {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.geo-popup-image-card {
  display: grid;
  gap: 4px;
  overflow: visible;
}

.geo-popup-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  display: block;
}

.geo-popup-image-label {
  font-size: 11px;
  color: #6b7280;
}

.geo-popup-files {
  display: grid;
  gap: 6px;
  max-height: 18vh;
  overflow: auto;
  padding-right: 4px;
}

.geo-popup-file,
.geo-popup-link {
  font-size: 12px;
  color: #111827;
  text-decoration: underline;
}

.geo-popup-links {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.geo-popup-details {
  margin-top: 8px;
  border-top: 1px solid #e5e7eb;
  padding-top: 6px;
}

.geo-popup-details > summary {
  cursor: pointer;
  font-size: 12px;
  color: #374151;
  font-weight: 600;
  list-style: none;
}

.geo-popup-details > summary::-webkit-details-marker {
  display: none;
}

.geo-popup-details > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transform-origin: center;
  transition: transform 0.15s ease;
}

.geo-popup-details[open] > summary::before {
  transform: rotate(90deg);
}

.geo-popup-list-technical {
  margin-top: 6px;
  max-height: 26vh;
}

.geo-popup-technical-section {
  margin-top: 8px;
}

.geo-popup-technical-section:first-of-type {
  margin-top: 6px;
}

.geo-popup-technical-title {
  font-size: 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px 8px 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #4b5563;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .geo-popup {
    width: min(94vw, 420px);
    max-width: min(94vw, 420px);
    max-height: 64vh;
    padding: 2px 0;
  }

  .leaflet-popup-content {
    width: min(94vw, 420px) !important;
    max-width: min(94vw, 420px);
    margin: 8px 10px;
  }

  .geo-popup-list {
    max-height: 36vh;
  }
}

.geo-popup-technical-title::-webkit-details-marker {
  display: none;
}

.geo-popup-technical-title::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transform-origin: center;
  transition: transform 0.15s ease;
}

.geo-popup-technical-section[open] > .geo-popup-technical-title::before {
  transform: rotate(90deg);
}

.pagination {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.page-link {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
}

.page-link.current {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.table-select {
  width: 100%;
}

.mono {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  color: #374151;
  word-break: break-all;
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  background: #f8fafc;
}

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

.ba-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: stretch;
  background: linear-gradient(135deg, #0d4f88, #0f766e);
  color: #e6f7ff;
  border: 0;
}

.ba-hero h1 {
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.ba-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfe9ff;
}

.ba-hero .muted {
  color: #d6ecff;
  margin: 8px 0 0;
}

.ba-layer-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ba-layer-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  color: #d9f3ff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.ba-layer-summary strong {
  color: #ffffff;
}

.ba-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
  min-width: 310px;
}

.ba-stat {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.ba-stat span {
  font-size: 12px;
  color: #d9f3ff;
}

.ba-stat strong {
  font-size: 25px;
  line-height: 1;
  color: #ffffff;
}

.ba-panel .panel-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.ba-table-wrap {
  max-height: 70vh;
  overflow: auto;
  position: relative;
}
.ba-table-wrap::after {
  content: "";
  position: sticky;
  display: block;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 24px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(243, 248, 244, 0.95));
}

.ba-table th,
.ba-table td {
  white-space: nowrap;
}

.ba-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.ba-filter-actions {
  justify-content: flex-start;
}

.ba-download-panel .panel-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.ba-download-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.ba-download-group {
  border: 1px solid #dbe6f2;
  border-radius: 12px;
  background: #f7fbff;
  padding: 12px;
}

.ba-download-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e3a5f;
  margin-bottom: 8px;
}

.ba-download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 900px) {
  .ba-hero {
    flex-direction: column;
  }

  .ba-hero-stats {
    min-width: 0;
    grid-template-columns: 1fr 1fr;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions form {
  margin: 0;
}

.flash {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

.field-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.field-card.dragging {
  opacity: 0.6;
}

.field-card.drag-over {
  border-color: #94a3b8;
}

.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.builder-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.6fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.config-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.config-field {
  margin-bottom: 0;
}

.logic-row {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.hidden {
  display: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat {
  background: #ffffff;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 32px;
  }

  .auth-panel {
    padding: 32px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .page-header {
    align-items: flex-start;
  }

  .builder-row,
  .logic-row {
    grid-template-columns: 1fr;
  }

  .geo-grid {
    grid-template-columns: 1fr;
  }
}

/* Forest Neo Theme Override */
:root {
  --forest-900: #173126;
  --forest-800: #214535;
  --forest-700: #2f6148;
  --forest-600: #3b7a5a;
  --moss-500: #6b8f52;
  --earth-500: #8b6b47;
  --sand-100: #f6f3ec;
  --mist-100: #eef6f2;
  --ink-900: #1d2b24;
  --ink-700: #41574c;
  --line-soft: #d7e3dc;
  --glow-soft: 0 22px 42px rgba(27, 59, 45, 0.11);
}

body.theme-forest {
  font-family: "Plus Jakarta Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(1200px 680px at 88% -10%, rgba(107, 143, 82, 0.22), transparent 66%),
    radial-gradient(1000px 540px at -15% 12%, rgba(59, 122, 90, 0.18), transparent 68%),
    linear-gradient(180deg, #f8fbf8 0%, var(--sand-100) 100%);
  transition: background 0.35s ease, color 0.3s ease;
}

body.theme-forest::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.23;
  background-image: linear-gradient(125deg, rgba(255, 255, 255, 0.14) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.14) 75%, transparent 75%, transparent);
  background-size: 34px 34px;
}

body.theme-forest .shell,
body.theme-forest .content,
body.theme-forest .sidebar,
body.theme-forest .auth-wrap,
body.theme-forest .auth-panel,
body.theme-forest .auth-hero {
  position: relative;
  z-index: 1;
}

body.theme-forest .auth-hero {
  background: linear-gradient(145deg, #153629 0%, #235140 45%, #3b7a5a 100%);
}

body.theme-forest .auth-brand h1,
body.theme-forest .topbar strong,
body.theme-forest .dashboard-intro h1,
body.theme-forest .ba-hero h1,
body.theme-forest .page-header h1 {
  font-family: "Sora", "Trebuchet MS", sans-serif;
}

body.theme-forest .sidebar {
  background: linear-gradient(180deg, #132a21 0%, #1c3a2d 50%, #2a4d3b 100%);
  box-shadow: 10px 0 30px rgba(16, 34, 26, 0.28);
}

body.theme-forest .nav a,
body.theme-forest .nav-link {
  border: 1px solid transparent;
  color: #dbece3;
}

body.theme-forest .nav a:hover,
body.theme-forest .nav-link:hover {
  border-color: rgba(204, 235, 218, 0.2);
  background: rgba(208, 236, 216, 0.1);
}

body.theme-forest .nav a.active {
  border-color: rgba(193, 235, 206, 0.25);
  box-shadow: inset 4px 0 0 #9fca88;
  background: linear-gradient(90deg, rgba(159, 202, 136, 0.27), rgba(159, 202, 136, 0.06));
}

body.theme-forest .nav .nav-logout {
  box-shadow: inset 4px 0 0 rgba(255, 178, 160, 0.65);
}

body.theme-forest .topbar {
  border-bottom: 1px solid var(--line-soft);
}

body.theme-forest .topbar-kicker,
body.theme-forest .eyebrow,
body.theme-forest .stat-label,
body.theme-forest .nav-label {
  color: #577a63;
}

body.theme-forest .panel,
body.theme-forest .card,
body.theme-forest .table,
body.theme-forest .overlay-card,
body.theme-forest .stat,
body.theme-forest .field-card {
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff 0%, #f9fcf9 100%);
  box-shadow: var(--glow-soft);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body.theme-forest.theme-transitioning .content,
body.theme-forest.theme-transitioning .sidebar,
body.theme-forest.theme-transitioning .panel,
body.theme-forest.theme-transitioning .card,
body.theme-forest.theme-transitioning .table,
body.theme-forest.theme-transitioning .overlay-card,
body.theme-forest.theme-transitioning .stat,
body.theme-forest.theme-transitioning .section-hero,
body.theme-forest.theme-transitioning .theme-switcher,
body.theme-forest.theme-transitioning .theme-palette-option {
  transition: background 0.32s ease, border-color 0.32s ease, color 0.32s ease, box-shadow 0.32s ease;
}

body.theme-forest .panel {
  border-radius: 20px;
}

body.theme-forest .dashboard-intro {
  margin-top: 8px;
  padding: 22px 24px;
  border-radius: 22px;
  border: 1px solid rgba(113, 153, 119, 0.25);
  background: linear-gradient(140deg, rgba(236, 247, 240, 0.96), rgba(243, 248, 234, 0.96));
  box-shadow: var(--glow-soft);
  animation: forestRise 0.55s ease both;
}

body.theme-forest .dashboard-intro p {
  color: var(--ink-700);
  margin: 10px 0 0;
}

body.theme-forest .stat-grid {
  margin-top: 18px;
}

body.theme-forest .stat {
  animation: forestRise 0.55s ease both;
}

body.theme-forest .stat strong {
  color: var(--forest-800);
}

body.theme-forest .btn {
  border: 1px solid rgba(21, 54, 41, 0.2);
  background: linear-gradient(135deg, var(--forest-700), var(--forest-600));
  color: #f4fff8;
  box-shadow: 0 12px 24px rgba(46, 97, 73, 0.25);
}

body.theme-forest .btn:hover {
  box-shadow: 0 16px 30px rgba(41, 90, 67, 0.32);
}

body.theme-forest .btn-secondary {
  color: #1f513d;
  border-color: #bfd9cc;
  background: linear-gradient(180deg, #eff9f4, #e3f2ea);
}

body.theme-forest .btn-ghost {
  color: #315948;
  border-color: #c8dcd1;
  background: #ffffff;
}

body.theme-forest .field label {
  color: #365343;
}

body.theme-forest .field input,
body.theme-forest .field select,
body.theme-forest .field textarea {
  border-color: #cddcd3;
  background: #fcfffd;
}

body.theme-forest .field input:focus,
body.theme-forest .field select:focus,
body.theme-forest .field textarea:focus {
  border-color: #4e8767;
  box-shadow: 0 0 0 4px rgba(78, 135, 103, 0.18);
}

body.theme-forest .table th {
  color: #4f695b;
  background: linear-gradient(180deg, #edf5ef, #e5f0e8);
}

body.theme-forest .table tbody tr:hover {
  background: #f1f8f3;
}

body.theme-forest .ba-hero {
  border: 1px solid rgba(183, 224, 188, 0.3);
  background: linear-gradient(130deg, #1a3a2d, #35674f 58%, #688f52 140%);
}

body.theme-forest .ba-download-group {
  border-color: #caddd0;
  background: linear-gradient(180deg, #f9fcf8, #f0f7f2);
}

body.theme-forest .inline-help,
body.theme-forest .muted,
body.theme-forest .settings-note,
body.theme-forest .geo-popup-meta,
body.theme-forest .geo-popup-empty,
body.theme-forest .geo-popup-status,
body.theme-forest .ba-download-label,
body.theme-forest .page-link {
  color: #5b6f63;
}

body.theme-forest .geo-map,
body.theme-forest .project-setup-panel {
  border-color: #ccddd2;
}

body.theme-forest .flash-success {
  color: #1e563f;
  background: #dff4e8;
  border-color: #b7e0c8;
}

body.theme-forest .flash-error,
body.theme-forest .alert {
  color: #7b3030;
  background: #feeae7;
  border-color: #f6cbc6;
}

@keyframes forestRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  body.theme-forest .dashboard-intro {
    padding: 18px;
  }
}

@media (max-width: 680px) {
  body.theme-forest .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-setup-frame,
  .setup-project-frame {
    height: 470px;
    border-radius: 14px;
  }

  .ba-panel {
    padding: 14px;
  }

  .ba-table-wrap {
    max-height: 56vh;
  }

  .ba-table th,
  .ba-table td {
    padding: 10px 11px;
    font-size: 12px;
  }

  body.theme-forest .dashboard-intro {
    flex-direction: column;
    align-items: flex-start;
  }

  body.theme-forest .dashboard-intro .btn {
    width: 100%;
  }
}

.section-hero {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #d0ddd4;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(242, 250, 245, 0.95), rgba(251, 248, 238, 0.96));
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: center;
}

.section-hero-head h2 {
  margin: 0;
  font-size: clamp(21px, 2.4vw, 30px);
  letter-spacing: -0.03em;
  color: #234735;
}

.section-hero-head p {
  margin: 8px 0 0;
  color: #5a6e62;
  line-height: 1.55;
}

.section-hero-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hero-chip {
  border: 1px solid #c8d9ce;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  padding: 9px 10px;
  display: grid;
  gap: 4px;
  min-height: 74px;
}

.hero-chip small {
  font-size: 11px;
  color: #657c6f;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-chip strong {
  font-size: 20px;
  color: #244936;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-pill-active {
  background: #dff3e6;
  color: #256147;
  border: 1px solid #b7dfc6;
}

.status-pill-muted {
  background: #eef2ef;
  color: #5f6e64;
  border: 1px solid #d7ded9;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #315948;
  background: #eaf4ef;
  border: 1px solid #c9ddd2;
}

.setup-data-panel {
  margin-top: 20px;
}

.setup-table td,
.setup-table th {
  vertical-align: middle;
}

@media (max-width: 980px) {
  .section-hero {
    grid-template-columns: 1fr;
  }

  .section-hero-chips {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }
}

@media (max-width: 620px) {
  .section-hero {
    padding: 14px;
  }

  .section-hero-chips {
    grid-template-columns: 1fr;
  }

  .hero-chip {
    min-height: 62px;
  }
}

body.theme-forest.role-super-admin {
  --role-accent: #df9b31;
}

body.theme-forest.role-org-admin {
  --role-accent: #3ca07a;
}

body.theme-forest.role-viewer {
  --role-accent: #3b79bf;
}

body.theme-forest.role-enumerator {
  --role-accent: #7a61c2;
}

body.theme-forest.theme-preset-forest {
  --role-accent: #3b7a5a;
}

body.theme-forest.theme-preset-earth {
  --role-accent: #a06b2f;
}

body.theme-forest.theme-preset-ocean {
  --role-accent: #2f6e9f;
}

body.theme-forest.theme-preset-earth {
  background:
    radial-gradient(1200px 680px at 88% -10%, rgba(173, 122, 61, 0.24), transparent 66%),
    radial-gradient(1000px 540px at -15% 12%, rgba(140, 92, 55, 0.18), transparent 68%),
    linear-gradient(180deg, #fbf8f4 0%, #f4ede3 100%);
}

body.theme-forest.theme-preset-ocean {
  background:
    radial-gradient(1200px 680px at 88% -10%, rgba(82, 155, 201, 0.24), transparent 66%),
    radial-gradient(1000px 540px at -15% 12%, rgba(50, 118, 160, 0.18), transparent 68%),
    linear-gradient(180deg, #f4f9fc 0%, #eaf2f8 100%);
}

body.table-compact-mode .table th,
body.table-compact-mode .table td {
  padding: 8px 10px;
  font-size: 12px;
}

body.table-compact-mode .ba-table-wrap {
  max-height: 52vh;
}

body.table-compact-mode .form-actions .btn-sm,
body.table-compact-mode .btn.btn-sm {
  padding: 5px 8px;
  font-size: 12px;
}

body.theme-forest .topbar-kicker {
  color: var(--role-accent, #577a63);
}

body.theme-forest .user-chip > span {
  background: linear-gradient(135deg, var(--role-accent, #3b7a5a), #5ea884);
}

body.theme-forest .nav a.active {
  box-shadow: inset 4px 0 0 var(--role-accent, #9fca88);
}

.builder-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr);
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #d6e3da;
  border-radius: 14px;
  background: linear-gradient(145deg, #f6fbf8, #faf8ef);
}

.builder-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.builder-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid #c8d9ce;
  background: #ffffff;
  color: #3f5f4e;
  padding: 6px 10px;
  font-size: 12px;
}

.builder-pill strong {
  color: #1f4937;
}

.builder-tools input {
  width: 100%;
  border: 1px solid #cad9d0;
  border-radius: 11px;
  padding: 10px 12px;
  background: #ffffff;
}

.builder-empty {
  border: 1px dashed #bfd3c6;
  border-radius: 14px;
  padding: 18px;
  background: #fbfffd;
  text-align: center;
  margin-bottom: 12px;
}

.builder-empty h4 {
  margin: 0;
  color: #2d5441;
}

.builder-empty p {
  margin: 8px 0 12px;
  color: #617569;
}

.field-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.field-card:hover {
  transform: translateY(-1px);
  border-color: #bcd4c5;
  box-shadow: 0 10px 20px rgba(31, 73, 55, 0.08);
}

.ba-split-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.5fr);
  gap: 16px;
  align-items: start;
}

.ba-split-side {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.ba-split-main {
  min-width: 0;
}

.ba-filter-panel .panel-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.ba-crs-note {
  margin-top: 10px;
}

@media (max-width: 1080px) {
  .builder-workbench {
    grid-template-columns: 1fr;
  }

  .ba-split-layout {
    grid-template-columns: 1fr;
  }

  .ba-split-side {
    position: static;
  }
}

@media (max-width: 900px) {
  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .theme-switcher {
    margin: 0 0 10px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    align-items: stretch;
    gap: 10px;
  }

  .nav {
    display: block;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-label,
  .nav-dropdown {
    display: block;
  }

  .nav a,
  .nav-link {
    flex: none;
    margin-bottom: 4px;
  }

  .nav-logout {
    margin-top: 20px !important;
  }
}

/* Modern Auth Experience */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(1100px 540px at 90% -5%, rgba(26, 111, 85, 0.18), transparent 68%),
    radial-gradient(900px 420px at -5% 110%, rgba(11, 76, 104, 0.2), transparent 72%),
    linear-gradient(180deg, #f4f8f6 0%, #edf3f2 100%);
}

.auth-page .auth-wrap {
  min-height: 100vh;
  grid-template-columns: minmax(470px, 1.25fr) minmax(420px, .75fr);
  background: transparent;
}

.auth-page .auth-hero {
  position: relative;
  padding: clamp(34px, 5.6vw, 88px);
  background:
    linear-gradient(150deg, #0b2f26 0%, #174d3f 43%, #2f7059 100%);
  border-radius: 0 34px 34px 0;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 16px 0 34px rgba(11, 47, 38, 0.15);
  overflow: hidden;
}

.auth-page .auth-hero::before,
.auth-page .auth-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-page .auth-hero::before {
  right: -120px;
  top: -110px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  border: 62px solid rgba(141, 228, 187, 0.13);
}

.auth-page .auth-hero::after {
  left: -180px;
  bottom: -180px;
  width: 430px;
  height: 430px;
  border-radius: 46px;
  background: linear-gradient(135deg, rgba(125, 202, 164, 0.16), rgba(26, 91, 69, 0.02));
  transform: rotate(22deg);
}

.auth-page .auth-hero-main,
.auth-page .hero-footer {
  position: relative;
  z-index: 1;
}

.auth-page .hero-eyebrow {
  margin-bottom: 16px;
  color: #8ce1bf;
  font-size: 11px;
  letter-spacing: .13em;
}

.auth-page .auth-brand {
  margin-bottom: 14px;
  gap: 14px;
}

.auth-page .auth-brand h1 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 62px);
  letter-spacing: -0.05em;
  color: #effaf4;
  line-height: .95;
}

.auth-page .auth-logo {
  width: 68px;
  height: 68px;
  padding: 7px;
  border-radius: 18px;
  background: rgba(245, 255, 250, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.auth-page .auth-hero p {
  margin: 0;
  max-width: 540px;
  color: #d7efe5;
  font-size: 16px;
  line-height: 1.7;
}

.auth-page .auth-hero-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-page .auth-meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(183, 236, 211, 0.3);
  background: rgba(183, 236, 211, 0.12);
  color: #dcf8eb;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.auth-page .auth-highlight-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  max-width: 510px;
}

.auth-page .auth-highlight-list li {
  position: relative;
  color: #d2ebdf;
  padding-left: 16px;
  font-size: 14px;
}

.auth-page .auth-highlight-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ce1bf;
}

.auth-page .hero-footer {
  margin-top: 24px;
  align-items: flex-start;
}

.auth-page .hero-footer p {
  color: #c6e5d8;
  line-height: 1.5;
}

.auth-page .hero-orb {
  margin-top: 4px;
  width: 11px;
  height: 11px;
  background: #8ce1bf;
  box-shadow: 0 0 0 7px rgba(140, 225, 191, 0.16);
}

.auth-page .auth-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(26px, 4vw, 58px);
  background: transparent;
}

.auth-page .auth-login-card {
  width: 100%;
  max-width: 460px;
  padding: 34px;
  border-radius: 26px;
  border: 1px solid rgba(216, 228, 223, 0.88);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 253, 252, 0.96));
  box-shadow: 0 22px 56px rgba(15, 45, 36, 0.13);
  backdrop-filter: blur(5px);
}

.auth-page .auth-login-head {
  margin-bottom: 16px;
}

.auth-page .auth-login-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #cfe6da;
  color: #285f4b;
  background: #ecf7f1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.auth-page .auth-login-card h2 {
  margin: 10px 0 8px;
  font-size: 34px;
  line-height: .96;
  letter-spacing: -0.04em;
  color: #163529;
}

.auth-page .auth-login-card .muted {
  margin: 0;
  color: #55756a;
  line-height: 1.6;
}

.auth-page .auth-alert {
  margin: 14px 0 8px;
  border: 1px solid #f1c0c0;
  background: #fff2f2;
}

.auth-page .auth-login-form {
  margin-top: 16px;
}

.auth-page .auth-login-form .field {
  margin-bottom: 13px;
}

.auth-page .auth-login-form .field label {
  color: #2f5448;
  font-weight: 700;
  margin-bottom: 7px;
}

.auth-page .auth-input-wrap {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  border: 1px solid #d2e2da;
  border-radius: 12px;
  background: #f8fcfa;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-page .auth-input-wrap-password {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.auth-page .auth-input-wrap:focus-within {
  border-color: #3b8f71;
  box-shadow: 0 0 0 4px rgba(59, 143, 113, 0.14);
  background: #ffffff;
}

.auth-page .auth-input-icon {
  display: inline-grid;
  place-items: center;
  height: 100%;
  color: #5a7a6f;
  font-weight: 800;
  border-right: 1px solid #dce9e2;
  background: linear-gradient(180deg, #eef7f2, #e4f2ec);
}

.auth-page .auth-input-wrap input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 11px 12px;
  font-size: 15px;
}

.auth-page .auth-input-wrap input:focus {
  outline: none;
}

.auth-page .auth-input-toggle {
  margin: 0 6px 0 2px;
  border: 1px solid #cfe0d8;
  border-radius: 9px;
  background: #eef7f2;
  color: #2d6651;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 9px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.auth-page .auth-input-toggle:hover {
  background: #e3f3eb;
  border-color: #b9d8cc;
}

.auth-page .auth-input-toggle[aria-pressed="true"] {
  background: #dff2e8;
  color: #1f5b45;
  border-color: #a9cebf;
}

.auth-page .auth-caps-hint {
  margin: 7px 2px 0;
  color: #8f5f18;
  font-size: 12px;
  font-weight: 600;
}

.auth-page .auth-remember-row {
  margin: 2px 0 12px;
}

.auth-page .auth-remember-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #486d61;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-page .auth-remember-check input {
  width: 16px;
  height: 16px;
  accent-color: #287a5e;
}

.auth-page .auth-submit-btn {
  margin-top: 6px;
  min-height: 46px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  background: linear-gradient(135deg, #1b7c63, #2e9a75);
  box-shadow: 0 14px 26px rgba(24, 118, 90, 0.28);
}

.auth-page .auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(24, 118, 90, 0.31);
}

.auth-page .auth-submit-btn:disabled,
.auth-page .auth-submit-btn.is-loading {
  cursor: wait;
  opacity: .96;
}

.auth-page .auth-login-footnote {
  margin: 14px 0 0;
  color: #628277;
  font-size: 12px;
  line-height: 1.5;
}

.auth-page .auth-hero-main {
  animation: authFadeUp .58s ease both;
}

.auth-page .hero-footer {
  animation: authFadeUp .58s ease .12s both;
}

.auth-page .auth-login-card {
  animation: authFadeUp .62s ease .18s both;
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page .auth-hero-main,
  .auth-page .hero-footer,
  .auth-page .auth-login-card {
    animation: none;
  }
}

@media (max-width: 1080px) {
  .auth-page .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-page .auth-hero {
    min-height: auto;
    border-radius: 0;
    padding-bottom: 28px;
  }

  .auth-page .auth-panel {
    padding-top: 20px;
  }
}

@media (max-width: 640px) {
  .auth-page .auth-login-card {
    padding: 24px;
    border-radius: 20px;
  }

  .auth-page .auth-brand h1 {
    font-size: 42px;
  }

  .auth-page .auth-login-card h2 {
    font-size: 30px;
  }
}
