/* =========================================================
   IASH SocialGuard - UI v3 "social"
   Gradien merek, story ring, gelembung komentar, feed aktivitas.
   Warna utama & sekunder diatur dari menu Setting App (--sg-accent, --sg-accent-2)
   ========================================================= */
:root {
  --sg-accent: #e1306c;
  --sg-accent-2: #833ab4;
  --sg-accent-dark: #c21f58;
  --sg-accent-soft: rgba(225, 48, 108, .14);
  --sg-on-accent: #ffffff;
  --sg-grad: linear-gradient(135deg, var(--sg-accent-2) 0%, var(--sg-accent) 100%);
  --sg-story: linear-gradient(45deg, #f9ce34 0%, #ee2a7b 55%, #6228d7 100%);

  --sg-bg: #f5f3f9;
  --sg-surface: #ffffff;
  --sg-surface-2: #faf8fd;
  --sg-border: #ebe6f3;
  --sg-hover: rgba(60, 20, 100, .04);
  --sg-text: #1a1325;
  --sg-muted: #6f6a80;
  --sg-shadow: 0 1px 2px rgba(40, 20, 70, .04), 0 12px 30px -10px rgba(40, 20, 70, .12);
  --sg-shadow-lg: 0 26px 64px -14px rgba(30, 10, 60, .35);

  --sg-side-bg: linear-gradient(185deg, #150c24 0%, #1b1033 60%, #170d2a 100%);
  --sidebar-w: 268px;
  --radius: 18px;

  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--sg-text);
  --bs-body-bg: var(--sg-bg);
  --bs-border-color: var(--sg-border);
  --bs-secondary-color: var(--sg-muted);
  --bs-link-color: var(--sg-accent-dark);
}

[data-bs-theme='dark'] {
  --sg-bg: #0e0a17;
  --sg-surface: #17102a;
  --sg-surface-2: #130d23;
  --sg-border: #2a2042;
  --sg-hover: rgba(255, 255, 255, .045);
  --sg-text: #f1ecf9;
  --sg-muted: #a299b8;
  --sg-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 12px 30px -10px rgba(0, 0, 0, .55);
  --sg-side-bg: linear-gradient(185deg, #0a0614 0%, #110a21 100%);
  --bs-body-color: var(--sg-text);
  --bs-body-bg: var(--sg-bg);
  --bs-border-color: var(--sg-border);
  --bs-secondary-color: var(--sg-muted);
  --bs-link-color: var(--sg-accent);
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--bs-body-font-family); font-size: .9rem; background: var(--sg-bg); color: var(--sg-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.sg-lock { overflow: hidden; }
h1, h2, h3, h4, h5 { letter-spacing: -.02em; }
a { text-underline-offset: 2px; }
code { color: var(--sg-accent-dark); background: var(--sg-accent-soft); padding: .1rem .38rem; border-radius: 7px; font-size: .82em; }
[data-bs-theme='dark'] code { color: #ff8fb5; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.text-muted { color: var(--sg-muted) !important; }
.grad-text { background: var(--sg-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Sidebar ---------- */
.sg-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040; background: var(--sg-side-bg); color: #bcb2d3; display: flex; flex-direction: column; border-right: 1px solid rgba(255, 255, 255, .05); transition: transform .28s cubic-bezier(.4, 0, .2, 1); }
.sg-sidebar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 220px; background: radial-gradient(120% 100% at 0% 100%, var(--sg-accent-soft), transparent 70%); pointer-events: none; }
.sg-brand { display: flex; align-items: center; gap: .8rem; padding: 1.2rem 1.25rem; }
.sg-mark { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; background: var(--sg-grad); color: var(--sg-on-accent); font-size: 1.35rem; box-shadow: 0 8px 20px -6px var(--sg-accent); }
.sg-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }
.sg-brand-text { min-width: 0; line-height: 1.2; }
.sg-brand-text strong { display: block; color: #fff; font-size: 1.04rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-brand-text small { display: block; color: #8d82a8; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sg-nav { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: .25rem .8rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.sg-group { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: #6b5f88; padding: 1.1rem .8rem .4rem; }
.sg-link { position: relative; display: flex; align-items: center; gap: .8rem; padding: .62rem .8rem; margin-bottom: 3px; color: #c3b9d8; text-decoration: none; border-radius: 13px; font-weight: 500; transition: background .15s, color .15s; }
.sg-link i { font-size: 1.08rem; width: 1.3rem; text-align: center; color: #85799f; transition: color .15s; }
.sg-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sg-link:hover i { color: #d6cde8; }
.sg-link.active { background: var(--sg-grad); color: var(--sg-on-accent); font-weight: 600; box-shadow: 0 10px 22px -10px var(--sg-accent); }
.sg-link.active i { color: var(--sg-on-accent); }

.sg-userbox { position: relative; z-index: 1; margin: .75rem; padding: .7rem; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .06); display: flex; align-items: center; gap: .7rem; }
.sg-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--sg-grad); color: var(--sg-on-accent); box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
.sg-userbox .who { min-width: 0; flex: 1; line-height: 1.25; }
.sg-userbox .who strong { display: block; color: #fff; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-userbox .who small { display: block; color: #8d82a8; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-userbox button { background: transparent; border: 0; color: #a99fc0; width: 34px; height: 34px; border-radius: 10px; }
.sg-userbox button:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.sg-backdrop { position: fixed; inset: 0; z-index: 1035; background: rgba(10, 6, 20, .6); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .25s; }
.sg-backdrop.show { opacity: 1; visibility: visible; }

/* ---------- Main ---------- */
.sg-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.sg-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.75rem; background: var(--sg-surface); background: color-mix(in srgb, var(--sg-surface) 80%, transparent); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--sg-border); }
.sg-crumb { color: var(--sg-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-tools { display: flex; align-items: center; gap: .5rem; }
.sg-clock { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--sg-muted); background: var(--sg-surface-2); border: 1px solid var(--sg-border); padding: .38rem .75rem; border-radius: 999px; white-space: nowrap; }
.sg-iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--sg-border); background: var(--sg-surface); color: var(--sg-text); transition: background .15s, transform .15s; }
.sg-iconbtn:hover { background: var(--sg-hover); }
.sg-iconbtn:active { transform: scale(.95); }
.sg-content { padding: 1.75rem; flex: 1; width: 100%; }
.sg-footer { padding: 1rem 1.75rem 1.5rem; color: var(--sg-muted); font-size: .8rem; text-align: center; }

.sg-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-title { font-size: 1.6rem; font-weight: 800; margin: 0; }
.page-sub { color: var(--sg-muted); margin: .2rem 0 0; }
.sg-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.live-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .38rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: rgba(34, 197, 94, .13); color: #16a34a; white-space: nowrap; }
.live-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.9s infinite; }
.live-chip.dry { background: rgba(245, 158, 11, .15); color: #d97706; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }

/* ---------- Components ---------- */
.card { background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: var(--radius); box-shadow: var(--sg-shadow); --bs-card-bg: var(--sg-surface); --bs-card-border-color: var(--sg-border); --bs-card-cap-bg: transparent; }
.card-header { border-bottom: 1px solid var(--sg-border); font-weight: 650; padding: 1rem 1.25rem; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-header .sub { display: block; font-weight: 400; font-size: .78rem; color: var(--sg-muted); margin-top: .1rem; }
.card-body { padding: 1.25rem; }
.card-footer { border-top: 1px solid var(--sg-border); padding: .9rem 1.25rem; }

.btn { border-radius: 12px; font-weight: 500; padding: .5rem 1rem; transition: all .15s; }
.btn-sm { border-radius: 10px; padding: .3rem .6rem; }
.btn-accent { background: var(--sg-grad); color: var(--sg-on-accent); border: 0; box-shadow: 0 10px 20px -8px var(--sg-accent); }
.btn-accent:hover, .btn-accent:focus { color: var(--sg-on-accent); filter: brightness(1.07); transform: translateY(-1px); }
.btn-glass { background: rgba(255, 255, 255, .2); color: inherit; border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255, 255, 255, .32); color: inherit; }
.btn-outline-secondary { --bs-btn-color: var(--sg-text); --bs-btn-border-color: var(--sg-border); --bs-btn-hover-bg: var(--sg-hover); --bs-btn-hover-color: var(--sg-text); --bs-btn-hover-border-color: var(--sg-border); --bs-btn-active-bg: var(--sg-hover); --bs-btn-active-color: var(--sg-text); }
.btn-light { --bs-btn-bg: var(--sg-surface-2); --bs-btn-border-color: var(--sg-border); --bs-btn-color: var(--sg-text); --bs-btn-hover-bg: var(--sg-hover); --bs-btn-hover-color: var(--sg-text); }

.form-control, .form-select, .input-group-text { border-radius: 12px; border-color: var(--sg-border); background-color: var(--sg-surface); color: var(--sg-text); }
.input-group > .form-control:not(:last-child), .input-group > .form-select:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .form-control:not(:first-child), .input-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group-text { background: var(--sg-surface-2); }
.form-control:focus, .form-select:focus { border-color: var(--sg-accent); box-shadow: 0 0 0 .25rem var(--sg-accent-soft); background-color: var(--sg-surface); color: var(--sg-text); }
.form-control::placeholder { color: color-mix(in srgb, var(--sg-muted) 70%, transparent); }
.form-label { font-weight: 500; font-size: .84rem; margin-bottom: .35rem; }
.form-text { color: var(--sg-muted); }
.form-check-input:checked { background-color: var(--sg-accent); border-color: var(--sg-accent); }
.form-check-input:focus { border-color: var(--sg-accent); box-shadow: 0 0 0 .25rem var(--sg-accent-soft); }
.form-switch .form-check-input { cursor: pointer; }

.badge { font-weight: 600; border-radius: 999px; padding: .4em .7em; letter-spacing: .01em; }
.list-group-item { background: transparent; border-color: var(--sg-border); color: var(--sg-text); padding: .8rem 1.25rem; }
.alert { border-radius: 16px; border: 1px solid transparent; }

.nav-tabs { border-bottom: 0; gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-radius: 12px; color: var(--sg-muted); font-weight: 500; padding: .45rem .95rem; }
.nav-tabs .nav-link:hover { background: var(--sg-hover); color: var(--sg-text); }
.nav-tabs .nav-link.active { background: var(--sg-accent-soft); color: var(--sg-accent-dark); }
[data-bs-theme='dark'] .nav-tabs .nav-link.active { color: #ff8fb5; }

.modal-content { background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: 22px; box-shadow: var(--sg-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--sg-border); }
.modal-header { padding: 1.1rem 1.4rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { padding: 1rem 1.4rem; }
.modal-title { font-weight: 700; }
.modal-backdrop.show { opacity: .55; }

/* ---------- Social: avatar, story ring, bubble, feed ---------- */
.u-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; letter-spacing: .02em; background: linear-gradient(135deg, hsl(var(--h) 78% 60%), hsl(calc(var(--h) + 48) 78% 48%)); }
.u-avatar.lg { width: 42px; height: 42px; font-size: .85rem; }

.story-ring { flex: none; display: inline-grid; place-items: center; width: 62px; height: 62px; padding: 3px; border-radius: 50%; background: var(--sg-story); }
.story-ring.sm { width: 42px; height: 42px; padding: 2px; }
.story-ring.off { background: var(--sg-border); filter: grayscale(1); }
.story-in { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--sg-surface); border: 2px solid var(--sg-surface); color: var(--sg-accent); font-size: 1.15rem; }
.story-ring.sm .story-in { font-size: .95rem; border-width: 1.5px; }
.story-in img { width: 100%; height: 100%; object-fit: cover; }

.bubble { display: inline-block; max-width: 100%; padding: .42rem .8rem; border-radius: 5px 16px 16px 16px; background: var(--sg-surface-2); border: 1px solid var(--sg-border); line-height: 1.35; word-break: break-word; white-space: normal; }
.bubble-bad { background: rgba(239, 68, 68, .07); border-color: rgba(239, 68, 68, .28); }

.feed-scroll { max-height: 396px; overflow-y: auto; scrollbar-width: thin; }
.feed-item { display: flex; gap: .8rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--sg-border); }
.feed-item:last-child { border-bottom: 0; }
.feed-body { min-width: 0; flex: 1; }
.feed-head { font-size: .82rem; display: flex; flex-wrap: wrap; gap: .1rem .45rem; align-items: baseline; }
.feed-head .when { color: var(--sg-muted); font-size: .74rem; }
.feed-meta { margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.empty { text-align: center; color: var(--sg-muted); padding: 2.2rem 1rem; }
.empty i { display: block; font-size: 2rem; opacity: .5; margin-bottom: .4rem; }

/* ---------- Dashboard hero ---------- */
.hero { position: relative; overflow: hidden; border: 0; border-radius: 24px; background: var(--sg-grad); color: var(--sg-on-accent); padding: 1.7rem 1.8rem; box-shadow: 0 24px 50px -22px var(--sg-accent); }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .14); pointer-events: none; }
.hero::before { width: 320px; height: 320px; right: -80px; top: -140px; }
.hero::after { width: 200px; height: 200px; right: 160px; bottom: -120px; background: rgba(255, 255, 255, .09); }
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 1.7rem; font-weight: 800; margin: 0 0 .3rem; }
.hero p { margin: 0; opacity: .92; max-width: 560px; }
.hero .stories { display: flex; gap: 1rem; overflow-x: auto; padding: .35rem .15rem .1rem; scrollbar-width: none; }
.hero .stories::-webkit-scrollbar { display: none; }
.story { text-align: center; min-width: 68px; max-width: 78px; color: inherit; text-decoration: none; }
.story small { display: block; margin-top: .35rem; font-size: .7rem; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .story-ring.off { background: rgba(255, 255, 255, .45); filter: none; }
.story.add .story-ring { background: rgba(255, 255, 255, .4); }
.story.add .story-in { background: transparent; border-color: transparent; color: inherit; }

/* Stat cards */
.stat { display: flex; align-items: center; gap: .95rem; }
.stat-card { transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat .ico { flex: none; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 1.28rem; color: #fff; box-shadow: 0 10px 18px -8px rgba(0, 0, 0, .3); }
.stat .num { font-size: 1.75rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--sg-muted); font-size: .79rem; margin-top: .15rem; }
.ico-teal { background: var(--sg-grad); }
.ico-red { background: linear-gradient(135deg, #fb7185, #e11d48); }
.ico-amber { background: linear-gradient(135deg, #fbbf24, #f97316); }
.ico-blue { background: linear-gradient(135deg, #60a5fa, #4f46e5); }
.ico-green { background: linear-gradient(135deg, #4ade80, #0d9488); }
.ico-slate { background: linear-gradient(135deg, #94a3b8, #475569); }
.skeleton { display: inline-block; min-width: 3ch; background: linear-gradient(90deg, var(--sg-border), var(--sg-surface-2), var(--sg-border)); background-size: 200% 100%; animation: sk 1.2s infinite; color: transparent !important; border-radius: .4rem; }
@keyframes sk { to { background-position: -200% 0; } }
.chart-box { position: relative; height: 320px; }
.avatar-fallback { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--sg-story); color: #fff; display: grid; place-items: center; }

/* ---------- Loading ---------- */
#sg-topbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--sg-story); z-index: 3000; transition: width .25s ease, opacity .3s ease; box-shadow: 0 0 12px var(--sg-accent); opacity: 0; }
#sg-overlay { position: fixed; inset: 0; background: rgba(10, 6, 20, .55); z-index: 2900; display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px); padding: 1rem; }
#sg-overlay.show { display: flex; animation: fade .15s; }
#sg-overlay .box { background: var(--sg-surface); color: var(--sg-text); border: 1px solid var(--sg-border); border-radius: 22px; padding: 1.5rem 1.9rem; min-width: 290px; max-width: 92vw; text-align: center; box-shadow: var(--sg-shadow-lg); }
#sg-overlay .progress { height: 6px; margin-top: 1rem; background: var(--sg-surface-2); border-radius: 999px; }
#sg-overlay .progress-bar { background: var(--sg-grad); }
#sg-overlay .spinner-border { color: var(--sg-accent) !important; }
@keyframes fade { from { opacity: 0; } }

/* ---------- DataTables ---------- */
div.dt-container { --dt-row-hover: var(--sg-hover); }
div.dt-container .dt-layout-row { margin: 0 !important; padding: .35rem 0; }
div.dt-container .dt-search input, div.dt-container .dt-length select { border: 1px solid var(--sg-border); background: var(--sg-surface); color: var(--sg-text); border-radius: 12px; padding: .42rem .8rem; }
div.dt-container .dt-search input:focus, div.dt-container .dt-length select:focus { outline: 0; border-color: var(--sg-accent); box-shadow: 0 0 0 .22rem var(--sg-accent-soft); }
div.dt-container .dt-processing { background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: 14px; box-shadow: var(--sg-shadow-lg); padding: .65rem 1.1rem; font-weight: 600; color: var(--sg-accent-dark); z-index: 5; }
div.dt-container .dt-info { color: var(--sg-muted); font-size: .82rem; }
div.dt-container .dt-layout-table { overflow-x: auto; }
table.dataTable { --bs-table-bg: transparent; --bs-table-hover-bg: var(--sg-hover); --bs-table-color: var(--sg-text); --bs-table-border-color: var(--sg-border); margin: .25rem 0 !important; }
table.dataTable > thead > tr > th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--sg-muted); font-weight: 600; white-space: nowrap; background: var(--sg-surface-2); border-bottom: 1px solid var(--sg-border) !important; padding: .75rem .9rem; }
table.dataTable > thead > tr > th:first-child { border-top-left-radius: 12px; }
table.dataTable > thead > tr > th:last-child { border-top-right-radius: 12px; }
table.dataTable > tbody > tr > td { padding: .8rem .9rem; vertical-align: middle; border-bottom: 1px solid var(--sg-border); }
table.dataTable > tbody > tr:last-child > td { border-bottom: 0; }
table.dataTable > tbody > tr:hover > * { background-color: var(--sg-hover); box-shadow: none; }
.pagination { gap: 3px; margin: .25rem 0 0; }
.page-link { border: 0 !important; border-radius: 11px !important; color: var(--sg-text); background: transparent; padding: .38rem .7rem; }
.page-link:hover { background: var(--sg-hover); color: var(--sg-text); }
.page-item.active .page-link { background: var(--sg-grad) !important; color: var(--sg-on-accent) !important; }
.page-item.disabled .page-link { color: var(--sg-muted); background: transparent; opacity: .5; }
table.dataTable > tbody > tr.child { background: var(--sg-surface-2); }
table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable > tbody > tr.child ul.dtr-details > li { display: flex; gap: .75rem; padding: .5rem 0; border-bottom: 1px dashed var(--sg-border); }
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child { border-bottom: 0; }
table.dataTable > tbody > tr.child span.dtr-title { flex: 0 0 34%; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--sg-muted); font-weight: 600; }
table.dataTable > tbody > tr.child span.dtr-data { flex: 1; min-width: 0; word-break: break-word; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before { background-color: var(--sg-accent) !important; box-shadow: none; border: 0; }

/* ---------- Pengaturan ---------- */
.set-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.set-nav a { padding: .48rem 1rem; border-radius: 999px; border: 1px solid var(--sg-border); color: var(--sg-muted); text-decoration: none; font-weight: 500; background: var(--sg-surface); }
.set-nav a:hover { color: var(--sg-text); background: var(--sg-hover); }
.set-nav a.active { background: var(--sg-grad); border-color: transparent; color: var(--sg-on-accent); box-shadow: 0 8px 16px -8px var(--sg-accent); }
.theme-pick { display: flex; flex-wrap: wrap; gap: .6rem; }
.theme-chip { display: flex; align-items: center; gap: .55rem; padding: .35rem .8rem .35rem .4rem; border-radius: 999px; border: 2px solid var(--sg-border); background: var(--sg-surface); cursor: pointer; font-weight: 500; font-size: .82rem; color: var(--sg-text); transition: transform .12s, border-color .12s; }
.theme-chip:hover { transform: translateY(-1px); }
.theme-chip.active { border-color: var(--sg-accent); box-shadow: 0 0 0 .2rem var(--sg-accent-soft); }
.theme-chip .sw { width: 26px; height: 26px; border-radius: 50%; }
.img-slot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.img-preview { width: 84px; height: 84px; border-radius: 18px; border: 1px dashed var(--sg-border); background: var(--sg-surface-2); display: grid; place-items: center; overflow: hidden; color: var(--sg-muted); font-size: 1.8rem; }
.img-preview.sm { width: 52px; height: 52px; border-radius: 14px; font-size: 1.2rem; }
.img-preview img { width: 100%; height: 100%; object-fit: contain; }
.brand-preview { background: var(--sg-side-bg); border-radius: 18px; padding: 1.1rem; color: #bcb2d3; }
.brand-preview .sg-brand { padding: 0; }
.brand-preview .pv-btn { margin-top: 1rem; display: inline-block; padding: .5rem 1.1rem; border-radius: 12px; background: linear-gradient(135deg, var(--pv2, var(--sg-accent-2)), var(--pv, var(--sg-accent))); color: #fff; font-weight: 600; font-size: .85rem; }
.check-row { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px dashed var(--sg-border); }
.check-row:last-child { border-bottom: 0; }
.check-row .ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; }
.check-row .ic.ok { background: rgba(34, 197, 94, .16); color: #16a34a; }
.check-row .ic.warn { background: rgba(245, 158, 11, .18); color: #d97706; }
.check-row .ic.fail { background: rgba(239, 68, 68, .16); color: #dc2626; }
.src { font-size: .68rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; margin-left: .4rem; vertical-align: middle; }
.src.db { background: var(--sg-accent-soft); color: var(--sg-accent-dark); }
.src.env { background: rgba(59, 130, 246, .14); color: #2563eb; }
.src.none { background: rgba(239, 68, 68, .13); color: #dc2626; }
.sticky-lg { position: sticky; top: 5.2rem; }

/* ---------- Login ---------- */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--sg-bg); }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; background: linear-gradient(155deg, #150c24 0%, #1d1038 55%, var(--sg-accent-2) 170%); }
.auth-hero::before, .auth-hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.auth-hero::before { width: 460px; height: 460px; background: var(--sg-accent); opacity: .5; top: -160px; right: -140px; }
.auth-hero::after { width: 380px; height: 380px; background: var(--sg-accent-2); opacity: .55; bottom: -160px; left: -120px; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero h2 { font-size: 2.25rem; font-weight: 800; line-height: 1.18; max-width: 470px; margin-bottom: .6rem; }
.auth-hero .lead { color: #cfc6e4; max-width: 440px; font-size: 1rem; }

.mock { margin-top: 1.6rem; max-width: 410px; border-radius: 22px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(14px); padding: 1rem; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); transform: rotate(-1.5deg); }
.mock-head { display: flex; align-items: center; gap: .7rem; }
.mock-head .story-ring { width: 40px; height: 40px; padding: 2px; }
.mock-head .story-in { background: #1b1033; border-color: #1b1033; color: #fff; font-size: .9rem; }
.mock-head strong { display: block; font-size: .85rem; line-height: 1.1; }
.mock-head small { color: #bdb2d6; font-size: .72rem; }
.mock-img { margin: .8rem 0; height: 104px; border-radius: 16px; background: var(--sg-grad); display: grid; place-items: center; font-size: 2.2rem; color: rgba(255, 255, 255, .85); }
.mock-actions { display: flex; gap: .9rem; font-size: 1.15rem; margin-bottom: .6rem; color: #e8e1f6; }
.mock-cm { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem; border-radius: 14px; background: rgba(255, 255, 255, .07); margin-top: .5rem; font-size: .82rem; }
.mock-cm .u-avatar { width: 30px; height: 30px; font-size: .66rem; }
.mock-cm .txt { line-height: 1.3; }
.mock-cm b { font-weight: 600; margin-right: .3rem; }
.mock-chip { display: inline-flex; align-items: center; gap: .3rem; margin-top: .35rem; padding: .15rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 600; }
.mock-chip.ok { background: rgba(34, 197, 94, .22); color: #86efac; }
.mock-chip.bad { background: rgba(239, 68, 68, .25); color: #fda4af; }
.mock-cm.spam .txt-body { animation: blurout 7s ease-in-out infinite; }
.mock-cm.spam .mock-chip { animation: chipin 7s ease-in-out infinite; }
@keyframes blurout { 0%, 38% { filter: none; opacity: 1; text-decoration: none; } 48%, 92% { filter: blur(2.5px); opacity: .45; } 100% { filter: none; opacity: 1; } }
@keyframes chipin { 0%, 40% { opacity: 0; transform: translateY(4px) scale(.9); } 50%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.auth-form-wrap { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.75rem; font-weight: 800; }
.auth-card .form-control { padding: .72rem .95rem; }
.auth-card .btn-accent { padding: .8rem 1rem; font-size: 1rem; }
.pw-toggle { border: 1px solid var(--sg-border); border-left: 0; background: var(--sg-surface); color: var(--sg-muted); border-radius: 0 12px 12px 0 !important; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1199.98px) {
  .sg-content { padding: 1.4rem; }
  .sg-topbar { padding: .7rem 1.4rem; }
}

@media (max-width: 991.98px) {
  .sg-sidebar { transform: translateX(-100%); width: min(86vw, 300px); }
  .sg-sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .55); }
  .sg-main { margin-left: 0; }
  .sg-link { padding: .75rem .9rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .sticky-lg { position: static; }
  .feed-scroll { max-height: 340px; }
}

@media (max-width: 767.98px) {
  body { font-size: .92rem; }
  .sg-content { padding: 1rem .85rem 1.25rem; }
  .sg-topbar { padding: .6rem .85rem; }
  .sg-footer { padding: .75rem .85rem 1.25rem; }
  .sg-pagehead { margin-bottom: 1rem; }
  .page-title { font-size: 1.3rem; }
  .sg-actions { width: 100%; }
  .sg-actions > .btn, .sg-actions > a.btn { flex: 1 1 calc(50% - .5rem); }
  .sg-actions > .btn:only-child { flex-basis: 100%; }
  .card-body { padding: 1rem; }
  .card-header { padding: .85rem 1rem; }
  .hero { padding: 1.3rem 1.15rem; border-radius: 20px; }
  .hero h2 { font-size: 1.35rem; }
  .story-ring { width: 56px; height: 56px; }
  .feed-item { padding: .8rem 1rem; }
  .stat { gap: .75rem; }
  .stat .ico { width: 42px; height: 42px; border-radius: 13px; font-size: 1.12rem; }
  .stat .num { font-size: 1.35rem; }
  .stat .lbl { font-size: .72rem; }
  .chart-box { height: 250px; }
  .modal-body { padding: 1.1rem; }
  .form-control, .form-select, div.dt-container .dt-search input, div.dt-container .dt-length select { font-size: 1rem; }

  div.dt-container .dt-layout-row { flex-direction: column; align-items: stretch !important; gap: .5rem; }
  div.dt-container .dt-layout-cell { width: 100%; display: flex; justify-content: center; }
  div.dt-container .dt-search { display: flex; align-items: center; gap: .5rem; width: 100%; }
  div.dt-container .dt-search label { display: none; }
  div.dt-container .dt-search input { flex: 1; margin: 0 !important; width: 100%; }
  div.dt-container .dt-length { display: flex; align-items: center; justify-content: space-between; width: 100%; }
  div.dt-container .dt-paging { width: 100%; }
  div.dt-container .dt-paging ul.pagination { flex-wrap: wrap; justify-content: center; }
  .page-link { padding: .42rem .65rem; }
  table.dataTable > thead > tr > th, table.dataTable > tbody > tr > td { padding: .7rem .6rem; }

  .set-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; -webkit-overflow-scrolling: touch; }
  .set-nav a { white-space: nowrap; }
  .auth-hero { display: none; }
  .auth-form-wrap { justify-content: flex-start; padding-top: 12vh; }
}

@media (max-width: 575.98px) {
  .sg-clock { display: none; }
  .img-preview { width: 72px; height: 72px; }
  #sg-overlay .box { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Panduan Meta ---------- */
.accordion { --bs-accordion-bg: var(--sg-surface); --bs-accordion-border-color: var(--sg-border); --bs-accordion-border-radius: var(--radius); --bs-accordion-inner-border-radius: calc(var(--radius) - 1px); --bs-accordion-btn-bg: var(--sg-surface); --bs-accordion-active-bg: var(--sg-accent-soft); --bs-accordion-active-color: var(--sg-text); --bs-accordion-btn-color: var(--sg-text); --bs-accordion-color: var(--sg-text); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--sg-accent-soft); box-shadow: var(--sg-shadow); border-radius: var(--radius); }
.accordion-button { font-weight: 600; }
.accordion-button:not(.collapsed) { box-shadow: none; }
[data-bs-theme='dark'] .accordion-button::after { filter: invert(1) grayscale(1); }
.guide-no { flex: none; width: 26px; height: 26px; margin-right: .7rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--sg-on-accent); background: var(--sg-grad); }

/* Role user */
.role-super { background: var(--sg-grad); color: #fff; font-weight: 600; }

/* Kirim komentar */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .85rem; }
.post-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--bs-border-color); border-radius: 14px; overflow: hidden; background: var(--bs-body-bg); transition: transform .15s, box-shadow .15s; cursor: pointer; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .12); }
.post-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-size: 2rem; }
.post-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-type { position: absolute; top: 8px; right: 8px; font-size: 1.05rem; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.post-meta { display: flex; flex-direction: column; gap: .25rem; padding: .6rem .7rem .7rem; }
.post-cap { font-size: .82rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-sub { font-size: .72rem; color: var(--bs-secondary-color); }
.cm-item { padding: .65rem 0; border-bottom: 1px solid var(--bs-border-color); }
.cm-item:last-child { border-bottom: 0; }
.cm-item.is-hidden .cm-text { opacity: .55; }
.cm-main { display: flex; gap: .6rem; align-items: flex-start; }
.cm-body { min-width: 0; flex: 1; }
.cm-text { white-space: pre-wrap; word-break: break-word; }
.cm-replies { margin: .5rem 0 0 2.6rem; padding-left: .8rem; border-left: 2px solid var(--bs-border-color); display: flex; flex-direction: column; gap: .5rem; }
.cm-replybox { margin: .5rem 0 0 2.6rem; }
.u-avatar.sm { width: 26px; height: 26px; font-size: .6rem; }
.cm-main .u-avatar { margin-top: 2px; }

/* Badge jumlah di sidebar */
.sg-badge { margin-left: auto; min-width: 1.4rem; padding: .08rem .45rem; border-radius: 999px; background: #ff3b6b; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1.35; text-align: center; }

.cm-actions { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-top: .15rem; }

/* Laporan */
.rep-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border: 1px solid var(--bs-border-color); border-radius: 16px; background: var(--bs-body-bg); }
.chart-box.short { height: 250px; }
.stat .delta { font-size: .72rem; margin-top: .1rem; }
.delta .d-up { color: #e11d48; font-weight: 600; }
.delta .d-down { color: #16a34a; font-weight: 600; }
.delta .d-flat { color: var(--sg-muted); font-weight: 600; }
.acc-row:hover td { background: var(--bs-tertiary-bg); }
@media print {
  .sg-sidebar, .sg-topbar, .sg-backdrop, .sg-footer, .no-print, .sg-actions { display: none !important; }
  .sg-main { margin-left: 0 !important; }
  .card { break-inside: avoid; box-shadow: none !important; }
  body { background: #fff !important; }
}
