/* TOOL SEBAR BROSUR INSTAGRAM — Java Maya Studio design system */
:root {
  --primary: #635BFF;
  --primary-600: #5248F0;
  --primary-50: #F0EFFF;
  --primary-100: #E3E1FF;
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --text: #202124;
  --muted: #6B7280;
  --border: #E6E8EC;
  --border-strong: #D5D8DE;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --info: #0EA5E9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .14);
  --sidebar-w: 260px;
  --bs-primary: #635BFF;
  --bs-primary-rgb: 99, 91, 255;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: #202124;
  --bs-body-bg: #F7F8FA;
  --bs-border-color: #E6E8EC;
  --bs-link-color: #635BFF;
  --bs-link-hover-color: #5248F0;
  --bs-link-color-rgb: 99, 91, 255;
}

html, body { background: var(--bg); color: var(--text); }
body { font-family: var(--bs-body-font-family); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.01em; }
.text-secondary { color: var(--muted) !important; }
.small, small { font-size: 12.5px; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040; transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: var(--text); border-bottom: 1px solid var(--border); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 14px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 11.5px; }
.sidebar-nav { overflow-y: auto; padding: 8px 12px 16px; flex: 1; scrollbar-width: thin; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9CA3AF; font-weight: 600; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: #4B5563; font-weight: 500;
  margin-bottom: 1px; transition: background .12s, color .12s;
}
.nav-item i { font-size: 16px; width: 18px; text-align: center; color: #9CA3AF; }
.nav-item:hover { background: #F3F4F6; color: var(--text); }
.nav-item.active { background: var(--primary-50); color: var(--primary); }
.nav-item.active i { color: var(--primary); }
.nav-badge { margin-left: auto; background: var(--primary); color: #fff; font-size: 10.5px; border-radius: 99px; padding: 1px 7px; font-weight: 600; }
.sidebar-foot { padding: 12px 20px; border-top: 1px solid var(--border); color: #9CA3AF; font-size: 11.5px; }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 1030;
}
.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9CA3AF; }
.topbar-search input {
  width: 100%; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; padding: 8px 12px 8px 36px; font-size: 13.5px; outline: none;
}
.topbar-search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-100); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.btn-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; color: #4B5563; font-size: 18px; }
.btn-icon:hover { background: #F3F4F6; }
.dot-badge { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.profile-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 8px; border-radius: 10px; }
.profile-btn:hover { background: #F3F4F6; }
.profile-btn strong { font-size: 13px; }
.profile-btn small { color: var(--muted); font-size: 11.5px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #7A73FF, #4F46E5); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: 0 0 auto; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.notif-menu { width: 360px; max-width: calc(100vw - 32px); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-row { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #F3F4F6; color: var(--text); }
.notif-row:hover { background: #FAFAFB; }
.notif-row.unread { background: #FAF9FF; }
.notif-row .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }

.content { padding: 28px 32px 48px; max-width: 1480px; width: 100%; }
.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: 24px; margin: 0; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Components ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h6, .card-title { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { background: #FCFCFD; border-top: 1px solid var(--border); padding: 12px 20px; }

.stat-card { padding: 18px 20px; }
.stat-card .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-card .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; line-height: 1.2; }
.stat-card .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.ic-primary { background: var(--primary-50); color: var(--primary); }
.ic-success { background: #DCFCE7; color: var(--success); }
.ic-warning { background: #FEF3C7; color: #B45309; }
.ic-danger { background: #FEE2E2; color: var(--danger); }
.ic-info { background: #E0F2FE; color: #0369A1; }
.ic-muted { background: #F3F4F6; color: #4B5563; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 0; }

.btn { font-weight: 500; border-radius: 9px; font-size: 13.5px; padding: 7px 14px; }
.btn-sm { font-size: 12.5px; padding: 4px 10px; border-radius: 7px; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-600); --bs-btn-hover-border-color: var(--primary-600); --bs-btn-active-bg: #463CDB; --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); box-shadow: 0 1px 2px rgba(99, 91, 255, .3); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary-100); --bs-btn-hover-bg: var(--primary-50); --bs-btn-hover-color: var(--primary); --bs-btn-hover-border-color: var(--primary-100); --bs-btn-active-bg: var(--primary-100); --bs-btn-active-color: var(--primary); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--border); --bs-btn-hover-bg: #F9FAFB; --bs-btn-hover-border-color: var(--border-strong); color: #374151; }
.btn-soft { background: var(--primary-50); color: var(--primary); border: 1px solid transparent; }
.btn-soft:hover { background: var(--primary-100); color: var(--primary); }

.form-label { font-weight: 500; font-size: 13px; color: #374151; margin-bottom: 6px; }
.form-control, .form-select { border-radius: 9px; border-color: var(--border-strong); font-size: 13.5px; padding: 8px 12px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.form-text { font-size: 12px; color: var(--muted); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--primary-100); border-color: var(--primary); }
.input-group-text { border-color: var(--border-strong); background: #F9FAFB; font-size: 13px; }

.table { margin: 0; font-size: 13.5px; --bs-table-hover-bg: #FAFAFB; }
.table > :not(caption) > * > * { padding: 11px 14px; border-bottom-color: #F0F1F3; vertical-align: middle; }
.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #FAFAFB; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-card { overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.pagination { --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-color: #374151; --bs-pagination-border-color: var(--border); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; padding: 6px 10px; font-size: 13px; }
.filters .search-input { min-width: 240px; flex: 1; max-width: 360px; }
.bulk-bar { display: none; align-items: center; gap: 8px; padding: 10px 16px; background: var(--primary-50); border-bottom: 1px solid var(--primary-100); flex-wrap: wrap; }
.bulk-bar.show { display: flex; }

.badge-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-danger { background: #FEE2E2; color: #B91C1C; }
.badge-info { background: #E0F2FE; color: #0369A1; }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-secondary { background: #F3F4F6; color: #4B5563; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: #F3F4F6; color: #374151; font-size: 12px; font-weight: 500; margin: 2px 2px 2px 0; }
.chip-primary { background: var(--primary-50); color: var(--primary); }

.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-50); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 12px; }
.empty-state h6 { margin-bottom: 4px; }
.empty-state p { color: var(--muted); max-width: 420px; margin: 0 auto 16px; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.quick-action { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); font-weight: 500; transition: border-color .12s, box-shadow .12s, transform .12s; }
.quick-action:hover { border-color: var(--primary-100); box-shadow: var(--shadow); color: var(--primary); transform: translateY(-1px); }
.quick-action i { color: var(--primary); font-size: 17px; }

.limit-note { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.info-note { background: var(--primary-50); border: 1px solid var(--primary-100); color: #3730A3; border-radius: 10px; padding: 12px 14px; font-size: 13px; }

/* Media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; padding: 16px; }
.media-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; position: relative; transition: box-shadow .12s, border-color .12s; }
.media-card:hover { box-shadow: var(--shadow); }
.media-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.media-thumb { aspect-ratio: 1; background: #F3F4F6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-meta { padding: 8px 10px; font-size: 12px; }
.media-meta .name { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-check { position: absolute; top: 8px; left: 8px; z-index: 2; }
.media-check .form-check-input { width: 18px; height: 18px; box-shadow: var(--shadow); }
.media-type { position: absolute; top: 8px; right: 8px; background: rgba(17, 24, 39, .7); color: #fff; border-radius: 6px; font-size: 11px; padding: 1px 6px; }

.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 40px 20px; text-align: center; background: #FCFCFD; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone.drag { border-color: var(--primary); background: var(--primary-50); }
.dropzone i { font-size: 36px; color: var(--primary); }
.upload-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #F3F4F6; font-size: 13px; }
.upload-row .progress { flex: 1; height: 6px; }

/* Wizard */
.wizard-steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; }
.wizard-step { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border); white-space: nowrap; color: var(--muted); font-weight: 500; font-size: 13px; cursor: pointer; }
.wizard-step .num { width: 22px; height: 22px; border-radius: 50%; background: #F3F4F6; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; }
.wizard-step.active { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.wizard-step.active .num, .wizard-step.done .num { background: var(--primary); color: #fff; }
.wizard-step.done { color: var(--text); }
.wizard-pane { display: none; }
.wizard-pane.active { display: block; }
.select-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: #fff; height: 100%; transition: border-color .12s; }
.select-card:hover { border-color: var(--border-strong); }
.select-card:has(input:checked) { border-color: var(--primary); background: #FAF9FF; box-shadow: 0 0 0 2px var(--primary-100); }
.select-card .title { font-weight: 600; }
.select-card .desc { font-size: 12.5px; color: var(--muted); }
.scroll-box { max-height: 360px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }

/* IG preview */
.ig-preview { border: 1px solid var(--border); border-radius: 12px; background: #fff; max-width: 380px; overflow: hidden; }
.ig-preview .ig-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; font-size: 13px; }
.ig-preview .ig-media { aspect-ratio: 4/5; background: #F3F4F6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ig-preview .ig-media img, .ig-preview .ig-media video { width: 100%; height: 100%; object-fit: cover; }
.ig-preview .ig-caption { padding: 10px 12px; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.ig-actions { padding: 8px 12px 0; font-size: 20px; display: flex; gap: 14px; }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-cell { min-height: 112px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; background: #fff; overflow: hidden; }
.cal-cell.muted { background: #FAFAFB; }
.cal-cell.today .cal-day { background: var(--primary); color: #fff; }
.cal-head { background: #FAFAFB; font-size: 11.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); text-align: center; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-day { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.cal-event { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-50); color: var(--primary); border-left: 3px solid var(--primary); }
.cal-event.st-published { background: #DCFCE7; color: #15803D; border-color: var(--success); }
.cal-event.st-failed { background: #FEE2E2; color: #B91C1C; border-color: var(--danger); }
.cal-event.st-cancelled { background: #F3F4F6; color: #6B7280; border-color: #9CA3AF; text-decoration: line-through; }
.cal-event.st-processing, .cal-event.st-queued { background: #FEF3C7; color: #B45309; border-color: var(--warning); }

/* Chat */
.chat-box { height: 520px; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; background: #FCFCFD; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }

/* Health */
.health-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid #F3F4F6; gap: 12px; }
.health-row:last-child { border-bottom: 0; }
.log-pre { background: #0F172A; color: #E2E8F0; font-size: 12px; border-radius: 10px; padding: 14px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

.chart-box { position: relative; height: 260px; }
.kbd-hint { font-size: 11.5px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qc-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 4px 0; }

/* Auth */
.auth-body { background: #fff; }
.auth-wrap { display: flex; min-height: 100vh; }
.auth-side { flex: 1; background: radial-gradient(1200px 600px at 0% 0%, #7A73FF 0%, #4F46E5 45%, #312E81 100%); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-side-inner { max-width: 440px; }
.auth-side h2 { font-size: 26px; margin: 20px 0 8px; letter-spacing: .01em; }
.auth-side .lead { opacity: .85; font-size: 16px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0; }
.auth-points li { padding: 6px 0; opacity: .92; }
.auth-points i { margin-right: 8px; }
.auth-side small { opacity: .6; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(17, 24, 39, .4); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 20px 16px 40px; }
  .topbar { padding: 0 12px; }
  .auth-side { display: none; }
}
@media (max-width: 575.98px) {
  .page-head h1 { font-size: 20px; }
  .filters .search-input { min-width: 100%; }
  .filters .form-select, .filters .form-control { flex: 1 1 140px; min-width: 0; }
  .cal-cell { min-height: 72px; padding: 3px; }
  .cal-event { font-size: 10px; padding: 1px 3px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
  .chat-msg { max-width: 92%; }
}

/* Compact choice cards (jenis publikasi) */
.select-card.py-2 { align-items: center; padding-left: 10px; padding-right: 10px; }
.select-card.py-2 .title { white-space: nowrap; }
