/* ===== TMS CKS — tema compact modern (Bootstrap 5) ===== */
:root {
    --app-primary: #2563eb;
    --app-primary-soft: #eff4ff;
    --app-bg: #f5f7fb;
    --app-surface: #ffffff;
    --app-border: #e5e8ef;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --app-sidebar: #0f172a;
    --app-sidebar-text: #94a3b8;
    --app-sidebar-active: #ffffff;
    --app-sidebar-w: 248px;
    --app-topbar-h: 60px;
    --app-radius: 10px;

    --bs-primary: var(--app-primary);
    --bs-primary-rgb: 37, 99, 235;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-font-size: .8125rem;
    --bs-body-color: var(--app-text);
    --bs-body-bg: #ffffff;
    --bs-border-color: var(--app-border);
    --bs-border-radius: 8px;
}

body { -webkit-font-smoothing: antialiased; background: var(--app-bg); }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; margin-left: var(--app-sidebar-w); display: flex; flex-direction: column; transition: margin .2s ease; }
.app-content { padding: 20px 24px 32px; }

.app-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--app-sidebar-w); z-index: 1040;
    background: var(--app-sidebar); display: flex; flex-direction: column; transition: transform .2s ease;
}
.sidebar-brand {
    height: var(--app-topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 20px;
    color: #fff; text-decoration: none; font-size: 15px; letter-spacing: .2px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand img { width: 30px; height: 30px; border-radius: 8px; background: #fff; object-fit: contain; }
.sidebar-brand:hover { color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; margin-bottom: 2px;
    border: 0; border-radius: 8px; background: none; color: var(--app-sidebar-text); font-size: 13px; text-align: left; text-decoration: none;
}
.sidebar-nav .nav-link .bi { font-size: 15px; }
.sidebar-nav .nav-link:hover { color: #e2e8f0; background: rgba(255,255,255,.05); }
.sidebar-nav .nav-link.active { color: var(--app-sidebar-active); background: var(--app-primary); }
.sidebar-nav .nav-child { padding-left: 38px; font-size: 12.5px; }
.sidebar-nav .nav-child .bi { font-size: 13px; }
.sidebar-nav .caret { margin-left: auto; font-size: 11px !important; transition: transform .2s; }
.sidebar-nav .nav-toggle.collapsed .caret { transform: rotate(-90deg); }
.sidebar-backdrop { display: none; }

.app-topbar {
    position: sticky; top: 0; z-index: 1030; height: var(--app-topbar-h); display: flex; align-items: center; gap: 12px;
    padding: 0 24px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--app-border);
}
.topbar-title h1 { font-size: 16px; font-weight: 600; margin: 0; }
.topbar-title p { font-size: 12px; color: var(--app-muted); margin: 0; }
.btn-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; color: var(--app-muted); }
.btn-icon:hover { background: var(--app-bg); }
.user-chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--app-border); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 12.5px; }
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--app-primary-soft); color: var(--app-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }

body.sidebar-collapsed .app-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .app-main { margin-left: 0; }

@media (max-width: 991.98px) {
    .app-main { margin-left: 0; }
    .app-sidebar { transform: translateX(-100%); }
    body.sidebar-open .app-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(15,23,42,.4); }
    .app-content { padding: 16px; }
    .app-topbar { padding: 0 16px; }
    .search-box { width: auto; flex: 1; }
}

/* ---------- Komponen ---------- */
.card { border: 1px solid var(--app-border); border-radius: var(--app-radius); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--app-surface); border-bottom: 1px solid var(--app-border); padding: 12px 16px; }
.card-header:first-child { border-radius: var(--app-radius) var(--app-radius) 0 0; }

.btn { font-size: 12.5px; font-weight: 500; border-radius: 8px; }
.btn-sm { padding: 5px 12px; }
.btn-primary { --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary); --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; }
.btn-light { --bs-btn-bg: #f1f3f7; --bs-btn-border-color: #f1f3f7; }

.form-control, .form-select { font-size: 13px; border-radius: 8px; border-color: var(--app-border); }
.form-control:focus, .form-select:focus { border-color: #93b4f8; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-label { font-size: 12px; font-weight: 500; color: #374151; margin-bottom: 4px; }

.search-box { position: relative; width: 260px; max-width: 100%; }
.search-box .bi { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--app-muted); font-size: 13px; }
.search-box .form-control { padding-left: 30px; }

.modal-content { border: 0; border-radius: 12px; box-shadow: 0 20px 40px rgba(15,23,42,.18); }
.modal-header, .modal-footer { border-color: var(--app-border); padding: 12px 18px; }
.modal-title { font-size: 14.5px; font-weight: 600; }

/* ---------- Tabel modern (DataTables) ---------- */
.table-card { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--app-border); }
.table-toolbar .toolbar-title { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.table-toolbar .toolbar-title h2 { font-size: 14px; font-weight: 600; margin: 0; }
.table-toolbar .toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count-badge { font-size: 11px; font-weight: 600; color: var(--app-primary); background: var(--app-primary-soft); border-radius: 999px; padding: 2px 8px; min-width: 24px; text-align: center; }
.btn-ghost { border: 1px solid var(--app-border); background: #fff; color: var(--app-muted); }
.btn-ghost:hover { background: var(--app-bg); color: var(--app-text); }
.btn-ghost.spinning .bi { animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.search-box .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--app-muted); border: 1px solid var(--app-border); border-radius: 4px; padding: 0 5px; background: #fff; pointer-events: none; }
.search-box .form-control:focus ~ .kbd, .search-box .form-control:not(:placeholder-shown) ~ .kbd { display: none !important; }

/* loading tabel: overlay truk (pengganti kotak "processing") */
.table-progress { height: 2px; }
.table-card.is-loading tbody, .tl-host.is-loading tbody { opacity: .45; transition: opacity .15s; }
div.dt-processing { display: none !important; }

.table { --bs-table-bg: #ffffff; --bs-table-hover-bg: #f8faff; font-size: 12.5px; margin: 0; }
table.dataTable { border-collapse: separate !important; border-spacing: 0; }
table.dataTable th.dt-type-numeric, table.dataTable td.dt-type-numeric { text-align: left; }
table.dataTable th.dt-type-numeric div.dt-column-header { flex-direction: row; }
.table > thead th { position: sticky; top: 0; z-index: 1; background: #fafbfc; color: #6b7280; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--app-border); padding: 10px 16px; white-space: nowrap; }
.table > tbody td { padding: 10px 16px; border-bottom: 1px solid #f1f3f7; vertical-align: middle; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table > tbody tr { transition: background-color .12s; }
table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order,
table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order { opacity: .5; }
table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc { color: var(--app-primary); }

.cell-no { color: #9ca3af; font-variant-numeric: tabular-nums; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main .avatar-chip { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; }
.cell-main .title { font-weight: 600; color: var(--app-text); line-height: 1.3; }
.cell-main .sub { font-size: 11px; color: #9ca3af; line-height: 1.3; }
.cell-time { color: var(--app-muted); white-space: nowrap; }
.cell-time .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #d1d5db; margin-right: 6px; vertical-align: middle; }
.cell-time.recent .dot { background: #22c55e; }

.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--app-muted); border-radius: 8px; border: 0; }
.row-actions .btn:hover { background: var(--app-primary-soft); color: var(--app-primary); }
.row-actions .btn.danger:hover { background: #fef2f2; color: #dc2626; }
@media (hover: hover) and (min-width: 768px) {
    .row-actions .btn { opacity: .55; transition: opacity .12s; }
    tr:hover .row-actions .btn, .row-actions .btn:focus-visible { opacity: 1; }
}

/* footer: jumlah per halaman, info, paginasi */
/* integrasi bootstrap5 DataTables memakai .row/.col */
.table-card .dt-container > .row { margin: 0 !important; --bs-gutter-x: 0; }
.table-card .dt-container > .row > [class*="col"] { padding: 0; }
.table-card .dt-container > .row:last-child { padding: 10px 16px; border-top: 1px solid var(--app-border); background: #fcfcfd; border-radius: 0 0 var(--app-radius) var(--app-radius); }
.table-card .dt-container .dt-layout-start { display: flex !important; align-items: center; gap: 14px; }
div.dt-container .dt-info { font-size: 12px; color: var(--app-muted); padding-top: 0 !important; }
div.dt-container .dt-length { font-size: 12px; color: var(--app-muted); }
div.dt-container .dt-length select { font-size: 12px; border-radius: 8px; padding: 3px 26px 3px 8px; border-color: var(--app-border); }
div.dt-container .dt-paging .pagination { gap: 4px; margin: 0; }
div.dt-container .dt-paging .page-link { font-size: 12px; min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px !important; border: 1px solid transparent; color: var(--app-text); background: transparent; padding: 0 8px; }
div.dt-container .dt-paging .page-link:hover { background: var(--app-bg); }
div.dt-container .dt-paging .page-item.active .page-link { background: var(--app-primary); border-color: var(--app-primary); color: #fff; box-shadow: 0 2px 6px rgba(37,99,235,.3); }
div.dt-container .dt-paging .page-item.disabled .page-link { color: #d1d5db; }

/* empty state */
.empty-state { padding: 40px 16px; text-align: center; color: var(--app-muted); }
.empty-state .icon { width: 52px; height: 52px; border-radius: 14px; background: var(--app-bg); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: #9ca3af; margin-bottom: 10px; }
.empty-state .title { font-weight: 600; color: var(--app-text); font-size: 13px; }
.empty-state .text { font-size: 12px; }
table.dataTable td.dt-empty { padding: 0 !important; background: #fff; }

/* HP: baris tampil sebagai kartu */
@media (max-width: 767.98px) {
    .table-toolbar .toolbar-actions { width: 100%; }
    .table-toolbar .search-box { flex: 1; }
    .table.table-cards thead { display: none; }
    .table.table-cards, .table.table-cards tbody { display: block; }
    .table.table-cards tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid #f1f3f7; }
    .table.table-cards tbody td { display: block; padding: 0; border: 0; }
    .table.table-cards tbody td.cell-no-col { display: none; }
    .table.table-cards tbody td.row-actions { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
    .table.table-cards tbody td[data-label]:not(.cell-primary-col)::before { content: attr(data-label) ' · '; color: #9ca3af; font-size: 11px; }
    .table.table-cards tbody td.cell-secondary { font-size: 11.5px; padding-left: 42px; grid-column: 1 / -1; }
    .table.table-cards tbody td.cell-secondary .pill { white-space: normal; }
    .table.table-cards tbody td.cell-secondary:has(.cell-time.empty) { display: none; }
    .table.table-cards tbody td.dt-empty { grid-column: 1 / -1; }
    .table-card .dt-container > .row:last-child > div { justify-content: center !important; margin: 4px 0 !important; }
}

.dropdown-menu { font-size: 12.5px; border-color: var(--app-border); border-radius: 10px; padding: 4px; }
.dropdown-item { border-radius: 6px; padding: 6px 10px; }
.dropdown-item .bi { width: 18px; }

/* ---------- Select2 ---------- */
.select2-container--bootstrap-5 .select2-selection { font-size: 13px; border-color: var(--app-border); border-radius: 8px; min-height: calc(1.5em + .75rem + 2px); }

/* ---------- SweetAlert ---------- */
.swal2-popup { font-family: var(--bs-body-font-family); font-size: 13px; border-radius: 14px; padding: 20px; width: 24em; }
.swal2-title { font-size: 17px; font-weight: 600; color: var(--app-text); padding-top: 4px; }
.swal2-html-container { font-size: 13px; color: var(--app-muted); }
.swal2-icon { transform: scale(.7); margin: 8px auto 0; }

/* ---------- Toast ---------- */
.app-toasts { position: fixed; bottom: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.app-toast { min-width: 260px; max-width: 380px; background: #111827; color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 12.5px; display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 10px 24px rgba(15,23,42,.25); animation: toast-in .18s ease-out; }
.app-toast .bi { font-size: 15px; }
.app-toast.success .bi { color: #4ade80; }
.app-toast.error .bi { color: #f87171; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: radial-gradient(1200px 600px at 10% -10%, #dbe7ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e0f2fe 0%, transparent 60%), var(--app-bg); }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--app-border); border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand img { width: 42px; height: 42px; object-fit: contain; }
.auth-brand h1 { font-size: 18px; font-weight: 700; margin: 0; }
.auth-brand p { font-size: 12px; color: var(--app-muted); margin: 0; }
.input-icon { position: relative; }
.input-icon .bi { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--app-muted); }
.input-icon .form-control { padding-left: 34px; height: 38px; }

/* ---------- Ruang napas tabel di dalam card ---------- */
.table-card .table-toolbar { border-bottom: 0; padding: 16px 20px 12px; }
.table-card .table-progress { margin: 0 20px; border-radius: 2px; }
.table-card .dt-container { padding: 4px 12px 0; }
.table-card .table > thead th { background: #f6f7f9; border-bottom: 0; }
.table-card .table > thead th:first-child { border-radius: 8px 0 0 8px; }
.table-card .table > thead th:last-child { border-radius: 0 8px 8px 0; }
.table-card .table > tbody td:first-child { border-radius: 8px 0 0 8px; }
.table-card .table > tbody td:last-child { border-radius: 0 8px 8px 0; }
.table-card .dt-container > .row:last-child { margin: 8px -12px 0 !important; padding: 12px 20px; }
@media (max-width: 767.98px) {
    .table-card .table-toolbar { padding: 14px 16px 10px; }
    .table-card .table-progress { margin: 0 16px; }
    .table-card .dt-container { padding: 0 4px; }
    .table-card .table.table-cards tbody tr { border-radius: 10px; padding: 12px; }
    .table-card .dt-container > .row:last-child { margin: 8px -4px 0 !important; }
}

/* Layar sedang: tabel boleh digulir ke samping, jangan sampai kolom aksi terpotong */
.table-card .dt-layout-table, .table-card .dt-layout-table > .dt-layout-full { overflow-x: auto; min-width: 0; max-width: 100%; }
.table-card .dt-layout-table table.dataTable { min-width: 640px; }
.table-card .row-actions { min-width: 80px; }
@media (max-width: 767.98px) {
    .table-card .dt-layout-table table.dataTable { min-width: 0; }
}
/* Kolom pelengkap disembunyikan di layar sedang supaya kolom aksi tidak terdorong keluar */
@media (min-width: 768px) and (max-width: 1099.98px) {
    table.dataTable .col-optional { display: none; }
}

/* ---------- Form informatif ---------- */
.modal-subtitle { font-size: 12px; color: var(--app-muted); margin-top: 2px; }
.modal-body { padding: 18px; }
.form-section + .form-section { border-top: 1px dashed var(--app-border); padding-top: 16px; }
.form-section-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.form-section-icon { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 8px; background: var(--app-primary-soft); color: var(--app-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--app-text); line-height: 1.3; }
.form-section-desc { font-size: 11.5px; color: var(--app-muted); }
.form-field .form-text { font-size: 11px; color: #8b93a1; margin-top: 4px; }
.form-field .form-text .bi { font-size: 10px; }
.char-count { font-size: 10.5px; color: #a0a7b4; font-variant-numeric: tabular-nums; }
.char-count.near { color: #d97706; }
.char-count.full { color: #dc2626; font-weight: 600; }
.input-group-text { background: #f8f9fb; border-color: var(--app-border); color: #8b93a1; font-size: 13px; border-radius: 8px 0 0 8px; }
.input-group > .form-control { border-radius: 0 8px 8px 0 !important; }
.form-control::placeholder { color: #b6bcc7; font-size: 12.5px; }
.form-control.text-uppercase::placeholder { text-transform: none; }
.form-control.is-valid-soft { border-color: #86efac; }
.form-legend { font-size: 11.5px; color: var(--app-muted); }

.record-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--app-border); }
.record-meta .meta-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #9ca3af; font-weight: 600; }
.record-meta .meta-value { font-size: 12px; color: var(--app-text); }
.record-meta .meta-sub { font-size: 11px; color: var(--app-muted); }
.record-meta .usage-ok { color: #059669; }
.record-meta .usage-warn { color: #b45309; }
@media (max-width: 575.98px) { .record-meta { grid-template-columns: 1fr; } }

/* ---------- Panduan halaman (offcanvas) ---------- */
.btn-guide { display: inline-flex; align-items: center; gap: 2px; border: 1px solid #c7d7fe; background: var(--app-primary-soft); color: var(--app-primary); border-radius: 999px; padding: 5px 14px; font-weight: 600; }
.btn-guide:hover, .btn-guide:focus { background: #dbe7ff; color: #1d4ed8; border-color: #a5bffc; }
@media (max-width: 575.98px) { .btn-guide span { display: none; } .btn-guide { padding: 6px 10px; } }
.guide-panel { --bs-offcanvas-width: 440px; border-left: 0 !important; box-shadow: -12px 0 40px rgba(15,23,42,.15); }
.guide-panel .offcanvas-header { border-bottom: 1px solid var(--app-border); padding: 14px 20px; }
.guide-panel .offcanvas-title { font-size: 16px; font-weight: 700; }
.guide-panel .offcanvas-body { padding: 18px 20px 24px; }
.guide-hero { display: flex; gap: 14px; padding: 18px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0f2a5f 0%, #1d4ed8 100%); margin-bottom: 20px; }
.guide-hero-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.14); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.guide-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; opacity: .7; }
.guide-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.guide-summary { font-size: 12.5px; opacity: .9; margin: 4px 0 0; }
.guide-heading { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--app-text); margin: 18px 0 10px; }
.guide-heading .bi { color: #6b7280; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-chip { font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 999px; background: #eef1f5; color: #374151; }
.guide-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.guide-steps li { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--app-border); border-radius: 12px; background: #fff; }
.guide-step-no { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--app-primary); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.guide-step-title { font-weight: 600; font-size: 13px; }
.guide-step-text { font-size: 12.5px; color: #4b5563; }
.guide-used { display: grid; grid-template-columns: 120px 1fr; margin: 0; border: 1px solid var(--app-border); border-radius: 12px; padding: 4px 14px; }
.guide-used dt, .guide-used dd { padding: 9px 0; margin: 0; font-size: 12.5px; border-bottom: 1px dashed var(--app-border); }
.guide-used dt { font-weight: 600; padding-right: 10px; }
.guide-used dd { color: #4b5563; }
.guide-used dt:nth-last-child(2), .guide-used dd:last-child { border-bottom: 0; }
.guide-notes { margin: 0; padding: 12px 14px 12px 30px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; font-size: 12.5px; color: #92400e; }
.guide-updated { text-align: right; font-size: 11px; color: #9ca3af; margin-top: 20px; }

/* ---------- Pill status & dokumen ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill .bi { font-size: 12px; }
.pill-success { background: #ecfdf5; color: #047857; }
.pill-warning { background: #fffbeb; color: #b45309; }
.pill-danger { background: #fef2f2; color: #b91c1c; }
.pill-muted { background: #f1f3f6; color: #6b7280; }
.pill-info { background: var(--app-primary-soft); color: var(--app-primary); }
.cell-sub { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.doc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.doc-item { border: 1px solid var(--app-border); border-radius: 10px; padding: 8px 10px; background: #fff; }
.doc-name { font-size: 11px; font-weight: 700; letter-spacing: .4px; color: #6b7280; }
.doc-date { font-size: 12px; font-weight: 600; }
.doc-no { font-size: 11px; color: #9ca3af; }
.doc-ok .doc-date { color: #047857; }
.doc-soon { border-color: #fde68a; background: #fffbeb; } .doc-soon .doc-date { color: #b45309; }
.doc-expired { border-color: #fecaca; background: #fef2f2; } .doc-expired .doc-date { color: #b91c1c; }
.doc-none .doc-date { color: #9ca3af; font-weight: 500; }
@media (max-width: 575.98px) { .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-select.is-invalid + .select2 .select2-selection { border-color: var(--bs-form-invalid-border-color); }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder { color: #b6bcc7; font-size: 12.5px; }
.sim-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--app-border); border-radius: 10px; }
.sim-row .form-check { margin: 0; }
.sim-row .form-check-label { font-size: 12.5px; font-weight: 600; }
.doc-grid > .text-secondary { grid-column: 1 / -1; }
/* ---------- Operations (Planner & PPIC) ---------- */
.toolbar-actions .filter-select + .select2-container .select2-selection { min-height: 31px; font-size: 12.5px; }
.toolbar-actions .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered { flex-wrap: nowrap; overflow: hidden; }
.booking-list { display: grid; gap: 8px; }
.booking-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--app-border); border-radius: 10px; background: #fff; }
.booking-date { font-weight: 700; font-size: 12.5px; color: var(--app-primary); }
.booking-dest { font-size: 12.5px; }
.booking-empty { font-size: 12.5px; color: #9ca3af; padding: 10px 12px; border: 1px dashed var(--app-border); border-radius: 10px; }
.wo-summary { padding: 10px 12px; border-radius: 10px; background: #f6f7f9; }
.wo-summary-title { font-weight: 600; font-size: 13px; }
@media (max-width: 767.98px) {
    .toolbar-actions .select2-container { width: calc(50% - 4px) !important; flex: 1 1 calc(50% - 4px); }
    .toolbar-actions { flex-wrap: wrap; }
    .booking-item { grid-template-columns: 1fr auto; }
    .booking-item .booking-dest { grid-column: 1 / -1; grid-row: 2; }
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice { font-size: 12px; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 6px; background: var(--app-primary-soft); border-color: #c7d7fe; color: var(--app-primary); }
.select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field { font-size: 12.5px; }
.select2-container--bootstrap-5 .select2-selection--multiple { min-height: calc(1.5em + .75rem + 2px); }
/* Tombol aksi berlabel (mis. "Bongkar") di kolom aksi */
.row-actions .btn.btn-labeled { width: auto; padding: 0 12px; opacity: 1; color: var(--app-primary); background: var(--app-primary-soft); font-size: 12px; font-weight: 600; }
.row-actions .btn.btn-labeled:hover { background: var(--app-primary); color: #fff; }
/* ---------- Proof of Delivery ---------- */
.seg .btn { font-size: 12px; padding: 4px 12px; }
.mini-flag { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: #9ca3af; margin-right: 6px; }
.mini-flag.on { color: #047857; }
.wo-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.wo-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.fact { padding: 10px 12px; border: 1px solid var(--app-border); border-radius: 10px; background: #fff; }
.fact-label { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.fact-value { font-size: 13px; font-weight: 600; }
.wo-do-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; background: #f6f7f9; }
.wo-do-table td { font-size: 12.5px; }
.money-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.money-field .form-label { font-size: 11.5px; }
.money-field .form-text { font-size: 11px; margin-top: 2px; }
.dtl-card { border: 1px solid var(--app-border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.dtl-head { display: flex; justify-content: space-between; margin-bottom: 10px; }
/* Toolbar dengan banyak filter: turun baris di layar sedang, kotak cari tetap terbaca */
@media (max-width: 1199.98px) {
    .table-toolbar { flex-wrap: wrap; }
    .table-toolbar .toolbar-actions { flex-wrap: wrap; }
    .table-toolbar .search-box { min-width: 220px; flex: 1; }
}
/* Form POD */
.pod-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pod-summary > div { padding: 10px 14px; border-radius: 10px; background: #f6f7f9; display: flex; flex-direction: column; }
.pod-summary span { font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .4px; }
.pod-summary b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pod-summary .is-total { background: var(--app-primary-soft); }
.pod-summary .is-total b { color: var(--app-primary); }
.pod-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.pod-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 720px; }
.pod-grid-base { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pf .form-label { font-size: 11.5px; font-weight: 600; margin-bottom: 3px; color: #374151; }
.pf .form-control { font-variant-numeric: tabular-nums; }
.pf .input-group-text { font-size: 11px; color: #6b7280; background: #f6f7f9; padding: 0 8px; }
.pf .is-locked .form-control, .pf .is-locked .input-group-text { background: #f3f4f6; color: #6b7280; }
.dtl-card { padding: 0; overflow: hidden; }
.dtl-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0; background: #f9fafb; border-bottom: 1px solid var(--app-border); }
.dtl-head .min-w-0 { min-width: 0; flex: 1; }
.dtl-no { flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--app-primary); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dtl-title { font-weight: 700; font-size: 13.5px; }
.dtl-sum { text-align: right; white-space: nowrap; }
.dtl-sum b { font-variant-numeric: tabular-nums; }
.pod-group { padding: 12px 14px; }
.pod-group + .pod-group { border-top: 1px dashed var(--app-border); }
.pod-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
@media (max-width: 1199.98px) { .pod-grid-base { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .pod-grid, .pod-grid-3, .pod-grid-base { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pod-summary { grid-template-columns: 1fr; }
    .dtl-head { flex-wrap: wrap; }
}
.pod-grid-rate { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 767.98px) { .pod-grid-rate { grid-template-columns: 1fr 1fr; } .pod-grid-rate > .pf:first-child { grid-column: 1 / -1; } }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option { font-size: 12.5px; padding: 6px 10px; }
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { font-size: 12.5px; padding: 4px 8px; }
/* Detail WO: keterangan aksi & konfirmasi hapus */
.wo-actions-sep { flex: 1; }
.wo-notices { display: grid; gap: 6px; margin-bottom: 12px; }
.wo-notices:empty { display: none; }
.wo-notice { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; }
.wo-notice .bi { margin-top: 2px; }
.wo-notice-info { background: var(--app-primary-soft); color: #1e40af; }
.wo-notice-warning { background: #fffbeb; color: #92400e; }
.wo-notice-muted { background: #f3f4f6; color: #4b5563; }
.del-summary { border: 1px solid var(--app-border); border-radius: 10px; padding: 4px 12px; margin-bottom: 10px; }
.del-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--app-border); }
.del-row:last-child { border-bottom: 0; }
.del-row span { color: #6b7280; white-space: nowrap; }
.del-row b { text-align: right; font-weight: 600; color: var(--app-text); }
.del-warn { display: flex; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 12.5px; margin-bottom: 12px; }
.del-reason .form-label { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.del-reason .form-text { font-size: 11px; }
.del-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.del-chip { border: 1px solid var(--app-border); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; color: #374151; }
.del-chip:hover, .del-chip.active { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.swal2-html-container.text-start { text-align: left; margin: 12px 20px 0; }
.swal2-validation-message { font-size: 12px; }
/* Buat WO */
.ship-entry { border: 1px dashed var(--app-border); border-radius: 12px; padding: 12px; background: #fafbfc; margin-bottom: 10px; }
.ship-list { display: grid; gap: 8px; }
.ship-item { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--app-border); border-radius: 10px; background: #fff; }
.ship-item.is-cost { border-color: #93b4fd; background: #f8faff; }
.ship-main { min-width: 0; }
.ship-side { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ship-side .form-check { margin: 0; }

/* ===== Loader truk 2D: jalan + asap knalpot ===== */
.truck-loader { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--app-muted); font-size: 12px; font-weight: 500; }
.truck-loader .tl-svg { width: 112px; height: auto; overflow: visible; }
.truck-loader.sm .tl-svg { width: 76px; }
.tl-road { stroke: #cbd5e1; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 12 9; animation: tl-road .6s linear infinite; }
.tl-box { fill: var(--app-primary); }
.tl-stripe { fill: #93b4fb; }
.tl-cab { fill: #1e40af; }
.tl-window { fill: #dbeafe; }
.tl-light { fill: #fbbf24; }
.tl-chassis, .tl-pipe { fill: #334155; }
.tl-body { animation: tl-bump .32s ease-in-out infinite alternate; }
.tl-wheel circle { fill: #1f2937; stroke: #fff; stroke-width: 2; }
.tl-wheel .tl-spoke { stroke: #94a3b8; stroke-width: 1.6; stroke-linecap: round; transform-box: fill-box; transform-origin: center; animation: tl-spin .45s linear infinite; }
.tl-smoke circle { fill: #94a3b8; opacity: 0; transform-box: fill-box; transform-origin: center; animation: tl-puff 1.2s ease-out infinite; }
.tl-smoke circle:nth-child(2) { animation-delay: .4s; }
.tl-smoke circle:nth-child(3) { animation-delay: .8s; }
@keyframes tl-road { to { stroke-dashoffset: 21; } }
@keyframes tl-bump { from { transform: translateY(0); } to { transform: translateY(-1px); } }
@keyframes tl-spin { to { transform: rotate(360deg); } }
@keyframes tl-puff {
    0% { opacity: .9; transform: translate(0, 0) scale(.45); }
    55% { opacity: .55; }
    100% { opacity: 0; transform: translate(-26px, -14px) scale(2.1); }
}
@media (prefers-reduced-motion: reduce) { .tl-road, .tl-body, .tl-spoke, .tl-smoke circle { animation-duration: 2.4s; } }

/* overlay di area tabel */
.tl-host { position: relative; }
.tl-host.is-loading { min-height: 170px; }
.table-loader { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55);
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, visibility 0s .15s; }
.tl-host.is-loading .table-loader { opacity: 1; visibility: visible; transition: opacity .15s .2s, visibility 0s .2s; }
.table-loader .truck-loader { position: sticky; top: 40%; background: #fff; border: 1px solid var(--app-border); border-radius: 12px; padding: 10px 18px 8px; box-shadow: 0 6px 20px rgba(15, 23, 42, .08); }

/* overlay layar penuh (App.busy) */
.app-busy { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .18);
    opacity: 0; visibility: hidden; transition: opacity .15s, visibility 0s .15s; }
.app-busy.show { opacity: 1; visibility: visible; transition: opacity .15s .25s, visibility 0s .25s; }
.app-busy-card { background: #fff; border-radius: 14px; padding: 14px 24px 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }

/* ===== Quotation: daftar tarif & biaya rute ===== */
.cell-pick { width: 36px; }
.min-w-0 { min-width: 0; }
.rate-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.rate-toolbar .search-box { margin-left: auto; min-width: 220px; }
.rate-stats { display: flex; gap: 6px; }
.rate-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.rate-card { border: 1px solid var(--app-border); border-radius: 12px; background: #fff; overflow: hidden; }
.rate-card.open { border-color: #c7d6fb; box-shadow: 0 2px 10px rgba(37, 99, 235, .06); }
.rate-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; user-select: none; }
.rate-head:hover { background: #fafbff; }
.rate-head:focus-visible { outline: 2px solid var(--app-primary); outline-offset: -2px; }
.rate-truck { flex: 0 0 auto; min-width: 64px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--app-primary); background: var(--app-primary-soft); border-radius: 8px; padding: 5px 8px; }
.rate-area { font-size: 13px; font-weight: 600; }
.rate-value { text-align: right; white-space: nowrap; }
.rate-value b { font-size: 13.5px; }
.rate-caret { color: #9ca3af; transition: transform .15s; }
.rate-card.open .rate-caret { transform: rotate(180deg); }
.rate-body { display: none; border-top: 1px solid var(--app-border); }
.rate-card.open .rate-body { display: block; }
.rate-empty { padding: 12px; font-size: 12.5px; color: var(--app-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rate-foot { padding: 8px 12px; border-top: 1px dashed var(--app-border); }
.cost-table { font-size: 12px; }
.cost-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; font-weight: 600; background: #fafbfc; white-space: nowrap; padding: 6px 10px; }
.cost-table td { padding: 6px 10px; }
.cost-table td:first-child { max-width: 320px; }
.cost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; }
.cost-total { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--app-primary-soft); font-size: 12.5px; color: #1e40af; }
.cost-total b { font-size: 14px; }
@media (max-width: 991.98px) { .cost-table .col-optional { display: none; } }
@media (max-width: 576px) {
    .rate-caret { display: none; }
    .cost-table .text-truncate { white-space: normal; }
    .rate-head { flex-wrap: wrap; }
    .rate-value { order: 3; width: 100%; text-align: left; display: flex; gap: 8px; align-items: baseline; }
    .rate-toolbar .search-box { margin-left: 0; width: 100%; }
}

/* ===== Penjualan ===== */
.month-filter { width: 150px; }
.pi-pick-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; padding: 8px 12px; border-radius: 10px 10px 0 0; background: var(--app-primary-soft); color: #1e40af; font-size: 12.5px; }
.pi-pick-head .text-body-secondary { color: #475569 !important; }
.pi-pick { max-height: 340px; overflow: auto; border: 1px solid var(--app-border); border-top: 0; border-radius: 0 0 10px 10px; }
.pi-pick thead th { position: sticky; top: 0; z-index: 1; }
/* Pilih jenis PI (modal Buat PI) */
.pi-type-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pi-type { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--app-border); border-radius: 10px; cursor: pointer; background: var(--bs-body-bg); transition: border-color .15s, background .15s; min-width: 0; }
.pi-type i { font-size: 18px; color: #64748b; line-height: 1.2; }
.pi-type span { display: flex; flex-direction: column; min-width: 0; }
.pi-type b { font-size: 13px; }
.pi-type small { font-size: 11.5px; color: #64748b; line-height: 1.3; }
.pi-type:hover { border-color: #93c5fd; }
.btn-check:checked + .pi-type { border-color: var(--app-primary, #2563eb); background: var(--app-primary-soft); box-shadow: 0 0 0 1px var(--app-primary, #2563eb) inset; }
.btn-check:checked + .pi-type i { color: var(--app-primary, #2563eb); }
.btn-check:focus-visible + .pi-type { outline: 2px solid #93c5fd; outline-offset: 1px; }
@media (max-width: 767.98px) { .pi-type-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pi-type small { display: none; } }
.wo-actions:empty { display: none; }
.doc-menu { min-width: 270px; }
.doc-menu .dropdown-item { display: flex; gap: 10px; align-items: flex-start; white-space: normal; }
.doc-menu .dropdown-item .bi { margin-top: 2px; color: var(--app-muted); }
.doc-menu .dropdown-header { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }

/* Halaman Laporan: kartu tarikan Excel */
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1200px) { .report-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.report-card { display: flex; flex-direction: column; margin: 0; }
.report-head { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--app-border); }
.report-icon { flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--app-primary-soft); color: var(--app-primary); font-size: 17px; }
.report-icon-warn { background: #fff7ed; color: #c2410c; }
.report-title { font-weight: 600; font-size: 14.5px; }
.report-desc { font-size: 12.5px; color: #64748b; }
.report-body { padding: 14px 16px; }
.report-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--app-border); background: var(--app-surface); border-radius: 0 0 var(--app-radius) var(--app-radius); }
.report-type { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-type label { display: flex; flex-direction: column; padding: 8px 12px; border: 1px solid var(--app-border); border-radius: 10px; cursor: pointer; min-width: 0; }
.report-type label b { font-size: 13px; }
.report-type label small { font-size: 11.5px; color: #64748b; line-height: 1.3; }
.report-type .btn-check:checked + label { border-color: var(--app-primary); background: var(--app-primary-soft); box-shadow: 0 0 0 1px var(--app-primary) inset; }
.report-type .btn-check:focus-visible + label { outline: 2px solid #93c5fd; outline-offset: 1px; }
@media (max-width: 575.98px) { .report-type { grid-template-columns: 1fr; } }
