/* Redesign halaman Editor Test Case (acuan: editor-test-case.html dan EDITOR-SPEC.md). Hanya tampilan; logika ada di js/tc-ui.js. */
:root{--tc-garis:#DCE7F7;--tc-biru:#0B63CE;--tc-teks:#0A1F44;--tc-redup:#4F5869;--tc-no-w:44px}

/* ---------- halaman ---------- */
main#halTestCase{max-width:1640px;margin:0 auto;box-sizing:border-box;padding:22px 24px 48px;display:flex;flex-direction:column;gap:20px}
#halTestCase .kartu{background:#fff;border:1px solid var(--tc-garis);border-radius:18px;box-shadow:0 12px 32px rgba(11,87,196,.08);padding:22px 24px}
#halTestCase #tcProj,#halTestCase #tcDaftar{display:flex;flex-direction:column;gap:18px}
#halTestCase #tcProj[hidden],#halTestCase #tcDaftar[hidden],#halTestCase #tcPilih[hidden]{display:none}
#halTestCase #tcProj{gap:16px}

/* kepala halaman */
.tc-hal-kepala{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.tc-kembali{height:40px;padding:0 14px;border-radius:10px;border:1px solid var(--tc-garis);background:#fff;color:var(--tc-biru);font:700 14px 'Plus Jakarta Sans',sans-serif;display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.tc-kembali:hover{background:#F3F8FF}
.tc-hal-teks{display:flex;flex-direction:column;gap:2px;flex:1;min-width:280px}
.tc-hal-teks h1{margin:0;font-size:22px;font-weight:800;letter-spacing:-.3px;color:var(--tc-teks)}
.tc-hal-sub{margin:0;font-size:13px;color:var(--tc-redup)}
.tc-badge-simpan{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:30px;background:#F1FBF4;border:1px solid #CFE3D6;color:#166534;font-size:12px;font-weight:700;white-space:nowrap}
.tc-badge-simpan[hidden]{display:none}

/* judul kartu */
#halTestCase .ut-kepala{display:flex;align-items:center;gap:10px;margin:0}
#halTestCase .ut-no{width:26px;height:26px;border-radius:13px;background:var(--tc-biru);color:#fff;font-size:12px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;flex:none}
#halTestCase .ut-kepala h2,.tc-kartu-kepala h2{margin:0;font-size:17px;font-weight:800;color:var(--tc-teks)}
.tc-kartu-kepala{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.tc-ruang{flex:1}

/* ---------- kartu 1: pilih project dan dashboard ---------- */
#halTestCase .tc-pilih{display:grid;grid-template-columns:repeat(auto-fit,minmax(480px,1fr));gap:20px;margin:0}
#halTestCase .tc-pilih-kol{display:flex;flex-direction:column;gap:8px;min-width:0}
#halTestCase .tc-pilih-kol > label{font-size:13px;font-weight:700;color:#3A4D6B}
#halTestCase .tc-pilih-kol .tc-baris{display:flex;gap:8px;flex-wrap:wrap}
.tc-sel-bungkus{position:relative;flex:1 1 260px;min-width:0}
.tc-sel-ikon{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--tc-biru);display:flex;pointer-events:none}
#halTestCase .tc-sel-bungkus select{width:100%;height:46px;padding:0 38px 0 42px;border:1px solid #C9D9EE;border-radius:10px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230B63CE' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;font:600 14px 'Plus Jakarta Sans',sans-serif;color:var(--tc-teks);appearance:none;-webkit-appearance:none;text-overflow:ellipsis}
#halTestCase .tc-sel-bungkus select:focus{outline:none;border-color:var(--tc-biru);box-shadow:0 0 0 3px rgba(30,144,255,.18)}
#halTestCase .tc-sel-bungkus select:disabled{background-color:#F5F8FC;color:#8A97AB}
.tc-btn-baru{height:46px;padding:0 12px;border-radius:10px;border:1px solid #9CC4F2;background:#fff;color:var(--tc-biru);font:700 13px 'Plus Jakarta Sans',sans-serif;display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.tc-btn-baru:hover{background:#F3F8FF}
.tc-btn-ikon{width:46px;height:46px;border-radius:10px;border:1px solid var(--tc-garis);background:#fff;color:#3A4D6B;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.tc-btn-ikon:hover{background:#F3F8FF}
.tc-btn-ikon.bahaya{border-color:#F3D2CF;background:#FFF6F5;color:#B42318}
.tc-btn-ikon.bahaya:hover{background:#FFEAE8}
.tc-btn-baru:disabled,.tc-btn-ikon:disabled{opacity:.45;cursor:not-allowed}
#halTestCase #tcStatusSimpan{margin:0;font-size:12px;color:#6B7C95}
#halTestCase #tcStatusSimpan:empty{display:none}

/* ---------- kartu 2: toolbar ---------- */
.tc-kartu-kepala .tc-bar{display:flex;gap:10px;flex-wrap:wrap;margin:0}
.tc-btn-garis{height:42px;padding:0 14px;border-radius:10px;border:1px solid #9CC4F2;background:#fff;color:var(--tc-biru);font:700 13px 'Plus Jakarta Sans',sans-serif;display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.tc-btn-garis:hover{background:#F3F8FF}
.tc-btn-garis:disabled{opacity:.45;cursor:not-allowed}
.tc-btn-utama{height:42px;padding:0 16px;border:none;border-radius:10px;background:linear-gradient(90deg,#0B57C4,#1679F0);color:#fff;font:700 13px 'Plus Jakarta Sans',sans-serif;display:inline-flex;align-items:center;gap:8px;box-shadow:0 8px 18px rgba(11,87,196,.28);cursor:pointer}
.tc-btn-utama:hover{filter:brightness(1.06)}
.tc-btn-utama:disabled{opacity:.5;cursor:not-allowed}

/* Google Drive */
#halTestCase .tc-drive{background:#F5F9FF;border:1px dashed #C9D9EE;border-radius:12px;padding:12px 14px;margin:0}
.tc-drive-judul{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:700;color:var(--tc-teks)}
.tc-lencana{padding:2px 8px;border-radius:20px;background:#E9ECF1;color:#3A4354;font-size:11px;font-weight:700}
.tc-lencana.hijau{background:#DDF3E6;color:#0B6B3A}
#halTestCase .tc-drive-teks{display:flex;flex-direction:column;gap:2px;font-size:13px;color:var(--tc-redup)}
#halTestCase .tc-drive-ikon{width:36px;height:36px;border-radius:10px;background:#fff;border:1px solid var(--tc-garis);display:flex;align-items:center;justify-content:center;color:var(--tc-biru)}
#halTestCase #tcDriveSimpan{height:38px;padding:0 14px;border-radius:10px;border:1px solid #9CC4F2;background:#fff;color:var(--tc-biru);font:700 13px 'Plus Jakarta Sans',sans-serif}
#halTestCase #tcDriveSimpan:disabled{border-color:#DCE4EF;background:#EEF2F7;color:#8A97AB;cursor:not-allowed}

/* tab dashboard + ringkasan */
.tc-tab-baris{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;border-bottom:1px solid #E6EEF9}
#halTestCase .tc-tab-bar{position:static;display:flex;align-items:flex-end;gap:4px;margin:0;padding:0;background:none;border:0;border-radius:0;overflow:visible;box-shadow:none}
#halTestCase .tc-tab-daftar{display:flex;gap:4px;align-items:flex-end;overflow-x:auto;overflow-y:hidden;max-width:calc(100vw - 160px);scrollbar-width:none}
#halTestCase .tc-tab-daftar::-webkit-scrollbar{display:none}
#halTestCase .tc-tab{height:42px;max-width:260px;padding:0 16px;border:none;border-bottom:3px solid transparent;border-radius:0;background:transparent;color:#3A4D6B;font:600 14px 'Plus Jakarta Sans',sans-serif;display:inline-flex;align-items:center;gap:8px;white-space:nowrap;cursor:pointer;box-shadow:none;margin-bottom:-1px}
#halTestCase .tc-tab:hover{background:#F3F8FF;color:var(--tc-biru)}
#halTestCase .tc-tab[aria-selected=true]{color:var(--tc-biru);font-weight:800;border-bottom-color:var(--tc-biru);background:transparent;box-shadow:none}
.tc-tab-n{padding:1px 8px;border-radius:20px;background:#E6F1FD;font-size:11px;font-weight:700}
#halTestCase .tc-tab-baru{width:36px;height:36px;margin:0 0 4px 4px;border-radius:9px;border:1px dashed #9CC4F2;background:#fff;color:var(--tc-biru);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-size:0;align-self:flex-end}
#halTestCase .tc-tab-baru:hover{background:#F3F8FF}
#halTestCase .tc-ringkas{display:flex;gap:8px;padding-bottom:8px;flex-wrap:wrap;margin:0}
.chip-r{padding:6px 12px;border-radius:20px;font-size:12px;font-weight:700;white-space:nowrap}
.chip-r b{font-size:14px}
.chip-r.netral{background:#F3F7FD;border:1px solid #E3EBF7;color:#24406B}.chip-r.netral b{color:var(--tc-biru)}
.chip-r.biru{background:#E6F1FD;color:var(--tc-biru)}
.chip-r.oranye{background:#FFF1E6;color:#C2410C}
.chip-r.hijau{background:#DDF3E6;color:#0B6B3A}
.chip-r.merah{background:#FBE3E1;color:#A1261B}

/* ---------- tabel ---------- */
#halTestCase .tc-sheet-bungkus{margin:0;border:1px solid var(--tc-garis);border-radius:14px;background:#fff;position:relative}
#halTestCase .tc-sheet{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:13px;line-height:1.5}
#halTestCase .tc-sheet thead th{background:#EAF2FD;color:#24406B;padding:12px;text-align:left;font-size:11px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;line-height:1.35;border:0;border-bottom:1px solid #C9D9EE;white-space:normal;overflow-wrap:anywhere}
#halTestCase .tc-sheet thead th.c-no{text-align:center;padding:12px 6px}
#halTestCase .tc-sheet thead th.c-aksi-kepala{text-align:center}
#halTestCase .tc-sheet thead th:first-child{border-top-left-radius:13px}
#halTestCase .tc-sheet thead th:last-child{border-top-right-radius:13px}
/* kolom beku saat tabel digulir ke samping */
#halTestCase .tc-sheet thead th.c-no,#halTestCase .tc-sheet tbody td.c-no{position:sticky;left:0;z-index:3}
#halTestCase .tc-sheet thead th:nth-child(2),#halTestCase .tc-sheet tbody td:nth-child(2){position:sticky;left:var(--tc-no-w);z-index:3;border-right:1px solid #C9D9EE}
#halTestCase .tc-sheet tbody td:nth-child(2){border-right:1px solid #E3EBF7;z-index:1}
#halTestCase .tc-sheet tbody td.c-no{z-index:1}

#halTestCase .tc-sheet tbody tr{--bg:#fff}
#halTestCase .tc-sheet tbody tr.tc-gagal{--bg:#FFF7F6}
#halTestCase .tc-sheet tbody tr.tc-lulus{--bg:#F4FBF7}
#halTestCase .tc-sheet tbody td{background:var(--bg);padding:0;border:0;border-bottom:1px solid #EEF3FA;vertical-align:top;color:var(--tc-teks)}
#halTestCase .tc-sheet tbody tr:nth-child(even) td{background:var(--bg)}
#halTestCase .tc-sheet tbody tr:hover td{background:color-mix(in srgb,var(--bg) 70%,#EAF2FD)}
#halTestCase .tc-sheet tbody tr:last-child td{border-bottom:0}
#halTestCase .tc-sheet tbody td.c-no{padding:12px 6px;text-align:center;font-weight:800;color:#6B7C95;font-size:13px}
#halTestCase .tc-sheet tbody tr.tc-gagal td.c-no{color:#A1261B}
#halTestCase .tc-sheet tbody tr.tc-lulus td.c-no{color:#0B6B3A}
#halTestCase .tc-sheet tbody tr.tc-gagal td,#halTestCase .tc-sheet tbody tr.tc-lulus td{color:var(--tc-teks)}
#halTestCase .tc-sheet tbody tr.tc-gagal td textarea,#halTestCase .tc-sheet tbody tr.tc-lulus td textarea,#halTestCase .tc-sheet tbody tr.tc-gagal td input[type=text],#halTestCase .tc-sheet tbody tr.tc-lulus td input[type=text]{color:var(--tc-teks)}

/* isi sel */
#halTestCase .tc-sheet td .tc-isi > textarea,#halTestCase .tc-sheet td .tc-isi > input[type=text]{padding:12px;font:400 13px/1.5 'Plus Jakarta Sans',sans-serif;color:var(--tc-teks);background:transparent;border:0;border-radius:0}
#halTestCase .tc-sheet td:nth-child(2) .tc-isi > input[type=text]{font-weight:700;white-space:nowrap}
#halTestCase .tc-sheet td:nth-child(4) .tc-isi > textarea{font-weight:600}
#halTestCase .tc-sheet td .tc-isi > textarea::placeholder,#halTestCase .tc-sheet td .tc-isi > input[type=text]::placeholder{color:#A3AEC0;opacity:1;font-weight:400}

/* dropdown berbentuk pill */
#halTestCase .tc-sheet td .tc-isi > select{appearance:none;-webkit-appearance:none;width:auto;max-width:none;height:auto;margin:10px;align-self:flex-start;border:1px solid transparent;border-radius:20px;background-color:transparent;font:700 12px/1.4 'Plus Jakarta Sans',sans-serif;cursor:pointer;color:#8A97AB;padding:4px 10px}
#halTestCase .tc-sheet td .tc-isi > select:focus{outline:none;box-shadow:0 0 0 2px rgba(30,144,255,.35)}
#halTestCase .tc-sheet td .tc-isi > select[data-k=tipe][data-v=Positive]{background:#E6F1FD;color:#0B63CE;padding:3px 10px}
#halTestCase .tc-sheet td .tc-isi > select[data-k=tipe][data-v=Negative]{background:#FFF1E6;color:#C2410C;padding:3px 10px}
#halTestCase .tc-sheet td .tc-isi > select[data-k=tipe][data-v=""]{color:#A3AEC0;font-weight:600}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status]{--dot:#C9D2DF;--chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A97AB' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");padding:4px 26px 4px 24px;background-color:#fff;border-color:#E3EBF7;background-image:radial-gradient(circle,var(--dot) 0 3.5px,transparent 4px),var(--chev);background-repeat:no-repeat,no-repeat;background-size:8px 8px,12px 12px;background-position:10px center,right 8px center}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status][data-v=Pass]{--dot:#16A34A;--chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230B6B3A' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-color:#DDF3E6;color:#0B6B3A;border-color:#B9E3C9}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status][data-v=Fail]{--dot:#D92D20;--chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A1261B' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-color:#FBE3E1;color:#A1261B;border-color:#F3C6C1}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status][data-v="Not Executed"]{--dot:#8A97AB;background-color:#EEF1F6;color:#3A4354;border-color:#DCE2EB}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status][data-v=Blocked]{--dot:#F59E0B;background-color:#FFF1E0;color:#B45309;border-color:#F5D6A8}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status][data-v=Skip]{--dot:#98A2B3;background-color:#EDEFF3;color:#4F5869;border-color:#DCE2EB}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status][data-v=Retest]{--dot:#1E90FF;background-color:#E6F1FD;color:#0B63CE;border-color:#BFD8F7}
#halTestCase .tc-sheet td .tc-isi > select option{font:600 13px 'Plus Jakarta Sans',sans-serif;color:#0A1F44;background:#fff}

/* Evidence: tautan menjadi tombol "Lihat evidence" */
#halTestCase .tc-sheet .tc-bukti{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:10px 12px}
#halTestCase .tc-sheet .tc-bukti:empty{display:none}
.tc-lihat{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:8px;background:#fff;border:1px solid #C9D9EE;color:var(--tc-biru);font-size:12px;font-weight:700;text-decoration:none;white-space:nowrap}
.tc-lihat:hover{background:#F3F8FF;color:#084C9E}
#halTestCase .tc-sheet .tc-isi.tc-ev-link:not(:focus-within) > textarea{position:absolute;width:1px;height:0 !important;min-height:0;padding:0;opacity:0;overflow:hidden;pointer-events:none}

/* tombol aksi baris */
#halTestCase .tc-sheet td.c-aksi{padding:8px;background:var(--bg)}
#halTestCase .tc-ikon-baris{display:flex;gap:6px;justify-content:center}
#halTestCase .tc-ikon{width:32px;height:32px;padding:0;border-radius:8px;border:1px solid #C9D9EE;background:#fff;color:var(--tc-biru);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-size:0}
#halTestCase .tc-ikon:hover{background:#F3F8FF}
#halTestCase .tc-ikon.hapus{border-color:#F3D2CF;background:#FFF6F5;color:#B42318}
#halTestCase .tc-ikon.hapus:hover{background:#FFEAE8}

/* ---------- bagian bawah ---------- */
#halTestCase .tc-baris-bawah{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0}
.tc-btn-putus{height:42px;padding:0 14px;border-radius:10px;border:1px dashed #9CC4F2;background:#F5F9FF;color:var(--tc-biru);font:700 13px 'Plus Jakarta Sans',sans-serif;display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.tc-btn-putus:hover{background:#EAF3FF}
#halTestCase .tc-baris-bawah .ket{font-size:13px;color:var(--tc-redup)}
#halTestCase .tc-kaki{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:16px;border-top:1px solid #E6EEF9;margin:0}
.tc-btn-bawah{height:40px;padding:0 14px;border-radius:10px;border:1px solid var(--tc-garis);background:#fff;color:#24406B;font:700 13px 'Plus Jakarta Sans',sans-serif;display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.tc-btn-bawah:hover{background:#F3F8FF}
.tc-btn-bawah.bahaya{border-color:#F3D2CF;background:#FFF6F5;color:#B42318}
.tc-btn-bawah.bahaya:hover{background:#FFEAE8}
.tc-btn-bawah:disabled{opacity:.45;cursor:not-allowed}

/* tampilan sempit */
@media(max-width:1500px){#halTestCase .tc-sheet{min-width:1400px}#halTestCase .tc-sheet-bungkus{overflow:auto;max-height:78vh}#halTestCase .tc-sheet thead th{top:0}}
@media(max-width:900px){main#halTestCase{padding:16px 14px 36px}#halTestCase .tc-pilih{grid-template-columns:1fr}#halTestCase .tc-kartu-kepala .tc-bar{width:100%}#halTestCase .tc-sheet{width:max-content;min-width:1500px}}

#halTestCase .tc-drive .galat:empty,#halTestCase .tc-drive .ket[hidden]{display:none}
#halTestCase .tc-sheet td .tc-isi > select{min-height:0 !important;box-sizing:border-box}

/* dropdown Status/Scenario kosong tidak ditampilkan sampai sel disorot atau diklik (baris dan kolom baru tampak bersih) */
#halTestCase .tc-sheet td .tc-isi > select[data-v=""]{background-color:transparent !important;background-image:none !important;border-color:transparent !important;color:transparent !important;box-shadow:none}
#halTestCase .tc-sheet td:hover .tc-isi > select[data-v=""],#halTestCase .tc-sheet td .tc-isi:focus-within > select[data-v=""]{background-color:#fff !important;border-color:#E3EBF7 !important;color:#8A97AB !important}
#halTestCase .tc-sheet td .tc-isi > select[data-k=tipe][data-v=""]:not(:hover):not(:focus){position:relative}

/* baris terpilih lewat kolom NO */
#halTestCase .tc-sheet tbody td.c-no{cursor:pointer;user-select:none}
#halTestCase .tc-sheet tbody td.c-no.tc-sel{background:#BFD8F7 !important;color:#0B63CE;outline:0}
.tc-menu-baris{min-width:210px}

/* cegah tumpang tindih: pill Status dan tombol Evidence tidak boleh melebihi kolomnya */
#halTestCase .tc-sheet td .tc-isi > select{max-width:calc(100% - 20px);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}
#halTestCase .tc-sheet td .tc-isi > select[data-k=status]{padding-right:24px}
.tc-lihat{max-width:100%;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}
#halTestCase .tc-sheet .tc-bukti{min-width:0}
#halTestCase .tc-sheet td{min-width:0;overflow:hidden}
#halTestCase .tc-sheet td.tc-meluas{overflow:visible}

/* garis pemisah antar kolom */
#halTestCase .tc-sheet tbody td{border-right:1px solid #E3EBF7}
#halTestCase .tc-sheet tbody td:last-child{border-right:0}
#halTestCase .tc-sheet thead th{border-right:1px solid #D3E1F4}
#halTestCase .tc-sheet thead th:last-child{border-right:0}
#halTestCase .tc-sheet thead th:nth-child(2),#halTestCase .tc-sheet tbody td:nth-child(2){border-right:1px solid #C9D9EE}
