/* ============================================================================
   assets/nexus-v38.css — Tombol "Segarkan Data & Jalankan Mesin" + matriks 7 TF
   CREATIVE NEXUS v38
   ========================================================================== */

/* ---------------------------------------------------------- bilah sticky */
.nx38-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  margin: 14px 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0b2545 0%, #102e52 100%);
  border: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 0 10px 26px rgba(6, 20, 38, 0.28);
  color: #f2f6fb;
}

.nx38-bar[data-busy="1"] { border-color: rgba(201, 162, 39, 0.85); }

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

.nx38-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  cursor: pointer;
  color: #10233b;
  background: linear-gradient(180deg, #f0d264 0%, #c9a227 100%);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  max-width: 100%;
}

.nx38-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.nx38-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
.nx38-btn:disabled { cursor: not-allowed; filter: grayscale(0.35) brightness(0.86); box-shadow: none; }
.nx38-btn .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nx38-head { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nx38-head b { font-size: 13.5px; color: #eaf1f9; }
.nx38-head span { font-size: 11.5px; color: #9fb4cc; }

.nx38-stamp {
  margin-left: auto;
  font-size: 11.5px;
  color: #b9cbe0;
  text-align: right;
  min-width: 0;
}
.nx38-stamp b { color: #f0d264; }

/* ---------------------------------------------------------------- tahapan */
.nx38-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.nx38-stage {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.nx38-stage .ic {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #c9d7e6;
}

.nx38-stage .txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nx38-stage .nm { font-size: 12px; font-weight: 600; color: #dce8f5; }
.nx38-stage .dt {
  font-size: 11px;
  color: #93aac2;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.nx38-stage.s-run { border-color: rgba(201, 162, 39, 0.65); background: rgba(201, 162, 39, 0.1); }
.nx38-stage.s-run .ic { background: rgba(201, 162, 39, 0.25); color: #f0d264; }
.nx38-stage.s-ok { border-color: rgba(47, 125, 91, 0.6); background: rgba(47, 125, 91, 0.12); }
.nx38-stage.s-ok .ic { background: rgba(47, 125, 91, 0.35); color: #8ee0b8; }
.nx38-stage.s-err { border-color: rgba(192, 57, 43, 0.65); background: rgba(192, 57, 43, 0.14); }
.nx38-stage.s-err .ic { background: rgba(192, 57, 43, 0.35); color: #ffb3a7; }

.nx38-spin {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #f0d264;
  border-radius: 50%;
  animation: nx38spin 0.75s linear infinite;
}

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

/* ------------------------------------------------------------------ pesan */
.nx38-msg {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #cfe0f0;
  min-height: 18px;
}
.nx38-msg b { color: #f5f9fd; }
.nx38-msg.ok { color: #a9e8c8; }
.nx38-msg.err { color: #ffb3a7; }
.nx38-msg.run { color: #f0d264; }

/* --------------------------------------------------------- ringkasan hasil */
.nx38-wrap { margin-top: 14px; }

.nx38-sum {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.nx38-k {
  padding: 10px 11px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid #e2e9f2;
  min-width: 0;
}
.nx38-k span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: #5f7590;
  margin-bottom: 3px;
}
.nx38-k b { display: block; font-size: 14px; color: #10233b; overflow-wrap: anywhere; }
.nx38-k.go { background: #edf8f2; border-color: #b9e3cd; }
.nx38-k.go b { color: #1d6b46; }
.nx38-k.wait { background: #fdf7e8; border-color: #ecdcb2; }
.nx38-k.wait b { color: #8a6a12; }
.nx38-k.nogo { background: #fdefed; border-color: #f3c9c2; }
.nx38-k.nogo b { color: #a5342a; }

/* ------------------------------------------------------------- tabel matriks */
.nx38-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #fff;
}

.nx38-tbl thead th {
  position: sticky;
  top: 0;
  background: #0b2545;
  color: #eaf1f9;
  font-size: 10.5px;
  font-weight: 600;
  text-align: left;
  padding: 8px 7px;
  white-space: nowrap;
  border-bottom: 1px solid #1b3d63;
}

.nx38-tbl tbody td {
  padding: 7px;
  border-bottom: 1px solid #edf1f6;
  color: #22364d;
  vertical-align: top;
}
.nx38-tbl tbody tr:nth-child(even) { background: #fafcfe; }
.nx38-tbl tbody tr:hover { background: #f2f7fc; }
.nx38-tbl .nx38-tf { font-weight: 700; color: #0b2545; }
.nx38-tbl .nx38-na { color: #8b98a8; font-style: italic; }

.nx38-v { font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.nx38-v.bull { background: #e4f6ec; color: #1d6b46; }
.nx38-v.bear { background: #fdeae7; color: #a5342a; }
.nx38-v.side { background: #eef2f7; color: #4b5f76; }

.nx38-g { font-weight: 700; font-size: 11px; padding: 1px 5px; border-radius: 4px; }
.nx38-g.go { background: #d9f2e4; color: #17603c; }
.nx38-g.wait { background: #fbeed0; color: #7d5f0e; }
.nx38-g.nogo, .nx38-g.no-go { background: #fadcd6; color: #97281f; }
.nx38-gx { font-size: 10.5px; color: #7488a0; }

.nx38-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: #55677c;
  margin: 10px 0 0;
}
.nx38-note b { color: #2a3d54; }

/* -------------------------------------------------------------- responsif */

/* v38: cegah tabel (min-width global 620px) melebarkan grid/panel pada layar
   kecil. Tabel tetap bisa digeser di dalam wadahnya sendiri, halaman tidak. */
.grid-in > .field { min-width: 0; }
.tbl-wrap { max-width: 100%; }
.nx38-wrap, .nx38-sum, .nx38-k { min-width: 0; }
html { overflow-x: hidden; }

@media (max-width: 980px) {
  .nx38-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  /* v38: tabel laporan Markdown yang menjadi anak langsung <body> (bawaan v37)
     tidak punya wadah gulir, sehingga halaman bisa digeser horizontal. Di layar
     kecil tabel itu dibuat menggulir di dalam dirinya sendiri. Desktop tidak
     berubah. */
  body > table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; width: 100%; }

  .nx38-bar { padding: 11px 11px; border-radius: 12px; }
  .nx38-top { gap: 9px; }
  .nx38-btn { width: 100%; justify-content: center; padding: 12px 14px; }
  .nx38-stamp { margin-left: 0; text-align: left; width: 100%; }
  .nx38-stages { grid-template-columns: 1fr; }
  .nx38-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx38-tbl { font-size: 11px; }
  .nx38-tbl thead th, .nx38-tbl tbody td { padding: 6px 5px; }
}

@media (max-width: 420px) {
  .nx38-sum { grid-template-columns: 1fr; }
  .nx38-btn { font-size: 13.5px; }
}

@media print {
  .nx38-bar { position: static; box-shadow: none; background: #fff; color: #000; border: 1px solid #ccc; }
  .nx38-btn { display: none; }
}
