/* =========================================================
   CMS Bhakti Pustaka — gaya panel admin
   ========================================================= */
:root {
    --accent: #9c3d24;
    --accent-dark: #7a2d19;
    --accent-soft: #f6e5df;
    --bg: #f5f6f8;
    --card: #ffffff;
    --ink: #111827;
    --ink-2: #374151;
    --muted: #6b7280;
    --line: #e5e7eb;
    --line-soft: #f0f1f3;
    --success: #15803d; --success-bg: #dcfce7;
    --warning: #b45309; --warning-bg: #fef3c7;
    --danger: #b91c1c;  --danger-bg: #fee2e2;
    --info: #1d4ed8;    --info-bg: #dbeafe;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .25);
    --sidebar-w: 256px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
p { margin: 0 0 .8em; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .85em; background: var(--line-soft); padding: 2px 6px; border-radius: 4px; color: var(--ink-2); }
svg.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.sb-brand strong { display: block; font-size: 14.5px; line-height: 1.2; }
.sb-brand small { display: block; color: var(--muted); font-size: 12px; }
.sb-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 18px Georgia, serif; flex-shrink: 0; }
.sb-brand .brand-logo { height: 36px; width: auto; max-width: 60px; object-fit: contain; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.sb-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; padding: 16px 10px 6px; }
.sb-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; position: relative; transition: background .12s, color .12s; }
.sb-nav a .icon { color: #9ca3af; transition: color .12s; }
.sb-nav a:hover { background: var(--line-soft); color: var(--ink); }
.sb-nav a:hover .icon { color: var(--ink-2); }
.sb-nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.sb-nav a.active .icon { color: var(--accent); }
.sb-nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.sb-user { display: flex; align-items: center; gap: 8px; padding: 12px; margin: 0 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.sb-user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); }
.sb-user-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-info small { color: var(--muted); font-size: 12px; }
.avatar-xs { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.sb-overlay { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.crumbs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; color: var(--muted); font-size: 13px; }
.crumbs a { color: var(--muted); display: inline-flex; }
.crumbs a:hover { color: var(--ink); }
.crumbs span { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: #c4c8cf; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar .sb-toggle { display: none; }
.has-dot-wrap { position: relative; }
.has-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #fff; }
.content { padding: 28px; width: 100%; max-width: 1320px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #991b1b; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); box-shadow: none; }
.btn-danger-soft:hover { background: #fecaca; color: #991b1b; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
form.inline { display: inline; }

/* ---------- Kartu ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head h2, .card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon, .card-head h3 .icon { color: var(--muted); }
.card-head a { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--line-soft); color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); }
.star { color: #f59e0b; display: inline-flex; vertical-align: -2px; }
.star svg { fill: currentColor; }

/* ---------- Alert ---------- */
.flash-stack:empty { display: none; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; transition: opacity .4s, transform .4s; }
.alert > .icon { margin-top: 1px; }
.alert-body { flex: 1; }
.alert-close { background: none; border: 0; padding: 2px; cursor: pointer; color: inherit; opacity: .55; display: grid; }
.alert-close:hover { opacity: 1; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert.fade-out { opacity: 0; transform: translateY(-6px); }

/* ---------- Dasbor ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.stat:hover { border-color: var(--accent); transform: translateY(-1px); }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.stat-icon.t-success { background: var(--success-bg); color: var(--success); }
.stat-icon.t-warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.t-info { background: var(--info-bg); color: var(--info); }
.stat-icon.t-danger { background: var(--danger-bg); color: var(--danger); }
.stat strong { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.dash-grid .card { margin-bottom: 20px; }
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { margin-bottom: 14px; }
.bar-list li:last-child { margin-bottom: 0; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar-label b { font-weight: 600; }
.bar { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; transition: border-color .12s, background .12s; }
.quick a .icon { color: var(--accent); }
.quick a:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { display: block; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .title:hover { color: var(--accent); }
.list .sub { display: block; color: var(--muted); font-size: 12.5px; }
.list .unread .title { font-weight: 700; }
.list-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--line-soft); color: var(--muted); flex-shrink: 0; }

/* ---------- Tabel ---------- */
.table-card { overflow: hidden; }
.table-toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.search-box input { padding-left: 36px !important; }
.table-toolbar select { width: auto; min-width: 150px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 16px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.unread td { background: #fffbeb; }
.table tr.unread .t-title { font-weight: 700; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions > * { margin-left: 2px; }
.t-title { font-weight: 600; color: var(--ink); }
a.t-title:hover { color: var(--accent); }
.t-sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.t-media { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.thumb { width: 38px; flex-shrink: 0; }
.thumb .cover { width: 38px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 4px 4px 2px; display: block; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.thumb .cover-generated { padding: 4px; }
.thumb .cv-brand, .thumb .cv-author { display: none; }
.thumb .cv-title { font-size: 5.5px !important; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { color: #d1d5db; margin-bottom: 8px; }
.empty p { margin: 0; }

/* DataTables — disesuaikan dengan gaya CMS */
div.dt-container { font-size: 14px; }
div.dt-container .dt-layout-row { margin: 0; padding: 12px 16px; }
div.dt-container .dt-layout-row.dt-layout-table { padding: 0; }
div.dt-container .dt-layout-row:last-child { border-top: 1px solid var(--line-soft); }
div.dt-container .dt-layout-cell.dt-layout-start { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
div.dt-container .dt-info { color: var(--muted); font-size: 13px; padding: 0; }
div.dt-container .dt-length { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
div.dt-container .dt-length select { width: auto; height: 32px; padding: 0 28px 0 10px; }
div.dt-container .dt-paging { padding: 0; }
div.dt-container .dt-paging .dt-paging-button { min-width: 32px; height: 32px; padding: 0 10px !important; margin: 0 2px !important; border-radius: 7px !important; border: 1px solid transparent !important; background: none !important; color: var(--ink-2) !important; font-size: 13px; line-height: 30px; }
div.dt-container .dt-paging .dt-paging-button:hover { background: var(--line-soft) !important; color: var(--ink) !important; }
div.dt-container .dt-paging .dt-paging-button.current, div.dt-container .dt-paging .dt-paging-button.current:hover { background: var(--accent) !important; color: #fff !important; }
div.dt-container .dt-paging .dt-paging-button.disabled, div.dt-container .dt-paging .dt-paging-button.disabled:hover { color: #c4c8cf !important; background: none !important; }
table.dataTable { border-collapse: collapse !important; }
table.dataTable > thead > tr > th { border-bottom: 1px solid var(--line) !important; padding: 11px 16px !important; }
table.dataTable > tbody > tr > td { padding: 12px 16px !important; border-top: 0 !important; }
table.dataTable > thead > tr > th.dt-orderable-asc:hover, table.dataTable > thead > tr > th.dt-orderable-desc:hover { outline: none !important; background: var(--line-soft); }
table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc { color: var(--ink); }
table.dataTable td.dt-type-numeric, table.dataTable th.dt-type-numeric, table.dataTable td.dt-type-date, table.dataTable th.dt-type-date { text-align: left; }
table.dataTable > tbody > tr:hover > * { box-shadow: none !important; }
table.dataTable td.dt-empty { padding: 40px !important; color: var(--muted); }

/* ---------- Form ---------- */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
    font: inherit; width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { background: var(--line-soft); color: var(--muted); }
input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
textarea.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }
.field { display: block; margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > span:first-child, .field-label { display: block; font-weight: 500; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field .req { color: var(--danger); }
.hint { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.hint .icon { margin-top: 2px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.input-group { display: flex; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; background: var(--line-soft); border: 1px solid var(--line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-size: 13px; white-space: nowrap; }
.input-group input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=text] { width: 120px; font-family: ui-monospace, monospace; }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 10px; cursor: pointer; }
.check-inline input { accent-color: var(--accent); width: 16px; height: 16px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.form-layout > div > .card:last-child { margin-bottom: 0; }
.side { position: sticky; top: 80px; }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 26px 0 14px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* Toggle */
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin-bottom: 16px; }
.toggle:last-child { margin-bottom: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 38px; height: 22px; border-radius: 999px; background: #d1d5db; position: relative; flex-shrink: 0; transition: background .15s; margin-top: 1px; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle-text strong { display: block; font-weight: 500; font-size: 13.5px; }
.toggle-text small { display: block; color: var(--muted); font-size: 12.5px; }

/* Dropzone */
.dropzone { position: relative; border: 1.5px dashed #d1d5db; border-radius: var(--radius); background: #fafbfc; overflow: hidden; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.dz-preview { display: grid; place-items: center; width: 100%; height: 100%; }
.dz-preview img { width: 100%; height: 100%; object-fit: cover; }
.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; text-align: center; padding: 16px; }
.dz-empty .icon { color: #9ca3af; }
.dz-cover { aspect-ratio: 2 / 3; max-width: 200px; margin: 0 auto; }
.dz-cover .dz-preview { position: relative; }
.dz-cover .cover-generated { width: 100%; height: 100%; }
.dz-badge { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.95); color: var(--ink); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow); }
.dz-square { aspect-ratio: 1; max-width: 160px; }
.dz-wide { aspect-ratio: 16 / 9; }
.dz-logo { height: 110px; }
.dz-logo .dz-preview img, .dz-square .dz-preview img.contain { object-fit: contain; padding: 12px; }
.dz-favicon { width: 96px; height: 96px; }
.dz-favicon .dz-preview img { object-fit: contain; padding: 18px; }
.cover-current { width: 160px; margin: 0 auto 12px; }
.cover-current .cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px 6px 6px 3px; box-shadow: 0 8px 20px rgba(0,0,0,.18); }

/* Pilihan bergaya kartu (radio) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice-card { display: block; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; height: 100%; transition: border-color .12s, box-shadow .12s; background: #fff; }
.choice-card:hover { border-color: #c4c8cf; }
.choice input:checked + .choice-card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice input:focus-visible + .choice-card { box-shadow: 0 0 0 3px var(--accent-soft); }
.choice-card strong { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.choice-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.choice-card .check { margin-left: auto; color: var(--accent); opacity: 0; }
.choice input:checked + .choice-card .check { opacity: 1; }
.swatches { display: flex; height: 44px; border-radius: 8px; overflow: hidden; margin-bottom: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.swatches i { flex: 1; }
.swatches i:first-child { flex: 2; }

/* Tab pengaturan */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.tab-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; }
.tab-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.tab-nav a .icon { color: #9ca3af; }
.tab-nav a:hover { background: var(--card); }
.tab-nav a.active { background: var(--card); color: var(--accent-dark); box-shadow: var(--shadow); }
.tab-nav a.active .icon { color: var(--accent); }
.settings-panel .card-body > p.desc { color: var(--muted); margin-top: -4px; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* Quill */
.editor-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); background: #fff; }
.editor-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: #fafbfc; font-family: inherit; padding: 8px; }
.editor-wrap .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 15px; }
.editor-wrap .ql-editor { min-height: 360px; line-height: 1.7; padding: 18px 20px; }
.editor-wrap.editor-sm .ql-editor { min-height: 220px; }
.editor-wrap .ql-editor h2 { font-size: 1.5em; margin: .8em 0 .4em; }
.editor-wrap .ql-editor h3 { font-size: 1.25em; margin: .8em 0 .4em; }
.editor-wrap .ql-editor blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--ink-2); }
.editor-wrap .ql-editor img { max-width: 100%; border-radius: 6px; }
.editor-wrap .ql-editor.ql-blank::before { color: #9ca3af; font-style: normal; left: 20px; }
.editor-wrap .ql-snow .ql-stroke { stroke: var(--ink-2); }
.editor-wrap .ql-snow .ql-fill { fill: var(--ink-2); }
.editor-wrap .ql-snow.ql-toolbar button:hover .ql-stroke, .editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent); }
.editor-wrap .ql-snow.ql-toolbar button:hover .ql-fill, .editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--accent); }
.editor-wrap .ql-snow.ql-toolbar button.ql-active, .editor-wrap .ql-snow .ql-picker-label.ql-active { color: var(--accent); }
.editor-wrap .ql-snow .ql-tooltip { z-index: 5; border-radius: 8px; box-shadow: var(--shadow-lg); border-color: var(--line); }

/* Detail (pesan/naskah) */
.meta-list { display: grid; grid-template-columns: 130px 1fr; margin: 0; }
.meta-list dt, .meta-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.meta-list dt { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.meta-list dd { font-weight: 500; }
.message-body { background: #fafbfc; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 18px; line-height: 1.7; margin: 0; }
.file-box { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 16px; }
.file-box .list-icon { background: var(--accent-soft); color: var(--accent); }

/* Avatar penulis */
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-initials { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 1.5rem; }
.avatar-sm { width: 36px; height: 36px; font-size: 12.5px; }

/* Sampul otomatis (sama dengan situs publik) */
.cover-generated { --cv-bg: #1f3a5f; --cv-fg: #f4d58d; background: var(--cv-bg); color: var(--cv-fg); display: flex; flex-direction: column; padding: 14% 12%; container-type: inline-size; overflow: hidden; }
.cv-brand { font-size: 7cqi; letter-spacing: .2em; text-transform: uppercase; opacity: .75; }
.cv-title { font-family: Georgia, serif; font-weight: 700; font-size: 12cqi; line-height: 1.1; margin-top: auto; margin-bottom: 6%; }
.cv-author { font-size: 7.5cqi; margin-bottom: 18%; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(17, 24, 39, .5); animation: fade .15s; }
.modal-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 24px; box-shadow: var(--shadow-lg); animation: pop .15s; }
.modal-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger); margin-bottom: 14px; }
.modal-card h3 { font-size: 17px; margin-bottom: 6px; }
.modal-card p { color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.login-art { background: var(--accent); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before, .login-art::after { content: ''; position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); }
.login-art::before { width: 520px; height: 520px; right: -180px; bottom: -160px; }
.login-art::after { width: 300px; height: 300px; right: -60px; bottom: -40px; }
.login-art .sb-brand { color: #fff; border: 0; padding: 0; }
.login-art .sb-brand small { color: rgba(255,255,255,.75); }
.login-art .brand-mark { background: #fff !important; color: var(--accent) !important; }
.login-art .brand-logo { background: #fff; padding: 4px; border-radius: 8px; }
.login-art h2 { font-size: 30px; font-weight: 700; line-height: 1.25; max-width: 420px; font-family: Georgia, serif; }
.login-art p { color: rgba(255,255,255,.8); max-width: 400px; }
.login-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-box > p { color: var(--muted); margin-bottom: 24px; }
.login-box .btn { height: 42px; margin-top: 6px; }
.login-box .back { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; color: var(--muted); font-size: 13px; }
.login-box .back:hover { color: var(--ink); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.input-icon input { padding-left: 38px; height: 42px; }
.captcha-math input { max-width: 140px; }
.captcha-math { display: block; font-weight: 500; font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }
.captcha-math input { margin-top: 6px; display: block; }
.captcha-box { margin-bottom: 18px; }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: 1fr; }
    .form-layout { grid-template-columns: 1fr; }
    .side { position: static; }
}
@media (max-width: 900px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .sb-open .sidebar { transform: none; }
    .sb-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 35; }
    .topbar .sb-toggle { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .content { padding: 20px 16px; }
    .settings-layout { grid-template-columns: 1fr; }
    .tab-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
    .tab-nav a { white-space: nowrap; }
    .login-page { grid-template-columns: 1fr; }
    .login-art { display: none; }
}
@media (max-width: 640px) {
    .row-2, .row-3 { grid-template-columns: 1fr; }
    .hide-sm { display: none; }
    .page-head h1 { font-size: 19px; }
    .meta-list { grid-template-columns: 1fr; }
    .meta-list dt { border-bottom: 0; padding-bottom: 0; }
    .search-box { max-width: none; }
    div.dt-container .dt-layout-row:last-child { flex-direction: column; gap: 10px; }
}

/* Captcha gambar */
.captcha-image { margin-bottom: 18px; }
.captcha-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.captcha-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.captcha-row img { border-radius: 8px; border: 1px solid var(--line); display: block; width: 180px; height: 60px; image-rendering: pixelated; }
.captcha-refresh { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; cursor: pointer; }
.captcha-refresh:hover { border-color: var(--accent); color: var(--accent); }
.captcha-row input { width: 140px !important; flex: 0 0 auto; text-transform: uppercase; letter-spacing: .2em; font-weight: 600; margin: 0 !important; }
.captcha-label { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.captcha-row input { height: 42px; }

/* ---------- Analitik ---------- */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.range-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; }
.range-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-custom input[type=date] { width: auto; height: 32px; }
.segmented { display: inline-flex; background: var(--line-soft); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmented a, .segmented button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted); padding: 5px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.segmented a:hover, .segmented button:hover { color: var(--ink); }
.segmented .active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented-sm a, .segmented-sm button { padding: 3px 10px; font-size: 12.5px; }
.kpi > span:last-child > span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 999px; }
.delta.up { color: var(--success); background: var(--success-bg); }
.delta.down { color: var(--danger); background: var(--danger-bg); }
.chart-legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend .key { width: 16px; height: 2px; border-radius: 2px; background: var(--c); display: inline-block; }
.chart-box { position: relative; height: 300px; }
.daily-table { max-height: 320px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.daily-table th { position: sticky; top: 0; }
.breakdown-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.breakdown-grid .card { margin: 0; }
.breakdown .bar-label { gap: 10px; }
.bar-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-name a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.bar-name a:hover { color: var(--accent); }
.bar-name .icon { color: var(--muted); }
.bar-label b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-label b small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.breakdown .bar i { border-radius: 4px; }
.table .badge .icon { margin-right: -2px; }
div.dt-container .dt-processing { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px 16px; font-size: 13px; color: var(--muted); }
div.dt-container .dt-processing > div:last-child { display: none; }

/* ---------- Footer CMS ---------- */
.content { flex: 1; }
.cms-footer { padding: 18px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; }
.cms-footer a { color: var(--ink-2); font-weight: 600; }
.cms-footer a:hover { color: var(--accent); }
@media (max-width: 900px) { .cms-footer { padding: 16px; } }
