:root {
  box-sizing: border-box;
  --canvas: #e8ebef;
  --shell: #f2f4f7;
  --sidebar: #fbfcfd;
  --card: #ffffff;
  --card-soft: #f7f8fa;
  --inp: #f3f5f8;
  --inp-hv: #ebEEF3;
  --tx: #111317;
  --tx-2: #374151;
  --mu: #7b8494;
  --bd: #e6e9ef;
  --bd-soft: rgba(17, 19, 23, 0.06);

  /* Aksen khas referensi: Electric Neon Lime + Cornflower Periwinkle + Jet Black */
  --lime: #d4ff00;
  --lime-2: #c8f904;
  --lime-grad: radial-gradient(120% 120% at 15% 10%, #f6ffad 0%, #dcff24 52%, #cbf900 100%);
  --lime-soft: #f4ffbe;
  --blue: #95b4fa;
  --blue-deep: #1e3a8a;
  --blue-soft: #e6eeff;
  --black: #111317;
  --black-hv: #262a33;

  --gain: #15803d;
  --loss: #dc2626;
  --warn-bg: #fff9db;
  --warn-bd: #fde68a;
  --warn-tx: #713f12;

  --r-shell: 30px;
  --r-card: 24px;
  --r-inp: 14px;
  --r-pill: 999px;
  --pad-shell: clamp(12px, 1.35vw, 24px);
  --gap-shell: clamp(14px, 1.4vw, 24px);
  --sh-shell: 0 20px 60px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  --sh-card: 0 6px 22px rgba(15, 23, 42, 0.035);
}

body.dark {
  --canvas: #0b0d10;
  --shell: #12151a;
  --sidebar: #171b21;
  --card: #1b2028;
  --card-soft: #212731;
  --inp: #242b35;
  --inp-hv: #2c3440;
  --tx: #f3f5f8;
  --tx-2: #cbd5e1;
  --mu: #8e98a8;
  --bd: #2b3340;
  --bd-soft: rgba(255, 255, 255, 0.07);
  --blue: #8ab0ff;
  --blue-deep: #0f1d40;
  --blue-soft: #1e2c4a;
  --black: #f3f5f8;
  --black-hv: #ffffff;
  --gain: #4ade80;
  --loss: #f87171;
  --warn-bg: #2e2611;
  --warn-bd: #57471c;
  --warn-tx: #fde68a;
  --sh-shell: 0 20px 60px rgba(0, 0, 0, 0.45);
  --sh-card: 0 6px 20px rgba(0, 0, 0, 0.22);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--shell);
  color: var(--tx);
  font: 14px/1.5 "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Full-Bleed Fluid App Shell & Sidebar ---- */
.app-frame {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--pad-shell);
  background: var(--shell);
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-columns: clamp(220px, 14.5vw, 264px) minmax(0, 1fr);
  gap: var(--gap-shell);
  min-height: 100vh;
}

/* ---- Left Sidebar ---- */
.sidebar {
  background: var(--sidebar);
  border-radius: var(--r-card);
  padding: 22px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--sh-card);
  border: 1px solid var(--bd-soft);
  position: sticky;
  top: var(--pad-shell);
  height: calc(100vh - (2 * var(--pad-shell)));
  overflow-y: auto;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 14px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--tx);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--tx);
  color: var(--card);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-badge-square {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}

.brand-badge-square svg {
  width: 30px;
  height: 30px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.brand-text span {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: var(--mu);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-nav::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1040px) {
  .app-frame {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
    gap: 14px;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
  }

  #sec-recipe {
    order: -1;
  }

  .bento-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi-bento {
    padding: 12px 14px;
    min-height: 110px;
  }
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--r-pill);
  color: var(--mu);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.16s ease;
}

.nav-item .nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--tx);
  background: var(--card-soft);
}

.nav-item.active {
  background: var(--card);
  color: var(--tx);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
}

.badge-count {
  background: var(--blue);
  color: #132347;
  font-size: 11px;
  font-weight: 700;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.side-promo {
  background: var(--card);
  border-radius: 22px;
  padding: 16px;
  border: 1px solid var(--bd-soft);
  box-shadow: var(--sh-card);
}

.promo-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--lime);
  color: #111317;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.promo-icon svg {
  width: 20px;
  height: 20px;
  stroke: #111317;
  stroke-width: 1.9;
  fill: none;
}

.side-promo h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
}

.side-promo p {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--mu);
}

.side-promo button {
  width: 100%;
}

/* ---- Main Content Workspace ---- */
.workspace {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.3vw, 20px);
  padding: 2px 0 18px;
  min-width: 0;
}

/* ---- Top Header ---- */
header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 2px 4px;
}

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

h1 {
  font-size: clamp(22px, 1.8vw, 30px);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.pill-blue {
  background: var(--blue);
  color: #132347;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  letter-spacing: -0.01em;
}

.sub {
  color: var(--mu);
  margin: 3px 0 0;
  font-size: 13px;
}

a {
  color: var(--tx);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-underline-offset: 3px;
}
a:hover {
  opacity: 0.8;
}

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

button.icon-circle,
.icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--bd-soft);
  color: var(--tx);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--sh-card);
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

button.icon-circle:hover:not(:disabled),
.icon-circle:hover {
  transform: translateY(-1px);
  background: var(--inp-hv);
  color: var(--tx);
  border-color: var(--bd);
}

.icon-circle svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.profile-pill {
  background: var(--card);
  border: 1px solid var(--bd-soft);
  border-radius: var(--r-pill);
  padding: 4px 12px 4px 5px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: var(--sh-card);
  text-decoration: none;
}

.profile-pill .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--lime);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  color: #111317;
}

.profile-pill .p-txt small {
  display: block;
  font-size: 10px;
  color: var(--mu);
  line-height: 1.1;
}

.profile-pill .p-txt strong {
  display: block;
  font-size: 12px;
  color: var(--tx);
  font-weight: 700;
  line-height: 1.25;
}

/* ---- Row 1: 4-Card Bento KPI Strip ---- */
.bento-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.2vw, 18px);
}

@media (max-width: 1120px) {
  .bento-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .bento-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
}

.kpi-bento {
  background: var(--card);
  border-radius: var(--r-card);
  padding: clamp(16px, 1.3vw, 22px) clamp(18px, 1.5vw, 24px);
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--sh-card);
  border: 1px solid var(--bd-soft);
  position: relative;
  overflow: hidden;
}

.kpi-bento.hero {
  background: var(--lime-grad);
  color: #111317;
  border-color: rgba(255, 255, 255, 0.55);
}

.kpi-bento.hero.is-loss {
  background: linear-gradient(155deg, #ffe4e6 0%, #fecdd3 100%);
  color: #7f1d1d;
}

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

.kpi-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--card-soft);
  display: grid;
  place-items: center;
  color: var(--tx);
}

.kpi-bento.hero .kpi-ico {
  background: rgba(255, 255, 255, 0.55);
  color: #111317;
}

.kpi-ico svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.kpi-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(17, 19, 23, 0.22);
  display: grid;
  place-items: center;
  color: inherit;
}

body.dark .kpi-bento:not(.hero) .kpi-arrow {
  border-color: rgba(255, 255, 255, 0.18);
}

.kpi-arrow svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.kpi-val {
  font-size: clamp(23px, 1.75vw, 31px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-inline-sub {
  font-size: 12px;
  color: var(--mu);
  font-weight: 500;
}

.kpi-bento.hero .kpi-inline-sub,
.kpi-bento.hero .kpi-foot {
  color: rgba(17, 19, 23, 0.65);
}

.kpi-inline-pill {
  background: var(--blue);
  color: #132347;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.kpi-foot {
  font-size: 12px;
  color: var(--mu);
  margin-top: 5px;
  font-weight: 500;
}

/* ---- Toolbar Card (Auto-Recipe & Mode Switch) ---- */
.toolbar-card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: clamp(16px, 1.3vw, 22px);
  box-shadow: var(--sh-card);
  border: 1px solid var(--bd-soft);
}

.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  gap: clamp(14px, 1.3vw, 22px);
  align-items: end;
}

.tree-depth-col {
  width: 186px;
  flex-shrink: 0;
}

.toolbar-grid > div,
.grid > div {
  min-width: 0;
}

@media (max-width: 960px) {
  .toolbar-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.seg {
  display: flex;
  background: var(--inp);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 4px;
}

@media (max-width: 520px) {
  .seg {
    border-radius: 16px;
    flex-wrap: wrap;
  }
  .seg button {
    flex: 1 1 140px;
  }
}

.seg button {
  flex: 1 1 140px;
  min-width: 0;
  min-height: 44px;
  white-space: normal;
  border: 1px solid transparent;
  background: transparent;
  color: var(--mu);
  padding: 8px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* Hover pada tab tidak aktif: kontras tinggi, background soft tint, teks tajam */
button.seg-btn:hover:not(:disabled),
.seg button:hover:not(:disabled) {
  color: var(--tx);
  background: var(--card);
  border-color: var(--bd-soft);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

body.dark .seg button:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Tab aktif: solid pill */
.seg button.active {
  background: var(--black);
  color: var(--card);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Hover pada tab aktif: tetap kontras penuh */
.seg button.active:hover:not(:disabled) {
  background: var(--black-hv);
  color: var(--card);
  border-color: transparent;
}

.target-box {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--card-soft);
  border: 1px solid var(--bd);
  border-radius: 18px;
}

.pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.pill,
button.pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--tx-2);
  border: 1px solid var(--bd);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

button.pill:hover:not(:disabled),
.pill:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue-deep);
}

body.dark button.pill:hover:not(:disabled),
body.dark .pill:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: #ffffff;
}

/* ---- Main 2-Column Bento Grid ---- */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(380px, 1fr);
  gap: clamp(14px, 1.35vw, 22px);
  align-items: start;
}

@media (min-width: 1800px) {
  .grid {
    grid-template-columns: minmax(0, 1.44fr) minmax(430px, 1fr);
  }
}

@media (max-width: 1120px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  container-type: inline-size;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--bd-soft);
  border-radius: var(--r-card);
  padding: clamp(16px, 1.4vw, 24px);
  margin-bottom: clamp(14px, 1.3vw, 20px);
  box-shadow: var(--sh-card);
}

.card h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.head-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--inp);
  display: grid;
  place-items: center;
  color: var(--tx);
  flex-shrink: 0;
}

.head-ico svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.card h3 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mu);
  margin: 18px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
}

.card h3:first-of-type {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sprite-wrap {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--inp);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sprite {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
  object-fit: contain;
  vertical-align: middle;
}

.sprite.sm {
  width: 18px;
  height: 18px;
  margin-right: 2px;
}

/* ---- Form Controls ---- */
label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mu);
  margin: 9px 0 5px;
}

label .hint {
  font-size: 10.5px;
  color: var(--tx-2);
  background: var(--inp);
  padding: 1px 6px;
  border-radius: var(--r-pill);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

input, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-inp);
  background: var(--inp);
  color: var(--tx);
  font: inherit;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover:not(:disabled), select:hover:not(:disabled) {
  background: var(--inp-hv);
}

input:focus, select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--tx);
  box-shadow: 0 0 0 3px rgba(149, 180, 250, 0.25);
}

input:disabled, select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input.auto-solved {
  background: var(--lime-soft);
  color: #111317;
  border-color: #b7e300;
  font-weight: 700;
}

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

.r3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.r4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  align-items: end;
}

.r2 > div,
.r3 > div,
.r4 > div {
  min-width: 0;
}

/* Container-aware form wrapping inside cards so labels never cramp */
@container (max-width: 680px) {
  .r4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .box > .row {
    flex-wrap: wrap;
  }
  .box > .row > .grow {
    flex: 1 1 100%;
  }
  .box > .row > button {
    width: 100%;
  }
}

@container (max-width: 560px) {
  .r3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .r3 > div:last-child {
    grid-column: 1 / -1;
  }
}

@container (max-width: 420px) {
  .r2, .r3, .r4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .r3 > div:last-child {
    grid-column: auto;
  }
}

.row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
}

.row > .grow {
  flex: 1;
  min-width: 0;
}

.row > .grow > input {
  width: 100%;
}

@media (max-width: 680px) {
  .r2, .r3, .r4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row {
    flex-wrap: wrap;
  }
  .row > .grow {
    flex: 1 1 100%;
  }
  .tree-depth-col {
    flex: 1 1 155px;
    width: auto;
  }
  .row > button {
    flex: 1 1 auto;
  }
}

@media (max-width: 440px) {
  .r2, .r3, .r4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.stage-actions-bar {
  margin-bottom: 16px;
}

.only-compact {
  display: none;
}

@media (max-width: 1040px) {
  .only-compact {
    display: inline-flex;
  }
}

/* ---- Pill Buttons ---- */
button {
  padding: 9px 16px;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--card);
  border-radius: var(--r-pill);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--black-hv);
  color: var(--card);
  border-color: var(--black-hv);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button.g {
  background: var(--card);
  color: var(--tx);
  border: 1px solid var(--bd);
}
button.g:hover:not(:disabled) {
  background: var(--inp-hv);
  color: var(--tx);
  border-color: var(--tx-2);
}

button.lime-btn {
  background: var(--lime);
  border-color: var(--lime-2);
  color: #111317;
  font-weight: 700;
}
button.lime-btn:hover:not(:disabled) {
  background: var(--lime-2);
  color: #111317;
  border-color: var(--lime-2);
}

button.d {
  background: var(--card);
  color: var(--loss);
  border: 1px solid var(--bd);
}
button.d:hover:not(:disabled) {
  border-color: var(--loss);
  background: rgba(220, 38, 38, 0.12);
  color: var(--loss);
}

button.sm {
  padding: 5px 11px;
  font-size: 12px;
}

button.cir {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
}

.bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Tags / Badges ---- */
.tag {
  font-size: 11px;
  background: var(--lime);
  color: #111317;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-weight: 700;
}

.tag.splice {
  background: var(--blue);
  color: #132347;
}

.tag.soft {
  background: var(--inp);
  color: var(--tx-2);
  font-weight: 600;
}

.tag.warn {
  background: var(--warn-bg);
  color: var(--warn-tx);
  border: 1px solid var(--warn-bd);
}

.st {
  font-size: 12px;
  margin-top: 8px;
  color: var(--mu);
}
.st.ok {
  color: var(--gain);
  font-weight: 500;
}
.st.err {
  color: var(--loss);
}

.box {
  border-top: 1px solid var(--bd);
  margin-top: 12px;
  padding-top: 8px;
}

.inline-chk {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--tx);
  margin-top: 8px;
  cursor: pointer;
}

.inline-chk input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #111317;
  cursor: pointer;
}

.chk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 10px 0 6px;
}

@media (max-width: 560px) {
  .chk-grid {
    grid-template-columns: 1fr;
  }
}

.buff-summary {
  background: var(--lime-grad);
  color: #111317;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 10px;
}

.note {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  color: var(--warn-tx);
  border-radius: 14px;
  padding: 10px 13px;
  font-size: 12px;
  margin-top: 10px;
}

/* ---- Right Column: Statistics Card (Income vs Spend + Dual Pill Bar Chart) ---- */
.sticky-col {
  position: sticky;
  top: var(--pad-shell);
}

@media (max-width: 1120px) {
  .sticky-col {
    position: static;
  }
}

/* ---- Card Perkiraan Hasil Akhir & Durasi Proyek (Menggantikan Bar Chart Statistik) ---- */
.outcome-hero-card {
  background: var(--card-soft);
  border: 1px solid var(--bd-soft);
  border-radius: var(--r-card);
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.dark .outcome-hero-card {
  background: #171b22;
  border-color: #272f3c;
}

.outcome-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.outcome-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--tx-2);
}

.target-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(212, 255, 0, 0.45);
}

.outcome-cycle-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(149, 180, 250, 0.14);
  color: #2563eb;
  border: 1px solid rgba(149, 180, 250, 0.35);
}

body.dark .outcome-cycle-badge {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.outcome-hero-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.outcome-main-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.outcome-main-num {
  font-size: clamp(28px, 2.3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: #111317;
}

body.dark .outcome-main-num {
  color: var(--lime);
  text-shadow: 0 0 20px rgba(212, 255, 0, 0.25);
}

.outcome-main-unit {
  font-size: 16px;
  font-weight: 700;
  color: var(--mu);
}

.outcome-extra-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(212, 255, 0, 0.15);
  color: #728c00;
  border: 1px solid rgba(212, 255, 0, 0.35);
  margin-left: 4px;
}

body.dark .outcome-extra-badge {
  background: rgba(212, 255, 0, 0.18);
  color: #d4ff00;
  border-color: rgba(212, 255, 0, 0.4);
}

.outcome-extra-badge.blue {
  background: rgba(56, 189, 248, 0.14);
  color: #0284c7;
  border-color: rgba(56, 189, 248, 0.35);
}

body.dark .outcome-extra-badge.blue {
  color: #38bdf8;
}

.outcome-sub-note {
  font-size: 11.5px;
  color: var(--mu);
  line-height: 1.35;
}

/* Variansi RNG Drop Box */
.outcome-rng-box {
  background: var(--card);
  border: 1px solid var(--bd-soft);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

body.dark .outcome-rng-box {
  background: #12151a;
  border-color: #222834;
}

.outcome-rng-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.rng-title {
  font-weight: 700;
  color: var(--tx);
}

.rng-subtitle {
  color: var(--mu);
  font-size: 10.5px;
}

.outcome-rng-track {
  position: relative;
  height: 8px;
  background: rgba(149, 180, 250, 0.15);
  border-radius: 4px;
  margin: 6px 4px 4px;
}

body.dark .outcome-rng-track {
  background: #1c232e;
}

.rng-track-bar {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f87171 0%, #38bdf8 50%, #4ade80 100%);
  border-radius: 4px;
  opacity: 0.85;
}

.rng-point {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

body.dark .rng-point {
  border-color: #12151a;
}

.rng-point.min {
  left: 8%;
  background: #f87171;
}

.rng-point.avg {
  left: 50%;
  background: #38bdf8;
  width: 12px;
  height: 12px;
}

.rng-point.max {
  left: 92%;
  background: #4ade80;
}

.outcome-rng-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.rng-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rng-col.min { text-align: left; }
.rng-col.avg { text-align: center; }
.rng-col.max { text-align: right; }

.rng-col small {
  font-size: 10.5px;
  color: var(--mu);
  white-space: nowrap;
}

.rng-col strong {
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.rng-col.min strong { color: #ef4444; }
body.dark .rng-col.min strong { color: #f87171; }

.rng-col.avg strong { color: #2563eb; }
body.dark .rng-col.avg strong { color: #38bdf8; }

.rng-col.max strong { color: #16a34a; }
body.dark .rng-col.max strong { color: #4ade80; }

/* Grid Metrik Waktu & Sumber Daya */
.outcome-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  .outcome-tiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .outcome-tiles-grid {
    grid-template-columns: 1fr;
  }
}

.outcome-tile {
  background: var(--card-soft);
  border: 1px solid var(--bd-soft);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

body.dark .outcome-tile {
  background: #171b22;
  border-color: #262e3b;
}

.outcome-tile:hover {
  transform: translateY(-1px);
  border-color: var(--tx-2);
}

.tile-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.tile-texts small {
  font-size: 11px;
  color: var(--mu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-texts strong {
  font-size: 15px;
  font-weight: 750;
  color: var(--tx);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 1px 0;
}

.tile-texts strong.gain {
  color: #16a34a;
}
body.dark .tile-texts strong.gain {
  color: #4ade80;
}

.tile-texts strong.loss {
  color: #dc2626;
}
body.dark .tile-texts strong.loss {
  color: #f87171;
}

.tile-texts span {
  font-size: 10.5px;
  color: var(--mu);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tool Badges Strip */
.outcome-tools-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--inp);
  border: 1px solid var(--bd-soft);
  border-radius: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

body.dark .outcome-tools-strip {
  background: #141820;
  border-color: #242c38;
}

.tools-label {
  font-size: 11px;
  color: var(--mu);
  font-weight: 600;
}

.tools-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tool-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 1px solid var(--bd);
  color: var(--tx-2);
}

body.dark .tool-tag {
  background: #1c222c;
  border-color: #2f3847;
  color: #cbd5e1;
}

/* ---- Bento Grid Tahapan Massing (2 Kolom di Desktop: Kiri Tahap 1, Kanan Tahap 2) ---- */
#stages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  margin-bottom: 8px;
}

@media (max-width: 1080px) {
  #stages {
    grid-template-columns: 1fr;
  }
}

.stage-card {
  margin-bottom: 0 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.stage-card.is-collapsed {
  padding-top: 14px;
  padding-bottom: 14px;
  background: var(--card-soft);
}

.stage-card.is-collapsed h2 {
  margin-bottom: 0;
}

.stage-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
  flex-wrap: wrap;
}

.stage-head-left:hover .stage-title-text {
  color: var(--lime-2);
}

.toggle-collapse-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--inp);
  border: 1px solid var(--bd);
  color: var(--tx);
  cursor: pointer;
  padding: 0;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.toggle-collapse-btn:hover {
  background: var(--lime);
  color: #111317;
  border-color: var(--lime-2);
}

.stage-title-text {
  font-weight: 750;
  font-size: 15px;
  color: var(--tx);
}

.collapsed-preview-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--inp);
  color: var(--tx-2);
  border: 1px solid var(--bd);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

body.dark .collapsed-preview-pill {
  background: #242a34;
  color: #cbd5e1;
  border-color: #333d4b;
}

@container (max-width: 560px) {
  .bp-btn-group {
    grid-template-columns: 1fr;
  }
}

/* ---- Action Bar: Tombol Tambah Tahap (Spasi Lega ke Bawah) ---- */
.action-bar-stages {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 28px; /* Ruang bernapas yang jelas sebelum 2 kartu di bawah */
  flex-wrap: wrap;
}

.action-bar-stages button {
  height: 42px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--bd);
  color: var(--tx);
  transition: all 0.16s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.dark .action-bar-stages button {
  background: #171b22;
  border-color: #2b3340;
  color: #f3f5f8;
}

.action-bar-stages button:hover {
  transform: translateY(-2px);
  border-color: var(--lime);
  color: var(--tx);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

body.dark .action-bar-stages button:hover {
  border-color: var(--lime);
  background: #1c222b;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ---- Seksi Analitik 2 Kolom (Kiri Statistik, Kanan Detail Belanja & Bahan Modal) ---- */
.analytics-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 28px;
}

@media (max-width: 1080px) {
  .analytics-2col {
    grid-template-columns: 1fr;
  }
}

.analytics-2col > .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

#shopSection {
  display: flex;
  flex-direction: column;
}

#shopSection .table-wrap {
  overflow-x: auto;
  max-height: 290px;
  overflow-y: auto;
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid var(--bd-soft);
}

#shopSection .table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

#shopSection .table-wrap::-webkit-scrollbar-thumb {
  background: var(--bd);
  border-radius: 6px;
}

/* ---- Cost Allocation Progress Bars (gaya kartu kanan bawah referensi) ---- */
.alloc-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 8px 0 14px;
}

.alloc-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
}

.alloc-row-top span {
  color: var(--tx-2);
  font-weight: 500;
}

.alloc-row-top b {
  color: var(--tx);
  font-weight: 700;
}

.prog-track {
  height: 7px;
  background: var(--inp);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--lime);
  transition: width 0.25s ease;
}

.prog-fill.alt {
  background: var(--blue);
}

/* ---- Clean Tables ---- */
.tw {
  overflow-x: auto;
  margin-top: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
  min-width: 420px;
}

th, td {
  padding: 8px 8px;
  text-align: right;
  border-bottom: 1px solid var(--bd);
}

th:first-child, td:first-child {
  text-align: left;
}

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

th {
  color: var(--mu);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}


/* ---- Header Guide Pill & Guide Modal (Bento Style) ---- */
.guide-trigger,
button.guide-trigger {
  height: 38px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  background: var(--lime);
  border: 1px solid var(--lime-2);
  color: #111317;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: var(--sh-card);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

button.guide-trigger:hover:not(:disabled),
.guide-trigger:hover:not(:disabled) {
  background: var(--lime-2);
  color: #111317;
  border-color: var(--lime-2);
  transform: translateY(-1px);
}

.guide-trigger svg {
  width: 16px;
  height: 16px;
  stroke: #111317;
  stroke-width: 2;
  fill: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fadeIn 0.16s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guide-modal {
  width: 100%;
  max-width: 780px;
  max-height: min(88vh, 760px);
  background: var(--card);
  color: var(--tx);
  border-radius: 28px;
  border: 1px solid var(--bd-soft);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.guide-head {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--bd);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.guide-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--mu);
}

.guide-tabs-bar {
  padding: 12px 24px 0;
}

.guide-body {
  padding: 18px 24px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gtab-pane {
  display: none;
}

.gtab-pane.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .g-steps {
    grid-template-columns: 1fr;
  }
}

.g-card {
  background: var(--card-soft);
  border: 1px solid var(--bd);
  border-radius: 18px;
  padding: 15px 16px;
}

.g-card.highlight {
  background: var(--lime-soft);
  color: #111317;
  border-color: #d9f94a;
}

.g-card.highlight p,
.g-card.highlight li {
  color: #262b16;
}

.g-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lime);
  color: #111317;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 8px;
}

.g-step-num.blue {
  background: var(--blue);
  color: #132347;
}

.g-card h4 {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 700;
}

.g-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--mu);
  line-height: 1.5;
}

.g-list {
  margin: 6px 0 0;
  padding-left: 17px;
  font-size: 12.5px;
  color: var(--tx-2);
  line-height: 1.55;
}

.g-list li + li {
  margin-top: 4px;
}

.g-code {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--bd);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tx);
}

.scenario-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--card-soft);
  border: 1px solid var(--bd);
  border-radius: 18px;
  padding: 16px 18px;
}

.scenario-card h4 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 700;
}

.scenario-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--mu);
  max-width: 470px;
}

.guide-foot {
  padding: 12px 24px;
  border-top: 1px solid var(--bd);
  background: var(--card-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--mu);
}

@media (max-width: 600px) {
  .modal-backdrop {
    padding: 10px;
  }
  .guide-modal {
    max-height: 92vh;
    border-radius: 22px;
  }
  .guide-head,
  .guide-tabs-bar,
  .guide-body,
  .guide-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  #guideTabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 16px;
  }
}

/* ---- CALC GT Hub Portal ---- */
.hub-view {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.6vw, 24px);
  animation: fadeIn 0.18s ease;
}

.hub-hero {
  background: var(--card);
  border: 1px solid var(--bd-soft);
  border-radius: var(--r-card);
  padding: clamp(20px, 2.4vw, 36px);
  box-shadow: var(--sh-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.hub-hero::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 255, 0, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hub-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mu);
}

.hub-brand-badge svg {
  width: 18px;
  height: 18px;
}

.hub-hero h1 {
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.15;
}

.hub-hero p {
  margin: 0;
  font-size: clamp(13px, 1.05vw, 15px);
  color: var(--mu);
  max-width: 740px;
  line-height: 1.6;
}

.hub-quick-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.hub-stat-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--inp);
  color: var(--tx-2);
}

.hub-stat-pill.active {
  background: var(--lime-soft);
  color: #111317;
}

.hub-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hub-filter-pills {
  display: flex;
  background: var(--card);
  border: 1px solid var(--bd-soft);
  padding: 4px;
  border-radius: var(--r-pill);
  gap: 4px;
}

.hub-filter-btn {
  border: none;
  background: transparent;
  color: var(--mu);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hub-filter-btn:hover {
  color: var(--tx);
  background: var(--inp);
}

.hub-filter-btn.active {
  background: var(--black);
  color: var(--card);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 1.4vw, 20px);
}

.hub-card {
  grid-column: span 6;
  background: var(--card);
  border: 1px solid var(--bd-soft);
  border-radius: var(--r-card);
  padding: clamp(18px, 1.6vw, 26px);
  box-shadow: var(--sh-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--bd);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.hub-card.featured {
  grid-column: span 12;
  background: linear-gradient(155deg, var(--card) 0%, var(--card-soft) 100%);
  border: 1.5px solid rgba(212, 255, 0, 0.45);
}

@media (max-width: 900px) {
  .hub-card {
    grid-column: span 12;
  }
}

.hub-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hub-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--inp);
  color: var(--tx);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hub-ico.lime {
  background: var(--lime);
  color: #111317;
}

.hub-ico svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
}

.hub-card-head .tag {
  flex-shrink: 0;
}

.hub-card h3 {
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 700;
  margin: 0 0 3px;
  letter-spacing: -0.015em;
  color: var(--tx);
}

.hub-sub {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mu);
  margin: 0 0 8px;
}

.hub-desc {
  font-size: 13px;
  color: var(--tx-2);
  line-height: 1.55;
  margin: 0;
}

.hub-feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--mu);
}

@media (max-width: 580px) {
  .hub-feature-list {
    grid-template-columns: 1fr;
  }
}

.hub-feature-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hub-feature-list li svg {
  width: 14px;
  height: 14px;
  stroke: var(--gain);
  stroke-width: 2.2;
  fill: none;
  flex-shrink: 0;
}

.hub-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--bd-soft);
  margin-top: auto;
}

.calc-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--bd-soft);
  margin-bottom: 8px;
}

.calc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--mu);
}

.calc-breadcrumb a {
  text-decoration: none;
  color: var(--mu);
}
.calc-breadcrumb a:hover {
  color: var(--tx);
}

.calc-breadcrumb b {
  color: var(--tx);
}

/* ---- Spacious Stage Block Action Bar ---- */
.stage-bp-bar {
  background: var(--card-soft);
  border: 1px solid var(--bd-soft);
  border-radius: var(--r-inp);
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
}

body.dark .stage-bp-bar {
  background: #171b22;
  border-color: #272f3c;
}

.bp-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.bp-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
}

.bp-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
}

.bp-status-badge.badge-seed {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

body.dark .bp-status-badge.badge-seed {
  background: rgba(212, 255, 0, 0.16);
  color: #d4ff00 !important;
  border: 1px solid rgba(212, 255, 0, 0.45);
}

.bp-status-badge.badge-block {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

body.dark .bp-status-badge.badge-block {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.bp-status-badge.badge-custom {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

body.dark .bp-status-badge.badge-custom {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.bp-btn-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

@container (max-width: 440px) {
  .bp-btn-group {
    grid-template-columns: 1fr;
  }
}

.bp-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--bd);
  background: var(--card);
  color: var(--tx);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

body.dark .bp-toggle-btn {
  background: #1e242d;
  border-color: #2b3442;
  color: #f3f5f8;
}

.bp-toggle-btn:hover:not(.active) {
  background: var(--inp-hv);
  border-color: var(--tx-2);
  transform: translateY(-1px);
}

body.dark .bp-toggle-btn:hover:not(.active) {
  background: #252d38;
  border-color: #4b5563;
}

.bp-toggle-btn.active {
  background: #111317;
  color: #ffffff;
  border-color: #111317;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark .bp-toggle-btn.active {
  background: rgba(212, 255, 0, 0.12) !important;
  color: #ffffff !important;
  border-color: var(--lime) !important;
  box-shadow: 0 0 14px rgba(212, 255, 0, 0.22);
}

body.dark .bp-toggle-btn.active strong {
  color: var(--lime) !important;
}

.bp-btn-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.bp-btn-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.bp-btn-texts strong {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-btn-texts small {
  font-size: 10.5px;
  color: var(--mu);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Callout Hint Penjelasan Aksi */
.bp-active-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--inp);
  border: 1px solid var(--bd-soft);
  font-size: 11.5px;
  color: var(--tx-2);
  line-height: 1.35;
}

body.dark .bp-active-hint {
  background: #1a1f28;
  border-color: #262f3c;
  color: #cbd5e1;
}

.bp-hint-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bp-hint-dot.green { background: #22c55e; }
.bp-hint-dot.blue { background: #38bdf8; }
.bp-hint-dot.amber { background: #f59e0b; }

.bp-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-inp);
  background: var(--card);
  border: 1px dashed var(--bd);
  margin-top: 2px;
  flex-wrap: wrap;
}

.bp-custom-input-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bp-custom-input-box input {
  width: 70px !important;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

.bp-custom-input-box .bp-unit {
  font-weight: 700;
  color: var(--mu);
}

.bp-hint-note {
  font-size: 11.5px;
  color: var(--mu);
}
