:root {
  --ink: #16232a;
  --muted: #62747d;
  --line: #d8e3e0;
  --panel: #ffffff;
  --page: #f3f7f6;
  --sidebar: #102b33;
  --sidebar-2: #153942;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --teal-soft: #e8f6f3;
  --blue: #176b87;
  --amber: #b7791f;
  --red: #b42318;
  --green: #13795b;
  --shadow-sm: 0 6px 18px rgba(17, 39, 46, .06);
  --shadow-md: 0 14px 34px rgba(17, 39, 46, .10);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #eef5f3 0%, #f7faf9 42%, #eef3f2 100%);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

a {
  color: var(--blue);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, .08);
  color: #eff8f6;
}

.app-workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand,
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: #ffffff;
  text-decoration: none;
}

.sidebar-brand:hover,
.brand-mark:hover {
  color: #ffffff;
}

.sidebar-brand strong {
  display: block;
  line-height: 1.05;
  font-size: 1rem;
}

.sidebar-brand small {
  display: block;
  margin-top: 3px;
  color: #afc7c7;
  font-weight: 650;
}

.brand-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e8f6f3;
  color: var(--teal-dark);
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(15, 118, 110, .18);
}

.sidebar-identity {
  margin: 18px 0 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .10);
}

.identity-label,
.nav-section-title {
  display: block;
  color: #a9c4c2;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-identity strong {
  display: block;
  margin-top: 6px;
  color: #ffffff;
  font-size: .98rem;
}

.sidebar-identity small {
  display: block;
  margin-top: 4px;
  color: #c5d7d5;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav-section-title {
  margin: 0 10px 7px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #dbeceb;
  text-decoration: none;
  font-weight: 720;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #9fd4ce;
}

.sidebar-link:hover,
.sidebar-link:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, .09);
}

.sidebar-link.active {
  color: #082d2b;
  background: #e8f6f3;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

.sidebar-link.active svg {
  color: var(--teal);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.topbar-context {
  min-width: 0;
}

.topbar-context span {
  display: block;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 850;
}

.topbar-context small {
  display: block;
  color: var(--muted);
  font-weight: 650;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-actions .navbar-nav,
.login-header .navbar-nav {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.topbar-actions .nav-link,
.login-header .nav-link {
  color: #33464e;
  font-weight: 750;
  border-radius: 7px;
  padding: .45rem .65rem;
}

.login-header .nav-link {
  color: #eef8f6;
}

.topbar-actions .nav-link:hover,
.login-header .nav-link:hover {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 38px;
  padding: .4rem .75rem;
  border-radius: 999px;
  border: 1px solid #b7ded8;
  background: var(--teal-soft);
  color: #0c645c;
  text-decoration: none;
  font-weight: 820;
  white-space: nowrap;
}

.credit-pill svg,
.btn svg,
.badge-soft svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.app-main {
  flex: 1;
  padding: 24px 22px 36px;
}

.login-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--sidebar);
}

.login-main {
  width: min(1120px, calc(100% - 28px));
  margin: 34px auto;
}

.public-main {
  width: 100%;
  margin: 0;
}

.landing-hero {
  min-height: clamp(470px, 68svh, 690px);
  display: flex;
  align-items: center;
  padding: 56px max(22px, 7vw);
  background-image:
    linear-gradient(90deg, rgba(246, 250, 249, .98) 0%, rgba(246, 250, 249, .90) 34%, rgba(246, 250, 249, .38) 58%, rgba(246, 250, 249, .08) 100%),
    url("/img/landing-hero.png");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.landing-hero-content {
  width: min(680px, 100%);
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 7px;
  background: #e8f6f3;
  color: #0c645c;
  border: 1px solid #cbe7e2;
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.landing-hero h1,
.landing-section-head h2,
.landing-split h2,
.landing-final h2,
.auth-visual h1,
.auth-card h2 {
  letter-spacing: 0;
}

.landing-hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(2.75rem, 7vw, 5.9rem);
  line-height: .92;
  font-weight: 930;
  color: #12242b;
}

.landing-hero p {
  max-width: 620px;
  margin: 0;
  color: #34464d;
  font-size: clamp(1rem, 2.1vw, 1.28rem);
  line-height: 1.55;
  font-weight: 620;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.landing-actions .btn-outline-light {
  color: #153942;
  border-color: #9db8b5;
  background: rgba(255, 255, 255, .64);
}

.landing-actions .btn-outline-light:hover {
  color: #ffffff;
  border-color: var(--teal);
  background: var(--teal);
}

.landing-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.landing-proof span,
.landing-roles span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid #d7e5e2;
  color: #34464d;
  font-weight: 760;
}

.landing-proof strong {
  margin-right: 4px;
  color: var(--teal-dark);
}

.landing-band {
  padding: clamp(42px, 7vw, 76px) max(18px, 7vw);
}

.landing-intro,
.landing-pricing {
  background: #ffffff;
}

.landing-section-head {
  max-width: 880px;
  margin-bottom: 26px;
}

.landing-section-head h2,
.landing-split h2,
.landing-final h2 {
  margin: 14px 0 10px;
  color: var(--ink);
  font-size: clamp(1.8rem, 3.8vw, 3.1rem);
  line-height: 1.04;
  font-weight: 900;
}

.landing-section-head p,
.landing-split p,
.landing-card p,
.landing-steps p,
.auth-card-head p,
.auth-visual p {
  color: var(--muted);
  line-height: 1.58;
}

.landing-metrics,
.landing-feature-grid,
.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.landing-metrics > div,
.landing-card,
.landing-steps > div {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.landing-metrics > div {
  min-height: 126px;
  padding: 18px;
}

.landing-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 1.28rem;
}

.landing-metrics span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.landing-split {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(320px, 1fr);
  gap: clamp(22px, 5vw, 52px);
  align-items: center;
  background: #f3f7f6;
}

.landing-checklist {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 22px 0 0;
  list-style: none;
}

.landing-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #26343b;
  font-weight: 690;
}

.landing-checklist svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--green);
  margin-top: 2px;
}

.landing-card {
  min-height: 178px;
  padding: 18px;
}

.landing-card svg {
  width: 28px;
  height: 28px;
  color: var(--teal);
}

.landing-card h3,
.landing-steps h3 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 870;
}

.landing-workflow {
  background: #ffffff;
}

.landing-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.landing-steps > div {
  padding: 18px;
  min-height: 210px;
}

.landing-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #fff4e4;
  color: #8a4b00;
  border: 1px solid #f5d19b;
  font-weight: 900;
}

.landing-compliance {
  background: #edf4f2;
}

.landing-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-roles span {
  background: #ffffff;
}

.landing-final {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(38px, 6vw, 64px) max(18px, 7vw);
  background: #102b33;
  color: #ffffff;
}

.landing-final h2 {
  color: #ffffff;
  max-width: 780px;
}

.landing-final .landing-eyebrow {
  background: rgba(255, 255, 255, .10);
  color: #d8f4ef;
  border-color: rgba(255, 255, 255, .16);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, .7fr);
  min-height: min(720px, calc(100svh - 142px));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.auth-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 520px;
  padding: clamp(22px, 4vw, 42px);
  background-image:
    linear-gradient(180deg, rgba(16, 43, 51, .12) 0%, rgba(16, 43, 51, .86) 100%),
    url("/img/landing-hero.png");
  background-size: cover;
  background-position: center;
}

.auth-visual-content {
  max-width: 620px;
}

.auth-visual h1 {
  margin: 14px 0 10px;
  color: #ffffff;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: .96;
  font-weight: 930;
}

.auth-visual p {
  max-width: 560px;
  color: #e7f2f0;
  font-size: 1.06rem;
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #ffffff;
  font-weight: 750;
}

.auth-highlights svg {
  width: 18px;
  height: 18px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 44px);
}

.auth-card-head {
  margin-bottom: 22px;
}

.auth-card h2 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 900;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-input {
  position: relative;
}

.auth-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #709099;
  pointer-events: none;
}

.auth-input .form-control {
  min-height: 46px;
  padding-left: 40px;
}

.auth-options {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #40535b;
  font-weight: 690;
}

.auth-validation ul {
  margin-bottom: 0;
}

.page-title {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.page-title h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 880;
  letter-spacing: 0;
  color: var(--ink);
}

.page-subtitle {
  margin: .25rem 0 0;
  color: var(--muted);
  max-width: 820px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel,
.item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.metric-card {
  position: relative;
  min-height: 126px;
  padding: 18px;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--teal);
}

.metric-card::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 16px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #edf6f5;
  border: 1px solid #d5e8e5;
}

.metric-icon {
  position: absolute;
  right: 14px;
  top: 16px;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
}

.metric-icon svg {
  width: 21px;
  height: 21px;
}

.metric-label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--ink);
}

.metric-note {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  color: #73858c;
  font-size: .88rem;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.12rem;
  font-weight: 850;
  color: var(--ink);
}

.panel:hover,
.metric-card:hover,
.item-card:hover {
  box-shadow: var(--shadow-md);
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  border-radius: 999px;
  padding: .3rem .65rem;
  background: #edf6ff;
  color: #14547a;
  border: 1px solid #cde4f5;
  font-weight: 750;
}

.badge-risk {
  background: #fff4e4;
  color: #8a4b00;
  border-color: #f5d19b;
}

.badge-ok {
  background: #eaf8ef;
  color: #12613a;
  border-color: #c6e9d2;
}

.badge-warn {
  background: #fff5dd;
  color: #7a5600;
  border-color: #f1d896;
}

.progress {
  height: .86rem;
  background: #e4ecea;
  border-radius: 999px;
}

.progress-bar {
  background: var(--teal);
  border-radius: 999px;
}

.table {
  vertical-align: middle;
}

.table thead th {
  color: #52636b;
  font-size: .78rem;
  text-transform: uppercase;
  border-bottom-color: var(--line);
  background: #f7faf9;
}

.table td {
  color: #26343b;
}

.table-hover tbody tr:hover {
  background: #f4faf8;
}

.form-control,
.form-select {
  border-color: #ccd9d6;
  border-radius: 7px;
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus {
  border-color: #23948b;
  box-shadow: 0 0 0 .18rem rgba(15, 118, 110, .2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border-radius: 7px;
  font-weight: 780;
  min-height: 38px;
}

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
}

.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.btn-outline-primary {
  color: var(--teal);
  border-color: var(--teal);
}

.btn-outline-primary:hover {
  background: var(--teal);
  border-color: var(--teal);
}

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

.stepper span {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--teal-soft);
  border: 1px solid #d5e5e2;
  color: #37515a;
  font-weight: 760;
}

.map-canvas {
  width: 100%;
  height: min(62vh, 640px);
  min-height: 420px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.chart-frame {
  width: 100%;
  min-height: 280px;
  height: 34vh;
}

.risk-score {
  min-width: 76px;
  display: inline-flex;
  justify-content: center;
  padding: .35rem .5rem;
  border-radius: 7px;
  color: #ffffff;
  background: var(--red);
  font-weight: 880;
}

.risk-score.low {
  background: var(--green);
}

.risk-score.mid {
  background: var(--amber);
}

.app-alert {
  border-radius: 8px;
  border-color: #bfe4df;
  background: var(--teal-soft);
  color: #164e48;
}

@media (max-width: 1199.98px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .app-topbar {
    position: relative;
  }

  .landing-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .landing-split,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 360px;
  }

  .landing-final {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 767.98px) {
  .app-main {
    padding: 16px 10px 28px;
  }

  .page-title {
    padding: 14px;
  }

  .page-title h1 {
    font-size: 1.45rem;
  }

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

  .topbar-actions {
    justify-content: flex-start;
  }

  .map-canvas {
    min-height: 360px;
  }

  .login-header {
    padding: 12px 14px;
    width: 100%;
    max-width: 100vw;
    gap: 12px;
  }

  .login-header .navbar-nav {
    margin-left: auto;
  }

  .login-main {
    width: 100%;
    margin: 18px auto;
    padding: 0 10px;
  }

  .landing-hero {
    display: block;
    min-height: 500px;
    padding: 42px 18px;
    background-position: 58% center;
  }

  .landing-hero-content,
  .landing-hero p {
    width: 100%;
    max-width: 320px;
    min-width: 0;
  }

  .landing-hero-content {
    flex: 0 1 320px;
  }

  .landing-hero h1 {
    font-size: clamp(2.15rem, 10.8vw, 2.9rem);
    line-height: 1;
  }

  .landing-actions .btn {
    width: 100%;
    max-width: 320px;
  }

  .landing-proof span {
    width: 100%;
    max-width: 320px;
  }

  .landing-section-head h2,
  .landing-split h2,
  .landing-final h2 {
    font-size: clamp(1.55rem, 7vw, 2rem);
    max-width: 100%;
  }

  .landing-band {
    padding: 38px 18px;
    overflow: hidden;
  }

  .landing-section-head,
  .landing-split > div,
  .landing-metrics,
  .landing-feature-grid,
  .landing-pricing-grid,
  .landing-steps {
    width: 100%;
    max-width: 340px;
  }

  .landing-steps,
  .landing-metrics,
  .landing-feature-grid,
  .landing-pricing-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    width: min(100%, 340px);
    margin: 0;
    border-radius: 8px;
  }

  .auth-visual {
    min-height: 300px;
    overflow: hidden;
  }

  .auth-card {
    padding: 22px;
    overflow: hidden;
  }

  .auth-visual-content,
  .auth-visual p,
  .auth-card-head,
  .auth-form {
    width: 100%;
    max-width: 296px;
  }

  .auth-highlights {
    max-width: 296px;
  }

  .auth-highlights span {
    width: 100%;
  }
}
