/* =====================================================================
   SmartXP TL :: Tema Warna Global
   - Variabel warna per tema  : html[data-theme="..."]
   - Override skin DHTMLX dhx_skyblue (layout, accordion, tabbar,
     toolbar, tree, statusbar, windows)
   Pakai juga di halaman-halaman yang dibuka di dalam tab (iframe)
   supaya warnanya ikut tema yang dipilih.
   ===================================================================== */

/* ---------------- 1. PALET TEMA ---------------- */
:root,
html[data-theme="navy"]{               /* Biru Dongker (default) */
    --tl-g1:#0a1230; --tl-g2:#13245c; --tl-g3:#1e40af;
    --tl-primary:#1e3a8a; --tl-primary-dark:#0f1f4d; --tl-primary-light:#3b82f6;
    --tl-accent:#7dd3fc; --tl-soft:#e8efff; --tl-bg:#eef2fb;
    --tl-border:#d6e0f5; --tl-text:#0f1f4d; --tl-muted:#5b6b8c;
}
html[data-theme="royal"]{              /* Biru Royal */
    --tl-g1:#0c1a4a; --tl-g2:#1d3fa8; --tl-g3:#2563eb;
    --tl-primary:#2563eb; --tl-primary-dark:#1e40af; --tl-primary-light:#60a5fa;
    --tl-accent:#a5f3fc; --tl-soft:#e6efff; --tl-bg:#f0f5ff;
    --tl-border:#d3e1fb; --tl-text:#172554; --tl-muted:#55678f;
}
html[data-theme="tosca"]{              /* Biru Tosca */
    --tl-g1:#053b38; --tl-g2:#0f766e; --tl-g3:#14b8a6;
    --tl-primary:#0d9488; --tl-primary-dark:#0f766e; --tl-primary-light:#14b8a6;
    --tl-accent:#5eead4; --tl-soft:#e2f8f4; --tl-bg:#effbf8;
    --tl-border:#c7efe7; --tl-text:#134e4a; --tl-muted:#5b7b78;
}
html[data-theme="ocean"]{              /* Ocean / Biru Laut */
    --tl-g1:#062a45; --tl-g2:#0c4a6e; --tl-g3:#0284c7;
    --tl-primary:#0369a1; --tl-primary-dark:#0c4a6e; --tl-primary-light:#0ea5e9;
    --tl-accent:#7dd3fc; --tl-soft:#e3f3fc; --tl-bg:#eff8fd;
    --tl-border:#cbe6f6; --tl-text:#0c3550; --tl-muted:#557189;
}
html[data-theme="violet"]{             /* Ungu */
    --tl-g1:#1e0b45; --tl-g2:#4c1d95; --tl-g3:#7c3aed;
    --tl-primary:#6d28d9; --tl-primary-dark:#4c1d95; --tl-primary-light:#8b5cf6;
    --tl-accent:#c4b5fd; --tl-soft:#f0eaff; --tl-bg:#f6f3ff;
    --tl-border:#e0d6fb; --tl-text:#2e1065; --tl-muted:#6b5b8c;
}
html[data-theme="emerald"]{            /* Hijau Emerald */
    --tl-g1:#022c22; --tl-g2:#065f46; --tl-g3:#059669;
    --tl-primary:#047857; --tl-primary-dark:#065f46; --tl-primary-light:#10b981;
    --tl-accent:#6ee7b7; --tl-soft:#e3f7ef; --tl-bg:#effaf5;
    --tl-border:#c9eedd; --tl-text:#064e3b; --tl-muted:#587a6c;
}
html[data-theme="maroon"]{             /* Merah Marun */
    --tl-g1:#2a0410; --tl-g2:#7f1d1d; --tl-g3:#be123c;
    --tl-primary:#9f1239; --tl-primary-dark:#7f1d1d; --tl-primary-light:#e11d48;
    --tl-accent:#fda4af; --tl-soft:#fdecef; --tl-bg:#fdf4f5;
    --tl-border:#f6d3d9; --tl-text:#4c0519; --tl-muted:#8a5a64;
}
html[data-theme="sunset"]{             /* Oranye Sunset */
    --tl-g1:#3b0d0c; --tl-g2:#9a3412; --tl-g3:#ea580c;
    --tl-primary:#c2410c; --tl-primary-dark:#9a3412; --tl-primary-light:#f97316;
    --tl-accent:#fed7aa; --tl-soft:#fff0e5; --tl-bg:#fff7f1;
    --tl-border:#fbdcc6; --tl-text:#431407; --tl-muted:#8a6553;
}
html[data-theme="slate"]{              /* Grafit / Abu Gelap */
    --tl-g1:#020617; --tl-g2:#0f172a; --tl-g3:#334155;
    --tl-primary:#334155; --tl-primary-dark:#1e293b; --tl-primary-light:#64748b;
    --tl-accent:#93c5fd; --tl-soft:#eaeef4; --tl-bg:#f1f4f8;
    --tl-border:#d8dee8; --tl-text:#0f172a; --tl-muted:#64748b;
}

:root{
    --tl-gradient: linear-gradient(125deg, var(--tl-g1) 0%, var(--tl-g2) 55%, var(--tl-g3) 100%);
    --tl-gradient-soft: linear-gradient(180deg, #ffffff 0%, var(--tl-soft) 100%);
    --tl-radius: 12px;
    --tl-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Gradient cerah untuk banner judul & tab aktif (gaya "eye catching") */
:root{
    --tl-gradient-bright: linear-gradient(110deg, var(--tl-g2) 0%, var(--tl-primary) 45%, var(--tl-primary-light) 100%);
    --tl-shadow-card: 0 2px 10px rgba(15,35,80,.06), 0 1px 2px rgba(15,35,80,.05);
}

/* ---------------- 2. LAYOUT ---------------- */
[class*="dhxlayout_base_"]{ background:var(--tl-bg) !important; }
div.dhxcont_global_content_area{ background:var(--tl-bg) !important; }

/* Header panel (mis. "::: PT. Pelayaran Tonasa Lines :::") */
div.dhtmlxPolyInfoBar,
[class*="dhtmlxPolyInfoBar"]{
    background:var(--tl-gradient-bright) !important;
    background-image:var(--tl-gradient-bright) !important;
    border:none !important;
    border-radius:10px 10px 0 0;
}
div.dhtmlxInfoBarLabel,
[class*="dhtmlxInfoBarLabel"]{
    color:#fff !important; font-family:var(--tl-font) !important;
    font-weight:700 !important; letter-spacing:.3px;
}

[class*="dhtmlxLayoutSinglePoly"],
div.dhxcont_global_layout_area{ border-color:var(--tl-border) !important; }

/* Splitter */
[class*="dhxlayout_sep"],
div.dhtmlxLayoutPolySplitterHor,
div.dhtmlxLayoutPolySplitterVer{
    background:var(--tl-bg) !important; background-image:none !important;
}
[class*="dhxlayout_sep"]:hover,
div.dhtmlxLayoutPolySplitterHor:hover,
div.dhtmlxLayoutPolySplitterVer:hover{ background:var(--tl-accent) !important; }

div.dhtmlxPolyInfoBarCollapsedHor,
div.dhtmlxPolyInfoBarCollapsedVer{ background:var(--tl-gradient-bright) !important; }

/* ---------------- 3. ACCORDION (kartu putih, teks tebal) ---------------- */
[class*="dhx_acc_base"]{ background:#fff !important; }
div.dhx_acc_item, [class*="dhx_acc_item_dhx"]{ border-color:transparent !important; }
div.dhx_acc_item_label,
[class*="dhx_acc_item_label"]{
    background:#fff !important; background-image:none !important;
    color:var(--tl-primary-dark) !important;
    font-family:var(--tl-font) !important; font-weight:700 !important; font-size:12.5px !important;
    border:none !important; border-bottom:1px solid var(--tl-border) !important;
    border-left:3px solid transparent !important;
    transition:background .2s, color .2s, border-color .2s;
}
div.dhx_acc_item_label:hover,
[class*="dhx_acc_item_label"]:hover{
    background:var(--tl-soft) !important; color:var(--tl-primary) !important;
}
[class*="opened"] > div.dhx_acc_item_label,
[class*="opened"] > [class*="dhx_acc_item_label"],
div.dhx_acc_item_label.dhx_acc_item_label_opened{
    background:linear-gradient(90deg, var(--tl-soft) 0%, #fff 100%) !important;
    color:var(--tl-primary) !important;
    border-left-color:var(--tl-primary-light) !important;
}

/* ---------------- 4. TABBAR (tab aktif = pil gradient) ---------------- */
div.dhx_tablist_zone,
div.dhx_tabbar_row,
[class*="dhx_tabbar_zone"] div.dhx_tablist_zone{
    background:#fff !important; background-image:none !important;
    border:none !important;
}
div.dhx_tab_element,
[class*="dhx_tab_element"]{
    background:transparent !important; background-image:none !important;
    color:var(--tl-muted) !important;
    border:none !important;
    border-radius:999px !important;
    font-family:var(--tl-font) !important; font-size:12.5px !important; font-weight:600 !important;
    transition:background .2s, color .2s;
}
[class*="dhx_tab_element"] div,
[class*="dhx_tab_element"] img[src*="tab"]{ background-image:none !important; background-color:transparent !important; }
.dhx_tabbar_row .dhx_tab_element div:not([class*="close"]),
.dhx_tablist_zone .dhx_tab_element div:not([class*="close"]){
    background-image:none !important; border:none !important;
}
.dhx_tabbar_row, .dhx_tablist_zone{ border-bottom:none !important; }
[class*="dhx_tab_element_inactive"]:hover{
    background:var(--tl-soft) !important; color:var(--tl-primary) !important;
}
div.dhx_tab_element_active,
[class*="dhx_tab_element_active"]{
    background:var(--tl-gradient-bright) !important;
    color:#fff !important; font-weight:700 !important;
    box-shadow:0 4px 12px rgba(15,35,80,.18) !important;
}
[class*="dhx_tab_element_active"] span,
[class*="dhx_tab_element_active"] div{ color:#fff !important; }
div.dhx_tabcontent_zone,
[class*="dhx_tabcontent_zone"]{
    border:none !important;
    border-top:1px solid var(--tl-border) !important;
    background:var(--tl-bg) !important;
}

/* ---------------- 5. TOOLBAR (kartu putih) ---------------- */
div.dhx_toolbar_dhx_skyblue,
[class*="dhx_toolbar_dhx"],
[class*="dhx_toolbar_base"],
div.dhxcont_toolbar_dhx_skyblue{
    background:#fff !important; background-image:none !important;
    border:1px solid var(--tl-border) !important;
    border-radius:10px;
    box-shadow:var(--tl-shadow-card);
}
[class*="dhx_toolbar"] div.dhx_toolbar_btn,
[class*="dhx_toolbar"] div.dhx_toolbar_btn div.dhxtoolbar_text{
    color:var(--tl-text) !important; font-family:var(--tl-font) !important; font-weight:500;
}
[class*="dhx_toolbar"] div.dhx_toolbar_btn{
    border-radius:8px !important; border:1px solid transparent !important;
    transition:background .15s, border-color .15s;
}
[class*="dhx_toolbar"] div.dhx_toolbar_btn.over,
[class*="dhx_toolbar"] div.dhx_toolbar_btn:hover{
    background:var(--tl-soft) !important; background-image:none !important;
    border-color:var(--tl-border) !important;
}
[class*="dhx_toolbar"] div.dhx_toolbar_btn.over div.dhxtoolbar_text{ color:var(--tl-primary) !important; }
[class*="dhx_toolbar"] div.dhx_toolbar_btn.pres,
[class*="dhx_toolbar"] div.dhx_toolbar_btn:active{
    background:var(--tl-primary) !important; border-color:var(--tl-primary) !important;
}
[class*="dhx_toolbar"] div.dhx_toolbar_btn.pres div.dhxtoolbar_text{ color:#fff !important; }
[class*="dhx_toolbar"] div.dhx_toolbar_sep{
    background:var(--tl-border) !important; background-image:none !important; width:1px !important;
}

/* Semua wadah toolbar DHTMLX (termasuk bar "Tabs : n | CloseAll"):
   buang gambar latar skin skyblue, ganti putih + warna tema */
[class*="dhx_toolbar"]:not([class*="btn"]):not([class*="sep"]):not([class*="arw"]):not([class*="text"]),
[class*="dhxtoolbar"]:not([class*="btn"]):not([class*="sep"]):not([class*="arw"]):not([class*="text"]):not(img),
[class*="dhxcont_toolbar"],
[class*="dhx_cell_toolbar"]{
    background-color:#fff !important; background-image:none !important;
    border-color:var(--tl-border) !important;
}
[class*="dhx_toolbar"] div.dhx_toolbar_text,
[class*="dhx_toolbar"] div.dhxtoolbar_text{ color:var(--tl-text) !important; font-family:var(--tl-font) !important; }
/* garis bawah deretan tab bawaan skin */
[class*="dhx_tablist_line"]{
    background:var(--tl-border) !important; background-image:none !important; border:none !important;
}

/* ---------------- 6. TREE (item terpilih = pil) ---------------- */
.containerTableStyle{ background:#fff; }
.standartTreeRow, .standartTreeRow_lor{
    font-family:var(--tl-font) !important; font-size:12px !important;
    color:var(--tl-text) !important; padding:1px 6px; border-radius:6px;
}
.standartTreeRow_lor, .standartTreeRow:hover{
    background:var(--tl-soft) !important; color:var(--tl-primary) !important;
    text-decoration:none !important;
}
.selectedTreeRow, .selectedTreeRow_lor{
    background:var(--tl-primary-light) !important; background-image:none !important;
    color:#fff !important; font-weight:700 !important;
    border:none !important; border-radius:5px; padding:1px 6px;
    font-family:var(--tl-font) !important; font-size:12px !important;
    box-shadow:0 2px 6px rgba(15,35,80,.18);
}

/* ---------------- 7. STATUSBAR ---------------- */
div.dhxcont_sb_container,
[class*="dhxcont_statusbar"],
[class*="dhx_cell_statusbar"]{
    background:#fff !important; background-image:none !important;
    color:var(--tl-muted) !important; border-color:var(--tl-border) !important;
    font-family:var(--tl-font) !important; font-size:11.5px !important;
}
div.dhxcont_sb_container div, div.dhxcont_sb_container span{ color:var(--tl-muted) !important; }

/* ---------------- 8. WINDOWS (popup) ---------------- */
div.dhtmlx_window_active, div.dhtmlx_window_inactive{
    border-radius:var(--tl-radius) !important; overflow:hidden;
    box-shadow:0 20px 50px rgba(5,15,40,.35) !important;
}
div.dhtmlx_window_active div.dhtmlx_wins_title,
div.dhtmlx_window_inactive div.dhtmlx_wins_title{
    color:#fff !important; font-family:var(--tl-font) !important; font-weight:700 !important;
}
div.dhtmlx_window_active table.dhtmlxWindowMainContent > tbody > tr:first-child td,
div.dhtmlx_window_inactive table.dhtmlxWindowMainContent > tbody > tr:first-child td,
[class*="dhtmlx_wins_ha"]{
    background:var(--tl-gradient-bright) !important; background-image:var(--tl-gradient-bright) !important;
}
div.dhtmlx_window_inactive table.dhtmlxWindowMainContent > tbody > tr:first-child td{ filter:saturate(.6); }

/* ---------------- 9. GRID (dhtmlxGrid) ---------------- */
div.gridbox, [class*="gridbox_"]{
    background:#fff !important; border:1px solid var(--tl-border) !important;
    border-radius:12px; overflow:hidden; box-shadow:var(--tl-shadow-card);
}
div.gridbox table.hdr td, [class*="gridbox_"] table.hdr td{
    background:var(--tl-soft) !important; background-image:none !important;
    color:var(--tl-primary-dark) !important; font-weight:700 !important;
    font-family:var(--tl-font) !important; font-size:12.5px !important;
    border-color:var(--tl-border) !important; padding-top:6px; padding-bottom:6px;
}
/* Area header grid di luar kolom (kanan) + pojok scrollbar */
div.gridbox div.xhdr, [class*="gridbox_"] div.xhdr,
div.gridbox div.xhdr table, [class*="gridbox_"] div.xhdr table,
div.gridbox div.ftr, [class*="gridbox_"] div.ftr{
    background:var(--tl-soft) !important; background-image:none !important;
    border-color:var(--tl-border) !important;
}
div.gridbox table.hdr td div.hdrcell, [class*="gridbox_"] table.hdr td div.hdrcell{ color:var(--tl-primary-dark) !important; }
div.gridbox div.objbox, [class*="gridbox_"] div.objbox{ background:#fff !important; }
div.gridbox table.obj td, [class*="gridbox_"] table.obj td{
    font-family:var(--tl-font) !important; font-size:12.5px !important;
    color:var(--tl-text); border-color:#eef1f6 !important;
}
div.gridbox table.obj tr.ev_dhx_skyblue td, [class*="gridbox_"] table.obj tr[class*="ev_"] td{ background:#fafbfe; }
div.gridbox table.obj tr:hover td{ background:var(--tl-soft) !important; }
div.gridbox table.obj tr.rowselected td,
div.gridbox table.obj tr.rowselected td.cellselected{
    background:var(--tl-primary-light) !important; color:#fff !important;
}

/* ---------------- 10. KOMPONEN HALAMAN (dipakai di form / isi tab) ----------------
   Contoh:
   <div class="tl-page-head"><i class="fa fa-truck"></i> Master Supplier <span class="tl-badge">0 data</span></div>
   <div class="tl-card"> ...form pencarian... </div>
   ----------------------------------------------------------------------------------- */
.tl-page{ padding:10px 12px; background:var(--tl-bg); font-family:var(--tl-font); color:var(--tl-text); }
.tl-page-head{
    display:flex; align-items:center; gap:10px;
    padding:12px 18px; margin-bottom:10px;
    border-radius:14px;
    background:var(--tl-gradient-bright);
    color:#fff; font-size:15px; font-weight:700;
    box-shadow:0 8px 20px rgba(15,35,80,.18);
}
.tl-page-head .fa{ opacity:.9; }
.tl-badge{
    display:inline-flex; align-items:center; padding:2px 11px;
    border-radius:999px; font-size:12px; font-weight:600;
    background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.35); color:#fff;
}
.tl-card{
    background:#fff; border:1px solid var(--tl-border);
    border-radius:14px; padding:14px; margin-bottom:10px;
    box-shadow:var(--tl-shadow-card);
}
.tl-label{
    display:block; margin-bottom:6px;
    font-size:11px; font-weight:700; letter-spacing:.6px; text-transform:uppercase;
    color:var(--tl-muted);
}
.tl-divider{ border:0; border-top:1px dashed var(--tl-border); margin:12px 0; }
.tl-page input[type=text], .tl-page input[type=search], .tl-page input[type=number],
.tl-page input[type=date], .tl-page select, .tl-page textarea,
.tl-card input[type=text], .tl-card select, .tl-card textarea,
.tl-input{
    height:38px; padding:6px 12px;
    border:1px solid var(--tl-border); border-radius:10px;
    background:#fff; color:var(--tl-text);
    font-family:var(--tl-font); font-size:13px;
    transition:border-color .15s, box-shadow .15s; outline:none;
}
.tl-page textarea, .tl-card textarea{ height:auto; }
.tl-page input:focus, .tl-page select:focus, .tl-page textarea:focus,
.tl-card input:focus, .tl-card select:focus, .tl-card textarea:focus,
.tl-input:focus{
    border-color:var(--tl-primary-light);
    box-shadow:0 0 0 3px color-mix(in srgb, var(--tl-primary-light) 22%, transparent);
}
.tl-btn-theme{
    display:inline-flex; align-items:center; gap:6px;
    height:36px; padding:0 16px; border:none; border-radius:10px; cursor:pointer;
    background:var(--tl-gradient-bright); color:#fff; font-weight:600; font-size:13px;
    box-shadow:0 4px 12px rgba(15,35,80,.18); transition:filter .15s, transform .15s;
}
.tl-btn-theme:hover{ filter:brightness(1.1); transform:translateY(-1px); }

/* ---------------- 10b. HALAMAN FORM (body.tl-form) ----------------
   Semua halaman form memakai tata letak ALIR (bukan posisi absolut),
   sehingga tiap bagian otomatis memberi tempat untuk bagian berikutnya
   dan rapi di desktop maupun HP.
   - Halaman GRID   : punya #toolbarGrdObj  (daftar data + pencarian)
   - Halaman POPUP  : punya #divheader      (list pilih data di window)
   - Halaman INPUT  : punya #toolbarIudObj  (header, detail, tab, grid detail)
   ------------------------------------------------------------------ */
body.tl-form{
    margin:0; background:var(--tl-bg) !important;
    font-family:var(--tl-font); font-size:12.5px; color:var(--tl-text);
}
body.tl-form .tl-page-head{ margin:0; padding:0 18px; min-height:46px; box-sizing:border-box; }

/* ===== Komponen kartu bersama ===== */
body.tl-form #query[style*="absolute"],
body.tl-form #divheader,
body.tl-form #entryheader,
body.tl-form #detail,
body.tl-form #footer{
    background:#fff !important; border:1px solid var(--tl-border);
    border-radius:12px; box-shadow:var(--tl-shadow-card);
    padding:10px 14px !important; box-sizing:border-box;
}
body.tl-form #toolbarGrdObj, body.tl-form #toolbarRecObj, body.tl-form #toolbarIudObj{
    background:transparent !important; min-height:36px;
}

/* ===== 1) HALAMAN GRID ===== */
body.tl-form:has(> #toolbarGrdObj){
    display:flex !important; flex-direction:column; gap:8px;
    height:100vh; box-sizing:border-box; padding:8px !important;
    overflow:hidden !important;
}
body.tl-form:has(> #toolbarGrdObj) > *{
    position:relative !important; top:auto !important; left:auto !important;
    right:auto !important; bottom:auto !important;
    width:auto !important; flex:0 0 auto;
}
body.tl-form:has(> #toolbarGrdObj) > .tl-page-head{ order:0; }
body.tl-form:has(> #toolbarGrdObj) > #toolbarGrdObj{ order:1; height:36px !important; }
body.tl-form:has(> #toolbarGrdObj) > #query{ order:2; height:auto !important; }
body.tl-form:has(> #toolbarGrdObj) > #gridbox{ order:3; flex:1 1 auto; min-height:220px; height:auto !important; }
body.tl-form:has(> #toolbarGrdObj) > #toolbarRecObj{ order:4; height:36px !important; }
/* tombol Import (#upload) melayang di kanan toolbar */
body.tl-form:has(> #toolbarGrdObj) > #upload{
    position:absolute !important; top:14px !important; right:18px !important; left:auto !important;
    width:auto !important; height:auto !important; z-index:5;
    display:flex; align-items:center; gap:5px;
    padding:4px 12px; border-radius:999px; background:var(--tl-soft);
    border:1px solid var(--tl-border); font-weight:600;
}
body.tl-form:has(> .tl-page-head):has(> #toolbarGrdObj) > #upload{ top:68px !important; }
body.tl-form:has(> #toolbarGrdObj) > #upload a{ color:var(--tl-primary) !important; text-decoration:none; }

/* kotak pencarian */
body.tl-form #query[style*="absolute"] form{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin:0; color:var(--tl-muted); font-weight:600; }
body.tl-form #query[style*="absolute"] table{ border-collapse:collapse; }
body.tl-form #query label[for="findlabel"]{ font-weight:700; color:var(--tl-primary-dark); margin-right:2px; }
body.tl-form #query label[for="findlabel"]:before{ content:"\1F50D"; font-size:12px; margin-right:6px; filter:grayscale(1) opacity(.6); }
body.tl-form #query label[for="sep01"]{ display:none; }

/* ===== 2) HALAMAN POPUP (list pilih data) ===== */
body.tl-form:has(> #divheader){
    display:flex !important; flex-direction:column; gap:8px;
    height:100vh; box-sizing:border-box; padding:8px !important; overflow:hidden !important;
}
body.tl-form:has(> #divheader) > *{
    position:relative !important; top:auto !important; left:auto !important; width:auto !important; flex:0 0 auto;
}
body.tl-form:has(> #divheader) > #divheader{ order:1; }
body.tl-form:has(> #divheader) > #gridbox{ order:2; flex:1 1 auto; min-height:200px; height:auto !important; }
body.tl-form #divheader table, body.tl-form #divheader tbody, body.tl-form #divheader tr{ display:contents; }
body.tl-form #divheader{ display:flex !important; flex-wrap:wrap; align-items:center; gap:8px; color:var(--tl-muted); font-weight:600; }

/* popup form kecil (mis. Create PO: #endtry) */
body.tl-form:has(> #endtry){ padding:10px !important; overflow-y:auto !important; height:auto !important; }
body.tl-form #endtry{
    position:static !important; width:auto !important; height:auto !important;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px;
    box-shadow:var(--tl-shadow-card); padding:12px 14px; box-sizing:border-box;
}
body.tl-form #endtry table + table td{ padding-top:8px; }
body.tl-form #endtry table:first-child{ width:100%; }
body.tl-form #endtry table:first-child td:first-child{ width:120px; white-space:nowrap; }
body.tl-form #endtry input[type=text], body.tl-form #endtry select{ width:100% !important; max-width:100%; }
body.tl-form #endtry #currency_code{ width:auto !important; }
body.tl-form #endtry #currency_rate{ width:90px !important; }
/* catatan peringatan di popup list (mis. "PENTING: ...") */
body.tl-form #divheader font{ flex-basis:100%; color:#b45309 !important; font-family:var(--tl-font) !important; font-size:12px !important; }
body.tl-form #divheader font br{ display:none; }
/* fieldset (mis. Pabean) */
body.tl-form fieldset{ border:1px solid var(--tl-border); border-radius:10px; padding:6px 12px 10px; }
body.tl-form legend{ padding:0 6px; color:var(--tl-primary); font-weight:700; font-size:12px; }

/* tombol biasa (Save >>, Select All, dll.) */
body.tl-form input[type=button], body.tl-form input[type=submit], body.tl-form button:not(.tl-swatch){
    min-height:32px; padding:0 16px; border:none; border-radius:9px; cursor:pointer;
    font-family:var(--tl-font); font-size:12.5px; font-weight:700; color:#fff;
    background:var(--tl-gradient-bright); box-shadow:0 3px 10px rgba(15,35,80,.16);
    transition:filter .15s, transform .15s;
}
body.tl-form input[type=button]:hover, body.tl-form input[type=submit]:hover{ filter:brightness(1.1); transform:translateY(-1px); }

/* ===== 3) HALAMAN INPUT / EDIT (master & transaksi) ===== */
html:has(body.tl-form > #toolbarIudObj){ height:auto; }
body.tl-form:has(> #toolbarIudObj){
    height:auto !important; min-height:100vh; box-sizing:border-box;
    padding:8px 8px 24px !important;
    overflow-x:hidden !important; overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
}
/* semua blok utama mengalir berurutan */
body.tl-form #toolbarIudObj,
body.tl-form #title,
body.tl-form #entryheader,
body.tl-form #toold,
body.tl-form #toolx,
body.tl-form #detail,
body.tl-form #footer,
body.tl-form #a_tabbar,
body.tl-form #tooldp,
body.tl-form:has(> #toolbarIudObj) #gridbox,
body.tl-form:has(> #toolbarIudObj) #gridbox1,
body.tl-form:has(> #toolbarIudObj) #gridbox2{
    position:relative !important;
    top:auto !important; left:auto !important; right:auto !important; bottom:auto !important;
    width:auto !important; height:auto !important;
    margin:0 0 8px 0 !important;
}
body.tl-form #toolbarIudObj{ min-height:36px; }
body.tl-form #title{
    display:flex; align-items:center; min-height:46px; padding:0 18px; box-sizing:border-box;
    border-radius:14px; background:var(--tl-gradient-bright);
    box-shadow:0 8px 20px rgba(15,35,80,.18);
}
body.tl-form #title h3{ margin:0; color:#fff; font-size:15px; font-weight:700; font-family:var(--tl-font); }
body.tl-form:has(> #toolbarIudObj) #upload{
    position:absolute !important; top:auto !important; left:auto !important; right:22px !important;
    margin-top:-46px; height:30px !important; width:auto !important;
    display:flex; align-items:center; gap:4px; color:#fff; z-index:2;
    padding:0 12px; border-radius:999px;
    background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.35); cursor:pointer;
}
body.tl-form:has(> #toolbarIudObj) #upload img{ cursor:pointer; filter:brightness(0) invert(1); }

/* kartu header bisa digeser ke samping bila tabelnya lebar (desktop) */
body.tl-form #entryheader, body.tl-form #detail, body.tl-form #footer{ overflow-x:auto; }
body.tl-form #entryheader table, body.tl-form #detail table, body.tl-form #footer table{ width:auto !important; }

/* grid detail transaksi: tinggi tetap supaya DHTMLX bisa menggambar */
body.tl-form:has(> #toolbarIudObj) #gridbox,
body.tl-form:has(> #toolbarIudObj) #gridbox1,
body.tl-form:has(> #toolbarIudObj) #gridbox2{
    height:max(260px, 48vh) !important;
    background:#fff !important; border-radius:12px;
}

/* tautan "Entry Detail" / "View Grid" sebagai tombol pil */
body.tl-form #toold, body.tl-form #toolx{ background:transparent !important; }
body.tl-form #toold a, body.tl-form #toolx a{
    display:inline-flex; align-items:center; gap:6px; margin-left:4px;
    padding:6px 14px; border-radius:999px; text-decoration:none !important;
    background:var(--tl-soft); border:1px solid var(--tl-border);
    color:var(--tl-primary) !important; font-weight:700;
}
body.tl-form #toold a:hover, body.tl-form #toolx a:hover{ background:var(--tl-primary); color:#fff !important; }
body.tl-form #detail a{ color:var(--tl-primary) !important; font-weight:700; text-decoration:none; margin-right:10px; }
body.tl-form #detail tr[bgcolor]{ display:none; }   /* garis abu-abu "?>" lama */

/* --- Tabbar di halaman input: ikut mengalir --- */
body.tl-form #a_tabbar{ overflow:visible !important; }
body.tl-form #a_tabbar [class*="dhx_tabbar_zone"],
body.tl-form #a_tabbar [class*="dhx_tablist_zone"],
body.tl-form #a_tabbar [class*="dhx_tabcontent_zone"]{
    position:relative !important; top:auto !important; left:auto !important;
    width:auto !important; height:auto !important; overflow:visible !important;
}
body.tl-form #a_tabbar [class*="dhx_tablist_zone"]{ min-height:38px; overflow-x:auto !important; overflow-y:hidden !important; }
body.tl-form #a_tabbar [class*="dhx_tabcontent_zone"]{
    background:#fff !important; border:1px solid var(--tl-border) !important;
    border-radius:0 0 12px 12px; padding:6px 0 10px;
}
body.tl-form #a_tabbar [class*="dhx_tabcontent_zone"] div:not([id^="gridbox"]):not([id^="gridbox"] *):not(.shiny_box):not(.shiny_box *){
    position:static !important; width:auto !important; height:auto !important; overflow:visible !important;
}
body.tl-form #a_tabbar [class*="dhx_tabcontent_zone"] div[style*="visibility: hidden"],
body.tl-form #a_tabbar [class*="dhx_tabcontent_zone"] div[style*="visibility:hidden"],
body.tl-form #a_tabbar [class*="dhx_tabcontent_zone"] div[style*="display: none"],
body.tl-form #a_tabbar [class*="dhx_tabcontent_zone"] div[style*="display:none"]{ display:none !important; }

/* kolom-kolom di dalam tab (frm1/frm2, div1/div2) berdampingan, turun ke bawah bila sempit */
body.tl-form #a_tabbar div:has(> [id^="frm"]),
body.tl-form #a_tabbar div:has(> #div1 + #div2),
body.tl-form #a_tabbar div:has(> #div2 + #div3){
    display:flex !important; flex-wrap:wrap; gap:0 24px; align-items:flex-start;
}
body.tl-form #a_tabbar [id^="frm"],
body.tl-form #a_tabbar #div1, body.tl-form #a_tabbar #div2, body.tl-form #a_tabbar #div3{
    flex:1 1 360px; min-width:0; overflow-x:auto;
    margin:0 !important; padding:12px 14px 4px !important;
}

/* Tabel label + input */
body.tl-form table td{
    padding:3px 8px 3px 0; vertical-align:middle;
    color:var(--tl-muted) !important; font-family:var(--tl-font) !important;
    font-weight:600; font-size:12px !important;
}

/* --- Field input (semua form) --- */
body.tl-form input[type=text], body.tl-form input[type=password],
body.tl-form input:not([type]), body.tl-form select, body.tl-form textarea{
    box-sizing:border-box; min-height:30px; padding:4px 10px;
    border:1px solid var(--tl-border); border-radius:8px;
    background:#fff; color:var(--tl-text);
    font-family:var(--tl-font); font-size:12.5px; font-weight:400;
    outline:none; transition:border-color .15s, box-shadow .15s;
}
body.tl-form textarea{ min-height:52px; resize:vertical; }
body.tl-form select{ padding-right:6px; }
body.tl-form input[readonly], body.tl-form textarea[readonly]{ background:var(--tl-soft); color:var(--tl-muted); }
body.tl-form input:focus, body.tl-form select:focus, body.tl-form textarea:focus{
    border-color:var(--tl-primary-light);
    box-shadow:0 0 0 3px color-mix(in srgb, var(--tl-primary-light) 22%, transparent);
}
body.tl-form img[src*="lookup"]{ vertical-align:middle; margin-left:4px; cursor:pointer; opacity:.8; transition:opacity .15s, transform .15s; }
body.tl-form img[src*="lookup"]:hover{ opacity:1; transform:scale(1.1); }

/* --- Advance search (mode query) --- */
body.tl-form #query #div1, body.tl-form #query #div2, body.tl-form #query #div3,
body.tl-form #query #div4, body.tl-form #query #div5{ display:flex; flex-wrap:wrap; gap:6px; margin:4px 0; }
body.tl-form #query #ss{ display:none; }
body.tl-form #query:not([style*="absolute"]){
    position:relative; margin:8px 0; padding:14px 16px !important;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card);
    font-weight:700; color:var(--tl-primary-dark);
}

/* ===== 4) HALAMAN LAPORAN (report_*) : toolbar + #title + #titleline + #query ===== */
body.tl-form:has(> #titleline) #titleline{ display:none !important; }
body.tl-form:has(> #titleline) #query{
    position:relative !important; top:auto !important; left:auto !important;
    width:auto !important; height:auto !important; max-width:760px;
    margin:0 0 8px 0 !important; padding:14px 18px !important;
    background:#fff !important; border:1px solid var(--tl-border);
    border-radius:12px; box-shadow:var(--tl-shadow-card); box-sizing:border-box;
}
body.tl-form:has(> #titleline) #query form{ display:block !important; }
body.tl-form:has(> #titleline) #query table{ width:auto !important; border-collapse:collapse; }
/* baris label (tanpa input) tampil sebagai label kecil */
body.tl-form:has(> #titleline) #query tr:not(:has(input,select,textarea)) td{
    padding:10px 16px 3px 0 !important; font-size:11px !important;
    letter-spacing:.4px; text-transform:uppercase; white-space:nowrap;
}
body.tl-form:has(> #titleline) #query tr:has(input,select,textarea) td{ padding:0 16px 2px 0 !important; white-space:nowrap; }
body.tl-form:has(> #titleline) #query input[type=text],
body.tl-form:has(> #titleline) #query select{ min-width:160px; }
/* kolom-kolom centang (mis. Audit Trail) */
body.tl-form:has(> #titleline) #query #a1,
body.tl-form:has(> #titleline) #query #a2,
body.tl-form:has(> #titleline) #query #a3{
    position:static !important; display:inline-block; vertical-align:top;
    margin:0 28px 12px 0; line-height:26px; color:var(--tl-text); font-weight:600;
}
body.tl-form input[type=checkbox], body.tl-form input[type=radio]{ accent-color:var(--tl-primary); width:16px; height:16px; vertical-align:middle; margin-right:4px; }

/* ===== 5) HEADER BERKOLOM (#kol1, #kol2, #kol3 - mis. Payment) ===== */
body.tl-form #kol1, body.tl-form #kol2, body.tl-form #kol3{
    position:relative !important; top:auto !important; left:auto !important;
    width:auto !important; height:auto !important;
    display:inline-block; vertical-align:top; box-sizing:border-box;
    margin:0 8px 8px 0 !important; padding:10px 14px !important;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card);
}
body.tl-form #kol1 input[type=text], body.tl-form #kol2 input[type=text], body.tl-form #kol3 input[type=text]{ max-width:300px; }
body.tl-form #Toolb{ position:static !important; width:auto !important; height:auto !important; padding:8px 14px; }
body.tl-form #Toolb a{ color:var(--tl-primary) !important; font-weight:700; text-decoration:none; margin-right:12px; }

/* ===== 6) POPUP dengan footer (mis. Payment Detail) ===== */
body.tl-form:has(> #divheader) > #toolbarRecObj{ order:3; height:36px !important; top:auto !important; left:auto !important; }
body.tl-form:has(> #divheader) > #divFooter{
    order:4; position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
    display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; padding:8px 12px; box-shadow:var(--tl-shadow-card);
    color:var(--tl-text);
}
body.tl-form #divFooter b{ display:flex; align-items:center; gap:8px; }
body.tl-form #divheader #img{ position:static !important; width:auto !important; display:inline-flex; }
body.tl-form #divheader #img img{ cursor:pointer; }

/* ===== 7) POPUP LOOKUP sederhana (item_*_list: hanya #gridbox + form cari) ===== */
body.tl-form:has(> #gridbox):not(:has(> #toolbarGrdObj)):not(:has(> #divheader)):not(:has(> #toolbarIudObj)){
    display:flex !important; flex-direction:column; gap:8px;
    height:100vh; box-sizing:border-box; padding:8px !important; overflow:hidden !important;
}
body.tl-form:has(> #gridbox):not(:has(> #toolbarGrdObj)):not(:has(> #divheader)):not(:has(> #toolbarIudObj)) > *{
    position:relative !important; top:auto !important; left:auto !important; width:auto !important; flex:0 0 auto;
}
body.tl-form:has(> #gridbox):not(:has(> #toolbarGrdObj)):not(:has(> #divheader)):not(:has(> #toolbarIudObj)) > form{
    order:1; display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin:0;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card);
    padding:10px 14px; color:var(--tl-muted); font-weight:600;
}
body.tl-form:has(> #gridbox):not(:has(> #toolbarGrdObj)):not(:has(> #divheader)):not(:has(> #toolbarIudObj)) > #img{
    order:2; display:flex; align-items:center; gap:8px; height:auto !important;
}
body.tl-form:has(> #gridbox):not(:has(> #toolbarGrdObj)):not(:has(> #divheader)):not(:has(> #toolbarIudObj)) > #gridbox{
    order:3; flex:1 1 auto; min-height:200px; height:auto !important; width:auto !important;
}
body.tl-form:has(> #gridbox):not(:has(> #toolbarGrdObj)):not(:has(> #divheader)):not(:has(> #toolbarIudObj)) > #toolbarRecObj{ order:4; height:36px !important; }
body.tl-form form label[for="findlabel"]{ font-weight:700; color:var(--tl-primary-dark); }
body.tl-form form label[for="findlabel"]:before{ content:"\1F50D"; font-size:12px; margin-right:6px; filter:grayscale(1) opacity(.6); }
body.tl-form form label[for="sep01"]{ display:none; }
/* tombol Print Barcode / Print Label / Run Query sebagai pil */
body.tl-form > #img a{ color:var(--tl-primary) !important; font-weight:700; text-decoration:none; }
body.tl-form > #img:has(a){ padding:6px 12px; border-radius:999px; background:var(--tl-soft); border:1px solid var(--tl-border); width:fit-content !important; }
body.tl-form > #img img{ cursor:pointer; vertical-align:middle; }

/* ===== 8) Master Item: kelompok fieldset berdampingan & ikon advance search ===== */
body.tl-form #a_tabbar div:has(> #supplier){
    display:flex !important; flex-wrap:wrap; gap:12px 20px; align-items:flex-start; padding:12px 14px;
}
body.tl-form #a_tabbar #supplier, body.tl-form #a_tabbar #customer, body.tl-form #a_tabbar #pabean{ flex:1 1 320px; min-width:0; }
body.tl-form #a_tabbar #frm3a, body.tl-form #a_tabbar #frmPacking, body.tl-form #a_tabbar #frmProduksi{ flex:1 1 220px; }
body.tl-form #a_tabbar #itemPictureDiv{ padding:8px 14px; }
body.tl-form #a_tabbar #itemPictureDiv img{ max-width:100%; height:auto; border-radius:12px; border:1px solid var(--tl-border); }
body.tl-form:has(> #toolbarIudObj) > #img{
    position:relative !important; top:auto !important; width:auto !important;
    display:flex; align-items:center; gap:8px; margin:6px 0; color:var(--tl-primary-dark);
}
body.tl-form:has(> #toolbarIudObj) #query{ position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important; }
body.tl-form:has(> #toolbarIudObj) #img b{ font-weight:700; }

/* ===== 9) HEADER DUA KOLOM (#sub_entry1/#sub_entry2) & form #entry sederhana ===== */
body.tl-form #entryheader:has(> [id^="sub_entry"]), body.tl-form #entry:has(> [id^="sub_entry"]){ display:flex; flex-wrap:wrap; gap:0 28px; align-items:flex-start; }
body.tl-form #entryheader > [id^="sub_entry"], body.tl-form #entry > [id^="sub_entry"]{
    position:static !important; top:auto !important; left:auto !important;
    width:auto !important; height:auto !important; flex:1 1 340px; min-width:0;
}
body.tl-form:has(> #toolbarIudObj) #entry{
    position:relative !important; top:auto !important; left:auto !important;
    width:auto !important; height:auto !important; margin:0 0 8px 0 !important;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px;
    box-shadow:var(--tl-shadow-card); padding:10px 14px; box-sizing:border-box;
}
/* toolbar Entry Detail di dalam tab (mis. Inventory Issue) */
body.tl-form #a_tabbar #toold, body.tl-form #a_tabbar #toolx{ padding:8px 10px 0; }
body.tl-form #a_tabbar #detail{ margin:8px 10px !important; }
body.tl-form #a_tabbar #gridbox{ margin:8px 10px !important; }

/* ===== 10) LAPORAN/QUERY dengan toolbar Iud + grid (mis. Journal History) ===== */
body.tl-form:has(> #toolbarIudObj):has(> #toolbarRecObj):has(> #gridbox){
    display:flex !important; flex-direction:column; gap:8px;
    height:100vh !important; min-height:0; padding:8px !important; overflow:hidden !important;
}
body.tl-form:has(> #toolbarIudObj):has(> #toolbarRecObj):has(> #gridbox) > *{
    position:relative !important; top:auto !important; left:auto !important; width:auto !important; flex:0 0 auto; margin:0 !important;
}
body.tl-form:has(> #toolbarIudObj):has(> #toolbarRecObj):has(> #gridbox) > .tl-page-head{ order:0; }
body.tl-form:has(> #toolbarIudObj):has(> #toolbarRecObj):has(> #gridbox) > #toolbarIudObj{ order:1; }
body.tl-form:has(> #toolbarIudObj):has(> #toolbarRecObj):has(> #gridbox) > #query{ order:2; height:auto !important; }
body.tl-form:has(> #toolbarIudObj):has(> #toolbarRecObj):has(> #gridbox) > #gridbox{ order:3; flex:1 1 auto; min-height:220px; height:auto !important; }
body.tl-form:has(> #toolbarIudObj):has(> #toolbarRecObj):has(> #gridbox) > #toolbarRecObj{ order:4; height:36px !important; }

/* ===== 11) #title berisi tabel header (mis. Job Description) -> kartu putih ===== */
body.tl-form #title:has(table){
    display:block; height:auto !important; padding:10px 14px; background:#fff;
    border:1px solid var(--tl-border); box-shadow:var(--tl-shadow-card); border-radius:12px; overflow-x:auto;
}
body.tl-form #title:has(table) table{ width:auto !important; }
body.tl-form:has(> #toolbarIudObj) > .tl-page-head{ margin:0 0 8px !important; }
body.tl-form #a_tabbar #entry1b{ display:none !important; }   /* tabel kosong pengisi jarak */
body.tl-form #toold1, body.tl-form #toolx1{ position:relative !important; top:auto !important; width:auto !important; height:auto !important; background:transparent !important; padding:8px 10px 0; }
body.tl-form #toold1 a, body.tl-form #toolx1 a{
    display:inline-flex; align-items:center; gap:6px; margin-left:4px; padding:6px 14px; border-radius:999px;
    text-decoration:none !important; background:var(--tl-soft); border:1px solid var(--tl-border); color:var(--tl-primary) !important; font-weight:700;
}
body.tl-form #a_tabbar #detail1{ margin:8px 10px !important; }
body.tl-form #a_tabbar #gridbox1{ margin:8px 10px !important; }

/* ===== 12) Form master dgn #frm1/#frm2 langsung di form (mis. Master Account) ===== */
body.tl-form:has(> #toolbarIudObj) form:has(> #frm1){ display:flex; flex-wrap:wrap; gap:8px 16px; align-items:flex-start; }
body.tl-form:has(> #toolbarIudObj) form:has(> #frm1) > #title,
body.tl-form:has(> #toolbarIudObj) form:has(> #frm1) > #titleline{ flex:1 1 100%; }
body.tl-form:has(> #toolbarIudObj) form > [id^="frm"],
body.tl-form:has(> #toolbarIudObj) > [id^="frm"]{
    position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
    flex:1 1 340px; min-width:0; overflow-x:auto; box-sizing:border-box;
    background:#fff !important; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card); padding:10px 14px;
}
body.tl-form:has(> #toolbarIudObj) #titleline{ display:none !important; }
/* baris detail input di luar tab (mis. Attendance #detailH1) */
body.tl-form #detailH1{
    position:relative !important; top:auto !important; width:auto !important; margin:0 0 8px !important; overflow-x:auto;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card); padding:10px 14px; box-sizing:border-box;
}
body.tl-form #detailH1 tr[bgcolor], body.tl-form #detail tr[bgcolor]{ display:none; }
body.tl-form #detailH1 a{ color:var(--tl-primary) !important; font-weight:700; text-decoration:none; margin-right:10px; }
/* tab berisi tabbar di dalam #entry (mis. Allowance) */
body.tl-form #entry #a_tabbar{ margin-top:10px !important; }
body.tl-form #a_tabbar #general table{ margin:10px 14px; }

/* ===== 13) HAK AKSES (akses_iud / aksesx_iud / akses_iud_tree) ===== */
body.tl-form:has(> #aksess) #aksess,
body.tl-form:has(> #jobTreeObj) > #query{
    position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
    margin:0 0 8px !important; padding:10px 14px !important; box-sizing:border-box;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card);
    color:var(--tl-primary-dark) !important; font-family:var(--tl-font) !important; font-size:13px !important;
}
body.tl-form:has(> #aksess) > #query:not(:has(label)){ display:none !important; }   /* hanya pembuka form */
body.tl-form #aksess font{ font-family:var(--tl-font); }
body.tl-form #aksess #ahabar{ position:static !important; display:inline-flex; align-items:center; gap:6px; margin-left:12px; font-weight:600; color:var(--tl-muted); }
body.tl-form #aksess #ahabar[style*="none"]{ display:none !important; }
body.tl-form #a_tabbar div:has(> #gnr1){ display:flex !important; flex-wrap:wrap; gap:12px; padding:12px 14px; }
body.tl-form #a_tabbar [id^="gnr"] fieldset{ width:auto !important; min-width:240px; line-height:26px; color:var(--tl-text); }
body.tl-form #a_tabbar [id^="gridbox"]{ position:relative !important; top:auto !important; left:auto !important; margin:8px 10px !important; }
body.tl-form #a_tabbar #gridboxTrans, body.tl-form #a_tabbar #gridboxRpt, body.tl-form #a_tabbar #gridboxUtl,
body.tl-form:has(> #aksess) #a_tabbar #gridbox{ width:auto !important; height:max(320px, 58vh) !important; background:#fff !important; border-radius:12px; }
body.tl-form #a_tabbar [id^="divchk"], body.tl-form #a_tabbar #divchother{ padding:0 12px; font-weight:600; color:var(--tl-text); }
body.tl-form #a_tabbar a[id^="save"]{
    display:inline-flex; margin:4px 0 10px; padding:6px 14px; border-radius:999px; text-decoration:none !important;
    background:var(--tl-soft); border:1px solid var(--tl-border); color:var(--tl-primary) !important; font-weight:700;
}
/* versi tree */
body.tl-form:has(> #jobTreeObj){
    display:grid !important; grid-template-columns:minmax(240px,38%) 1fr; gap:8px; align-content:start;
    padding:8px !important; height:100vh !important; box-sizing:border-box; overflow:auto !important; background:var(--tl-bg) !important;
}
body.tl-form:has(> #jobTreeObj) > *{ position:relative !important; top:auto !important; left:auto !important; width:auto !important; grid-column:1 / -1; margin:0 !important; }
body.tl-form:has(> #jobTreeObj) > #ExpColapse{ height:auto !important; }
body.tl-form:has(> #jobTreeObj) > #ExpColapse img{ cursor:pointer; }
body.tl-form:has(> #jobTreeObj) > #jobTreeObj{
    grid-column:1; height:70vh !important; overflow:auto; background:#fff;
    border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card); padding:6px;
}
body.tl-form:has(> #jobTreeObj) > #others{
    grid-column:2; height:auto !important; background:#fff; border:1px solid var(--tl-border); border-radius:12px;
    box-shadow:var(--tl-shadow-card); padding:12px 16px; line-height:26px; font-weight:600; color:var(--tl-text);
}

/* ===== 14) DETAIL TERSEMBUNYI di halaman grid (mis. Attendance Overview) ===== */
body.tl-form:has(> #toolbarGrdObj) > #toolx{ order:2; height:auto !important; background:transparent !important; }
body.tl-form:has(> #toolbarGrdObj) > #toolx a{
    display:inline-flex; padding:6px 14px; border-radius:999px; text-decoration:none !important;
    background:var(--tl-soft); border:1px solid var(--tl-border); color:var(--tl-primary) !important; font-weight:700;
}
body.tl-form:has(> #toolbarGrdObj) > #detail{ order:3; height:auto !important; overflow-x:auto; }
body.tl-form:has(> #toolbarGrdObj) > #toolx[style*="none"], body.tl-form:has(> #toolbarGrdObj) > #detail[style*="none"]{ display:none !important; }

/* ===== 15) Header #header (mis. Bill of Lading) & grid tab tambahan ===== */
body.tl-form:has(> #toolbarIudObj) #header{
    position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
    margin:0 0 8px !important; overflow-x:auto; box-sizing:border-box;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card); padding:10px 14px;
}
body.tl-form:has(> #toolbarIudObj) #header table{ width:auto !important; }
body.tl-form:has(> #toolbarIudObj):has(#header) #entry:not(:has(*)){ display:none !important; }
body.tl-form:has(> #toolbarIudObj) #a_tabbar :where([id^="gridbox"]){
    width:auto !important; height:max(260px, 48vh) !important; background:#fff !important; border-radius:12px;
}
body.tl-form #a_tabbar div:has(> #detail2){ display:flex !important; flex-wrap:wrap; gap:8px 24px; padding:8px 12px; }
body.tl-form #a_tabbar div:has(> #detail2) > #detail1, body.tl-form #a_tabbar div:has(> #detail2) > #detailBottom{ flex:1 1 100%; }
body.tl-form #a_tabbar div:has(> #detail2) > [id^="detail"]:not(#detail1):not(#detailBottom){ flex:0 1 auto; }
body.tl-form #a_tabbar #toold a{ color:var(--tl-primary) !important; font-weight:700; }

/* ===== 16) Popup Cancel/Close Transaksi (#endtry) ===== */
body.tl-form #endtry #cancel_date, body.tl-form #endtry #close_date{ width:140px !important; margin:0 8px; }
body.tl-form #endtry textarea{ width:100% !important; max-width:520px; box-sizing:border-box; }

/* ===== 17) Form edit dengan #transaksi > #content_master (mis. Master Divisi) ===== */
body.tl-form:has(> #toolbarIudObj) #transaksi{
    position:relative !important; top:auto !important; left:auto !important; height:auto !important; width:auto !important;
    margin:10px 0 0; background:#fff; border:1px solid var(--tl-border); border-radius:14px;
    box-shadow:var(--tl-shadow-card); padding:14px 16px; overflow-x:auto;
}
body.tl-form #content_master table td{ padding:4px 8px 4px 0; }

/* ===== 18) Header #entryhead, kolom #entry1/#entry2, popup #enthead (FA Manual) ===== */
body.tl-form:has(> #toolbarIudObj) #entryhead,
body.tl-form:has(> #toolbarIudObj) #entry1,
body.tl-form:has(> #toolbarIudObj) #entry2{
    position:relative !important; top:auto !important; left:auto !important;
    width:auto !important; height:auto !important; box-sizing:border-box;
    margin:0 8px 8px 0 !important; padding:10px 14px;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card);
}
body.tl-form:has(> #toolbarIudObj) #entry1,
body.tl-form:has(> #toolbarIudObj) #entry2{ display:inline-block; vertical-align:top; max-width:100%; overflow-x:auto; }
body.tl-form #entryhead table{ width:auto !important; }
body.tl-form:has(#enthead){ height:auto !important; min-height:100vh; overflow-y:auto !important; padding:8px !important; box-sizing:border-box; }
body.tl-form #enthead{
    position:relative !important; top:auto !important; height:auto !important; width:auto !important;
    display:flex; flex-wrap:wrap; gap:6px 24px; align-items:flex-start;
    margin:0 0 8px; padding:10px 14px; box-sizing:border-box;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card);
}
body.tl-form #enthead > [id^="entfrm"]{
    position:static !important; top:auto !important; left:auto !important;
    width:auto !important; height:auto !important; flex:1 1 260px; min-width:0;
}
body.tl-form #enthead td:first-child{ white-space:nowrap; padding-right:8px; }
body.tl-form #enthead input[type=text]{ max-width:100%; box-sizing:border-box; }
body.tl-form #entfrm1 #fa_name{ width:100% !important; min-width:180px; }
body.tl-form:has(#enthead) #a_tabbar{ position:relative !important; top:auto !important; height:auto !important; min-height:360px; }
body.tl-form #GeneralDet{ position:relative !important; height:auto !important; display:flex; flex-wrap:wrap; gap:8px 24px; padding:10px; }
body.tl-form #GeneralDet > [id^="frm"]{ position:static !important; width:auto !important; height:auto !important; flex:1 1 300px; }

/* ===== 19) Popup 2 kolom #endtry1/#endtry2 (Receipe FA) & #entry + #entry2 (Giro) ===== */
body.tl-form:has(> #endtry1){ display:flex; flex-wrap:wrap; gap:10px; align-items:flex-start; padding:10px !important; height:auto !important; min-height:100vh; overflow-y:auto !important; box-sizing:border-box; }
body.tl-form > #endtry1, body.tl-form > #endtry2{
    position:static !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
    flex:1 1 280px; box-sizing:border-box; padding:12px 14px;
    background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card);
}
body.tl-form > #endtry1 td:first-child{ white-space:nowrap; padding-right:8px; }
body.tl-form:has(> #toolbarIudObj) #entry:has(~ #entry2){ display:inline-block; vertical-align:top; width:auto !important; max-width:100%; }

/* ===== 20) Form KPI: #footer kosong (tabel tak tertutup) disembunyikan ===== */
body.tl-form #a_tabbar #footer:not(:has(td)){ display:none !important; }
body.tl-form:has(> #toolbarIudObj) #title:has(table){ position:relative !important; top:auto !important; width:auto !important; height:auto !important; }

/* ===== 21) Organisasi (judul ber-id lain), header Payroll lebar, lookup Overtime ===== */
body.tl-form:has(> .tl-page-head) #organisasi, body.tl-form:has(> .tl-page-head) #organisasiline{ display:none !important; }
body.tl-form:has(> #toolbarIudObj) #entry:has(> #a_tabbar) > table{ display:block; width:100% !important; max-width:100%; overflow-x:auto; }
body.tl-form #detailH1 td:has(> img[id^="list_"]){ white-space:nowrap; }
body.tl-form input[type="remark"]{ border:1px solid var(--tl-border); border-radius:10px; padding:6px 10px; min-height:30px; background:#fff; font:inherit; }

/* ===== 22) Setup Periode (periode.php): info periode & tombol aksi di bawah grid ===== */
body.tl-form:has(> #currperiode) > #currperiode{ order:5; }
body.tl-form:has(> #currperiode) > #rmkper{ order:6; }
body.tl-form > #currperiode, body.tl-form > #rmkper{
  position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
  background:#fff !important; border:1px solid var(--tl-border); border-radius:14px; box-shadow:var(--tl-shadow-card);
  margin:8px 8px 0; padding:10px 14px; }
body.tl-form > #currperiode font{ font-family:var(--tl-font) !important; font-weight:700; color:var(--tl-primary); }
body.tl-form > #currperiode br:first-child{ display:none; }
body.tl-form > #rmkper table{ border-collapse:collapse; }
body.tl-form > #rmkper td:empty, body.tl-form > #rmkper td:has(> :only-child:is(br)){ display:none; }
body.tl-form > #rmkper td{ text-align:center; padding:2px 8px; }
body.tl-form > #rmkper h5{ margin:0; }
body.tl-form > #rmkper a{ display:inline-block; padding:6px 14px; border-radius:999px; background:var(--tl-gradient-bright); color:#fff !important; text-decoration:none; font-size:12px; white-space:nowrap; }
body.tl-form > #rmkper img{ display:none; }

/* ===== 23) Tab Personal: tombol Export PDF (#toolz) & foto di samping form ===== */
body.tl-form #toolz{
  position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
  display:inline-block; margin:0 0 8px 0 !important; background:transparent !important; }
body.tl-form #toold:has(~ #toolz){ display:inline-block; }
body.tl-form #toolz a{
  display:inline-flex; align-items:center; gap:6px; margin-left:4px; padding:6px 14px; border-radius:999px;
  text-decoration:none !important; background:var(--tl-soft); border:1px solid var(--tl-border);
  color:var(--tl-primary) !important; font-weight:700; }
body.tl-form #toolz a:hover{ background:var(--tl-primary); color:#fff !important; }
body.tl-form #a_tabbar #personal_file:has(> #PersonalPictureDiv):not([style*="display: none"]):not([style*="display:none"]):not([style*="visibility: hidden"]):not([style*="visibility:hidden"]){
  display:grid !important; grid-template-columns:minmax(0,auto) 1fr; gap:10px 16px; align-items:start; }
body.tl-form #personal_file > #entry{ grid-row:1 / span 2; }
body.tl-form #personal_file > #frm5, body.tl-form #personal_file > #PersonalPictureDiv{
  position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important; }
body.tl-form #personal_file > #PersonalPictureDiv img{ max-width:100%; height:auto; border-radius:12px; border:1px solid var(--tl-border); background:#fff; }
@media (max-width:900px){
  body.tl-form #personal_file:has(> #PersonalPictureDiv){ grid-template-columns:1fr; }
  body.tl-form #personal_file > #entry{ grid-row:auto; }
}

/* ===== 24) Mutasi Bank: bar "Load/Del R Penerimaan" (#Toolb/#tooly) seperti tombol pil ===== */
body.tl-form #Toolb, body.tl-form #tooly{
  position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
  background:transparent !important; padding:8px 10px 0; margin:0 0 8px 0 !important; }
body.tl-form #Toolb a, body.tl-form #tooly a{
  display:inline-flex; align-items:center; gap:6px; margin:0 6px 0 4px; padding:6px 14px; border-radius:999px;
  text-decoration:none !important; background:var(--tl-soft); border:1px solid var(--tl-border);
  color:var(--tl-primary) !important; font-weight:700; }
body.tl-form #Toolb a:hover, body.tl-form #tooly a:hover{ background:var(--tl-primary); color:#fff !important; }

/* ===== 25) PPh21: bar Get PPH21 (#iudtoolbar1); popup Proses Transaksi (#proses_date) ===== */
body.tl-form #iudtoolbar1{
  position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
  background:transparent !important; padding:4px 10px 0; margin:0 0 8px 0 !important; font-size:inherit !important; }
body.tl-form #iudtoolbar1 a{
  display:inline-flex; align-items:center; gap:6px; margin:0 6px 0 4px; padding:6px 14px; border-radius:999px;
  text-decoration:none !important; background:var(--tl-soft); border:1px solid var(--tl-border);
  color:var(--tl-primary) !important; font-weight:700; }
body.tl-form #iudtoolbar1 a:hover{ background:var(--tl-primary); color:#fff !important; }
body.tl-form:has(> #endtry #proses_date){ display:flex !important; flex-wrap:wrap; align-items:flex-start; gap:10px; }
body.tl-form:has(> #endtry #proses_date) > #endtry{ position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important; flex:0 0 auto; }
body.tl-form #endtry #proses_date{ width:160px !important; }

/* ===== 26) Halaman Home (util_home.php): dashboard Power BI responsif ===== */
body.tl-home{
  margin:0; min-height:100vh; box-sizing:border-box; padding:14px;
  background:var(--tl-bg, #f4f7fb) !important; font-family:var(--tl-font);
  overflow:auto; }
body.tl-home > center{ display:block; text-align:initial; }
body.tl-home .tl-home-wrap{ max-width:1280px; margin:0 auto; display:flex; flex-direction:column; gap:12px; }
body.tl-home .tl-page-head{ margin:0 !important; }
body.tl-home .tl-home-card{
  background:#fff; border:1px solid var(--tl-border); border-radius:16px; box-shadow:var(--tl-shadow-card);
  padding:10px; overflow:hidden; }
body.tl-home .tl-home-card iframe{
  display:block; width:100% !important; height:auto !important; aspect-ratio:4 / 3;
  max-height:calc(100vh - 120px); border:0; border-radius:10px; background:#fff; }
@media (max-width:700px){
  body.tl-home{ padding:8px; }
  body.tl-home .tl-home-card{ padding:4px; border-radius:12px; }
  body.tl-home .tl-home-card iframe{ max-height:none; aspect-ratio:3 / 4; }
}

/* ===== 27) Sales Order: kotak "Alamat" (div tanpa id, absolute left:600px) ikut alur di bawah total ===== */
body.tl-form:has(> #toolbarIudObj) div:not([id])[style*="left:600px"]{
    position:relative !important; top:auto !important; left:auto !important; width:auto !important; height:auto !important;
    margin:0 0 8px !important; padding:10px 14px; background:#fff; border:1px solid var(--tl-border);
    border-radius:12px; box-shadow:var(--tl-shadow-card); color:var(--tl-muted); font-weight:600;
}
body.tl-form:has(> #toolbarIudObj) div:not([id])[style*="left:600px"] textarea{ width:100%; max-width:520px; box-sizing:border-box; }

/* ===== 28) #entry kosong (sisa layout lama, mis. Shipping Instruction / Cargo Declaration) disembunyikan ===== */
body.tl-form:has(> #toolbarIudObj) #entry:not(:has(*)){ display:none !important; }

/* ===== 29) Header SI (#atas) & kolom #entryheader1..4 berdampingan ===== */
body.tl-form:has(> #toolbarIudObj) #atas{ position:relative !important; top:auto !important; left:auto !important; width:auto !important; display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; margin:0 0 8px; padding:12px 16px; background:#fff; border:1px solid var(--tl-border); border-radius:12px; box-shadow:var(--tl-shadow-card); color:var(--tl-muted); font-weight:600; }
body.tl-form:has(> #toolbarIudObj) > form > .tl-page-head + #atas, body.tl-form:has(> #toolbarIudObj) #atas input{ margin-right:8px; }
body.tl-form #a_tabbar #entryheaderInduk{ position:relative !important; top:auto !important; left:auto !important; display:flex; flex-wrap:wrap; gap:12px 24px; align-items:flex-start; padding:12px 14px; }
body.tl-form #a_tabbar #entryheaderInduk > [id^="entryheader"]{ position:relative !important; top:auto !important; left:auto !important; width:auto !important; flex:1 1 220px; min-width:0; }
body.tl-form #a_tabbar #entryheaderInduk input[type="text"]{ max-width:calc(100% - 30px); box-sizing:border-box; }

/* ===== 30) Tabel berisi input tersembunyi saja di dalam tabbar (sisa tab lama) ===== */
body.tl-form #a_tabbar > table:not(:has(input:not([type="hidden"]), select, textarea)),
body.tl-form #a_tabbar .dhx_tabcontent_zone > table:not(:has(input:not([type="hidden"]), select, textarea)){ display:none !important; }

/* ===== 31) Form Budget: #entryheader/#entrydetail berisi tabbar (b_TabBar / a_TabBar) ===== */
body.tl-form:has(> #toolbarIudObj) #entrydetail{
    position:relative !important; top:auto !important; left:auto !important;
    width:auto !important; height:calc(100vh - 260px) !important; min-height:460px;
    margin:0 0 8px !important; background:#fff; border:1px solid var(--tl-border);
    border-radius:12px; box-shadow:var(--tl-shadow-card); overflow:hidden;
}
body.tl-form:has(> #toolbarIudObj) #entryheader:has(> .dhtmlxTabBar, > [id$="TabBar"]){
    height:190px !important; min-height:190px; padding:0 !important; overflow:hidden !important;
}
body.tl-form #entrydetail > [id$="TabBar"], body.tl-form #entryheader > [id$="TabBar"]{ top:0 !important; border-radius:12px; }
body.tl-form #entrydetail [id$="Content"] [id^="toold"]{ border-bottom:2px solid var(--tl-border) !important; }
body.tl-form #entrydetail #iudDetail, body.tl-form #entrydetail #iudDetail2{ overflow:auto; }

/* ===== 32) Tombol "Upload Excel" (#uploadDiv) di halaman daftar -> pill di banner ===== */
body.tl-form:has(> #toolbarGrdObj) > #uploadDiv{
    position:absolute !important; top:17px !important; left:auto !important; right:22px !important;
    width:auto !important; height:28px !important; z-index:3;
    display:flex; align-items:center; gap:6px; padding:0 12px; border-radius:999px;
    background:rgba(255,255,255,.18) !important; border:1px solid rgba(255,255,255,.35);
}
body.tl-form:has(> #toolbarGrdObj) > #uploadDiv a{ color:#fff !important; font-family:var(--tl-font) !important; font-size:12px !important; font-weight:600; }
body.tl-form:has(> #toolbarGrdObj) > #uploadDiv img{ filter:brightness(0) invert(1); }
body.tl-form:has(> #toolbarGrdObj) #toolbarGrdObj{ width:auto !important; }

/* ===== 33) Popup upload sederhana (body.tl-upload) -> kartu upload ===== */
body.tl-form.tl-upload{ padding:16px !important; overflow:auto !important; background-image:none !important; }
body.tl-upload form{
    max-width:520px; margin:8px auto; padding:18px 20px; box-sizing:border-box;
    background:#fff; border:1px solid var(--tl-border); border-radius:14px; box-shadow:var(--tl-shadow-card);
    color:var(--tl-muted); font-weight:600;
}
body.tl-upload form::before{
    content:"\1F4E4  Upload File"; display:block; margin:-18px -20px 14px; padding:12px 20px;
    border-radius:14px 14px 0 0; background:var(--tl-gradient-bright); color:#fff; font-size:14px; font-weight:700;
}
body.tl-upload form br{ display:none; }
body.tl-upload form > div{ margin:0 0 10px; font-weight:500; }
body.tl-upload input[type=file]{
    display:block; width:100%; box-sizing:border-box; margin:8px 0 14px; padding:18px 12px;
    border:2px dashed var(--tl-border); border-radius:12px; background:var(--tl-soft);
    color:var(--tl-text); font-family:var(--tl-font); cursor:pointer;
}
body.tl-upload input[type=file]:hover{ border-color:var(--tl-primary); }
body.tl-upload input[type=file]::file-selector-button{
    margin-right:12px; padding:7px 14px; border:0; border-radius:999px; cursor:pointer;
    background:var(--tl-primary); color:#fff; font-weight:600; font-family:var(--tl-font);
}
body.tl-upload form table{ width:100%; border:0; }
body.tl-upload input[type=submit]{ min-width:120px; }
body.tl-upload #divheader{ position:static !important; text-align:center; padding:40px 0; }

/* ===== 34) Report Template (toolbar #toolbarObj + form frmdata) & halaman "upload berhasil" ===== */
body.tl-form:has(> #toolbarObj){ padding:8px !important; overflow:auto !important; height:auto !important; }
body.tl-form > #toolbarObj{ position:relative !important; top:auto !important; left:auto !important; width:auto !important; min-height:36px; margin:0 0 8px; background:transparent !important; }
body.tl-form:has(> #toolbarObj) > br{ display:none; }
body.tl-form form[name="frmdata"] > table.adminform{ width:100% !important; }
body.tl-upload:not(:has(form)) h3{
    margin:0; padding:12px 18px; border-radius:14px 14px 0 0; color:#fff; font-size:14px;
    background:var(--tl-gradient-bright); max-width:520px; margin:8px auto 0; box-sizing:border-box;
}
body.tl-upload:not(:has(form)) h3 ~ ul, body.tl-upload:not(:has(form)) h3 ~ p{
    max-width:520px; margin:0 auto; box-sizing:border-box; background:#fff;
    border:1px solid var(--tl-border); border-top:0; padding:10px 18px 10px 36px;
}
body.tl-upload:not(:has(form)) h3 ~ p{ border-radius:0 0 14px 14px; padding-left:18px; box-shadow:var(--tl-shadow-card); }
body.tl-upload:not(:has(form)) h3 ~ p a{ color:var(--tl-primary); font-weight:600; }

/* ===== 35. Blok jam masuk/keluar (#in_out_time) jadi kartu ===== */
body.tl-form #in_out_time{position:relative !important;top:auto !important;left:auto !important;width:auto !important;height:auto !important;margin:12px 8px;padding:14px 18px;background:#fff;border:1px solid var(--tl-border,#e2e8f0);border-radius:14px;box-shadow:0 4px 14px rgba(15,23,42,.05);}
body.tl-form #in_out_time table{width:auto;}

/* ===== 36. HP: tombol buka/tutup filter (#tlQueryToggle) di halaman daftar ===== */
#tlQueryToggle{ display:none; }
@media (max-width: 768px){
    body.tl-form:has(> #toolbarGrdObj) > #tlQueryToggle{
        order:2; display:flex; align-items:center; justify-content:space-between;
        margin:0 0 6px; padding:9px 14px; border-radius:12px; cursor:pointer; user-select:none;
        background:#fff; border:1px solid var(--tl-border,#dbe4f0); color:var(--tl-primary-dark,#1e3a8a);
        font-weight:700; font-size:14px; box-shadow:0 2px 8px rgba(15,23,42,.05);
    }
    body.tl-form:has(> #toolbarGrdObj) > #tlQueryToggle b{ font-size:14px; color:var(--tl-primary,#2563eb); }
    body.tl-form.tl-q-collapsed > #query{ display:none !important; }
    body.tl-form.tl-q-collapsed > #gridbox{ min-height:calc(100vh - 210px) !important; }
}

/* ===== Layar HP / tablet kecil ===== */
@media (max-width: 760px){
    body.tl-form:has(> #toolbarGrdObj){ padding:6px !important; gap:6px; }
    body.tl-form #query[style*="absolute"] select,
    body.tl-form #query[style*="absolute"] input[type=text],
    body.tl-form #query[style*="absolute"] input:not([type]){ flex:1 1 140px; width:auto !important; min-height:38px; font-size:15px; }
    body.tl-form #query[style*="absolute"] table,
    body.tl-form #query[style*="absolute"] tbody,
    body.tl-form #query[style*="absolute"] tr,
    body.tl-form #query[style*="absolute"] td{ display:block; width:auto !important; }
    body.tl-form #query[style*="absolute"] td{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:2px 0 !important; }
    body.tl-form:has(> #toolbarGrdObj) > #upload{ display:none; }

    body.tl-form:has(> #toolbarIudObj){ padding:6px 6px 24px !important; }
    body.tl-form #entry table, body.tl-form #entry tbody, body.tl-form #entry tr{ display:block; width:auto !important; }
    body.tl-form #entry td{ display:flex; flex-wrap:wrap; gap:6px; padding:0 0 4px !important; font-size:11px !important; text-transform:uppercase; letter-spacing:.4px; }
    body.tl-form #entry td:empty, body.tl-form #entry td:has(> :only-child:is(br)){ display:none; }
    body.tl-form #entry input[type=text], body.tl-form #entry select{ width:100% !important; min-height:40px; font-size:15px; }
    body.tl-form #title:has(table) table, body.tl-form #title:has(table) tbody, body.tl-form #title:has(table) tr{ display:block; width:auto !important; }
    body.tl-form #title:has(table) td{ display:flex; flex-wrap:wrap; gap:6px; padding:0 0 4px !important; font-size:11px !important; text-transform:uppercase; letter-spacing:.4px; }
    body.tl-form #title:has(table) input[type=text], body.tl-form #title:has(table) select{ width:100% !important; min-height:40px; font-size:15px; }
    body.tl-form:has(> #jobTreeObj){ grid-template-columns:1fr; }
    body.tl-form:has(> #jobTreeObj) > #others{ grid-column:1; }
    body.tl-form #detailH1 table, body.tl-form #detailH1 tbody, body.tl-form #detailH1 tr{ display:block; }
    body.tl-form #detailH1 td{ display:flex; flex-wrap:wrap; gap:6px; padding:0 0 4px !important; }
    body.tl-form #detailH1 input[type=text], body.tl-form #detailH1 select{ width:100% !important; min-height:40px; font-size:15px; }
    /* popup lookup sederhana */
    body.tl-form > form select, body.tl-form > form input[type=text], body.tl-form > form input:not([type]){ flex:1 1 140px; min-height:38px; font-size:15px; }
    body.tl-form > #img{ flex-wrap:wrap; }
    body.tl-form #kol1, body.tl-form #kol2, body.tl-form #kol3{ display:block; margin-right:0 !important; }
    body.tl-form #kol1 table, body.tl-form #kol2 table, body.tl-form #kol3 table,
    body.tl-form #kol1 tbody, body.tl-form #kol2 tbody, body.tl-form #kol3 tbody,
    body.tl-form #kol1 tr, body.tl-form #kol2 tr, body.tl-form #kol3 tr,
    body.tl-form #kol1 td, body.tl-form #kol2 td, body.tl-form #kol3 td{ display:block; width:auto !important; }
    body.tl-form #kol1 td, body.tl-form #kol2 td, body.tl-form #kol3 td{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:0 0 4px !important; }
    body.tl-form #kol1 input[type=text], body.tl-form #kol2 input[type=text], body.tl-form #kol3 input[type=text],
    body.tl-form #kol1 select, body.tl-form #kol2 select, body.tl-form #kol3 select,
    body.tl-form #kol1 textarea{ flex:1 1 140px; width:100% !important; min-height:40px; font-size:15px; }
    body.tl-form:has(> #titleline) #query{ max-width:none; }
    body.tl-form:has(> #titleline) #query input[type=text],
    body.tl-form:has(> #titleline) #query select{ width:100% !important; min-height:40px; font-size:15px; }
    body.tl-form:has(> #titleline) #query td{ display:block; white-space:normal !important; }

    /* tabel label-input: label di atas, input selebar layar */
    body.tl-form #entryheader table, body.tl-form #entryheader tbody, body.tl-form #entryheader tr, body.tl-form #entryheader td,
    body.tl-form #detail table, body.tl-form #detail tbody, body.tl-form #detail tr, body.tl-form #detail td,
    body.tl-form #footer table, body.tl-form #footer tbody, body.tl-form #footer tr, body.tl-form #footer td,
    body.tl-form #a_tabbar table, body.tl-form #a_tabbar tbody, body.tl-form #a_tabbar tr, body.tl-form #a_tabbar td{
        display:block; width:auto !important; height:auto !important;
    }
    body.tl-form #entryheader td, body.tl-form #detail td, body.tl-form #footer td, body.tl-form #a_tabbar td{
        display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:0 0 4px !important;
        font-size:11px !important; letter-spacing:.4px; text-transform:uppercase;
    }
    body.tl-form #entryheader td:empty, body.tl-form #detail td:empty,
    body.tl-form #a_tabbar td:empty, body.tl-form #a_tabbar tr:empty{ display:none; }
    body.tl-form #entryheader td:has(input,select,textarea),
    body.tl-form #detail td:has(input,select,textarea),
    body.tl-form #footer td:has(input,select,textarea),
    body.tl-form #a_tabbar td:has(input,select,textarea){ margin-bottom:8px; text-transform:none; font-size:12px !important; }
    body.tl-form #entryheader input[type=text], body.tl-form #entryheader input:not([type]), body.tl-form #entryheader select, body.tl-form #entryheader textarea,
    body.tl-form #detail input[type=text], body.tl-form #detail input:not([type]), body.tl-form #detail select, body.tl-form #detail textarea,
    body.tl-form #footer input[type=text], body.tl-form #footer input:not([type]),
    body.tl-form #a_tabbar input[type=text], body.tl-form #a_tabbar input[type=password], body.tl-form #a_tabbar input:not([type]),
    body.tl-form #a_tabbar select, body.tl-form #a_tabbar textarea{
        flex:1 1 140px; width:100% !important; min-width:0; max-width:100%;
        min-height:40px; font-size:15px;            /* 15px+ agar HP tidak auto-zoom */
    }
    body.tl-form #a_tabbar textarea, body.tl-form #detail textarea{ min-height:64px; }
    body.tl-form #entryheader img, body.tl-form #detail img, body.tl-form #a_tabbar img{ flex:0 0 auto; }
    body.tl-form #a_tabbar [id^="frm"] + [id^="frm"],
    body.tl-form #a_tabbar #div1 + #div2{ border-top:1px dashed var(--tl-border); }
    body.tl-form:has(> #toolbarIudObj) #gridbox,
    body.tl-form:has(> #toolbarIudObj) #gridbox2{ height:max(240px, 55vh) !important; }
}

/* ---------------- 11. SCROLLBAR & SELEKSI ---------------- */
*::-webkit-scrollbar{ width:9px; height:9px; }
*::-webkit-scrollbar-track{ background:transparent; }
*::-webkit-scrollbar-thumb{ background:var(--tl-border); border-radius:8px; border:2px solid transparent; background-clip:padding-box; }
*::-webkit-scrollbar-thumb:hover{ background:var(--tl-primary-light); background-clip:padding-box; }
::selection{ background:var(--tl-accent); color:var(--tl-primary-dark); }

/* ---------------- 12. TOMBOL MODERN ----------------
   a) Show/Hide panel layout (panah di header "::: PT. ... :::") */
div.dhtmlxInfoBarButtonsFake, div.dhtmlxInfoBarButtonsFake2,
[class*="dhtmlxInfoBarButtonsFake"]{ background:none !important; background-image:none !important; border:none !important; }
[class*="dhtmlxInfoButtonShowHide"],
[class*="dhtmlxInfoButtonDock"], [class*="dhtmlxInfoButtonUnDock"]{
    position:relative; box-sizing:border-box;
    width:22px !important; height:22px !important; margin-top:-2px;
    border-radius:50% !important;
    background:rgba(255,255,255,.16) !important; background-image:none !important;
    border:1px solid rgba(255,255,255,.35) !important;
    cursor:pointer; filter:none !important; opacity:1 !important;
    transition:background .2s, transform .2s, box-shadow .2s;
}
[class*="dhtmlxInfoButtonShowHide"]:before{
    content:""; position:absolute; top:50%; left:50%;
    width:6px; height:6px;
    border-left:2px solid #fff; border-bottom:2px solid #fff;
    transform:translate(-30%,-50%) rotate(45deg);            /* panah kiri  */
    transition:border-color .2s;
}
[class*="dhtmlxInfoButtonShowHide_ver"]:before{ transform:translate(-50%,-25%) rotate(135deg); }   /* panah atas */
[class*="Collapsed"] [class*="dhtmlxInfoButtonShowHide"]:before{ transform:translate(-70%,-50%) rotate(-135deg); } /* panah kanan saat tertutup */
[class*="Collapsed"] [class*="dhtmlxInfoButtonShowHide_ver"]:before{ transform:translate(-50%,-75%) rotate(-45deg); }
[class*="dhtmlxInfoButtonShowHide"]:hover,
[class*="dhtmlxInfoButtonDock"]:hover, [class*="dhtmlxInfoButtonUnDock"]:hover{
    background:#fff !important; transform:scale(1.08);
    box-shadow:0 3px 10px rgba(0,0,0,.25);
}
[class*="dhtmlxInfoButtonShowHide"]:hover:before{ border-color:var(--tl-primary); }

/* b) Tombol close tab: lingkaran kecil "×", merah saat di-hover */
[class*="dhx_tab_element"] img[src*="close"],
[class*="dhx_tab_element"] [class*="close"],
[class*="dhx_tab_close"]{
    box-sizing:border-box !important;
    width:16px !important; height:16px !important;
    padding:16px 0 0 0 !important;              /* sembunyikan gambar asli */
    overflow:hidden; border:none !important; border-radius:50%;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23e2e8f0'/%3E%3Cpath d='M5.8 5.8l4.4 4.4m0-4.4l-4.4 4.4' stroke='%2364748b' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") center/16px 16px no-repeat !important;
    background-color:transparent !important;
    opacity:1 !important; filter:none !important; cursor:pointer;
    vertical-align:middle; transition:transform .15s;
}
[class*="dhx_tab_element_active"] img[src*="close"],
[class*="dhx_tab_element_active"] [class*="close"]{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23ffffff'/%3E%3Cpath d='M5.8 5.8l4.4 4.4m0-4.4l-4.4 4.4' stroke='%2394a3b8' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") !important;
}
[class*="dhx_tab_element"] img[src*="close"]:hover,
[class*="dhx_tab_element"] [class*="close"]:hover,
[class*="dhx_tab_close"]:hover{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23ef4444'/%3E%3Cpath d='M5.5 5.5l5 5m0-5l-5 5' stroke='%23fff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") !important; transform:scale(1.12);
}

/* c) Deretan tab: dikenali dari strukturnya (elemen yang berisi tab),
      apa pun nama class wadahnya. Lebar tab mengikuti judul. */
:has(> [class*="dhx_tab_element"]){
    display:flex !important; align-items:center !important; gap:4px;
    padding:0 6px !important; box-sizing:border-box;
    overflow-x:auto !important; overflow-y:hidden !important; scrollbar-width:thin;
    background:#fff !important; background-image:none !important; border:none !important;
}
:has(> [class*="dhx_tab_element"])::-webkit-scrollbar{ height:4px; }
:has(> [class*="dhx_tab_element"]) > [class*="dhx_tab_element"]{
    position:relative !important; left:auto !important; top:auto !important;
    width:auto !important; max-width:260px;
    height:24px !important; line-height:24px !important;
    flex:0 0 auto; box-sizing:border-box !important;
    padding:0 14px !important; margin:0 !important;
    white-space:nowrap; text-align:left !important;
    border-radius:999px !important;
}
:has(> [class*="dhx_tab_element"]) > [class*="dhx_tab_element"]:has(img[src*="close"]),
:has(> [class*="dhx_tab_element"]) > [class*="dhx_tab_element"]:has([class*="close"]){
    padding-right:28px !important;
}
:has(> [class*="dhx_tab_element"]) > [class*="dhx_tab_element"] span{
    position:static !important; display:block; width:auto !important; height:auto !important;
    line-height:24px !important; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}
/* elemen lain di dalam deretan tab (garis bawah, gambar sudut, dll.) disembunyikan */
:has(> [class*="dhx_tab_element"]) > :not([class*="dhx_tab_element"]){ display:none !important; }
/* tombol scroll ◂ ▸ bawaan DHTMLX tidak diperlukan lagi (deretan tab bisa digeser) */
[class*="dhx_tablist"] [class*="scroll"],
[class*="dhx_tabbar"] [class*="scroll"]:not([class*="content"]),
[class*="dhx_tablist"] > img, [class*="dhx_tabbar_zone"] > img{ display:none !important; }
/* garis abu-abu tebal bawaan di bawah deretan tab */
[class*="dhx_tablist_zone"]{ border:none !important; border-bottom:1px solid var(--tl-border) !important; background:#fff !important; background-image:none !important; }
[class*="dhx_tablist_zone"] > div:not(:has([class*="dhx_tab_element"])):not([class*="dhx_tab_element"]){ display:none !important; }

[class*="dhx_tab_element"] img[src*="close"],
[class*="dhx_tab_element"] [class*="close"]{
    position:absolute !important;
    left:auto !important; right:5px !important;
    top:50% !important; margin:-8px 0 0 0 !important;
    box-shadow:0 1px 3px rgba(0,0,0,.18);
}
