/*
 * E-TOR: jembatan kelas lama (Bootstrap 4 / INSPINIA lama) ke template baru (Bootstrap 5).
 * View lama tidak perlu diubah; kelasnya diberi tampilan baru di sini.
 */

/* ---------- kartu: ibox & panel ---------- */
.ibox,
.panel {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--theme-secondary-bg, #fff);
    border: 1px solid var(--theme-border-color);
    border-radius: var(--theme-border-radius-lg, .5rem);
    box-shadow: var(--theme-box-shadow-sm, 0 1px 2px rgba(0, 0, 0, .05));
    margin-bottom: 1.5rem;
}
.ibox.float-e-margins { margin-bottom: 1.5rem; }
.ibox-title,
.panel-heading {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 52px;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--theme-border-color);
    background: transparent;
}
.ibox-title h5,
.ibox-title h3,
.panel-heading h3,
.panel-heading h4,
.panel-heading h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1 1 auto;
}
.ibox-tools { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.ibox-content,
.panel-body { padding: 1.25rem; flex: 1 1 auto; }
.ibox-content + .ibox-content { border-top: 1px solid var(--theme-border-color); }
.ibox-footer,
.panel-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--theme-border-color); }
.panel-primary > .panel-heading { border-left: 3px solid var(--theme-primary); }
.panel-success > .panel-heading { border-left: 3px solid var(--theme-success); }
.panel-info > .panel-heading { border-left: 3px solid var(--theme-info); }
.panel-warning > .panel-heading { border-left: 3px solid var(--theme-warning); }
.panel-danger > .panel-heading { border-left: 3px solid var(--theme-danger); }
.panel-default > .panel-heading { border-left: 3px solid var(--theme-secondary); }

/* ---------- widget INSPINIA lama ---------- */
.widget {
    border-radius: var(--theme-border-radius-lg, .5rem);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--theme-border-color);
    background: var(--theme-secondary-bg, #fff);
}
.widget.no-padding { padding: 0; }
.widget h1, .widget h2, .widget h3 { font-weight: 700; margin-bottom: .25rem; }
.navy-bg   { background: var(--theme-primary) !important; color: #fff !important; }
.lazur-bg  { background: var(--theme-info) !important; color: #fff !important; }
.yellow-bg { background: var(--theme-warning) !important; color: #fff !important; }
.red-bg    { background: var(--theme-danger) !important; color: #fff !important; }
.blue-bg   { background: var(--theme-primary) !important; color: #fff !important; }
.white-bg  { background: var(--theme-secondary-bg, #fff) !important; }
.gray-bg   { background: var(--theme-tertiary-bg, #f5f6f8) !important; }
.navy-bg h1, .navy-bg h2, .navy-bg h3, .navy-bg h4, .navy-bg h5,
.lazur-bg h1, .lazur-bg h2, .lazur-bg h3, .lazur-bg h4, .lazur-bg h5,
.yellow-bg h1, .yellow-bg h2, .yellow-bg h3, .yellow-bg h4, .yellow-bg h5,
.red-bg h1, .red-bg h2, .red-bg h3, .red-bg h4, .red-bg h5 { color: #fff; }
.text-navy { color: var(--theme-primary) !important; }

/* ---------- utilitas lama ---------- */
.float-right { float: right !important; }
.float-left  { float: left !important; }
.text-right  { text-align: right !important; }
.text-left   { text-align: left !important; }
.font-bold   { font-weight: 600 !important; }
.no-margins  { margin: 0 !important; }
.no-padding  { padding: 0 !important; }
.full-width  { width: 100% !important; }
.block       { display: block !important; }
.m-xs { margin: .25rem !important; }
.m-t  { margin-top: 1rem !important; }
.m-b  { margin-bottom: 1rem !important; }
.m-t-xs { margin-top: .25rem !important; }
.m-r-sm { margin-right: .5rem !important; }
.p-m  { padding: 1rem 1.25rem !important; }
.p-xs { padding: .5rem !important; }
.sr-only {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.hr-line-dashed { border-top: 1px dashed var(--theme-border-color); height: 1px; margin: 1.25rem 0; background: transparent; }
.col-lg-offset-2 { margin-left: 16.666667%; }
@media (max-width: 991.98px) { .col-lg-offset-2 { margin-left: 0; } }

/* ---------- form ---------- */
.form-group { margin-bottom: 1rem; }
.form-group > label,
.form-group label:not(.form-check-label) { font-weight: 500; margin-bottom: .35rem; }
.help-block { display: block; margin-top: .25rem; font-size: .8125rem; }
.help-block:empty { display: none; }
.has-error .form-control { border-color: var(--theme-danger); }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.form-inline .form-group { margin-bottom: 0; display: flex; align-items: center; gap: .5rem; }
.input-group-addon {
    display: flex; align-items: center; padding: .375rem .75rem;
    background: var(--theme-tertiary-bg); border: 1px solid var(--theme-border-color); border-radius: var(--theme-border-radius);
}
select.form-control:not([multiple]):not([size]) {
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23697582' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 14px 10px;
}

/* ---------- tombol ---------- */
.btn-xs {
    --theme-btn-padding-y: .15rem;
    --theme-btn-padding-x: .45rem;
    --theme-btn-font-size: .75rem;
    --theme-btn-border-radius: var(--theme-border-radius-sm);
}
.btn-white {
    --theme-btn-color: var(--theme-body-color);
    --theme-btn-bg: var(--theme-secondary-bg, #fff);
    --theme-btn-border-color: var(--theme-border-color);
    --theme-btn-hover-color: var(--theme-body-color);
    --theme-btn-hover-bg: var(--theme-tertiary-bg);
    --theme-btn-hover-border-color: var(--theme-border-color);
    --theme-btn-active-color: var(--theme-body-color);
    --theme-btn-active-bg: var(--theme-tertiary-bg);
    --theme-btn-active-border-color: var(--theme-border-color);
}
.btn-group .btn-white.active { background: var(--theme-primary); border-color: var(--theme-primary); color: #fff; }

/* ---------- label & badge BS3/BS4 ---------- */
.label {
    display: inline-block; padding: .25em .55em; font-size: .75em; font-weight: 600; line-height: 1;
    border-radius: var(--theme-border-radius-sm); background: var(--theme-secondary-bg-subtle, #eef0f3); color: var(--theme-body-color);
}
.label-primary, .badge-primary { background: var(--theme-primary) !important; color: #fff !important; }
.label-success, .badge-success { background: var(--theme-success) !important; color: #fff !important; }
.label-info,    .badge-info    { background: var(--theme-info) !important; color: #fff !important; }
.label-warning, .badge-warning { background: var(--theme-warning) !important; color: #fff !important; }
.label-danger,  .badge-danger  { background: var(--theme-danger) !important; color: #fff !important; }
.label-default, .badge-secondary { background: var(--theme-secondary) !important; color: #fff !important; }

/* ---------- modal BS4 ---------- */
.modal-header .close,
.alert .close,
button.close {
    margin-left: auto;
    padding: .25rem .5rem;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    opacity: .55;
    color: inherit;
    cursor: pointer;
}
.modal-header .close:hover, button.close:hover { opacity: .9; }
.modal-header .close:first-child { order: 2; }
.inmodal .modal-header { flex-wrap: wrap; justify-content: center; text-align: center; padding: 1.5rem 1.25rem 1rem; }
.inmodal .modal-header .close { position: absolute; top: .75rem; right: .75rem; }
.inmodal .modal-title { width: 100%; font-size: 1.25rem; }
.modal-icon { display: block; font-size: 3rem; color: var(--theme-secondary-color); margin-bottom: .5rem; width: 100%; }
.inmodal .modal-body { background: var(--theme-tertiary-bg); }
.dropdown-menu-right { right: 0; left: auto; }

/* ---------- chat / pesan INSPINIA lama ---------- */
.chat-user { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--theme-border-color); }
.chat-avatar { width: 36px; height: 36px; border-radius: 50%; }
.chat-user-name { font-weight: 600; }
.message { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--theme-border-color); }
.message-avatar { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; }
.message-author { font-weight: 600; }
.message-date { float: right; font-size: .75rem; color: var(--theme-secondary-color); }
.message-content { display: block; margin-top: .25rem; }

/* ---------- tabel ---------- */
.table > :not(caption) > * > th { font-weight: 600; }
.table-noborder td, .table-noborder th { border: 0 !important; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select { display: inline-block; width: auto; }
.html5buttons { margin-left: .5rem; }
.dt-buttons .btn { margin-left: .25rem; }

/* ---------- plugin lama di dalam BS5 ---------- */
.select2-container { z-index: 100000; }
.select2-container .select2-selection--single { height: calc(1.5em + .75rem + 2px); }
.chosen-container { font-size: inherit; }
.sweet-alert h2 { font-size: 1.5rem; }
.note-editor.note-frame { border-color: var(--theme-border-color); }

/* ---------- menu & judul halaman ---------- */
.side-nav .menu-icon .fa { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.sidenav-user .sidenav-user-name { display: block; }
.etor-brand-text { font-weight: 700; letter-spacing: .02em; color: #fff; font-size: 1.05rem; }
.logo-dark .etor-brand-text { color: var(--theme-body-color); }
.etor-brand { display: inline-flex; align-items: center; gap: .5rem; }
.etor-brand img { height: 30px; width: auto; }
.page-title-head { margin-bottom: 1.25rem; }
.app-topbar .topbar-title { font-weight: 600; font-size: 1rem; margin: 0; }

/* ---------- grid Bootstrap 4: anak .row tanpa kelas col-* selebar isinya ---------- */
.content-page .row > :not([class*="col"]) { width: auto; max-width: 100%; }

/* garis tepi tombol putih */
.btn-white { --theme-btn-border-width: 1px; border: 1px solid var(--theme-border-color); }

/* ---------- DataTables 2 dengan opsi dom lama ('<"html5buttons"B>lTfgitp') ---------- */
.dt-container { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: .75rem; }
.dt-container > * { flex: 0 0 100%; max-width: 100%; }
.dt-container > .dt-length { flex: 0 0 auto; order: 1; }
.dt-container > .dt-search { flex: 0 0 auto; order: 2; margin-left: auto; }
.dt-container > .html5buttons { flex: 0 0 auto; order: 3; float: none; margin: 0; }
.dt-container > .dt-info { order: 4; color: var(--theme-secondary-color); }
.dt-container > table, .dt-container > .dt-scroll { order: 5; margin: 0 !important; }
.dt-container > .dt-paging { order: 6; display: flex; justify-content: flex-end; }
.dt-container > .dt-autosize { order: 7; }
.dt-container .dt-length select { display: inline-block; width: auto; margin-right: .35rem; }
.dt-container .dt-search input { display: inline-block; width: 220px; margin-left: .35rem; }
@media (max-width: 767.98px) { .dt-container > .dt-search { margin-left: 0; } }
