/* ==========================================================================
   Komponen lanjutan: DataTables (server-side, responsif) & upload drag-and-drop.
   Dimuat setelah app.css.
   ========================================================================== */

/* --- DataTables: gaya sendiri agar serasi dengan tema ------------------- */
.dt-wrap { position: relative; }
.dt-wrap .dt-error { margin: 16px 20px 0; }
.dt-wrap.is-loading tbody { display: none; }
.dataTables_processing { display: none !important; }
table.dt-table { width: 100% !important; border-collapse: collapse; }
table.dt-table td.text-right, table.dt-table th.text-right { text-align: right; }
table.dt-table td.dt-actions { white-space: nowrap; width: 1%; }
table.dt-table td { word-break: break-word; }

/* Indikator urut */
table.dataTable thead th.sorting, table.dataTable thead th.sorting_asc, table.dataTable thead th.sorting_desc { cursor: pointer; padding-right: 28px; position: relative; user-select: none; }
table.dataTable thead th.sorting:hover { color: var(--ink-2); }
table.dataTable thead th.sorting::after, table.dataTable thead th.sorting_asc::after, table.dataTable thead th.sorting_desc::after { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; }
table.dataTable thead th.sorting::after { content: "\2195"; color: #b6c0d0; }
table.dataTable thead th.sorting_asc::after { content: "\2191"; color: var(--primary); }
table.dataTable thead th.sorting_desc::after { content: "\2193"; color: var(--primary); }

/* Indikator memuat */
.dataTables_processing { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 8px 18px 8px 38px; font-size: 13px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow); white-space: nowrap; }
.dataTables_processing::before { content: ""; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: dtspin .7s linear infinite; }
@keyframes dtspin { to { transform: rotate(360deg); } }

/* Footer: info, jumlah per halaman, paginasi */
.dt-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-2); font-size: 13.5px; color: var(--muted); }
.dt-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dataTables_length select { min-height: 34px; padding: 4px 28px 4px 10px; font: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); }
.dataTables_paginate { display: flex; align-items: center; gap: 4px; }
.dataTables_paginate > span { display: flex; gap: 4px; }
.dataTables_paginate .paginate_button { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; color: var(--ink-2); font-weight: 600; cursor: pointer; border: 1px solid transparent; user-select: none; }
.dataTables_paginate .paginate_button:hover { background: var(--line-2); }
.dataTables_paginate .paginate_button.current { background: var(--primary); color: #fff; }
.dataTables_paginate .paginate_button.disabled { color: #cbd5e1; cursor: default; pointer-events: none; }
.dataTables_paginate .ellipsis { padding: 0 4px; }

/* Data kosong (ikon + teks) */
table.dataTable td.dataTables_empty { padding: 0; text-align: center; }
table.dataTable td.dataTables_empty .empty { padding: 56px 20px; }
table.dataTable td.dataTables_empty:hover { background: none; }

/* Responsive: tombol detail baris pada layar sempit */
table.dataTable td.dtr-control, table.dataTable th.dtr-control { width: 40px; padding-right: 0; cursor: pointer; }
table.dataTable.dtr-column > tbody > tr > td.dtr-control::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-50); color: var(--primary-700); font-weight: 700; line-height: 1; font-size: 15px; }
table.dataTable.dtr-column > tbody > tr.parent > td.dtr-control::before, table.dataTable.dtr-column > tbody > tr.dtr-expanded > td.dtr-control::before { content: "\2013"; background: var(--primary); color: #fff; }
table.dataTable.dtr-column:not(.collapsed) > thead > tr > .dtr-control, table.dataTable.dtr-column:not(.collapsed) > tbody > tr > td.dtr-control { width: 0; padding: 0; overflow: hidden; }
table.dataTable.dtr-column:not(.collapsed) > tbody > tr > td.dtr-control::before { display: none; }
table.dataTable > tbody > tr.child, table.dataTable > tbody > tr.child:hover { background: var(--surface-2); }
table.dataTable > tbody > tr.child td.child { padding: 0; }
table.dataTable > tbody > tr.child ul.dtr-details { list-style: none; margin: 0; padding: 12px 20px 16px 52px; display: grid; gap: 10px; }
table.dataTable > tbody > tr.child ul.dtr-details > li { display: flex; gap: 14px; align-items: baseline; }
table.dataTable > tbody > tr.child span.dtr-title { flex: 0 0 110px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
table.dataTable > tbody > tr.child span.dtr-data { min-width: 0; }
@media (max-width: 560px) {
    .dt-footer { padding: 12px 14px; }
    .dt-meta { width: 100%; justify-content: space-between; }
    table.dataTable > tbody > tr.child ul.dtr-details { padding-left: 20px; }
    table.dataTable > tbody > tr.child ul.dtr-details > li { flex-direction: column; gap: 2px; }
}

/* --- Upload drag & drop -------------------------------------------------- */
.dropzone { position: relative; border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); padding: 22px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); background: var(--primary-50); outline: none; }
.dropzone.is-dragover { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }
.dropzone.is-invalid { border-color: var(--danger); background: var(--danger-50); }
.dropzone-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; }
.dropzone-title { font-weight: 600; color: var(--ink-2); }
.dropzone-title u { color: var(--primary-600); }
.dropzone-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone-preview { display: none; align-items: center; gap: 14px; text-align: left; }
.dropzone.has-file { padding: 14px; cursor: default; border-style: solid; border-color: var(--primary-100); background: var(--surface); }
.dropzone.has-file .dropzone-empty { display: none; }
.dropzone.has-file .dropzone-preview { display: flex; }
.dropzone-thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--line-2); border: 1px solid var(--line); flex: none; }
.dropzone-meta { flex: 1; min-width: 0; }
.dropzone-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone-size { font-size: 12.5px; color: var(--muted); }
.dropzone-actions { display: flex; gap: 6px; flex: none; }
.dropzone-error { font-size: 12.5px; color: var(--danger); font-weight: 500; margin-top: 6px; }
.dropzone-error:empty { display: none; }

/* Gambar produk / bukti bayar */
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--line-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: #94a3b8; }
.pos-item .pos-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: var(--line-2); }
.image-frame { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--line-2); display: block; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.dataTables_info:empty { display: none; }
.dataTables_info { padding: 0; }

/* ==========================================================================
   Form modal (AJAX), toast, animasi memuat — dipakai seluruh CRUD.
   ========================================================================== */
html.modal-open { overflow: hidden; }

/* Spinner pada tombol yang sedang memproses */
.btn.is-loading { position: relative; cursor: progress; }
.btn.is-loading::before { content: ""; flex: none; width: 15px; height: 15px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dtspin .65s linear infinite; }
.btn.btn-icon.is-loading::before { margin: 0; }
.btn.btn-icon.is-loading > svg { display: none; }

/* Modal form: header + badan yang bisa di-scroll + footer menempel */
.modal.mf-modal { animation: mf-fade .16s ease-out; }
.modal.mf-modal.closing { animation: mf-fade-out .16s ease-in forwards; }
.modal.mf-modal.closing .mf-box { animation: mf-pop-out .16s ease-in forwards; }
.mf-box { max-width: 560px; padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: hidden; border-radius: 18px; transition: max-width .15s; }
.mf { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.mf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line-2); }
.mf-head h3 { margin: 0; font-size: 18px; }
.mf-body { padding: 18px 22px 6px; overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1; }
.mf-body .field:last-child { margin-bottom: 8px; }
.mf-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.mf-alert { margin-bottom: 14px; }
.mf-alert.hidden { display: none; }
@media (max-width: 560px) {
    .mf-modal { align-items: flex-end; padding: 0; }
    .mf-box { max-width: none !important; border-bottom-left-radius: 0; border-bottom-right-radius: 0; max-height: 92dvh; animation: mf-sheet .2s ease-out; }
    .mf-head, .mf-body, .mf-foot { padding-left: 16px; padding-right: 16px; }
    .mf-foot .btn { flex: 1; }
}

/* Kerangka memuat (skeleton) */
.mf-loading { padding: 24px 22px; display: grid; gap: 14px; }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 37%, var(--skel-a) 63%); background-size: 400% 100%; animation: skel 1.2s ease infinite; }
.skel-title { height: 22px; width: 46%; }
.skel-line { height: 12px; width: 72%; }
.skel-input { height: 42px; }
.skel-btn { height: 40px; width: 38%; margin-left: auto; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.mf-error { padding: 32px 26px; text-align: center; }
.mf-error h3 { margin: 12px 0 6px; }
.mf-error p { margin: 0 0 18px; }
.mf-error-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; background: var(--danger-50); position: relative; }
.mf-error-icon::before, .mf-error-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 3px; border-radius: 2px; background: var(--danger); transform: translate(-50%, -50%) rotate(45deg); }
.mf-error-icon::after { transform: translate(-50%, -50%) rotate(-45deg); }
@keyframes mf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mf-fade-out { to { opacity: 0; } }
@keyframes mf-pop-out { to { transform: scale(.97); opacity: 0; } }
@keyframes mf-sheet { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

/* Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); cursor: pointer; animation: toast-in .22s ease-out; }
.toast-icon { display: grid; flex: none; }
.toast-success .toast-icon { color: #34d399; }
.toast-error { background: #7f1d1d; }
.toast-error .toast-icon { color: #fecaca; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .toasts { left: 16px; right: 16px; bottom: 16px; justify-items: stretch; } .toast { max-width: none; } }
@media (prefers-reduced-motion: reduce) { .skel, .btn.is-loading::before { animation-duration: 2s; } .mf-modal, .mf-box, .toast { animation: none !important; } }
/* Dropzone mode file (Excel/CSV): ikon dokumen menggantikan pratinjau gambar */
.dropzone-fileicon { width: 56px; height: 56px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; flex: none; }
/* ==========================================================================
   Impor produk
   ========================================================================== */
.import-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.import-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.import-steps li > span { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.import-steps li > div { flex: 1; min-width: 0; }
.import-progress { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.import-progress .progress > span { transition: width .2s ease; }
.tips { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-2); }
.tips code { background: var(--line-2); padding: 1px 6px; border-radius: 5px; }
.progress-lg { height: 14px; }
.progress-lg > span { transition: width .35s ease; background: linear-gradient(90deg, #8b5cf6, #7c3aed); position: relative; overflow: hidden; }
.progress-lg > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.import-pct { font-size: 32px; font-weight: 800; letter-spacing: -.03em; color: var(--primary-700); font-variant-numeric: tabular-nums; }
.import-state { width: 40px; height: 40px; border-radius: 50%; flex: none; position: relative; }
.import-state.run { border: 3px solid var(--primary-100); border-top-color: var(--primary); animation: dtspin .8s linear infinite; }
.import-state.ok { background: var(--success-50); }
.import-state.ok::after { content: ""; position: absolute; left: 14px; top: 8px; width: 9px; height: 16px; border: solid var(--success); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.import-state.bad { background: var(--danger-50); }
.import-state.bad::before, .import-state.bad::after { content: ""; position: absolute; left: 11px; top: 18px; width: 18px; height: 3px; border-radius: 2px; background: var(--danger); transform: rotate(45deg); }
.import-state.bad::after { transform: rotate(-45deg); }
.import-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.import-stats > div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.import-stats span { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.import-stats small { color: var(--muted); font-size: 12.5px; }
.import-stats .ok span { color: var(--success); }
.import-stats .info span { color: var(--info); }
.import-stats .bad span { color: var(--danger); }
@media (max-width: 640px) { .import-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .import-steps li { flex-wrap: wrap; } .import-pct { font-size: 26px; } }
.text-danger { color: var(--danger); }
.mt-2 { margin-top: 8px; }
/* Stok opname & laporan stok */
.how .card-body { position: relative; padding-left: 64px; }
.how-n { position: absolute; left: 18px; top: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.how h4 { margin: 0 0 4px; }
.stock-toolbar { flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.stock-toolbar .tb-field { display: grid; gap: 3px; }
.stock-toolbar .tb-quick { display: flex; gap: 2px; flex-wrap: wrap; }
.stock-toolbar .tb-check { align-self: center; }
.issue-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 260px; overflow-y: auto; }
.issue-title { padding: 8px 12px; background: var(--line-2); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.issue { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.issue-row { color: var(--danger); font-weight: 700; font-size: 12px; min-width: 62px; }
.upload-result.hidden { display: none; }
/* Aksi cepat (dashboard): chip ringkas selebar isinya, membungkus rapi; 2 kolom di ponsel */
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.qa { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 8px; line-height: 1.2; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s, background .15s; }
.qa svg { flex: none; box-sizing: content-box; width: 18px; height: 18px; padding: 7px; border-radius: 50%; background: var(--primary-50); color: var(--primary-700, var(--primary)); transition: background .15s, color .15s; }
.qa:hover, .qa:focus-visible { border-color: var(--primary); box-shadow: 0 4px 14px rgba(124, 58, 237, .14); transform: translateY(-1px); outline: none; }
.qa:hover svg, .qa:focus-visible svg { background: var(--primary); color: #fff; }
@media (max-width: 560px) {
    .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .qa { min-width: 0; padding: 7px 10px 7px 7px; gap: 8px; font-size: 13px; border-radius: 14px; }
    .qa span { overflow: hidden; text-overflow: ellipsis; }
}
/* ---- Testimoni (dashboard owner) ---- */
.stars-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars-input input { position: absolute; opacity: 0; pointer-events: none; }
.stars-input label { cursor: pointer; color: #d5dbe5; transition: color .15s, transform .15s; }
.stars-input label svg { fill: currentColor; }
.stars-input label:hover, .stars-input label:hover ~ label, .stars-input input:checked ~ label { color: #f59e0b; }
.stars-input label:hover { transform: scale(1.12); }
.stars-input input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.testi-preview { padding: 22px; border-radius: 16px; background: var(--primary-50); border: 1px solid var(--primary-100); }
.testi-preview p { font-size: 16px; line-height: 1.6; margin: 10px 0; }
.testi-preview .testi-stars { display: flex; gap: 2px; } .testi-preview .icon { fill: currentColor; } .testi-preview .on { color: #f59e0b; } .testi-preview .off { color: #d5dbe5; }
.rev-meter { display: flex; gap: 6px; }
.rev-meter i { flex: 1; height: 8px; border-radius: 99px; background: var(--primary); }
.rev-meter i.used { background: var(--surface-3); }
.my-3 { margin-top: 16px; margin-bottom: 16px; }
.text-warning { color: #d97706; }

/* ---- Editor blog (admin) ---- */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .blog-layout { grid-template-columns: minmax(0, 1fr); } }
.seg-tabs { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 10px; }
.seg-tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 20px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.md-toolbar.hidden, .md-editor.hidden, .md-preview.hidden { display: none; }
.md-toolbar button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); min-width: 34px; }
.md-toolbar button:hover { border-color: var(--primary); color: var(--primary-700); background: var(--primary-50); }
.md-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.65; min-height: 420px; resize: vertical; }
.serp { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 16px; }
.serp-url { font-size: 12.5px; color: #202124; margin-bottom: 2px; word-break: break-all; }
.serp-title { font-size: 19px; color: #1a0dab; line-height: 1.3; margin-bottom: 3px; }
.serp-desc { font-size: 13.5px; color: #4d5156; line-height: 1.5; }
/* ---- Hak akses staf platform ---- */
.perm-box { margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.perm-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.perm-quick { display: flex; gap: 2px; }
.perm-group { margin-top: 12px; }
.perm-group-title { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.perm-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.perm-item:hover { border-color: var(--line-strong); }
.perm-item:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.perm-item input { margin-top: 3px; accent-color: var(--primary); }
.perm-item b { display: block; font-size: 14px; }
.perm-item small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
@media (max-width: 640px) { .perm-items { grid-template-columns: minmax(0, 1fr); } }
/* ---- Pengaturan konten & SEO landing page (admin) ---- */
.lp-admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 30; box-shadow: var(--shadow-sm); }
.lp-admin-tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; position: relative; }
.lp-admin-tabs button:hover { background: var(--line-2); }
.lp-admin-tabs button.active { background: var(--primary); color: #fff; }
.lp-admin-tabs button.has-error::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.lp-admin-panel { display: none; padding-bottom: 20px; }
.lp-admin-panel.active { display: block; animation: lp-fade .25s ease; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.row-3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 2fr; gap: 0 16px; }
@media (max-width: 720px) { .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); } }
.faq-rows { display: grid; gap: 12px; margin-top: 14px; }
.faq-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 8px; }
.faq-row-head { display: flex; align-items: center; gap: 4px; }
.faq-row-head b { flex: 1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.seo-check { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.seo-check li { display: flex; gap: 10px; align-items: flex-start; }
.seo-check li.ok .icon { color: var(--success); } .seo-check li.todo .icon { color: #d97706; }
.seo-check b { display: block; font-size: 13.5px; } .seo-check small { color: var(--muted); font-size: 12px; line-height: 1.4; display: block; }
.lp-savebar { position: sticky; bottom: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 12px 16px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -8px 24px rgba(15, 23, 42, .08); }
.danger { color: var(--danger); }
/* ---- Daftar hutang (kasbon) ---- */
.debt-reminders .card-body { display: grid; gap: 4px; padding-top: 6px; padding-bottom: 6px; }
.debt-remind { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.debt-remind:last-child { border-bottom: 0; }
.debt-remind .cell-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---- Grafik tren (SVG) ---- */
.tc { position: relative; width: 100%; outline: none; }
.tc:focus-visible { box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); border-radius: 10px; }
.tc-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.tc-grid { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; }
.tc-grid.base { stroke: var(--line); stroke-dasharray: none; }
.tc-ytick, .tc-xtick { font-size: 10.5px; fill: var(--muted); font-family: inherit; }
.tc-line { fill: none; stroke: #7c3aed; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tc-area { stroke: none; }
.tc-dot { fill: #fff; stroke: #7c3aed; stroke-width: 2; opacity: 0; transition: opacity .12s; pointer-events: none; }
.tc-dot.show { opacity: 1; }
.tc-dot.peak { fill: #7c3aed; }
.tc-dot.active { opacity: 1; r: 5.5; fill: #7c3aed; stroke: #fff; stroke-width: 2.5; }
.tc-guide { stroke: #7c3aed; stroke-opacity: .35; stroke-width: 1.5; opacity: 0; pointer-events: none; }
.tc-guide.on { opacity: 1; }
.tc-hit { fill: transparent; cursor: crosshair; }
.tc-tip { position: absolute; z-index: 5; min-width: 120px; padding: 8px 11px; border-radius: 10px; background: #0f172a; color: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .22); pointer-events: none; white-space: nowrap; }
.tc-tip[hidden] { display: none; }
.tc-tip-label { font-size: 11px; color: #94a3b8; }
.tc-tip-value { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.tc-tip-sub { font-size: 11.5px; color: #c4b5fd; }
.tc-tip-sub:empty { display: none; }
.tc-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; pointer-events: none; }

.chart-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-stat { flex: 1 1 140px; padding: 10px 14px; border-radius: 12px; background: var(--line-2); min-width: 0; }
.chart-stat span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.chart-stat strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-stat small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---- Donat + legenda ---- */
.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-chart { position: relative; width: 168px; height: 168px; flex: none; margin: 0 auto; }
.donut-chart svg { width: 100%; height: 100%; transform: none; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.donut-center span { font-size: 11.5px; color: var(--muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; display: grid; gap: 10px; min-width: 0; }
.donut-legend li { display: flex; align-items: center; gap: 10px; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend b { display: block; font-size: 13.5px; }
.donut-legend small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.donut-val { text-align: right; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.donut-val small { text-align: right; }

/* ---- Peringkat produk dengan bar ---- */
.rank-bar { height: 6px; border-radius: 99px; background: var(--line-2); margin-top: 6px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #a78bfa, #7c3aed); }

/* ---- Dashboard pemilik (helicopter view) ---- */
.hv-attn { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.hv-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent; text-decoration: none; transition: transform .12s, box-shadow .12s; }
a.hv-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.hv-chip.danger { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.hv-chip.warning { background: var(--warning-50); color: #92400e; border-color: #fde68a; }
.hv-chip.ok { background: var(--success-50); color: var(--success); border-color: #a7f3d0; }

.hv-kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hv-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hv-kpi-top span { font-size: 13px; color: var(--muted); font-weight: 600; }
.hv-kpi-top .stat-icon { width: 38px; height: 38px; border-radius: 11px; font-style: normal; }
.hv-kpi strong { font-size: clamp(20px, 1.9vw, 27px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; }
.hv-delta { font-style: normal; font-size: 12px; font-weight: 600; }
.hv-delta.up { color: var(--success); } .hv-delta.down { color: var(--danger); } .hv-delta.muted, .hv-delta.flat { color: var(--muted); }

.hv-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line-2); }
.hv-mini div { padding: 12px 18px; border-right: 1px solid var(--line-2); }
.hv-mini div:last-child { border-right: 0; }
.hv-mini span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.hv-mini b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.text-warn { color: #b45309; }
@media (max-width: 560px) { .hv-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hv-mini div:nth-child(2) { border-right: 0; } .hv-mini div:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); } }

.hv-table-wrap { overflow-x: auto; }
.hv-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.hv-table th { text-align: left; padding: 10px 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); font-weight: 700; }
.hv-table th.text-right { text-align: right; }
.hv-table td { padding: 12px 18px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.hv-table tbody tr { transition: background .12s; }
.hv-table tbody tr:hover { background: var(--surface-2); }
.hv-meter-cell { min-width: 150px; }
.hv-meter-cell small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.hv-meter { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hv-meter span { display: block; height: 100%; border-radius: 99px; }
.hv-meter.warn span { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.hv-meter.danger span { background: var(--danger); }

.hv-debt-total { padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #fff7ed, #fffbeb); border: 1px solid #fde68a; margin-bottom: 8px; }
.hv-debt-total span { display: block; font-size: 12px; color: #92400e; font-weight: 600; }
.hv-debt-total strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hv-debt-total small { color: #92400e; }

.hv-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; margin: 0 -6px; border-radius: 12px; text-decoration: none; color: inherit; transition: background .12s; }
a.hv-item:hover { background: var(--line-2); }
.hv-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hv-item-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-item-main small { color: var(--muted); font-size: 12px; }
.hv-item-end { font-weight: 700; font-size: 14px; white-space: nowrap; }

.hv-peak { margin: 0 0 12px; font-size: 13.5px; }
.hv-hours { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.hv-hour { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.hv-hour span { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: #ddd6fe; transition: filter .12s; }
.hv-hour:hover span { filter: brightness(.9); }
.hv-hour.peak span { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.hv-hours-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }

.hv-list { display: grid; padding-top: 6px; padding-bottom: 6px; }
.hv-tx { display: flex; align-items: center; gap: 14px; padding: 12px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line-2); border-radius: 12px; text-decoration: none; color: inherit; transition: background .12s; }
.hv-tx:last-child { border-bottom: 0; }
.hv-tx:hover { background: var(--surface-2); }
.hv-tx.void { opacity: .6; }
.hv-tx-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary-700); }
.hv-tx-icon.m-qris { background: #e0f2fe; color: #0369a1; }
.hv-tx-icon.m-transfer { background: #ede9fe; color: #6d28d9; }
.hv-tx-icon.m-debit { background: #fef3c7; color: #b45309; }
.hv-tx-icon.m-credit { background: #fee2e2; color: #b91c1c; }
.hv-tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hv-tx-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-tx-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-tx-end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.hv-tx-end b { font-size: 14.5px; }
.hv-tx-end small { color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .hv-tx { gap: 10px; } .hv-tx-icon { width: 36px; height: 36px; } }
.hv-sm-only { display: none; }
@media (max-width: 720px) {
    .grid.cols-4.hv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .hv-kpi { padding: 12px 13px; }
    .hv-kpi-top .stat-icon { width: 32px; height: 32px; }
    .hv-kpi-top span { font-size: 12px; }
    .hv-delta { font-size: 11px; }
}
@media (max-width: 560px) {
    .tc-ytick, .tc-xtick { font-size: 16px; }
    .hv-table th:nth-child(2), .hv-table td:nth-child(2) { display: none; }
    .hv-sm-only { display: inline; }
    .hv-table th, .hv-table td { padding-left: 14px; padding-right: 14px; }
}

/* ---- Penjualan per kategori ---- */
.cat-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.cat-row:last-child { border-bottom: 0; }
.cat-dot { width: 10px; height: 10px; border-radius: 3px; margin-top: 6px; flex: none; }
.cat-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.cat-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-bar { height: 7px; border-radius: 99px; background: var(--line-2); margin: 6px 0 4px; overflow: hidden; }
.cat-bar span { display: block; height: 100%; border-radius: 99px; }
.cat-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }

/* ---- Filter rentang tanggal dashboard ---- */
.hv-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.hv-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.hv-presets a { padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; background: var(--line-2); transition: background .12s, color .12s; }
.hv-presets a:hover { background: var(--surface-3); }
.hv-presets a.active { background: var(--primary); color: #fff; }
.hv-range { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.hv-range .input { width: auto; height: 36px; padding: 0 10px; font-size: 13px; }
.hv-range > span { color: var(--muted); font-size: 13px; }
.hv-period { font-size: 12.5px; color: var(--muted); margin: -8px 0 14px; }
.hv-period b { color: var(--ink-2); }
@media (max-width: 720px) { .hv-range { margin-left: 0; width: 100%; } .hv-presets { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; width: 100%; } .hv-presets a { white-space: nowrap; } }

/* ---- Skeleton tabel (menggantikan isi tabel saat data dimuat) ---- */
.dt-skel { padding: 4px 0 8px; }
.dt-skel-row { display: flex; align-items: center; gap: 24px; padding: 17px 20px; border-top: 1px solid var(--line-2); }
.dt-skel-row:first-child { border-top: 0; }
.dt-skel-cell { display: block; min-width: 0; }
.dt-skel-cell .skel { display: block; height: 13px; border-radius: 6px; max-width: 100%; }
.dt-skel-cell:first-child .skel { height: 15px; }
.skel { position: relative; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---- Pemilih rentang tanggal (daterangepicker) ---- */
.drp { position: relative; display: inline-block; }
.drp-btn { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; max-width: 100%; transition: border-color .15s, box-shadow .15s; }
.drp-btn:hover { border-color: var(--line-strong); }
.drp-btn:focus-visible, .drp-btn.active { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }
.drp-btn > svg:first-child { color: var(--primary); flex: none; }
.drp-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drp-label.is-empty { color: var(--muted); font-weight: 500; }
.drp-caret { color: var(--muted); flex: none; }

body .daterangepicker { font-family: inherit; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(15, 23, 42, .18); z-index: 1200 !important; margin-top: 8px; overflow: hidden; }
body .daterangepicker::before, body .daterangepicker::after { display: none; }
body .daterangepicker .calendar-table { border: 0; }
body .daterangepicker .calendar-table th, body .daterangepicker .calendar-table td { border-radius: 8px; font-size: 13px; min-width: 34px; width: 34px; height: 34px; line-height: 34px; }
body .daterangepicker .calendar-table th.month { font-weight: 700; }
body .daterangepicker .calendar-table select { font: inherit; font-size: 13px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
body .daterangepicker td.available:hover, body .daterangepicker th.available:hover { background: var(--primary-50); color: var(--primary-700); }
body .daterangepicker td.in-range { background: var(--primary-50); color: var(--primary-700); }
body .daterangepicker td.active, body .daterangepicker td.active:hover { background: var(--primary); color: #fff; }
body .daterangepicker td.start-date { border-radius: 8px 0 0 8px; } body .daterangepicker td.end-date { border-radius: 0 8px 8px 0; } body .daterangepicker td.start-date.end-date { border-radius: 8px; }
body .daterangepicker td.off, body .daterangepicker td.off.in-range, body .daterangepicker td.off.start-date, body .daterangepicker td.off.end-date { color: #cbd5e1; background: transparent; }
body .daterangepicker td.disabled, body .daterangepicker option.disabled { color: #cbd5e1; text-decoration: none; cursor: not-allowed; }
body .daterangepicker .ranges { margin: 0; padding: 8px; min-width: 150px; }
body .daterangepicker .ranges ul { width: 100%; }
body .daterangepicker .ranges li { border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 8px 12px; margin: 0 0 2px; border: 0; background: transparent; }
body .daterangepicker .ranges li:hover { background: var(--line-2); }
body .daterangepicker .ranges li.active { background: var(--primary); color: #fff; }
body .daterangepicker .drp-buttons { padding: 10px 12px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 8px; }
body .daterangepicker .drp-selected { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-right: auto; }
body .daterangepicker .drp-buttons .btn { font: inherit; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 9px; margin: 0; }
body .daterangepicker .drp-buttons .btn-success, body .daterangepicker .drp-buttons .btn-primary { background: var(--primary); border: 1px solid var(--primary); color: #fff; }
body .daterangepicker .drp-buttons .btn-default { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
@media (max-width: 720px) {
    .drp { display: block; }
    .drp-btn { width: 100%; justify-content: flex-start; }
    .drp-label { flex: 1; text-align: left; }
    body .daterangepicker { max-width: calc(100vw - 20px); }
    body .daterangepicker .ranges ul { display: flex; flex-wrap: wrap; gap: 4px; }
    body .daterangepicker .ranges li { width: auto; padding: 6px 10px; }
}
body .daterangepicker select.monthselect { min-width: 104px; } body .daterangepicker select.yearselect { min-width: 66px; }

/* ---- Skeleton dashboard & elemen umum ---- */
.sk-line { display: block; height: 12px; border-radius: 6px; }
.sk-pill { display: inline-block; height: 34px; border-radius: 999px; }
.sk-icon { width: 38px; height: 38px; border-radius: 11px; display: block; }
.sk-value { display: block; height: 26px; width: 58%; border-radius: 8px; margin: 6px 0 4px; }
.sk-chip { flex: 1 1 140px; height: 66px; border-radius: 12px; }
.sk-chart { display: block; height: 230px; border-radius: 14px; }
.sk-donut { width: 150px; height: 150px; border-radius: 50%; display: block; margin: 6px auto 14px; }
.sk-center { display: grid; gap: 10px; }
.sk-block { display: block; height: 84px; border-radius: 14px; margin-bottom: 12px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.sk-avatar { width: 36px; height: 36px; border-radius: 50%; }
.sk-dot { width: 10px; height: 10px; border-radius: 3px; align-self: flex-start; margin-top: 4px; }
.sk-bar { display: block; height: 7px; border-radius: 99px; margin-top: 10px; }
#dash-skeleton .card { pointer-events: none; }
#dash-body.is-hidden { display: none; }
.hv-filter.is-busy { opacity: .7; pointer-events: none; }
.hv-presets button { padding: 7px 13px; border: 0; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--line-2); cursor: pointer; transition: background .12s, color .12s; }
.hv-presets button:hover { background: var(--surface-3); }
.hv-presets button.active { background: var(--primary); color: #fff; }
@media (max-width: 720px) { .hv-presets button { white-space: nowrap; } }

/* ---- Kepala halaman bergaya kartu + breadcrumb ---- */
.page-header.ph-card { position: relative; align-items: center; padding: 16px 20px 16px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 18px; }
.page-header.ph-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, #8b5cf6, #0ea5e9); }
.ph-crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ph-crumbs a { color: var(--muted); text-decoration: none; } .ph-crumbs a:hover { color: var(--primary-700); }
.ph-crumbs b { color: var(--ink-2); font-weight: 600; }
.page-header.ph-card h1 { font-size: 22px; }
.page-header.ph-card p { margin-top: 3px; font-size: 13.5px; }
.ph-main { min-width: 0; }

/* ---- Kartu KPI di atas tabel ---- */
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 15px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0; transition: transform .15s, box-shadow .15s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px; border-radius: 50%; background: var(--kpi-glow, rgba(124, 58, 237, .12)); filter: blur(6px); pointer-events: none; }
.kpi-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--kpi-bg, #f5f1fc); color: var(--kpi-fg, #7c3aed); }
.kpi-text { min-width: 0; }
.kpi-text strong { display: block; font-size: clamp(16px, 1.5vw, 22px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-text span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.kpi-card.tone-info { --kpi-bg: #e0f2fe; --kpi-fg: #0369a1; --kpi-glow: rgba(14, 165, 233, .14); }
.kpi-card.tone-violet { --kpi-bg: #ede9fe; --kpi-fg: #6d28d9; --kpi-glow: rgba(139, 92, 246, .14); }
.kpi-card.tone-warning { --kpi-bg: #fef3c7; --kpi-fg: #b45309; --kpi-glow: rgba(245, 158, 11, .16); }
.kpi-card.tone-danger { --kpi-bg: #fee2e2; --kpi-fg: #b91c1c; --kpi-glow: rgba(239, 68, 68, .14); }
/* nilai berubah jadi skeleton saat memuat */
.kpi-strip.is-loading [data-stat] { color: transparent; background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 37%, var(--skel-a) 63%); background-size: 400% 100%; animation: skel 1.2s ease infinite; border-radius: 8px; width: 64%; min-height: 24px; user-select: none; }
@media (max-width: 1000px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .kpi-strip { gap: 10px; } .kpi-card { padding: 12px; gap: 10px; } .kpi-icon { width: 38px; height: 38px; } }

/* ---- Toolbar filter tabel ---- */
.toolbar .input, .toolbar .select { border-radius: 12px; }

/* ---- Hak akses karyawan ---- */
.perm-presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.perm-presets > span { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.perm-presets .btn.active { background: var(--primary); color: #fff; }
.perm-item small em { display: block; font-style: normal; color: var(--primary-700); margin-top: 2px; }

/* ---- Pilihan metode HPP ---- */
.costing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.costing-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.costing-card:hover { border-color: var(--line-strong); }
.costing-card input { position: absolute; top: 16px; right: 16px; width: 18px; height: 18px; accent-color: var(--primary); }
.costing-card.is-active, .costing-card:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(124, 58, 237, .14); }
.costing-head { display: flex; gap: 12px; align-items: center; padding-right: 26px; }
.costing-head b { display: block; font-size: 16px; }
.costing-head small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.costing-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-100); color: var(--primary-700); }
.costing-body { display: grid; gap: 9px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.costing-body em, .costing-example em { display: block; font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.costing-example { margin-top: auto; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); font-size: 13px; }
.costing-example small { color: var(--muted); }
@media (max-width: 1000px) { .costing-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Lapisan stok di detail produk ---- */
.layer-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.layer-head { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--surface-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.layer-row { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line-2); font-size: 13px; }
.layer-row small { display: block; color: var(--muted); font-size: 11.5px; }
/* ---- Select2 (pencarian merchant) selaras tema terang/gelap ---- */
body .select2-container { font-family: inherit; min-width: 220px; }
body .select2-container--default .select2-selection--single { height: 40px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); display: flex; align-items: center; }
body .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--ink); line-height: 38px; padding-left: 14px; padding-right: 44px; font-size: 14px; font-weight: 500; }
body .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--ink-2); font-weight: 600; }
body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; right: 8px; }
body .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--muted) transparent transparent; }
body .select2-container--default .select2-selection--single .select2-selection__clear { color: var(--muted); font-size: 18px; margin-right: 6px; height: 38px; line-height: 36px; }
body .select2-container--default.select2-container--focus .select2-selection--single, body .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, .16); }
body .select2-dropdown { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 2000; }
body .select2-container--default .select2-search--dropdown { padding: 10px; }
body .select2-container--default .select2-search--dropdown .select2-search__field { height: 38px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--ink); padding: 0 12px; font: inherit; font-size: 14px; outline: none; }
body .select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--primary); }
body .select2-results__option { padding: 9px 14px; font-size: 14px; color: var(--ink); }
body .select2-container--default .select2-results__option--highlighted[aria-selected], body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--primary-50); color: var(--primary-700); }
body .select2-container--default .select2-results__option[aria-selected=true] { background: var(--surface-3); color: var(--ink); }
body .select2-results__message, body .select2-results__option.loading-results { color: var(--muted); }
body .select2-results__options { max-height: 300px; }
.ms-row { display: flex; flex-direction: column; line-height: 1.3; }
.ms-row small { color: var(--muted); font-size: 12px; }
.toolbar .select2-container { flex: 0 1 260px; }
@media (max-width: 720px) { .toolbar .select2-container { flex: 1 1 100%; } }
/* Kartu statistik: teks panjang (mis. status) boleh membungkus agar tidak keluar dari kartu */
.stat > .grow { min-width: 0; }
.stat-value.is-text { font-size: 18px; white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }

/* ---- Logo aplikasi (monogram "e") ---- */
.app-logo { display: inline-block; flex: none; border-radius: 0; object-fit: contain; }

/* ---- Versi sistem (footer sidebar) ---- */
.sidebar-version { margin-top: 10px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: rgba(255, 255, 255, .32); }

/* ---- Daftar produk terpilih untuk cetak label (lihat merchant/products/labels.blade.php) ---- */
.label-items { margin-top: 14px; }
.label-items .empty-hint { display: none; margin: 10px 0 0; }
.label-items.is-empty .table-wrap { display: none; }
.label-items.is-empty .empty-hint { display: block; }
.label-items .li-name { display: flex; flex-direction: column; line-height: 1.35; }
.label-items .li-name small { color: var(--muted); font-size: 12px; }
.label-items .btn-icon { padding: 6px; }

/* Grid satu kolom: kolom implisit "auto" melebar mengikuti isi (teks nowrap, tabel), sehingga halaman bisa bergeser ke samping
 * di ponsel. minmax(0, 1fr) membuat kolom selalu selebar wadahnya dan isi yang panjang terpotong/dibungkus. */
.hv-list, .mf-loading, .import-steps, .tips, .stock-toolbar .tb-field, .faq-rows, .faq-row, .seo-check,
.debt-reminders .card-body, .donut-legend, .costing-body, .pos-modal .success-actions, .help-list, .pay-credit,
table.dataTable > tbody > tr.child ul.dtr-details { grid-template-columns: minmax(0, 1fr); }

/* ---- Invoice berdiskon menunggu persetujuan (banner dashboard/laporan/detail) ---- */
.approval-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--warning, #b45309) 30%, transparent); background: var(--warning-50, #fffbeb); }
.approval-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--warning, #b45309) 16%, transparent); color: var(--warning, #b45309); }
.approval-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.approval-text strong { font-size: 15px; color: var(--ink, #0f172a); }
.approval-text span { font-size: 13px; line-height: 1.5; color: var(--ink-2, #334155); }
.approval-actions { flex: none; display: flex; gap: 8px; flex-wrap: wrap; }
.approval-actions form { margin: 0; }
@media (max-width: 720px) {
    .approval-banner { flex-wrap: wrap; align-items: flex-start; }
    .approval-actions { width: 100%; }
    .approval-actions .btn { flex: 1 1 0; justify-content: center; }
}

/* Tab halaman Persetujuan (Menunggu | Riwayat keputusan) */
.approval-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 12px; background: var(--surface-3, #f1f5f9); }
.approval-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--muted, #64748b); text-decoration: none !important; transition: background .15s, color .15s; }
.approval-tabs a:hover { color: var(--ink, #0f172a); }
.approval-tabs a.active { background: var(--surface, #fff); color: var(--primary-700, var(--primary)); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.approval-tab-count { min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--warning, #b45309); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* ---- Bonus target bulanan marketing ---- */
.bn-card { border-color: color-mix(in srgb, var(--primary, #7c3aed) 25%, var(--line, #e2e8f0)); }
.bn-card .card-header h3 { display: flex; align-items: center; gap: 8px; }
.bn-total { text-align: right; } .bn-total small { display: block; font-size: 11.5px; color: var(--muted, #64748b); } .bn-total b { font-size: 22px; letter-spacing: -.02em; color: var(--primary-700, var(--primary)); }
.bn-achieved { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--primary-50, #f5f1fc); }
.bn-achieved span { font-size: 13px; font-weight: 700; color: var(--muted, #64748b); } .bn-achieved b { font-size: 24px; letter-spacing: -.02em; color: var(--ink, #0f172a); } .bn-achieved small { flex: 1 1 100%; font-size: 12px; color: var(--muted, #64748b); }
.bn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .bn-grid { grid-template-columns: minmax(0, 1fr); } }
.bn-scheme-card { padding: 14px; border: 1px solid var(--line, #e2e8f0); border-radius: 14px; background: var(--surface, #fff); }
.bn-scheme-card.is-reached { border-color: var(--success, #047857); background: color-mix(in srgb, var(--success, #047857) 5%, var(--surface, #fff)); }
.bn-scheme-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; } .bn-scheme-head b { display: block; font-size: 14px; } .bn-scheme-head small { display: block; font-size: 12px; color: var(--muted, #64748b); }
.bn-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--primary-50, #f5f1fc); color: var(--primary, #7c3aed); }
.bn-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--ink-2, #334155); }
.bn-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted, #64748b); }
.bn-hist-title { margin: 18px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #64748b); }
.bn-hist .sb-item { padding-left: 0; padding-right: 0; }
.bn-scheme { padding: 14px; border: 1px solid var(--line, #e2e8f0); border-radius: 14px; background: var(--surface-2, #fafbfd); opacity: .75; transition: opacity .15s, border-color .15s; }
.bn-scheme.is-on, .bn-scheme:focus-within { opacity: 1; border-color: var(--primary, #7c3aed); background: var(--surface, #fff); }
.bn-switch { margin-bottom: 12px; align-items: flex-start; } .bn-switch b { font-size: 14px; }
