/* ================================================
   CreditScoreAI — MSME 5C System
   Design: Dark Navy Fintech + Teal/Gold Accents
   Fonts: Syne (headings) + DM Sans (body) + DM Mono
   ================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg: #07111f;
  --bg2: #0d1e35;
  --bg3: #112540;
  --bg4: #162d4e;
  --card: #0f2138;
  --card-hov: #152a48;
  --border: #1a3555;
  --border2: #1f3f65;

  --teal: #00d4a8;
  --teal-dim: #00a882;
  --gold: #f0a800;
  --gold-dim: #c88900;
  --blue: #4db8ff;
  --blue-dim: #2896e0;
  --red: #ff5c5c;
  --red-dim: #d93c3c;
  --orange: #ff8c42;

  --text: #e4eef8;
  --text2: #9ab3cc;
  --text3: #5a7a99;

  --risk-vlow: #00d4a8;
  --risk-low: #4db8ff;
  --risk-med: #f0a800;
  --risk-high: #ff8c42;
  --risk-vhigh: #ff5c5c;

  --font-head: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "DM Mono", monospace;

  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}
img,
canvas {
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}
select,
input {
  font: inherit;
}
::selection {
  background: rgba(0, 212, 168, 0.22);
}

/* ---- Accent helpers ---- */
.accent-teal {
  color: var(--teal);
}
.accent-gold {
  color: var(--gold);
}
.accent-blue {
  color: var(--blue);
}
.hidden {
  display: none !important;
}

/* ================================================
   HEADER
   ================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(7, 17, 31, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}
.brand-hex {
  font-size: 26px;
  color: var(--teal);
  line-height: 1;
  animation: hexSpin 8s linear infinite;
}
@keyframes hexSpin {
  to {
    transform: rotate(360deg);
  }
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text);
}
.brand-sub {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: block;
  margin-top: -2px;
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
}
.nav-link:hover {
  color: var(--teal);
  background: rgba(0, 212, 168, 0.08);
}
.nav-link.active {
  color: var(--teal);
  background: rgba(0, 212, 168, 0.12);
}
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: var(--transition);
}
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 16px 12px;
}
.mobile-link {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text2);
  transition: color var(--transition);
}
.mobile-link:hover {
  color: var(--teal);
}
.mobile-menu.open {
  display: flex;
}

/* ================================================
   HERO
   ================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 128px 24px 72px;
  background: linear-gradient(145deg, #07111f 0%, #0d1e35 50%, #0a1a2e 100%);
  border-bottom: 1px solid var(--border);
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 168, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 168, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    black 40%,
    transparent 100%
  );
}
.hero-inner {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
}
.hero-left {
  flex: 1;
}
.hero-chip {
  display: inline-block;
  background: rgba(0, 212, 168, 0.1);
  border: 1px solid rgba(0, 212, 168, 0.2);
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}
.hero-highlight {
  background: linear-gradient(120deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 15px;
  color: var(--text2);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-kpi-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}
.hero-kpi {
  padding: 16px 28px;
  text-align: center;
}
.hero-kpi-divider {
  width: 1px;
  background: var(--border);
  height: 44px;
  flex-shrink: 0;
}
.kpi-val {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
  display: block;
}
.kpi-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero donut */
.hero-right {
  flex-shrink: 0;
}
.donut-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  filter: drop-shadow(0 0 24px rgba(0, 212, 168, 0.3));
}
.donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-pct {
  font-family: var(--font-mono);
  font-size: 34px;
  color: var(--teal);
  font-weight: 500;
}
.donut-sub {
  font-size: 12px;
  color: var(--text3);
}

/* ================================================
   SECTIONS
   ================================================ */
main {
  padding-bottom: 80px;
}
.section {
  max-width: 1340px;
  margin: 0 auto;
  padding: 64px 24px 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-sub {
  font-size: 14px;
  color: var(--text2);
  margin-top: 4px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
}
.badge-teal {
  background: rgba(0, 212, 168, 0.15);
  color: var(--teal);
  border: 1px solid rgba(0, 212, 168, 0.3);
}
.badge-gold {
  background: rgba(240, 168, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(240, 168, 0, 0.3);
}

/* ================================================
   STAT CARDS
   ================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.stat-card.c-teal::before {
  background: var(--teal);
}
.stat-card.c-blue::before {
  background: var(--blue);
}
.stat-card.c-gold::before {
  background: var(--gold);
}
.stat-card.c-red::before {
  background: var(--red);
}
.stat-card.c-orange::before {
  background: var(--orange);
}
.stat-card:hover {
  background: var(--card-hov);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.stat-num {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card.c-teal .stat-num {
  color: var(--teal);
}
.stat-card.c-blue .stat-num {
  color: var(--blue);
}
.stat-card.c-gold .stat-num {
  color: var(--gold);
}
.stat-card.c-red .stat-num {
  color: var(--red);
}
.stat-card.c-orange .stat-num {
  color: var(--orange);
}
.stat-label {
  font-size: 12px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-sub {
  font-size: 12px;
  color: var(--text2);
  margin-top: 6px;
}

/* ================================================
   CHARTS
   ================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 22px 18px;
  transition: border-color var(--transition);
}
.chart-card:hover {
  border-color: var(--border2);
}
.chart-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.chart-card-head h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
}
.chart-sub-tag {
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text3);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.chart-canvas-wrap {
  position: relative;
  height: 240px;
}
.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ================================================
   FILTER BAR
   ================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}
.search-input::placeholder {
  color: var(--text3);
}
.search-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 212, 168, 0.1);
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-sel {
  padding: 9px 32px 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text2);
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a7a99' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.filter-sel:focus {
  border-color: var(--teal);
}
.btn-reset {
  padding: 9px 16px;
  background: rgba(255, 92, 92, 0.1);
  border: 1px solid rgba(255, 92, 92, 0.2);
  color: var(--red);
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.btn-reset:hover {
  background: rgba(255, 92, 92, 0.2);
}

/* ================================================
   VIEW TOGGLE
   ================================================ */
.view-toggle-wrap {
  display: flex;
  gap: 6px;
}
.view-btn {
  padding: 7px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.view-btn.active {
  background: rgba(0, 212, 168, 0.12);
  border-color: rgba(0, 212, 168, 0.3);
  color: var(--teal);
}
.view-btn:hover:not(.active) {
  background: var(--card-hov);
  color: var(--text);
}

/* ================================================
   MSME CARDS
   ================================================ */
.msme-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.msme-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.35s ease both;
}
.msme-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
}
.card-sector-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(77, 184, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(77, 184, 255, 0.2);
}
.card-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}
.card-loc {
  font-size: 12px;
  color: var(--text3);
  margin-top: 1px;
}
.card-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-score-num {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
}
.card-score-bar {
  height: 6px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
  flex: 1;
  margin-left: 12px;
}
.card-score-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s ease;
}
.card-5c-row {
  display: flex;
  gap: 6px;
}
.c-mini {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  background: var(--bg3);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.c-mini-label {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.c-mini-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.risk-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.risk-badge::before {
  content: "●";
  font-size: 8px;
}
.risk-vlow {
  background: rgba(0, 212, 168, 0.12);
  color: var(--teal);
  border: 1px solid rgba(0, 212, 168, 0.3);
}
.risk-low {
  background: rgba(77, 184, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(77, 184, 255, 0.3);
}
.risk-med {
  background: rgba(240, 168, 0, 0.12);
  color: var(--gold);
  border: 1px solid rgba(240, 168, 0, 0.3);
}
.risk-high {
  background: rgba(255, 140, 66, 0.12);
  color: var(--orange);
  border: 1px solid rgba(255, 140, 66, 0.3);
}
.risk-vhigh {
  background: rgba(255, 92, 92, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 92, 92, 0.3);
}

.dec-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
}
.dec-approved {
  background: rgba(0, 212, 168, 0.15);
  color: var(--teal);
  border: 1px solid rgba(0, 212, 168, 0.3);
}
.dec-considered {
  background: rgba(240, 168, 0, 0.15);
  color: var(--gold);
  border: 1px solid rgba(240, 168, 0, 0.3);
}
.dec-rejected {
  background: rgba(255, 92, 92, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 92, 92, 0.3);
}

/* ================================================
   TABLES
   ================================================ */
.table-outer {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.data-table thead tr {
  background: var(--bg3);
}
.data-table th {
  padding: 11px 14px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr {
  border-bottom: 1px solid rgba(26, 53, 85, 0.5);
  transition: background var(--transition);
}
.data-table tbody tr:last-child {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: var(--bg3);
}
.data-table td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--text2);
}
.data-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text3);
}
.td-name {
  font-weight: 500;
  color: var(--text) !important;
}
.td-score {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
}
.td-score.score-high {
  color: var(--teal);
}
.td-score.score-med {
  color: var(--gold);
}
.td-score.score-low {
  color: var(--red);
}
.td-adj.pos {
  color: var(--teal);
  font-family: var(--font-mono);
}
.td-adj.neg {
  color: var(--red);
  font-family: var(--font-mono);
}
.td-adj.zero {
  color: var(--text3);
  font-family: var(--font-mono);
}

/* ================================================
   PAGINATION
   ================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 0 4px;
  flex-wrap: wrap;
}
.pg-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.pg-btn:hover:not(.disabled):not(.active) {
  border-color: var(--teal);
  color: var(--teal);
}
.pg-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #07111f;
}
.pg-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pg-info {
  font-size: 12px;
  color: var(--text3);
  padding: 0 8px;
}

/* ================================================
   CALCULATOR
   ================================================ */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}
.calc-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.calc-form-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 20px;
}
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 212, 168, 0.1);
}
.form-input option {
  background: var(--bg3);
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.calc-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
  color: var(--text3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.calc-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.calc-divider span {
  position: relative;
  background: var(--card);
  padding: 0 12px;
}
.sliders-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}
.slider-item {
}
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.slider-icon-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.s-icon {
  font-size: 20px;
}
.slider-icon-label strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
}
.slider-icon-label small {
  font-size: 11px;
  color: var(--text3);
}
.slider-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--teal);
  min-width: 40px;
  text-align: right;
}
.c-slider {
  width: 100%;
  height: 6px;
  border-radius: 100px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg3);
  outline: none;
  cursor: pointer;
  transition: background var(--transition);
}
.c-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(0, 212, 168, 0.4);
  cursor: pointer;
  transition: transform var(--transition);
}
.c-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}
.c-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg);
  cursor: pointer;
}
.slider-minmax {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
  font-family: var(--font-mono);
}
.btn-calc {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #07111f;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--r-lg);
  letter-spacing: 0.3px;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(0, 212, 168, 0.3);
}
.btn-calc:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 212, 168, 0.45);
}
.btn-calc:active {
  transform: translateY(0);
}

/* Result card */
.calc-result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-idle {
  text-align: center;
  max-width: 360px;
}
.idle-icon {
  font-size: 52px;
  margin-bottom: 14px;
}
.result-idle h4 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
.result-idle p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
}
.formula-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-top: 20px;
  text-align: left;
}
.formula-title {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.formula-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal);
  word-break: break-all;
}

/* Result output */
.result-output {
  width: 100%;
}
.ro-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 4px;
}
.ro-meta {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
}
.ro-score-block {
  text-align: center;
  margin-bottom: 24px;
}
.ro-score-num {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 500;
  line-height: 1;
}
.ro-score-label {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
}
.ro-bar-outer {
  height: 10px;
  background: var(--bg3);
  border-radius: 100px;
  overflow: hidden;
  margin: 12px 0 6px;
}
.ro-bar-inner {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s ease;
}
.ro-bar-range {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
}
.ro-decision-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ro-5c-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.ro-c-item {
  background: var(--bg3);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 10px 8px;
  text-align: center;
}
.ro-c-label {
  font-size: 9px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.ro-c-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}
.ro-fuzzy-box {
  background: var(--bg3);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 12px 14px;
}
.ro-fuzzy-title {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.ro-fuzzy-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ro-fuzzy-item {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  gap: 8px;
}
.ro-fuzzy-item.pos {
  color: var(--teal);
}
.ro-fuzzy-item.neg {
  color: var(--red);
}
.ro-fuzzy-item.neu {
  color: var(--text3);
}

/* Fuzzy reference card */
.formula-ref-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.formula-ref-card h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 20px;
}
.fuzzy-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.fuzzy-rule {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid;
}
.fuzzy-rule.positive {
  border-color: rgba(0, 212, 168, 0.2);
  background: rgba(0, 212, 168, 0.06);
}
.fuzzy-rule.negative {
  border-color: rgba(255, 92, 92, 0.2);
  background: rgba(255, 92, 92, 0.06);
}
.rule-icon {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}
.fuzzy-rule.positive .rule-icon {
  color: var(--teal);
}
.fuzzy-rule.negative .rule-icon {
  color: var(--red);
}
.fuzzy-rule strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.fuzzy-rule p {
  font-size: 12px;
  color: var(--text3);
}

.decision-legend h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin-bottom: 12px;
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  font-size: 13px;
  color: var(--text2);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-vlow {
  background: var(--teal);
}
.dot-low {
  background: var(--blue);
}
.dot-med {
  background: var(--gold);
}
.dot-high {
  background: var(--orange);
}
.dot-vhigh {
  background: var(--red);
}

/* ================================================
   FOOTER
   ================================================ */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1340px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding: 56px 24px 40px;
}
.footer-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 10px;
}
.footer-brand p {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.7;
}
.footer-method h4,
.footer-tech h4 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  margin-bottom: 14px;
}
.footer-method li,
.footer-tech li {
  font-size: 13px;
  color: var(--text3);
  padding: 4px 0;
}
.footer-bottom {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 18px 24px;
  font-size: 12px;
  color: var(--text3);
}

/* ================================================
   TOAST
   ================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 13px;
  z-index: 9999;
  animation: toastIn 0.3s ease;
  box-shadow: var(--shadow);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1100px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
  .calc-result-card {
    min-height: 300px;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: flex;
  }
  .hero {
    padding: 96px 20px 56px;
  }
  .hero-inner {
    flex-direction: column;
    gap: 32px;
  }
  .hero-right {
    order: -1;
    align-self: center;
  }
  .donut-wrapper {
    width: 160px;
    height: 160px;
  }
  .donut-pct {
    font-size: 26px;
  }
  .hero-kpi {
    padding: 12px 18px;
  }
  .kpi-val {
    font-size: 20px;
  }
  .section {
    padding: 48px 16px 0;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .msme-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .ro-5c-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .legend-row {
    flex-direction: column;
    gap: 8px;
  }
}
@media (max-width: 500px) {
  .msme-cards-grid {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-kpi {
    padding: 10px 12px;
  }
  .kpi-val {
    font-size: 18px;
  }
  .hero-kpi-divider {
    display: none;
  }
  .ro-5c-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
