/* ==========================================================================
   SC Marketplace — Gaya tambahan Panel Admin (bagian 1: dashboard, pengguna, toko, produk, transaksi, keuangan)
   Hak cipta (c) 2026 sharecode.id — https://sharecode.id · Lisensi: LICENSE.md
   Komponen dasar ada di style.css & dashboard.css; file ini hanya pelengkap.
   ========================================================================== */
.adm-period { width: auto; min-width: 170px; }
.nav-pills-sm .nav-link { padding: .25rem .8rem; font-size: 12.5px; }
.adm-stat-cta { background: linear-gradient(135deg, var(--mp-navy), #2b4777); border: 0; color: #fff; align-items: center; }
.text-white-50 { color: rgba(255, 255, 255, .65) !important; }

/* Toolbar filter di header kartu tabel */
.adm-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .85rem 1.25rem; border-bottom: 1px solid var(--mp-border); background: #fcfcfd; }
.adm-toolbar .custom-select, .adm-toolbar .form-control { width: auto; min-width: 150px; height: 36px; font-size: 13px; padding-top: .3rem; padding-bottom: .3rem; }
.adm-toolbar .form-control[type=date] { min-width: 140px; }
.adm-toolbar .ml-auto { display: flex; gap: .5rem; flex-wrap: wrap; }
.adm-dt-card .card-body { padding: .75rem 1.25rem 1.25rem; }
.adm-dt-card table.dataTable { margin-top: .5rem !important; margin-bottom: .5rem !important; }
.adm-dt-card td { white-space: nowrap; }
.adm-dt-card td.wrap { white-space: normal; min-width: 200px; }
.bulk-bar { display: none; align-items: center; gap: .5rem; flex-wrap: wrap; background: var(--mp-primary-soft); border-radius: var(--mp-radius-sm); padding: .5rem .75rem; margin-bottom: .75rem; font-size: 13px; }
.bulk-bar.show { display: flex; }

/* Tab ringkas status (pill dengan jumlah) */
.status-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.status-tabs .btn { border-radius: 50px; }
.status-tabs .btn.active { background: var(--mp-navy); border-color: var(--mp-navy); color: #fff; }

/* Detail (modal / halaman) */
.adm-profile-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.adm-section-title { font-family: var(--mp-font-head); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--mp-muted); margin: 1rem 0 .5rem; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .25rem 1.5rem; }
.kv-grid .kv { border-bottom: 1px dashed var(--mp-border); }

/* Roles & permission */
.role-card { cursor: pointer; border: 1px solid var(--mp-border); border-radius: var(--mp-radius); padding: .85rem 1rem; background: #fff; margin-bottom: .6rem; transition: all var(--mp-ease); }
.role-card:hover { border-color: var(--mp-primary-2); }
.role-card.active { border-color: var(--mp-primary); box-shadow: 0 0 0 3px var(--mp-primary-soft); }
.perm-wrap { max-height: 620px; overflow: auto; }
.perm-table { font-size: 13px; }
.perm-table thead th { position: sticky; top: 0; z-index: 2; }
.perm-table .custom-control { display: inline-block; min-height: 1.25rem; padding-left: 1.5rem; }
.perm-table td:first-child { font-weight: 600; color: var(--mp-navy); white-space: nowrap; }
.perm-table th .btn-link { font-size: 11px; padding: 0; text-transform: none; letter-spacing: 0; }

/* Verifikasi dokumen */
.doc-ph { aspect-ratio: 16/10; border-radius: 10px; border: 1px solid var(--mp-border); background: repeating-linear-gradient(45deg, #f1f5f9 0 10px, #e9eef5 10px 20px); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--mp-muted); font-size: 12px; text-align: center; gap: .25rem; position: relative; overflow: hidden; }
.doc-ph i { font-size: 32px; color: #94a3b8; }
.doc-ph .doc-blur { position: absolute; left: 10%; right: 10%; bottom: 14%; height: 12%; background: rgba(23, 43, 77, .25); filter: blur(3px); border-radius: 4px; }
.verify-item { border: 1px solid var(--mp-border); border-radius: var(--mp-radius); background: #fff; padding: 1rem; margin-bottom: 1rem; }
.verify-item.done { opacity: .6; }

/* Moderasi produk */
.appr-card { background: #fff; border: 1px solid var(--mp-border); border-radius: var(--mp-radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: box-shadow var(--mp-ease); }
.appr-card:hover { box-shadow: var(--mp-shadow); }
.appr-card .ap-img { position: relative; aspect-ratio: 4/3; background: var(--mp-bg); }
.appr-card .ap-img img { width: 100%; height: 100%; object-fit: cover; }
.appr-card .ap-check { position: absolute; top: .6rem; left: .6rem; background: #fff; border-radius: 6px; padding: .2rem .3rem 0 1.85rem; min-height: 28px; box-shadow: var(--mp-shadow-sm); }
.appr-card .ap-flag { position: absolute; top: .6rem; right: .6rem; }
.appr-card .ap-body { padding: .85rem 1rem; flex: 1; }
.appr-card .ap-foot { padding: .65rem 1rem; border-top: 1px solid var(--mp-border); display: flex; gap: .4rem; }
.appr-card.selected { border-color: var(--mp-primary); box-shadow: 0 0 0 3px var(--mp-primary-soft); }
.violation-list .custom-control { margin-bottom: .35rem; }

/* Kategori bertingkat */
.cat-tree { list-style: none; padding: 0; margin: 0; }
.cat-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid var(--mp-border); background: #fff; }
.cat-row.sub { padding-left: 3.25rem; background: #fcfcfd; font-size: 13.5px; }
.cat-row .cat-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--mp-primary-soft); color: var(--mp-primary); font-size: 18px; flex-shrink: 0; }
.cat-row .cat-name { flex: 1; min-width: 0; }
.cat-row .cat-meta { display: flex; align-items: center; gap: 1rem; font-size: 12.5px; color: var(--mp-muted); }
.cat-toggle { border: 0; background: none; color: var(--mp-muted); width: 24px; padding: 0; }
.cat-toggle i { transition: transform .2s; display: inline-block; }
.cat-row.collapsed .cat-toggle i { transform: rotate(-90deg); }
.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.icon-pick button { border: 1px solid var(--mp-border); background: #fff; border-radius: 8px; height: 36px; font-size: 17px; color: var(--mp-navy); }
.icon-pick button.active { border-color: var(--mp-primary); background: var(--mp-primary-soft); color: var(--mp-primary); }

/* Pesanan & escrow */
.sub-order { border: 1px solid var(--mp-border); border-radius: var(--mp-radius); margin-bottom: 1rem; overflow: hidden; background: #fff; }
.sub-order .so-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; background: #fcfcfd; border-bottom: 1px solid var(--mp-border); }
.sub-order .so-body { padding: .75rem 1rem; }
.sub-order .so-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .7rem 1rem; border-top: 1px dashed var(--mp-border); font-size: 13px; }
.escrow-flow .flow-step { min-width: 108px; }
.ledger-table td.debit { color: #1d4ed8; font-weight: 600; }
.ledger-table td.credit { color: #15803d; font-weight: 600; }
.ledger-table tfoot td { font-weight: 800; color: var(--mp-navy); background: #f9fafb; }
.money-break .kv span:last-child { font-weight: 600; color: var(--mp-navy); }
.money-break .kv.minus span:last-child { color: var(--mp-danger); }
.lock-note { display: flex; gap: .6rem; align-items: flex-start; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: var(--mp-radius-sm); padding: .7rem .9rem; font-size: 13px; }

/* Sengketa */
.thread { list-style: none; padding: 0; margin: 0; }
.thread li { display: flex; gap: .75rem; margin-bottom: 1rem; }
.thread .th-body { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--mp-border); border-radius: 12px; padding: .7rem .9rem; font-size: 13.5px; }
.thread .th-buyer .th-body { border-left: 3px solid var(--mp-info); }
.thread .th-seller .th-body { border-left: 3px solid var(--mp-primary); }
.thread .th-admin .th-body { border-left: 3px solid var(--mp-navy); background: #f8fafc; }
.evidence { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.evidence a { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--mp-border); display: block; background: var(--mp-bg); }
.evidence a img { width: 100%; height: 100%; object-fit: cover; }

/* Komisi kalkulator */
.calc-result { background: var(--mp-navy); color: #fff; border-radius: var(--mp-radius); padding: 1.1rem 1.25rem; }
.calc-result .kv { color: rgba(255, 255, 255, .9); }
.calc-result .kv span:first-child { color: rgba(255, 255, 255, .65); }
.calc-result .kv.total { color: #fff; border-top-color: rgba(255, 255, 255, .25); }

/* Bukti transfer */
.proof-preview { width: 100%; max-height: 220px; object-fit: contain; border: 1px solid var(--mp-border); border-radius: 10px; background: var(--mp-bg); }

/* Laporan + cetak */
.report-head-print { display: none; }
@media print {
  .report-head-print { display: block; margin-bottom: 1rem; }
  .adm-toolbar, .dataTables_length, .dataTables_filter, .dataTables_paginate, .sim-note, .nav-tabs, .no-print { display: none !important; }
  .dash-content { padding: 0 !important; }
  .card { border: 0 !important; }
  .table td, .table th { padding: .35rem .5rem !important; font-size: 11px !important; }
  .chart-box { height: 220px !important; }
}

@media (max-width: 767.98px) {
  .adm-toolbar { padding: .75rem; }
  .adm-toolbar .custom-select, .adm-toolbar .form-control { flex: 1 1 140px; min-width: 0; }
  .adm-toolbar .ml-auto { margin-left: 0 !important; width: 100%; }
  .cat-row { flex-wrap: wrap; }
  .cat-row.sub { padding-left: 2rem; }
  .cat-row .cat-meta { width: 100%; order: 3; padding-left: 3.1rem; }
  .adm-dt-card .card-body { padding: .5rem .75rem 1rem; }
  .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { text-align: left !important; }
}

/* Baris kartu dompet (5 kartu) */
.wallet-row > [class*="col"] { min-width: 0; }
.wallet-row .wallet-card .wc-value { font-size: 20px; word-break: break-word; }
.ledger-table td { vertical-align: top; }
.money-break .kv span:last-child { white-space: nowrap; }
@media (max-width: 575.98px) {
  body[data-area="admin"] .stat-card { flex-direction: column; gap: .5rem; padding: .85rem; }
  body[data-area="admin"] .stat-icon { width: 38px; height: 38px; font-size: 18px; border-radius: 10px; }
  body[data-area="admin"] .stat-value { font-size: 17px; }
  body[data-area="admin"] .stat-trend span { display: none; }
  .adm-stat-cta { flex-direction: column; }
}
@media (max-width: 575.98px) { .appr-card .ap-body { padding: .6rem .7rem; } .appr-card .ap-foot { padding: .5rem .6rem; } .appr-card .ap-foot .btn-light.flex-fill { font-size: 0; } .appr-card .ap-foot .btn-light.flex-fill i { font-size: 14px; margin: 0 !important; } .appr-card .ap-flag { font-size: 10px; } }
