/* =====================================================================
   FORTU QC ONLINE — Dashboard Operator
   Gaya korporat Fortu: hitam, putih, abu-abu, aksen silver tipis.
   ===================================================================== */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --fq-black: #111111;
  --fq-ink: #1c1d20;
  --fq-text: #2b2d31;
  --fq-muted: #6b6e76;
  --fq-silver: #c9cbcf;
  --fq-silver-2: #e3e4e7;
  --fq-line: #e8e9ec;
  --fq-bg: #f4f4f5;
  --fq-white: #ffffff;
  --fq-pass: #14702f;
  --fq-pass-bg: #e7f3eb;
  --fq-fail: #c5221f;
  --fq-fail-bg: #fbeaea;
  --fq-error: #8a5a00;
  --fq-error-bg: #fbf1dc;
  --fq-na: #5b6170;
  --fq-na-bg: #eceef2;
  --fq-run: #1f4fbf;
  --fq-run-bg: #e8eefc;
  --fq-sidebar: 248px;
  --bs-body-font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --bs-body-color: var(--fq-text);
  --bs-body-bg: var(--fq-bg);
  --bs-border-color: var(--fq-line);
  --bs-primary: var(--fq-black);
  --bs-primary-rgb: 17, 17, 17;
  --bs-link-color: var(--fq-black);
  --bs-link-hover-color: #000;
  --bs-border-radius: .5rem;
  /* v1.7.0: warna grafik dan permukaan per tema (tema gelap di akhir berkas) */
  --fq-chart-pass: #14702f;
  --fq-chart-fail: #c5221f;
  --fq-chart-err: #b06000;
  --fq-chart-inc: #9aa0a6;
  --fq-chart-run: #4a7bd0;
  --fq-chart-other: #c9cbcf;
  --fq-chart-grid: #eeeef0;
  --fq-surface: #ffffff;
  --fq-surface-2: #fafafa;
  --fq-hover: #f7f7f8;
}

html, body { height: 100%; }
body { font-size: .9rem; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
.font-mono, code, .mono { font-family: 'Cascadia Mono', Consolas, 'SFMono-Regular', Menlo, monospace; font-size: .82em; }
a { text-decoration: none; }
::selection { background: #111; color: #fff; }

/* ---------- Tombol & form bernuansa hitam ---------- */
.btn { font-weight: 500; border-radius: .45rem; }
.btn-dark, .btn-primary { --bs-btn-bg: var(--fq-black); --bs-btn-border-color: var(--fq-black); --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-active-bg: #000; --bs-btn-disabled-bg: #5a5a5a; --bs-btn-disabled-border-color: #5a5a5a; }
.btn-outline-dark { --bs-btn-color: var(--fq-black); --bs-btn-border-color: var(--fq-silver); --bs-btn-hover-bg: var(--fq-black); --bs-btn-hover-border-color: var(--fq-black); }
.btn-light { --bs-btn-bg: var(--fq-white); --bs-btn-border-color: var(--fq-silver-2); --bs-btn-hover-bg: #f1f1f2; --bs-btn-hover-border-color: var(--fq-silver); }
.form-control, .form-select { border-color: var(--fq-silver-2); font-size: .9rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #111; box-shadow: 0 0 0 .2rem rgba(17,17,17,.12); }
.form-check-input:checked { background-color: #111; border-color: #111; }
.form-label { font-weight: 500; font-size: .8rem; color: var(--fq-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: #0d0d0d radial-gradient(1200px 600px at 10% 10%, #232323 0%, #0d0d0d 60%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand::after { content: ''; position: absolute; inset: auto -20% -40% auto; width: 620px; height: 620px; border: 1px solid rgba(201,203,207,.18); border-radius: 50%; }
.login-brand::before { content: ''; position: absolute; inset: auto -5% -25% auto; width: 420px; height: 420px; border: 1px solid rgba(201,203,207,.12); border-radius: 50%; }
.login-brand .tag { color: var(--fq-silver); letter-spacing: .3em; font-size: .72rem; text-transform: uppercase; }
.login-brand h1 { font-weight: 700; font-size: 2.6rem; letter-spacing: -.03em; line-height: 1.1; }
.login-brand .rule { width: 64px; height: 2px; background: var(--fq-silver); margin: 22px 0; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-card { width: 100%; max-width: 380px; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-brand { min-height: 240px; padding: 32px; } .login-brand h1 { font-size: 1.9rem; } }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--fq-sidebar); background: var(--fq-black); color: #d6d7da; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1030; transition: transform .2s ease; }
.sidebar .brand { padding: 22px 22px 18px; border-bottom: 1px solid #262626; }
.sidebar .brand .name { color: #fff; font-weight: 700; letter-spacing: .02em; font-size: 1.05rem; }
.sidebar .brand .sub { color: #8d9097; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.sidebar .brand .brand-logo { width: 36px; height: 36px; flex: none; display: block; }
.sidebar nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar .nav-section { color: #6f727a; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; padding: 14px 12px 6px; }
.sidebar .nav-link { color: #c3c5ca; border-radius: .45rem; padding: .55rem .75rem; display: flex; align-items: center; gap: .7rem; font-weight: 500; font-size: .86rem; }
.sidebar .nav-link i { font-size: 1.02rem; width: 18px; text-align: center; color: #8d9097; }
.sidebar .nav-link:hover { background: #1d1d1d; color: #fff; }
.sidebar .nav-link.active { background: #fff; color: #111; }
.sidebar .nav-link.active i { color: #111; }
.sidebar .side-foot { padding: 14px 18px; border-top: 1px solid #262626; font-size: .74rem; color: #7c7f86; }
.main { margin-left: var(--fq-sidebar); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(6px); border-bottom: 1px solid var(--fq-line); display: flex; align-items: center; padding: 0 24px; gap: 14px; position: sticky; top: 0; z-index: 1020; }
.topbar .title { font-weight: 600; font-size: 1.02rem; color: var(--fq-ink); }
/* v1.8.1: isi mengikuti lebar jendela (maximize/restore, skala Windows, Ctrl +/-). Sampai 1.8.0 isi dibatasi
   1560 px dan rata kiri: di layar 1920 px tersisa celah kosong 112 px di kanan, di 2560 px 752 px
   (screenshot Mr. Riffai 28 Nov 2026). Kisi Bootstrap, grafik Chart.js dan kisi kartu sesi melebar sendiri. */
.content { padding: 24px; width: 100%; max-width: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1025; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
}

/* ---------- Indikator koneksi ---------- */
.conn-pill { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--fq-silver-2); border-radius: 999px; padding: .2rem .65rem; font-size: .75rem; font-weight: 500; color: var(--fq-muted); background: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #b6b8bd; display: inline-block; flex: none; }
.dot.on { background: #18a144; box-shadow: 0 0 0 3px rgba(24,161,68,.15); }
.dot.off { background: #b6b8bd; }
.dot.warn { background: #d99a00; }
.dot.err { background: var(--fq-fail); }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(24,161,68,.35);} 70% { box-shadow: 0 0 0 8px rgba(24,161,68,0);} 100% { box-shadow: 0 0 0 0 rgba(24,161,68,0);} }

/* ---------- Kartu ---------- */
.card { border: 1px solid var(--fq-line); border-radius: .7rem; box-shadow: 0 1px 2px rgba(16,16,16,.03); }
.card-header { background: #fff; border-bottom: 1px solid var(--fq-line); padding: .85rem 1.1rem; font-weight: 600; color: var(--fq-ink); display: flex; align-items: center; gap: .5rem; border-radius: .7rem .7rem 0 0 !important; }
.card-header .sub { font-weight: 400; color: var(--fq-muted); font-size: .8rem; }
.card-body { padding: 1.1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 0; color: var(--fq-ink); }
.page-head p { margin: 2px 0 0; color: var(--fq-muted); }

.stat { padding: 16px 18px; background: #fff; border: 1px solid var(--fq-line); border-radius: .7rem; height: 100%; position: relative; overflow: hidden; }
.stat .label { padding-right: 40px; min-height: 2.4em; line-height: 1.2; color: var(--fq-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat .value { font-size: 1.85rem; font-weight: 700; color: var(--fq-ink); letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--fq-muted); font-size: .76rem; margin-top: 2px; }
.stat .ico { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--fq-bg); color: #3a3c41; }
.stat.dark { background: var(--fq-black); border-color: var(--fq-black); }
.stat.dark .label, .stat.dark .hint { color: #9ea1a8; }
.stat.dark .value { color: #fff; }
.stat.dark .ico { background: #222; color: #e9e9ea; }

/* ---------- Tabel ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .62rem .8rem; border-bottom-color: var(--fq-line); vertical-align: middle; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fq-muted); font-weight: 600; background: #fafafa; white-space: nowrap; border-bottom: 1px solid var(--fq-line); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7f7f8; }
.table tr.clickable { cursor: pointer; }
.table .muted { color: var(--fq-muted); }
.empty { text-align: center; color: var(--fq-muted); padding: 40px 16px; }
.empty i { font-size: 1.8rem; display: block; margin-bottom: 8px; color: var(--fq-silver); }

/* ---------- Badge status ---------- */
.st { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .04em; padding: .22rem .5rem; border-radius: .35rem; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; }
.st-PASS, .st-COMPLETED-PASS { color: var(--fq-pass); background: var(--fq-pass-bg); border-color: #cfe6d7; }
.st-FAIL { color: var(--fq-fail); background: var(--fq-fail-bg); border-color: #f2cfcf; }
.st-ERROR, .st-INCOMPLETE { color: var(--fq-error); background: var(--fq-error-bg); border-color: #f0dfb5; }
.st-NA, .st-PENDING, .st-NEVER_CONNECTED, .st-EXPIRED, .st-ARCHIVED, .st-DRAFT, .st-DISABLED { color: var(--fq-na); background: var(--fq-na-bg); border-color: #dfe2e8; }
.st-RUNNING, .st-SENT, .st-ACKNOWLEDGED { color: var(--fq-run); background: var(--fq-run-bg); border-color: #d3ddf7; }
.st-PAUSED { color: #6b4fbf; background: #efebfb; border-color: #ddd4f5; }
.st-ONLINE, .st-ACTIVE { color: var(--fq-pass); background: var(--fq-pass-bg); border-color: #cfe6d7; }
.st-OFFLINE, .st-STOPPED { color: #3d3f45; background: #ececee; border-color: #dcdde0; }
.st-COMPLETED { color: #111; background: #fff; border-color: var(--fq-silver); }
.st-REJECTED, .st-FAILED, .st-NOT_SUPPORTED, .st-PERMISSION_REQUIRED { color: var(--fq-error); background: var(--fq-error-bg); border-color: #f0dfb5; }
.role { font-size: .68rem; font-weight: 700; letter-spacing: .06em; padding: .2rem .45rem; border-radius: .3rem; background: var(--fq-black); color: #fff; }
.role.OPERATOR { background: #4a4c52; }
.role.VIEWER { background: #fff; color: #111; border: 1px solid var(--fq-silver); }

/* ---------- Progres QC ---------- */
.progress { height: 8px; background: var(--fq-silver-2); border-radius: 99px; }
.progress-bar { background: var(--fq-black); border-radius: 99px; transition: width .4s ease; }
.progress-bar.pass { background: var(--fq-pass); }
.progress-bar.fail { background: var(--fq-fail); }
.test-list { list-style: none; padding: 0; margin: 0; }
.test-list li { display: flex; align-items: center; gap: .7rem; padding: .62rem .2rem; border-bottom: 1px dashed var(--fq-line); }
.test-list li:last-child { border-bottom: 0; }
.test-list .idx { width: 26px; height: 26px; border-radius: 50%; background: var(--fq-bg); display: grid; place-items: center; font-size: .72rem; font-weight: 600; color: var(--fq-muted); flex: none; }
.test-list li.now .idx { background: var(--fq-black); color: #fff; animation: pulse 1.6s infinite; }
.test-list .nm { flex: 1; min-width: 0; }
.test-list .nm .t { font-weight: 500; color: var(--fq-ink); }
.test-list .nm .v { color: var(--fq-muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req { font-size: .62rem; color: var(--fq-muted); border: 1px solid var(--fq-silver-2); border-radius: .25rem; padding: 0 .3rem; margin-left: .35rem; vertical-align: 1px; }

/* ---------- Pilihan perangkat (Control Center) ---------- */
.dev-pick { border: 1px solid var(--fq-line); border-radius: .6rem; padding: .7rem .8rem; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; display: flex; gap: .65rem; align-items: center; }
.dev-pick:hover { border-color: var(--fq-silver); }
.dev-pick.sel { border-color: #111; box-shadow: 0 0 0 2px #111 inset; }
.dev-pick.disabled { opacity: .55; cursor: not-allowed; }
.dev-pick .n { font-weight: 600; color: var(--fq-ink); }
.dev-pick .m { color: var(--fq-muted); font-size: .76rem; }
.dev-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; max-height: 470px; overflow-y: auto; padding-right: 2px; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: .45rem 1rem; }
.kv dt { color: var(--fq-muted); font-weight: 500; font-size: .8rem; }
.kv dd { margin: 0; color: var(--fq-ink); word-break: break-all; }

.feed { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow-y: auto; }
.feed li { padding: .55rem 0; border-bottom: 1px solid var(--fq-line); display: flex; gap: .65rem; font-size: .83rem; }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 28px; height: 28px; border-radius: 7px; background: var(--fq-bg); display: grid; place-items: center; flex: none; color: #3a3c41; }
.feed .tm { color: var(--fq-muted); font-size: .72rem; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.filter-bar > div { min-width: 150px; }
.toast-container { z-index: 1090; }
.toast { border: 0; border-radius: .6rem; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.toast.fq-ok { background: #111; color: #fff; }
.toast.fq-err { background: var(--fq-fail); color: #fff; }
.modal-content { border: 0; border-radius: .8rem; }
.modal-header { border-bottom-color: var(--fq-line); }
.modal-footer { border-top-color: var(--fq-line); }
.drag { cursor: grab; color: var(--fq-silver); }
.spinner-border { --bs-spinner-border-width: .15em; }
.skeleton { background: linear-gradient(90deg, #efeff1 25%, #f7f7f8 50%, #efeff1 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: .35rem; height: 14px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.chart-box { position: relative; height: 280px; }
.text-pass { color: var(--fq-pass) !important; }
.text-fail { color: var(--fq-fail) !important; }
.text-err { color: var(--fq-error) !important; }
.nowrap { white-space: nowrap; }
.w-mono { font-variant-numeric: tabular-nums; }

/* Pendaftaran perangkat (v2.23.0) */
.pair-code { font-family: 'Cascadia Mono', Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .18em; line-height: 1; }
.pair-row td { vertical-align: middle; }
.pair-help { font-size: .85rem; color: #5b5e66; }
.qr-video { width: 100%; max-height: 320px; background: #111; border-radius: 8px; object-fit: cover; }

/* Sambungkan unit (v1.1.1) */
.srv-qr-img { width: fit-content; max-width: 100%; background: #fff; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 8px; padding: 6px; }
.srv-qr-img svg { display: block; shape-rendering: crispEdges; }
.connect-steps ol > li { margin-bottom: .45rem; }
.offline-help .card-header { background: #fff8e6; }

/* v1.1.6 — kartu angka yang bisa diklik */
a.stat-link { display: block; color: inherit; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
a.stat-link:hover, a.stat-link:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 18, 22, .12); }
a.stat-link .hint .bi { font-size: .7em; opacity: .6; }
.clickable { cursor: pointer; }
.failing-row:hover .fw-medium { text-decoration: underline; }
#feed li.clickable:hover b { text-decoration: underline; }

/* v1.1.6 — panel sesi langsung */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .75rem; }
.live-card { border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 10px; padding: .75rem .85rem; background: #fff; cursor: pointer; transition: box-shadow .12s ease, border-color .12s ease; }
.live-card:hover { border-color: #9aa0a8; box-shadow: 0 4px 14px rgba(16, 18, 22, .10); }
.live-card.stale { border-color: var(--fq-error, #b45309); background: #fffaf0; }
.live-card .min-w-0 { min-width: 0; }
.live-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.phase { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; border-radius: 999px; padding: .12rem .55rem; }
.phase.run { background: #e7f5ec; color: #14702f; }
.phase.wait { background: #fff4d6; color: #8a5a00; }
.phase.audio { background: #e8f0fe; color: #1a4fa3; }
.phase.idle { background: #f1f2f4; color: #5b5e66; }
.audio-line { color: #4a4d55; }
.badge-warn { display: inline-flex; align-items: center; gap: .2rem; background: #fff4d6; color: #8a5a00; border-radius: 999px; padding: 0 .45rem; font-size: .72rem; font-weight: 600; vertical-align: middle; }
.badge-unit { display: inline-flex; align-items: center; gap: .25rem; background: #eef1f5; color: #3b4048; border-radius: 999px; padding: .05rem .5rem; font-size: .75rem; font-weight: 600; }
details.rv { margin-top: .25rem; }
details.rv summary { font-size: .75rem; color: #6b6f78; cursor: pointer; }
details.rv pre { font-size: .72rem; max-height: 260px; overflow: auto; background: #f6f7f8; border-radius: 6px; padding: .5rem; white-space: pre-wrap; word-break: break-word; }
.unit-status li { margin-bottom: .2rem; }
.phase.off { background: #fdecea; color: #a1281f; }
.rv-cell { max-width: 340px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
#sd-results details.rv pre { max-width: 340px; }
/* v1.1.8 - Revisi 9B: PERINGATAN (LULUS bercatatan) kuning, sisa waktu antrean, Order Requester */
.st-WARN { color: #7a5200; background: #fff1c2; border-color: #f1d98a; }
.eta { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; color: #3b4048; }
.req-chip { display: inline-flex; align-items: center; gap: .25rem; background: #f3eefe; color: #4b3b8f; border-radius: 999px; padding: .02rem .5rem; font-size: .72rem; font-weight: 600; }
/* v1.1.9: jam modul "menit X dari 20" di panel sesi langsung */
.mod-clock { display: flex; align-items: center; gap: .5rem; margin-top: .25rem; font-size: .72rem; color: #3b4048; }
.mod-clock .mc-t { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mod-clock .mc-bar { flex: 1; height: 4px; background: #e9ecef; border-radius: 999px; overflow: hidden; min-width: 60px; }
.mod-clock .mc-bar > div { height: 100%; background: #2f6fde; transition: width .6s linear; }
.alert .mod-clock { margin-top: .4rem; }
.text-warn { color: #7a5200; }
/* v1.2.0 - sub-uji berurutan (QC Tools v2.25.0): pita kotak bernomor + daftar di Rincian */
.subt-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: .3rem; }
.subt-strip .sq { min-width: 20px; height: 20px; padding: 0 3px; border-radius: 4px; display: inline-grid; place-items: center; font-size: .64rem; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid transparent; cursor: default; }
.subt-strip .sq.pass { background: var(--fq-pass-bg); color: var(--fq-pass); border-color: #bfdcc8; }
.subt-strip .sq.fail { background: var(--fq-fail-bg); color: var(--fq-fail); border-color: #efc2c1; }
.subt-strip .sq.na { background: var(--fq-na-bg); color: var(--fq-na); }
.subt-strip .sq.run { background: var(--fq-run-bg); color: var(--fq-run); border-color: #b9c9f2; animation: pulse 1.6s infinite; }
.subt-strip .sq.wait { background: #fff; color: #9a9da4; border-color: var(--fq-line); }
.subt-strip .subt-now { margin-left: .35rem; font-size: .72rem; color: #3b4048; min-width: 0; overflow-wrap: anywhere; }
.subt { margin: .35rem 0 .45rem; }
.subt-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .75rem; color: var(--fq-ink); margin-bottom: .25rem; }
.subt-count { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.subt-count .sx { border-radius: 999px; padding: 0 .45rem; font-size: .68rem; font-weight: 600; }
.sx.pass { background: var(--fq-pass-bg); color: var(--fq-pass); }
.sx.fail { background: var(--fq-fail-bg); color: var(--fq-fail); }
.sx.na { background: var(--fq-na-bg); color: var(--fq-na); }
.sx.wait { background: #fff4d6; color: #8a5a00; }
.subt-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--fq-line); border-radius: 6px; overflow: hidden; }
.subt-list li { display: flex; align-items: flex-start; gap: .5rem; padding: .32rem .5rem; border-bottom: 1px solid var(--fq-line); font-size: .74rem; background: #fff; }
.subt-list li:last-child { border-bottom: 0; }
.subt-list li.fail { background: #fffafa; }
.subt-list .n { flex: none; width: 1.4rem; text-align: right; color: var(--fq-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.subt-list .nm { flex: 1; min-width: 0; color: var(--fq-ink); font-weight: 500; }
.subt-list .nt { display: block; color: var(--fq-muted); font-weight: 400; font-size: .7rem; overflow-wrap: anywhere; }
.subt-list .sb { flex: none; display: inline-flex; align-items: center; gap: .2rem; font-size: .64rem; font-weight: 700; letter-spacing: .03em; border-radius: .3rem; padding: .1rem .4rem; }
.subt-list .sb i { font-size: .7em; }
.sb.pass { background: var(--fq-pass-bg); color: var(--fq-pass); }
.sb.fail { background: var(--fq-fail-bg); color: var(--fq-fail); }
.sb.na { background: var(--fq-na-bg); color: var(--fq-na); }
.sb.run { background: var(--fq-run-bg); color: var(--fq-run); }
.sb.wait { background: #f4f4f5; color: #8a8d94; }
#sd-results .subt { max-width: 340px; }

/* v1.3.0 - penanda langsung dan pemilih periode Dashboard */
.badge-live { display: inline-flex; align-items: center; gap: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #c5221f; }
.badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c5221f; animation: fqPulse 1.6s ease-in-out infinite; }
@keyframes fqPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
#dash-period .btn { font-weight: 600; letter-spacing: .01em; }
#dash-period .btn.active { background: var(--fq-ink, #111); color: #fff; }
@media (prefers-reduced-motion: reduce) { .badge-live::before { animation: none; } }

/* v1.4.0 - tinjauan 18 Nov 2026: unit diam/terputus, perlu operator, linimasa, tabel ringkas */
.flex-none { flex: none; }
.min-w-0 { min-width: 0; }
.live-card.idle { border-color: #e0a100; box-shadow: 0 0 0 1px #e0a100 inset; background: #fffbef; }
.live-card.off { background: #fafafa; border-style: dashed; }
.live-card.off .progress-bar { background: #9aa0a6; }
.idle-chip { display: flex; align-items: flex-start; gap: .4rem; font-size: .76rem; font-weight: 600; color: #7a5200; background: #fff1c2; border-radius: .4rem; padding: .3rem .55rem; line-height: 1.35; }
.idle-chip > i { flex: none; margin-top: .08rem; }
.idle-chip > span { min-width: 0; }
.lc-name { color: #3b4048; }
.idle-chip b { font-variant-numeric: tabular-nums; }
.mini-bar { flex: 1; min-width: 50px; height: 6px; background: var(--fq-silver-2); border-radius: 99px; overflow: hidden; }
.mini-bar > div { height: 100%; border-radius: 99px; transition: width .4s ease; }
/* v1.7.0 (audit tampilan 1366 px): tabel yield muat di kartunya - kolom FPY tidak lagi terpotong. */
.yield-card { container-type: inline-size; }
.yield-card .yt-name { max-width: 220px; }
.yield-card .yt-op { max-width: 160px; }
@container (max-width: 640px) {
  .yield-card .mini-bar { display: none; }
  .yield-card .yt-name { max-width: 170px; }
}
@container (max-width: 420px) {
  .yield-card .yt-name, .yield-card .yt-op { max-width: 118px; }
  .yield-card .table > :not(caption) > * > * { padding-left: .45rem; padding-right: .45rem; }
}
/* v1.7.0: kolom aksi terakhir tabel lebar tetap terlihat saat tabel digeser ke samping (QC Result & Report). */
.table .sticky-end { position: sticky; right: 0; z-index: 1; background-color: var(--bs-card-bg, var(--bs-body-bg)); border-left: 1px solid var(--fq-line); }
.table-sm-fq > :not(caption) > * > * { padding: .5rem .75rem; font-size: .84rem; }
.table-sm-fq thead th { font-size: .66rem; }
.act-text { line-height: 1.35; overflow-wrap: anywhere; }
.act-detail { color: #4a4d55; }
#feed .tm { overflow-wrap: anywhere; }

/* Perlu operator sekarang */
.op-list { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; }
.op-list li { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .15rem; border-bottom: 1px solid var(--fq-line); }
.op-list li:last-child { border-bottom: 0; }
.op-list li:hover .op-unit b { text-decoration: underline; }
.op-wait { flex: none; min-width: 3.6rem; text-align: center; font-weight: 700; font-size: .95rem; color: #8a5a00; background: #fff4d6; border-radius: .45rem; padding: .2rem .35rem; }
.op-list li.long .op-wait { color: #fff; background: #b06000; }
.op-unit { font-size: .86rem; color: var(--fq-ink); }
.op-mod { font-size: .8rem; color: #3b4048; }
.op-msg { font-size: .74rem; color: var(--fq-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.op-list .muted, .tl-row .muted { color: var(--fq-muted); font-weight: 400; }

/* Linimasa unit: perkiraan selesai + giliran audio */
.tl-audio { color: #3b4048; background: #f6f7f9; border-radius: .45rem; padding: .4rem .6rem; margin-bottom: .6rem; }
.tl-axis { display: grid; grid-template-columns: minmax(140px, 28%) 1fr 3.4em 6.8em; margin-bottom: .2rem; }
.tl-axis-in { grid-column: 2; position: relative; height: 1.1rem; border-bottom: 1px solid var(--fq-line); }
.tl-axis-in span { position: absolute; transform: translateX(-50%); font-size: .66rem; color: var(--fq-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-axis-in span:first-child { transform: none; }
.tl-axis-in span:last-child { transform: translateX(-100%); }
.tl-axis-end { grid-column: 3; font-size: .66rem; color: var(--fq-muted); text-align: right; align-self: end; }
.tl-rows { max-height: 300px; overflow-y: auto; }
.tl-row { display: grid; grid-template-columns: minmax(140px, 28%) 1fr 3.4em 6.8em; align-items: center; padding: .22rem 0; border-bottom: 1px dashed #eef0f2; }
.tl-row:hover { background: #fafbfc; }
.tl-name { font-size: .8rem; padding-right: .6rem; color: var(--fq-ink); }
.tl-track { position: relative; height: 1.35rem; display: flex; align-items: center; background: linear-gradient(to right, transparent calc(25% - 1px), #f0f1f3 calc(25% - 1px), #f0f1f3 25%, transparent 25%, transparent calc(50% - 1px), #f0f1f3 calc(50% - 1px), #f0f1f3 50%, transparent 50%, transparent calc(75% - 1px), #f0f1f3 calc(75% - 1px), #f0f1f3 75%, transparent 75%); }
.tl-bar { height: .7rem; border-radius: 99px; background: #2f6fde; min-width: 4px; transition: width .6s linear; }
.tl-bar.op { background: #e0a100; }
.tl-bar.audio { background: #7a5cd6; }
.tl-bar.pause { background: #9b8ad8; opacity: .7; }
.tl-bar.off { background: repeating-linear-gradient(45deg, #b8bcc4, #b8bcc4 4px, #d7dae0 4px, #d7dae0 8px); }
.tl-end { font-size: .72rem; color: #3b4048; text-align: right; white-space: nowrap; }
.tl-tagcol { text-align: right; }
.tl-none { font-size: .72rem; color: var(--fq-muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-tag { display: inline-flex; align-items: center; gap: .2rem; font-size: .64rem; font-weight: 700; border-radius: 99px; padding: .05rem .4rem; white-space: nowrap; }
.tl-tag.listen { background: #e8f0fe; color: #1a4fa3; }
.tl-tag.sound { background: #eef1f5; color: #3b4048; }
.tl-tag.queue { background: #efebfb; color: #4b3b8f; }
.tl-more { margin-top: .4rem; }
.tl-more a { color: var(--fq-muted); text-decoration: none; }
.tl-more a:hover { color: var(--fq-ink); text-decoration: underline; }
.tl-legend { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .55rem; color: var(--fq-muted); }
.tl-legend .sw { display: inline-block; width: 18px; height: 8px; border-radius: 99px; margin-right: .3rem; vertical-align: 1px; }
.tl-legend .sw.run { background: #2f6fde; } .tl-legend .sw.op { background: #e0a100; } .tl-legend .sw.audio { background: #7a5cd6; }
.tl-legend .sw.pause { background: #9b8ad8; } .tl-legend .sw.off { background: #b8bcc4; }

/* Monitoring: baris unit diam / terputus */
tr.row-idle > td { background: #fffbef !important; }
tr.row-idle > td:first-child { box-shadow: 3px 0 0 #e0a100 inset; }
tr.row-off > td { color: #6b6e76; }
.row-note { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 600; border-radius: .35rem; padding: .05rem .4rem; }
.row-note.idle { background: #fff1c2; color: #7a5200; }
.row-note.off { background: #fdecea; color: #a1281f; }

/* Jadikan patokan */
.spec-diff td, .spec-diff th { font-size: .84rem; }
.spec-src { display: block; font-size: .66rem; color: var(--fq-muted); margin-top: .15rem; white-space: nowrap; }
@media (max-width: 575.98px) {
  .tl-axis, .tl-row { grid-template-columns: 96px 1fr 3.2em 0; }
  .tl-tagcol { display: none; }
  .tl-axis-in span:nth-child(2), .tl-axis-in span:nth-child(4) { display: none; }
}

/* v1.5.0 - Laporan unit ke Fortu CRM (System Settings + Detail Sesi) */
.crm-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; border-radius: 99px; padding: .12rem .55rem; white-space: nowrap; line-height: 1.4; }
.crm-chip i { font-size: .85em; }
.crm-chip.ok { background: #e6f4ea; color: #1e6b34; }
.crm-chip.info { background: #e8f0fe; color: #1a4fa3; }
.crm-chip.warn { background: #fff1c2; color: #7a5200; }
.crm-chip.err { background: #fdecea; color: #a1281f; }
.crm-chip.muted { background: #eef1f5; color: #4b4f57; }
.crm-card .card-header { gap: .5rem; }
.crm-kv { margin-bottom: .75rem; }
.crm-kv .sub { color: var(--fq-muted); font-size: .78rem; margin-left: .25rem; }
.crm-counts { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.crm-count { border: 1px solid var(--fq-line, #e5e7eb); border-radius: .55rem; padding: .45rem .6rem; min-width: 0; }
.crm-count .n { font-size: 1.15rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.crm-count .l { font-size: .7rem; color: var(--fq-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-count.zero .n { color: #b8bcc4; }
.crm-count.ok:not(.zero) { border-color: #b7dfc2; }
.crm-count.warn:not(.zero) { border-color: #f2d27a; background: #fffbef; }
.crm-count.err:not(.zero) { border-color: #f3b9b3; background: #fff6f5; }
.crm-alert { display: flex; gap: .6rem; align-items: flex-start; border-radius: .55rem; padding: .55rem .75rem; margin-bottom: .75rem; font-size: .84rem; }
.crm-alert > i { font-size: 1.05rem; line-height: 1.2; }
.crm-alert .sub { color: var(--fq-muted); font-size: .76rem; margin-top: .1rem; }
.crm-alert.warn { background: #fffbef; border: 1px solid #f2d27a; }
.crm-alert.info { background: #f3f7fe; border: 1px solid #c9d9f6; }
.crm-kv dd { word-break: normal; overflow-wrap: anywhere; }
.crm-table { table-layout: fixed; width: 100%; }
.crm-table th:nth-child(1) { width: 9.5rem; }
.crm-table th:nth-child(3) { width: 8.5rem; }
.crm-table th:nth-child(4) { width: 8.5rem; }
.crm-unit { min-width: 0; }
.crm-why { font-size: .76rem; color: var(--fq-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-when { font-size: .7rem; color: var(--fq-muted); white-space: normal; line-height: 1.25; margin-top: .1rem; }
tr.crm-open > td:first-child { box-shadow: 3px 0 0 #e0a100 inset; }
.crm-line { margin-top: .6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
/* v1.6.1 - kartu CRM yang mati (langkah menyalakan), Uji sambungan, tag staging */
.crm-alert.ok { background: #f0f8f2; border: 1px solid #b7dfc2; }
.crm-alert.err { background: #fff6f5; border: 1px solid #f3b9b3; }
.crm-alert.err > i { color: #a1281f; }
.crm-alert.warn > i { color: #8a5d00; }
.crm-alert.ok > i { color: #1e6b34; }
.crm-alert.info > i { color: #1a4fa3; }
.crm-problems { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .8rem; }
.crm-problems li + li { margin-top: .15rem; }
.crm-actions { display: inline-flex; gap: .4rem; flex-wrap: wrap; }
.crm-tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border: 1px solid #c9ccd2;
  color: #4b4f57; background: #f6f7f9; border-radius: .3rem; padding: 0 .35rem; margin-left: .3rem; vertical-align: .08em; }
.crm-steps { border: 1px solid var(--fq-line, #e5e7eb); border-radius: .55rem; padding: .6rem .8rem .55rem; font-size: .82rem; background: #fafbfc; }
.crm-steps-h { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #4b4f57; margin-bottom: .35rem; }
.crm-steps ol { margin: 0; padding-left: 1.15rem; }
.crm-steps li + li { margin-top: .4rem; }
.crm-steps .sub { color: var(--fq-muted); font-size: .76rem; margin-top: .15rem; }
.crm-cmd { display: block; width: fit-content; max-width: 100%; background: #111; color: #f2f2f2; border-radius: .35rem; padding: .3rem .55rem;
  font-size: .76rem; margin: .3rem 0 .35rem; overflow-wrap: anywhere; user-select: all; }
@media (max-width: 991.98px) { .crm-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 575.98px) {
  .crm-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-kv { grid-template-columns: 96px 1fr; }
  .crm-table th:nth-child(1) { width: 4.6rem; }
  .crm-table th:nth-child(3) { width: 6.9rem; }
  .crm-table th:nth-child(4) { width: 2.9rem; }
  .crm-table .crm-when { display: none; }
}

/* v1.6.0 — System Logs */
.log-box { max-height: 68vh; overflow: auto; }
.log-table thead th { position: sticky; top: 0; z-index: 1; background: #fff; }
.log-msg { white-space: pre-wrap; word-break: break-word; font-size: .78rem; line-height: 1.45; }
.log-error td { background: #fff6f5; }
.log-warn td { background: #fffbea; }

/* v1.6.0 — peringatan pengaturan, S/N ganda, ringkasan CRM di Dashboard */
.fq-alert { display: flex; gap: .75rem; align-items: flex-start; border-radius: .6rem; padding: .75rem 1rem; border: 1px solid transparent; font-size: .88rem; }
.fq-alert > i { font-size: 1.15rem; line-height: 1.2; }
.fq-alert .sub { color: inherit; opacity: .8; font-size: .8rem; }
.fq-alert.danger { background: #fdecea; color: #8c1d16; border-color: #f5c6c2; }
.fq-alert.warn { background: #fff6dc; color: #6b4a00; border-color: #f1d98a; }
.fq-alert.info { background: #eef3fd; color: #1a3f87; border-color: #d3ddf7; }
.fq-alert + .fq-alert { margin-top: .5rem; }
.crm-mini .crm-counts { margin-top: 0; }
.crm-mini .card-header .ms-auto { font-size: .8rem; }
.dup-list { margin: .45rem 0 0; padding-left: 1.1rem; }
.dup-list li { margin-bottom: .4rem; }
.dup-list a, .fq-alert a { color: inherit; text-decoration: underline; }
@media (max-width: 767.98px) {
  /* System Logs di ponsel: waktu + level di atas, pesan selebar layar di bawahnya */
  .log-table thead { display: none; }
  .log-table, .log-table tbody, .log-table tr, .log-table td { display: block; width: 100%; }
  .log-table tr { padding: .55rem .8rem; border-bottom: 1px solid var(--fq-line, #e5e7eb); }
  .log-table td { border: 0 !important; padding: 0 !important; background: transparent !important; }
  .log-table td:nth-child(1), .log-table td:nth-child(2) { display: inline-block; width: auto; margin-right: .5rem; }
  .log-table .log-msg { margin-top: .3rem; }
  .log-error { background: #fff6f5; }
  .log-warn { background: #fffbea; }
}

/* v1.7.0 — kendali perangkat, log unit, paket pembaruan, uji keamanan & pemulihan server, kelengkapan */
.cap-chip { display: inline-flex; align-items: center; gap: 2px; font-size: .76rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--fq-line); background: #fff; color: var(--fq-muted); white-space: nowrap; }
.cap-chip.on { color: var(--fq-pass); background: var(--fq-pass-bg); border-color: rgba(20, 112, 47, .22); }
.cap-chip.off { color: var(--fq-na); background: var(--fq-na-bg); text-decoration: line-through; text-decoration-color: rgba(91, 97, 112, .5); }
.cap-chip.unk { border-style: dashed; }
.st-test { list-style: none; padding: 0; margin: 0; }
.st-test li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-top: 1px solid var(--fq-line); }
.st-test li:first-child { border-top: 0; }
.st-test .nm { font-weight: 600; color: var(--fq-ink); }
.st-test .dt { color: var(--fq-muted); font-size: .82rem; overflow-wrap: anywhere; }
.st-test .grp { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--fq-muted); padding: 10px 14px 4px; border-top: 1px solid var(--fq-line); }
.st-test .grp:first-child { border-top: 0; }
.upload-bar { height: 6px; border-radius: 3px; background: var(--fq-line); overflow: hidden; }
.upload-bar > span { display: block; height: 100%; width: 0; background: var(--fq-black); transition: width .2s; }
.cl-editor textarea { font-family: var(--bs-font-monospace); font-size: .82rem; }
.cl-editor .cl-prof { font-weight: 600; }
.log-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--fq-line); }
.log-list li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--fq-line); }
.log-list li:last-child { border-bottom: 0; }
.log-list .ll-main { flex: 1 1 auto; min-width: 0; }
.log-list .ll-when { font-weight: 600; color: var(--fq-ink); font-size: .86rem; font-variant-numeric: tabular-nums; }
.log-list .ll-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .76rem; color: var(--fq-muted); margin-top: 2px; }
.log-list .ll-meta span + span::before { content: "·"; margin-right: 10px; color: var(--fq-muted); opacity: .6; }
.log-list .ll-crash { color: var(--fq-fail); font-weight: 600; }

/* =====================================================================
   v1.7.0 — TEMA GELAP FORTU (keputusan Mr. Riffai 24 Nov 2026: terang + gelap).
   Hitam, putih, silver tipis. Tema terang di atas TIDAK diubah; blok ini hanya
   berlaku bila <html data-bs-theme="dark"> (tombol tema di kop / halaman masuk).
   Bootstrap 5.3 menggelapkan komponennya sendiri; yang di sini adalah warna
   Fortu yang ditulis langsung di berkas ini.
   ===================================================================== */
.login-form { position: relative; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; }
.theme-toggle-login { position: absolute; top: 16px; right: 16px; }

[data-bs-theme=dark] {
  color-scheme: dark;
  --fq-ink: #f2f3f5;
  --fq-text: #d9dbdf;
  --fq-muted: #9a9ea7;
  --fq-silver: #5c6068;
  --fq-silver-2: #33363c;
  --fq-line: #2a2d33;
  --fq-bg: #0e0f11;
  --fq-white: #17181b;
  --fq-surface: #17181b;
  --fq-surface-2: #1d1f23;
  --fq-hover: #23262b;
  --fq-pass: #5ad08a;  --fq-pass-bg: rgba(90, 208, 138, .13);
  --fq-fail: #ff7a72;  --fq-fail-bg: rgba(255, 122, 114, .13);
  --fq-error: #f2bd5c; --fq-error-bg: rgba(242, 189, 92, .13);
  --fq-na: #a5abb8;    --fq-na-bg: rgba(165, 171, 184, .12);
  --fq-run: #8fb1ff;   --fq-run-bg: rgba(143, 177, 255, .13);
  --fq-chart-pass: #4fc283;
  --fq-chart-fail: #ff6b63;
  --fq-chart-err: #e9a640;
  --fq-chart-inc: #7b808a;
  --fq-chart-run: #7aa2ff;
  --fq-chart-other: #4a4e56;
  --fq-chart-grid: #26292e;
  --bs-body-color: var(--fq-text);
  --bs-body-bg: var(--fq-bg);
  --bs-border-color: var(--fq-line);
  --bs-secondary-color: #9a9ea7;
  --bs-tertiary-bg: #1d1f23;
  --bs-secondary-bg: #1d1f23;
  --bs-primary: #f3f3f4;
  --bs-primary-rgb: 243, 243, 244;
  --bs-link-color: #f3f3f4;
  --bs-link-color-rgb: 243, 243, 244;
  --bs-link-hover-color: #ffffff;
  --bs-emphasis-color: #f2f3f5;
}
[data-bs-theme=dark] ::selection { background: #f3f3f4; color: #111; }
/* tombol: aksen utama menjadi putih di atas latar gelap */
[data-bs-theme=dark] .btn-dark, [data-bs-theme=dark] .btn-primary { --bs-btn-color: #111; --bs-btn-bg: #f3f3f4; --bs-btn-border-color: #f3f3f4; --bs-btn-hover-color: #000; --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff; --bs-btn-active-color: #000; --bs-btn-active-bg: #fff; --bs-btn-active-border-color: #fff; --bs-btn-disabled-color: #3b3d42; --bs-btn-disabled-bg: #8b8e94; --bs-btn-disabled-border-color: #8b8e94; }
[data-bs-theme=dark] .btn-outline-dark { --bs-btn-color: #e9eaec; --bs-btn-border-color: #4a4d54; --bs-btn-hover-color: #111; --bs-btn-hover-bg: #f3f3f4; --bs-btn-hover-border-color: #f3f3f4; --bs-btn-active-color: #111; --bs-btn-active-bg: #fff; --bs-btn-active-border-color: #fff; }
[data-bs-theme=dark] .btn-light { --bs-btn-color: #e6e7ea; --bs-btn-bg: #1d1f23; --bs-btn-border-color: #33363c; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #26292e; --bs-btn-hover-border-color: #4a4d54; --bs-btn-active-color: #fff; --bs-btn-active-bg: #2b2e34; --bs-btn-active-border-color: #4a4d54; --bs-btn-disabled-color: #7f838b; --bs-btn-disabled-bg: #1d1f23; }
[data-bs-theme=dark] .border, [data-bs-theme=dark] .border-top, [data-bs-theme=dark] .border-bottom, [data-bs-theme=dark] .border-start, [data-bs-theme=dark] .border-end { border-color: var(--fq-line) !important; }
[data-bs-theme=dark] .form-control, [data-bs-theme=dark] .form-select { background-color: #141518; color: var(--fq-text); border-color: #33363c; }
[data-bs-theme=dark] .form-control:disabled, [data-bs-theme=dark] .form-select:disabled { background-color: #1a1b1e; color: #8d9097; }
[data-bs-theme=dark] .form-control:focus, [data-bs-theme=dark] .form-select:focus, [data-bs-theme=dark] .form-check-input:focus { border-color: #cfd1d5; box-shadow: 0 0 0 .2rem rgba(243, 243, 244, .14); }
[data-bs-theme=dark] .form-check-input:checked { background-color: #f3f3f4; border-color: #f3f3f4; }
[data-bs-theme=dark] .form-check-input:checked[type=checkbox] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23111' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
[data-bs-theme=dark] .form-check-input:checked[type=radio] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23111'/%3e%3c/svg%3e"); }
[data-bs-theme=dark] .form-switch .form-check-input:checked { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23111'/%3e%3c/svg%3e"); }
/* halaman masuk */
[data-bs-theme=dark] .login-form { background: #121315; }
[data-bs-theme=dark] .login-card > img { filter: invert(1); }
/* kerangka */
[data-bs-theme=dark] .sidebar { background: #0a0a0b; border-right: 1px solid #1f2125; }
[data-bs-theme=dark] .sidebar .nav-link:hover { background: #18191c; }
[data-bs-theme=dark] .topbar { background: rgba(18, 19, 22, .9); }
[data-bs-theme=dark] .role { background: #e6e7ea; color: #111; }
[data-bs-theme=dark] .role.OPERATOR { background: #8d9097; color: #111; }
[data-bs-theme=dark] .role.VIEWER { background: transparent; color: #e6e7ea; border-color: #4a4d54; }
[data-bs-theme=dark] .conn-pill { background: var(--fq-surface); }
/* kartu, ubin, tabel */
[data-bs-theme=dark] .card { --bs-card-bg: var(--fq-surface); background: var(--fq-surface); box-shadow: none; }
[data-bs-theme=dark] .card-header { background: var(--fq-surface); }
[data-bs-theme=dark] .stat { background: var(--fq-surface); }
[data-bs-theme=dark] .stat .ico { background: var(--fq-surface-2); color: #c9cbcf; }
[data-bs-theme=dark] .stat.dark { background: #050506; border-color: #2a2d33; }
[data-bs-theme=dark] .stat.dark .ico { background: #1a1b1e; }
[data-bs-theme=dark] a.stat-link:hover, [data-bs-theme=dark] a.stat-link:focus-visible { box-shadow: 0 6px 18px rgba(0, 0, 0, .55); border-color: #4a4d54; }
[data-bs-theme=dark] .table { --bs-table-color: var(--fq-text); }
[data-bs-theme=dark] .table thead th { background: #141518; }
[data-bs-theme=dark] .table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--fq-hover); }
[data-bs-theme=dark] .bg-white, [data-bs-theme=dark] .bg-light { background-color: var(--fq-surface-2) !important; }
[data-bs-theme=dark] .text-dark { color: var(--fq-ink) !important; }
[data-bs-theme=dark] .modal-content, [data-bs-theme=dark] .dropdown-menu { background: var(--fq-surface); }
[data-bs-theme=dark] .toast.fq-ok { background: #f3f3f4; color: #111; }
[data-bs-theme=dark] .skeleton { background: linear-gradient(90deg, #1d1f23 25%, #26292e 50%, #1d1f23 75%); background-size: 200% 100%; }
/* lencana status */
[data-bs-theme=dark] .st-PASS, [data-bs-theme=dark] .st-COMPLETED-PASS, [data-bs-theme=dark] .st-ONLINE, [data-bs-theme=dark] .st-ACTIVE { border-color: rgba(90, 208, 138, .3); }
[data-bs-theme=dark] .st-FAIL { border-color: rgba(255, 122, 114, .32); }
[data-bs-theme=dark] .st-ERROR, [data-bs-theme=dark] .st-INCOMPLETE, [data-bs-theme=dark] .st-REJECTED, [data-bs-theme=dark] .st-FAILED, [data-bs-theme=dark] .st-NOT_SUPPORTED, [data-bs-theme=dark] .st-PERMISSION_REQUIRED { border-color: rgba(242, 189, 92, .32); }
[data-bs-theme=dark] .st-NA, [data-bs-theme=dark] .st-PENDING, [data-bs-theme=dark] .st-NEVER_CONNECTED, [data-bs-theme=dark] .st-EXPIRED, [data-bs-theme=dark] .st-ARCHIVED, [data-bs-theme=dark] .st-DRAFT, [data-bs-theme=dark] .st-DISABLED { border-color: rgba(165, 171, 184, .26); }
[data-bs-theme=dark] .st-RUNNING, [data-bs-theme=dark] .st-SENT, [data-bs-theme=dark] .st-ACKNOWLEDGED { border-color: rgba(143, 177, 255, .32); }
[data-bs-theme=dark] .st-PAUSED { color: #b9a6ff; background: rgba(185, 166, 255, .13); border-color: rgba(185, 166, 255, .32); }
[data-bs-theme=dark] .st-OFFLINE, [data-bs-theme=dark] .st-STOPPED { color: #c3c6cc; background: #24262b; border-color: #33363c; }
[data-bs-theme=dark] .st-COMPLETED { color: #f2f3f5; background: transparent; border-color: #4a4d54; }
[data-bs-theme=dark] .st-WARN { color: #f2c86a; background: rgba(242, 200, 106, .13); border-color: rgba(242, 200, 106, .32); }
/* progres, antrean, pilihan perangkat */
[data-bs-theme=dark] .progress { background: #2a2d33; }
[data-bs-theme=dark] .progress-bar { background: #e6e7ea; }
[data-bs-theme=dark] .progress-bar.pass { background: var(--fq-pass); }
[data-bs-theme=dark] .progress-bar.fail { background: var(--fq-fail); }
[data-bs-theme=dark] .test-list li.now .idx { background: #f3f3f4; color: #111; }
[data-bs-theme=dark] .dev-pick { background: var(--fq-surface); }
[data-bs-theme=dark] .dev-pick.sel { border-color: #f3f3f4; box-shadow: 0 0 0 2px #f3f3f4 inset; }
[data-bs-theme=dark] .feed .ic { color: #c9cbcf; }
[data-bs-theme=dark] .pair-help { color: #a9adb5; }
[data-bs-theme=dark] .srv-qr-img { background: #fff; } /* QR tetap di atas putih supaya terbaca kamera */
[data-bs-theme=dark] .offline-help .card-header { background: rgba(242, 189, 92, .1); }
/* sesi langsung, operator, linimasa */
[data-bs-theme=dark] .live-card { background: var(--fq-surface); }
[data-bs-theme=dark] .live-card:hover { border-color: #5c6068; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
[data-bs-theme=dark] .live-card.stale { background: rgba(242, 189, 92, .07); }
[data-bs-theme=dark] .live-card.idle { border-color: #c88d00; box-shadow: 0 0 0 1px #c88d00 inset; background: rgba(242, 189, 92, .06); }
[data-bs-theme=dark] .live-card.off { background: #141518; }
[data-bs-theme=dark] .phase.run { background: rgba(90, 208, 138, .14); color: #6fd99a; }
[data-bs-theme=dark] .phase.wait { background: rgba(242, 189, 92, .14); color: #f2c86a; }
[data-bs-theme=dark] .phase.audio { background: rgba(143, 177, 255, .14); color: #a9c2ff; }
[data-bs-theme=dark] .phase.idle { background: #23262b; color: #b5b9c0; }
[data-bs-theme=dark] .phase.off { background: rgba(255, 122, 114, .14); color: #ff9a93; }
[data-bs-theme=dark] .audio-line, [data-bs-theme=dark] .lc-name, [data-bs-theme=dark] .eta, [data-bs-theme=dark] .mod-clock, [data-bs-theme=dark] .op-mod, [data-bs-theme=dark] .tl-end, [data-bs-theme=dark] .act-detail, [data-bs-theme=dark] .subt-strip .subt-now, [data-bs-theme=dark] .tl-audio { color: #b9bcc3; }
[data-bs-theme=dark] .badge-warn, [data-bs-theme=dark] .sx.wait, [data-bs-theme=dark] .op-wait, [data-bs-theme=dark] .idle-chip, [data-bs-theme=dark] .row-note.idle { background: rgba(242, 189, 92, .14); color: #f2c86a; }
[data-bs-theme=dark] .op-list li.long .op-wait { background: #b06000; color: #fff; }
[data-bs-theme=dark] .badge-unit { background: #23262b; color: #c9ccd2; }
[data-bs-theme=dark] .req-chip { background: rgba(185, 166, 255, .13); color: #c7b8ff; }
[data-bs-theme=dark] details.rv summary { color: #a1a5ad; }
[data-bs-theme=dark] details.rv pre { background: #141518; color: #d9dbdf; }
[data-bs-theme=dark] .text-warn { color: #f2c86a; }
[data-bs-theme=dark] .mod-clock .mc-bar { background: #2a2d33; }
[data-bs-theme=dark] .subt-strip .sq.pass { border-color: rgba(90, 208, 138, .32); }
[data-bs-theme=dark] .subt-strip .sq.fail { border-color: rgba(255, 122, 114, .34); }
[data-bs-theme=dark] .subt-strip .sq.run { border-color: rgba(143, 177, 255, .34); }
[data-bs-theme=dark] .subt-strip .sq.wait { background: transparent; color: #7f838b; }
[data-bs-theme=dark] .subt-list li { background: var(--fq-surface); }
[data-bs-theme=dark] .subt-list li.fail { background: rgba(255, 122, 114, .06); }
[data-bs-theme=dark] .sb.wait { background: #23262b; color: #9a9ea7; }
[data-bs-theme=dark] #dash-period .btn.active { background: #f3f3f4; color: #111; }
[data-bs-theme=dark] .badge-live { color: #ff7a72; }
[data-bs-theme=dark] .badge-live::before { background: #ff7a72; }
[data-bs-theme=dark] .row-note.off { background: rgba(255, 122, 114, .14); color: #ff9a93; }
[data-bs-theme=dark] tr.row-idle > td { background: rgba(242, 189, 92, .06) !important; }
[data-bs-theme=dark] tr.row-off > td { color: #8d9097; }
[data-bs-theme=dark] .tl-audio { background: #1d1f23; }
[data-bs-theme=dark] .tl-row { border-bottom-color: #23262b; }
[data-bs-theme=dark] .tl-row:hover { background: #1b1d21; }
[data-bs-theme=dark] .tl-track { background: linear-gradient(to right, transparent calc(25% - 1px), #26292e calc(25% - 1px), #26292e 25%, transparent 25%, transparent calc(50% - 1px), #26292e calc(50% - 1px), #26292e 50%, transparent 50%, transparent calc(75% - 1px), #26292e calc(75% - 1px), #26292e 75%, transparent 75%); }
[data-bs-theme=dark] .tl-tag.listen { background: rgba(143, 177, 255, .14); color: #a9c2ff; }
[data-bs-theme=dark] .tl-tag.sound { background: #23262b; color: #c9ccd2; }
[data-bs-theme=dark] .tl-tag.queue { background: rgba(185, 166, 255, .13); color: #c7b8ff; }
/* Fortu CRM */
[data-bs-theme=dark] .crm-chip.ok { background: rgba(90, 208, 138, .14); color: #6fd99a; }
[data-bs-theme=dark] .crm-chip.info { background: rgba(143, 177, 255, .14); color: #a9c2ff; }
[data-bs-theme=dark] .crm-chip.warn { background: rgba(242, 189, 92, .14); color: #f2c86a; }
[data-bs-theme=dark] .crm-chip.err { background: rgba(255, 122, 114, .14); color: #ff9a93; }
[data-bs-theme=dark] .crm-chip.muted { background: #23262b; color: #b5b9c0; }
[data-bs-theme=dark] .crm-count.zero .n { color: #5c6068; }
[data-bs-theme=dark] .crm-count.ok:not(.zero) { border-color: rgba(90, 208, 138, .4); }
[data-bs-theme=dark] .crm-count.warn:not(.zero) { border-color: rgba(242, 189, 92, .4); background: rgba(242, 189, 92, .06); }
[data-bs-theme=dark] .crm-count.err:not(.zero) { border-color: rgba(255, 122, 114, .4); background: rgba(255, 122, 114, .06); }
[data-bs-theme=dark] .crm-alert.warn { background: rgba(242, 189, 92, .08); border-color: rgba(242, 189, 92, .35); }
[data-bs-theme=dark] .crm-alert.info { background: rgba(143, 177, 255, .08); border-color: rgba(143, 177, 255, .35); }
[data-bs-theme=dark] .crm-alert.ok { background: rgba(90, 208, 138, .08); border-color: rgba(90, 208, 138, .35); }
[data-bs-theme=dark] .crm-alert.err { background: rgba(255, 122, 114, .08); border-color: rgba(255, 122, 114, .35); }
[data-bs-theme=dark] .crm-alert.err > i { color: #ff9a93; }
[data-bs-theme=dark] .crm-alert.warn > i { color: #f2c86a; }
[data-bs-theme=dark] .crm-alert.ok > i { color: #6fd99a; }
[data-bs-theme=dark] .crm-alert.info > i { color: #a9c2ff; }
[data-bs-theme=dark] .crm-tag { border-color: #4a4d54; color: #c9ccd2; background: #1d1f23; }
[data-bs-theme=dark] .crm-steps { background: #141518; }
[data-bs-theme=dark] .crm-steps-h { color: #b5b9c0; }
[data-bs-theme=dark] .crm-cmd { background: #050506; color: #f2f2f2; border: 1px solid #2a2d33; }
/* System Logs dan peringatan */
[data-bs-theme=dark] .log-table thead th { background: var(--fq-surface); }
[data-bs-theme=dark] .log-error td, [data-bs-theme=dark] .log-error { background: rgba(255, 122, 114, .07); }
[data-bs-theme=dark] .log-warn td, [data-bs-theme=dark] .log-warn { background: rgba(242, 189, 92, .07); }
[data-bs-theme=dark] .fq-alert.danger { background: rgba(255, 122, 114, .1); color: #ffb3ad; border-color: rgba(255, 122, 114, .35); }
[data-bs-theme=dark] .fq-alert.warn { background: rgba(242, 189, 92, .1); color: #f5d38a; border-color: rgba(242, 189, 92, .35); }
[data-bs-theme=dark] .fq-alert.info { background: rgba(143, 177, 255, .1); color: #c3d3ff; border-color: rgba(143, 177, 255, .35); }
[data-bs-theme=dark] .cap-chip { background: var(--fq-surface-2); }
[data-bs-theme=dark] .cap-chip.on { color: #6fd99a; background: rgba(90, 208, 138, .12); border-color: rgba(90, 208, 138, .3); }
[data-bs-theme=dark] .cap-chip.off { color: #9a9ea7; background: #1d1f23; }
[data-bs-theme=dark] .upload-bar > span { background: #f3f3f4; }

/* ---------------------------------------------------------------- v1.8.0 layar jarak jauh */
.cap-line { display: flex; align-items: flex-start; gap: 4px; font-size: .9rem; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--fq-line); background: var(--fq-hover); }
.cap-line.cap-on { color: var(--fq-pass); background: var(--fq-pass-bg); border-color: transparent; }
.cap-line.cap-off { color: var(--fq-error); background: var(--fq-error-bg); border-color: transparent; }
.cap-line.cap-unk { color: var(--fq-muted); }
.rs-now { margin-top: 10px; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.rs-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.rs-main { min-width: 0; }
.rs-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rs-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 420px; padding: 14px;
  background: #0b0c0e; border: 1px solid #1f2125; border-radius: 14px; outline: none; overflow: hidden; }
.rs-stage:focus-visible { box-shadow: 0 0 0 3px rgba(201, 203, 207, .45); }
.rs-canvas { display: block; max-width: 100%; max-height: calc(100vh - 260px); width: auto; height: auto; border-radius: 6px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, .55); cursor: crosshair; touch-action: none; user-select: none; image-rendering: auto; background: #000; }
.rs-canvas.rs-dim { opacity: .28; filter: grayscale(.6); }
.rs-stage:fullscreen { border-radius: 0; padding: 0; }
.rs-stage:fullscreen .rs-canvas { max-height: 100vh; max-width: 100vw; border-radius: 0; }
.rs-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; }
.rs-overlay.d-none { display: none !important; }
.rs-msg { pointer-events: auto; max-width: 460px; text-align: center; color: #e9eaec; background: rgba(23, 24, 27, .92);
  border: 1px solid #2a2d33; border-radius: 14px; padding: 22px 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.rs-msg > i { font-size: 2rem; display: block; margin-bottom: 6px; color: #c9cbcf; }
.rs-msg .spinner-border { width: 2rem; height: 2rem; color: #c9cbcf; margin-bottom: 8px; }
.rs-msg h5 { color: #fff; margin-bottom: 6px; }
.rs-msg p { margin-bottom: 10px; color: #c9cbcf; }
.rs-msg .text-secondary { color: #9a9ea7 !important; }
.rs-statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .8rem; color: var(--fq-muted); padding: 8px 4px 0; }
.rs-keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rs-keys .btn { display: flex; align-items: center; gap: 7px; justify-content: flex-start; font-size: .84rem; padding: 7px 9px; min-width: 0; }
.rs-keys .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-keys .btn i { flex: none; }
.rs-help { padding-left: 18px; }
.rs-ripple { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .18); pointer-events: none; animation: rs-ripple .6s ease-out forwards; }
.rs-ripple.long { border-color: #ffc53d; background: rgba(255, 197, 61, .2); }
@keyframes rs-ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
@media (max-width: 1199.98px) {
  .rs-wrap { grid-template-columns: minmax(0, 1fr); }
  .rs-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .rs-canvas { max-height: 70vh; }
}
@media (max-width: 575.98px) {
  .rs-stage { min-height: 260px; padding: 8px; }
  .rs-stage.rs-live { min-height: 0; }
  .rs-side { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- v1.8.1: tombol kendali nonaktif tampak nonaktif (juga tombol merah) ---------- */
.btn.btn-off, .btn.btn-off:disabled { color: var(--fq-muted, #6c757d); background: transparent; border-color: var(--fq-line, #dee2e6); opacity: .75; cursor: not-allowed; box-shadow: none; }
/* sebabnya (title) tetap terbaca saat kursor di atas tombol; tombol disabled tidak pernah menerima klik */
.btn.btn-off:disabled { pointer-events: auto; }
.btn.btn-off i { opacity: .8; }
[data-bs-theme=dark] .btn.btn-off, [data-bs-theme=dark] .btn.btn-off:disabled { color: #8d9097; border-color: #2c2f35; background: transparent; }
