/* ==========================================================================
   SC Marketplace — Panel Admin bagian 2: Marketing, Customer Service, CMS, Sistem
   Hak cipta (c) 2026 sharecode.id — https://sharecode.id · Lisensi: LICENSE.md
   Dipakai halaman admin: banners, campaigns, flash-sale, vouchers, promotions, reviews, complaints,
   chat, support, pages, articles, menus, media, faq, settings, activity-logs, profile.
   ========================================================================== */

/* ---------- Umum ---------- */
.cms-thumb { width: 132px; aspect-ratio: 3/1; border-radius: 8px; object-fit: cover; background: var(--mp-bg); border: 1px solid var(--mp-border); flex-shrink: 0; }
.cms-thumb.sq { width: 52px; aspect-ratio: 1/1; }
.table-media img.cms-thumb { width: 132px; height: auto; aspect-ratio: 3/1; border-radius: 8px; }
.table-actions .btn { white-space: nowrap; }
.cms-preview { width: 100%; aspect-ratio: 3/1; object-fit: cover; border-radius: 10px; border: 1px solid var(--mp-border); background: var(--mp-bg); }
.cms-preview.wide { aspect-ratio: 16/7; }
.order-btns { display: inline-flex; flex-direction: column; gap: 2px; }
.order-btns .btn { width: 26px; height: 20px; padding: 0; font-size: 11px; line-height: 1; border-radius: 5px; }
.code-chip { font-family: SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-weight: 700; font-size: 12.5px; letter-spacing: .04em; color: var(--mp-primary); background: var(--mp-primary-soft); border: 1px dashed #fdba9b; padding: .15rem .5rem; border-radius: 6px; white-space: nowrap; }
.mono { font-family: SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-size: 12.5px; }
.custom-switch .custom-control-label { cursor: pointer; }
.section-title { font-family: var(--mp-font-head); font-weight: 700; color: var(--mp-navy); font-size: 15px; margin-bottom: .75rem; display: flex; align-items: center; gap: .45rem; }
.section-title i { color: var(--mp-primary); }
.hint-box { background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; border-radius: var(--mp-radius-sm); padding: .65rem .9rem; font-size: 12.5px; display: flex; gap: .5rem; align-items: flex-start; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-chips .btn { border-radius: 50px; }
.filter-chips .btn.active { background: var(--mp-primary); border-color: var(--mp-primary); color: #fff; }
.progress-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--mp-muted); margin-bottom: .2rem; }
.mini-progress.success span { background: var(--mp-success); }
.mini-progress.warning span { background: var(--mp-warning); }
.mini-progress.danger span { background: var(--mp-danger); }
.dt-min { min-width: 760px; }
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* ---------- Banner manager ---------- */
.banner-card { background: #fff; border: 1px solid var(--mp-border); border-radius: var(--mp-radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; box-shadow: var(--mp-shadow-sm); }
.banner-card .bc-img { position: relative; }
.banner-card .bc-img img { width: 100%; aspect-ratio: 3/1; object-fit: cover; display: block; background: var(--mp-bg); }
.banner-card .bc-img .badge { position: absolute; top: .5rem; left: .5rem; }
.banner-card .bc-img .bc-order { position: absolute; top: .5rem; right: .5rem; background: rgba(23, 43, 77, .85); color: #fff; font-weight: 700; font-size: 12px; border-radius: 6px; padding: .1rem .45rem; }
.banner-card .bc-body { padding: .85rem 1rem; flex: 1; font-size: 13px; }
.banner-card .bc-foot { padding: .6rem 1rem; border-top: 1px solid var(--mp-border); display: flex; align-items: center; gap: .4rem; }
.banner-card.inactive .bc-img img { filter: grayscale(.9); opacity: .6; }
.view-toggle .btn.active { background: var(--mp-navy); color: #fff; border-color: var(--mp-navy); }

/* ---------- Flash sale ---------- */
.fs-sessions { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.fs-session { flex: 1; min-width: 118px; border: 1px solid var(--mp-border); background: #fff; border-radius: 10px; padding: .6rem .8rem; text-align: left; cursor: pointer; transition: all var(--mp-ease); }
.fs-session b { display: block; font-family: var(--mp-font-head); font-size: 18px; color: var(--mp-navy); line-height: 1.2; }
.fs-session small { font-size: 11.5px; color: var(--mp-muted); }
.fs-session:hover { border-color: var(--mp-primary); }
.fs-session.active { background: var(--mp-navy); border-color: var(--mp-navy); }
.fs-session.active b, .fs-session.active small { color: #fff; }
.fs-session .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mp-danger); margin-right: .3rem; box-shadow: 0 0 0 3px rgba(220, 38, 38, .2); }
.cd-box { display: inline-flex; gap: .3rem; align-items: center; }
.cd-box span { background: var(--mp-navy); color: #fff; font-family: var(--mp-font-head); font-weight: 700; border-radius: 6px; padding: .1rem .4rem; min-width: 30px; text-align: center; }

/* ---------- Voucher ---------- */
.vc-type { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.vc-type.nominal { background: var(--mp-primary-soft); color: var(--mp-primary); }
.vc-type.persen { background: #ede9fe; color: #6d28d9; }
.vc-type.ongkir { background: #dcfce7; color: var(--mp-success); }
.vc-type.cashback { background: #fef3c7; color: #b45309; }
.voucher-preview { display: flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--mp-border); background: #fff; }
.voucher-preview .vp-left { width: 96px; background: var(--mp-primary); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 11px; font-weight: 700; padding: .5rem; position: relative; }
.voucher-preview .vp-left i { font-size: 26px; }
.voucher-preview .vp-left::after { content: ''; position: absolute; right: -6px; top: 0; bottom: 0; width: 12px; background: radial-gradient(circle at 6px 8px, #fff 5px, transparent 5.5px) 0 0/12px 16px repeat-y; }
.voucher-preview .vp-right { padding: .7rem .9rem; flex: 1; min-width: 0; font-size: 12.5px; }

/* ---------- Promotions ---------- */
.promo-type-card { background: #fff; border: 1px solid var(--mp-border); border-radius: var(--mp-radius); padding: 1.1rem; height: 100%; display: flex; flex-direction: column; gap: .5rem; box-shadow: var(--mp-shadow-sm); }
.promo-type-card .pt-head { display: flex; align-items: center; gap: .75rem; }
.promo-type-card h3 { font-size: 15px; margin: 0; }
.promo-type-card .pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: var(--mp-bg); border-radius: 10px; padding: .6rem; margin-top: auto; }
.promo-type-card .pt-stats div { font-size: 11px; color: var(--mp-muted); }
.promo-type-card .pt-stats b { display: block; font-family: var(--mp-font-head); font-size: 14px; color: var(--mp-navy); }

/* ---------- Reviews ---------- */
.rv-photos { display: flex; gap: .4rem; flex-wrap: wrap; }
.rv-photos img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--mp-border); }
.rv-text { max-width: 320px; white-space: normal; }
.rating-bar { display: flex; align-items: center; gap: .5rem; font-size: 12.5px; margin-bottom: .3rem; }
.rating-bar .mini-progress { flex: 1; }
.rating-bar .mini-progress span { background: var(--mp-star); }

/* ---------- Thread (tiket, komplain) ---------- */
.thread { display: flex; flex-direction: column; gap: .85rem; }
.thread-item { display: flex; gap: .65rem; }
.thread-item .th-body { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--mp-border); border-radius: 12px; padding: .65rem .85rem; font-size: 13.5px; }
.thread-item .th-meta { font-size: 12px; color: var(--mp-muted); margin-bottom: .2rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.thread-item.staff .th-body { background: var(--mp-primary-soft); border-color: #fdd5c3; }
.thread-item.note .th-body { background: #fffbeb; border-style: dashed; border-color: #f59e0b; }
.thread-box { max-height: 420px; overflow-y: auto; padding: 1rem; background: #fafafa; border: 1px solid var(--mp-border); border-radius: var(--mp-radius); }

/* ---------- Chat monitoring ---------- */
.chat-flag { color: var(--mp-danger); font-size: 12px; font-weight: 600; }
.msg.flagged { border-color: var(--mp-danger) !important; box-shadow: 0 0 0 2px rgba(220, 38, 38, .12); }
.msg .msg-by { display: block; font-size: 11px; font-weight: 700; opacity: .75; margin-bottom: .1rem; }
.chat-room-head { padding: .75rem 1rem; border-bottom: 1px solid var(--mp-border); display: flex; align-items: center; gap: .65rem; }
.chat-list .cl-search { padding: .65rem; border-bottom: 1px solid var(--mp-border); }
.chat-list .cl-scroll { flex: 1; overflow-y: auto; }
.chat-list .cl-item .cl-name { font-weight: 700; color: var(--mp-navy); font-size: 13.5px; }
.chat-list .cl-item .cl-last { font-size: 12px; color: var(--mp-muted); }

/* ---------- Editor / CMS ---------- */
.editor-side .card + .card { margin-top: 1rem; }
.seo-preview { border: 1px solid var(--mp-border); border-radius: 10px; padding: .75rem .9rem; background: #fff; font-family: Arial, sans-serif; }
.seo-preview .sp-url { color: #188038; font-size: 12.5px; word-break: break-all; }
.seo-preview .sp-title { color: #1a0dab; font-size: 17px; line-height: 1.3; margin: .15rem 0; }
.seo-preview .sp-desc { color: #4d5156; font-size: 13px; }
.slug-input .input-group-text { font-size: 12.5px; color: var(--mp-muted); }
.tox-tinymce { border-radius: var(--mp-radius-sm) !important; border-color: var(--mp-border) !important; }
.modal-xl-full { max-width: 1180px; }

/* ---------- Menu manager ---------- */
.menu-tree { list-style: none; padding: 0; margin: 0; }
.menu-tree .menu-tree { padding-left: 1.75rem; margin-top: .4rem; }
.menu-item { margin-bottom: .4rem; }
.menu-item > .mi-row { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--mp-border); border-radius: 10px; padding: .5rem .65rem; transition: box-shadow var(--mp-ease), border-color var(--mp-ease); }
.menu-item > .mi-row:hover { border-color: #fdba9b; }
.menu-item .mi-handle { cursor: grab; color: #9ca3af; font-size: 16px; }
.menu-item .mi-label { font-weight: 600; color: var(--mp-navy); font-size: 13.5px; }
.menu-item .mi-url { font-size: 11.5px; color: var(--mp-muted); }
.menu-item.dragging > .mi-row { opacity: .45; }
.menu-item.drop-target > .mi-row { border-color: var(--mp-primary); box-shadow: 0 0 0 3px var(--mp-primary-soft); }
.menu-item.mi-hidden > .mi-row { background: #f9fafb; }
.menu-item.mi-hidden .mi-label { color: #9ca3af; text-decoration: line-through; }
.add-source .list-group-item { font-size: 13px; padding: .45rem .75rem; }
.footer-col-card { border: 1px dashed var(--mp-border); border-radius: 10px; padding: .75rem; height: 100%; background: #fcfcfd; }

/* ---------- Media library ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .7rem; }
.media-item { position: relative; background: #fff; border: 1px solid var(--mp-border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: all var(--mp-ease); text-align: left; padding: 0; }
.media-item .mi-thumb { aspect-ratio: 1/1; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0/16px 16px; display: grid; place-items: center; overflow: hidden; }
.media-item .mi-thumb img { width: 100%; height: 100%; object-fit: contain; }
.media-item .mi-name { font-size: 11.5px; padding: .35rem .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mp-text); display: block; }
.media-item:hover { border-color: #fdba9b; box-shadow: var(--mp-shadow-sm); }
.media-item.selected { border-color: var(--mp-primary); box-shadow: 0 0 0 3px var(--mp-primary-soft); }
.media-item .mi-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--mp-primary); color: #fff; display: none; place-items: center; font-size: 12px; }
.media-item.selected .mi-check { display: grid; }
.media-item .mi-new { position: absolute; top: 6px; left: 6px; }
.media-detail img.md-img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0/16px 16px; border-radius: 10px; border: 1px solid var(--mp-border); }
.media-folders .list-group-item { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; cursor: pointer; border-left: 0; border-right: 0; }
.media-folders .list-group-item.active { background: var(--mp-primary-soft); color: var(--mp-primary); border-color: var(--mp-border); font-weight: 700; }
@media (min-width: 1200px) { .media-detail { position: sticky; top: calc(var(--dash-top) + 1rem); } }

/* ---------- FAQ ---------- */
.faq-admin-item { background: #fff; border: 1px solid var(--mp-border); border-radius: 10px; padding: .75rem .9rem; display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .5rem; }
.faq-admin-item .fa-q { font-weight: 700; color: var(--mp-navy); font-size: 14px; }
.faq-admin-item .fa-a { font-size: 13px; color: var(--mp-muted); }

/* ---------- Settings ---------- */
.settings-nav .list-group-item { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 13.5px; color: var(--mp-text); border: 0; border-radius: 9px !important; margin-bottom: 2px; }
.settings-nav .list-group-item i { color: var(--mp-muted); font-size: 16px; }
.settings-nav .list-group-item:hover { background: var(--mp-bg); color: var(--mp-primary); }
.settings-nav .list-group-item.active { background: var(--mp-primary-soft); color: var(--mp-primary); }
.settings-nav .list-group-item.active i { color: var(--mp-primary); }
.gw-card { border: 1px solid var(--mp-border); border-radius: var(--mp-radius); background: #fff; margin-bottom: 1rem; overflow: hidden; }
.gw-card .gw-head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; }
.gw-card .gw-body { border-top: 1px solid var(--mp-border); padding: 1rem; background: #fcfcfd; }
.gw-card.off .gw-body { display: none; }
.gw-logo { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-family: var(--mp-font-head); font-weight: 800; color: #fff; font-size: 15px; flex-shrink: 0; }
.opt-card { display: block; border: 1px solid var(--mp-border); border-radius: 10px; padding: .75rem .9rem; cursor: pointer; height: 100%; transition: all var(--mp-ease); margin: 0; font-weight: 500; }
.opt-card:hover { border-color: #fdba9b; }
.opt-card input { margin-right: .4rem; }
.opt-card.checked { border-color: var(--mp-primary); background: var(--mp-primary-soft); }
.opt-card b { color: var(--mp-navy); }
.opt-card small { display: block; color: var(--mp-muted); margin-top: .2rem; font-weight: 400; }
.logo-box { width: 88px; height: 88px; border-radius: 12px; border: 1px dashed #d1d5db; display: grid; place-items: center; background: #fafafa; overflow: hidden; flex-shrink: 0; }
.logo-box img { max-width: 80%; max-height: 80%; }
.logo-box.sm { width: 52px; height: 52px; }
.notif-matrix th, .notif-matrix td { text-align: center; }
.notif-matrix td:first-child, .notif-matrix th:first-child { text-align: left; }
.notif-matrix .custom-control { display: inline-block; min-height: 1.2rem; padding-left: 1.5rem; }

/* ---------- Activity log / diff ---------- */
.diff-box { font-family: SFMono-Regular, Consolas, 'Liberation Mono', monospace; font-size: 12px; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: .75rem .9rem; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; margin: 0; }
.diff-box .del { color: #fca5a5; }
.diff-box .add { color: #86efac; }
.log-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: 15px; }

/* ---------- Profil admin ---------- */
.profile-cover { height: 110px; background: linear-gradient(120deg, var(--mp-navy), #2c4a80 60%, var(--mp-primary)); border-radius: var(--mp-radius) var(--mp-radius) 0 0; }
.profile-head { margin-top: -48px; text-align: center; padding: 0 1rem 1.25rem; }
.profile-head .avatar-wrap { position: relative; display: inline-block; }
.profile-head .avatar-xl { border: 4px solid #fff; box-shadow: var(--mp-shadow); }
.profile-head .avatar-edit { position: absolute; right: 0; bottom: 4px; width: 32px; height: 32px; border-radius: 50%; background: var(--mp-primary); color: #fff; display: grid; place-items: center; cursor: pointer; border: 3px solid #fff; margin: 0; }
.qr-mock { width: 168px; height: 168px; border: 1px solid var(--mp-border); border-radius: 10px; padding: 8px; background: #fff; }
.backup-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; font-family: SFMono-Regular, Consolas, monospace; font-size: 13px; }
.backup-codes span { background: var(--mp-bg); border-radius: 6px; padding: .25rem .5rem; text-align: center; }
.session-item { display: flex; gap: .75rem; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--mp-border); }
.session-item:last-child { border-bottom: 0; }

@media (max-width: 767.98px) {
  .cms-thumb, .table-media img.cms-thumb { width: 96px; }
  .toolbar .form-control, .toolbar .custom-select { min-width: 0; flex: 1 1 140px; }
  .menu-tree .menu-tree { padding-left: 1rem; }
  .menu-item > .mi-row { flex-wrap: wrap; }
  .menu-item > .mi-row > .table-actions { width: 100%; justify-content: flex-end; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
  .promo-type-card .pt-stats { grid-template-columns: repeat(3, 1fr); }
  .backup-codes { grid-template-columns: 1fr 1fr; }
}
