/* =========================================================
   e-Konseling — Tema Premium (di atas AdminLTE 4 / Bootstrap 5.3)
   ========================================================= */
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --radius: 1rem;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 4px 24px -6px rgba(16, 24, 40, .10);
  --bs-font-sans-serif: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: .925rem;
  --bs-primary: var(--brand);
  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-2);
}
body { font-family: var(--bs-font-sans-serif); -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
[data-bs-theme=light] body.bg-body-tertiary { background: #f4f6fb !important; }

/* ---------- Tombol / warna brand ---------- */
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-2); --bs-btn-hover-border-color: var(--brand-2); --bs-btn-active-bg: var(--brand-2); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn { border-radius: .7rem; font-weight: 600; }
.btn-sm { border-radius: .55rem; }
.btn-glow { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0; box-shadow: 0 6px 18px -6px var(--brand); }
.btn-glow:hover { filter: brightness(1.07); transform: translateY(-1px); }
.text-bg-brand { background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important; color: #fff !important; }
.bg-orange, .text-bg-orange { background-color: #f97316 !important; color: #fff !important; }
.btn-primary-subtle { background: var(--bs-primary-bg-subtle); border: 0; }
.btn-info-subtle { background: var(--bs-info-bg-subtle); border: 0; }
.btn-success-subtle { background: var(--bs-success-bg-subtle); border: 0; }
.btn-warning-subtle { background: var(--bs-warning-bg-subtle); border: 0; }
.btn-danger-subtle { background: var(--bs-danger-bg-subtle); border: 0; }
.btn[class*="-subtle"]:hover { filter: brightness(.95); }
.action-group .btn { border-radius: .5rem !important; margin-left: 3px; }
.action-group form .btn { border-radius: .5rem !important; }
.alert-primary-subtle { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }

/* ---------- Header ---------- */
.glass-header { backdrop-filter: saturate(180%) blur(12px); background: rgba(255, 255, 255, .82) !important; border-bottom: 1px solid rgba(0, 0, 0, .05); }
[data-bs-theme=dark] .glass-header { background: rgba(33, 37, 41, .82) !important; border-color: rgba(255, 255, 255, .06); }
.user-menu .user-header { padding: 1.25rem; text-align: center; }
.user-menu .user-header small { display: block; opacity: .85; font-size: .8rem; }
.user-menu .user-footer { padding: .75rem; }

/* ---------- Sidebar ---------- */
.sidebar-premium { background: linear-gradient(180deg, #111827 0%, #1e1b4b 100%) !important; }
.sidebar-premium .sidebar-brand { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; margin-right: .5rem; box-shadow: 0 6px 16px -6px var(--brand); }
.brand-image { border-radius: 8px; background: #fff; padding: 2px; }
.sidebar-user { display: flex; gap: .75rem; align-items: center; margin: .9rem .75rem .25rem; padding: .75rem; border-radius: .9rem; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); }
.sidebar-collapse .sidebar-user { display: none; }
.sidebar-premium .nav-header { font-size: .68rem !important; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .42) !important; padding-top: 1rem !important; }
.sidebar-premium .sidebar-menu .nav-link { border-radius: .7rem; margin: 1px .5rem; width: calc(100% - 1rem); color: rgba(255, 255, 255, .78); transition: all .18s; }
.sidebar-premium .sidebar-menu .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-premium .sidebar-menu .nav-link.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important; color: #fff !important; box-shadow: 0 8px 20px -10px var(--brand); }
.nav-badge { font-size: .65rem; margin-top: 2px; }

/* ---------- Konten ---------- */
.app-main { padding-bottom: 1rem; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.1rem; }
.page-title { font-size: 1.4rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.page-title .bi { color: var(--brand); }
.page-sub { margin: .2rem 0 0; color: var(--bs-secondary-color); font-size: .88rem; }
.card-premium { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-premium > .card-header { background: transparent; border-bottom: 1px solid var(--bs-border-color-translucent); font-weight: 700; padding: 1rem 1.25rem; }
.card-premium .card-title { font-weight: 700; font-size: 1rem; }
.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand); border-bottom: 1px dashed var(--bs-border-color); padding: .9rem 0 .35rem; margin-bottom: .25rem; }
.text-pre { white-space: pre-wrap; }
.form-control, .form-select { border-radius: .65rem; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 18%, transparent); }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.input-group-text { border-radius: .65rem; }

.table-premium thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); border-bottom: 0; padding: .75rem; white-space: nowrap; }
.table-premium td { padding: .7rem .75rem; border-color: var(--bs-border-color-translucent); }
.table-premium tbody tr { transition: background .15s; }
.filter-bar .form-select, .filter-bar .form-control { font-size: .85rem; }

.avatar-img { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-txt { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; }

.detail-list dt { font-weight: 600; color: var(--bs-secondary-color); font-size: .85rem; padding: .55rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.detail-list dd { padding: .55rem 0; margin: 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.detail-list dt.section-label { border-bottom: 1px dashed var(--bs-border-color); color: var(--brand); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--bs-secondary-color); }
.empty-state > .bi { font-size: 3.2rem; opacity: .35; display: block; margin-bottom: .5rem; }

/* ---------- Kartu statistik ---------- */
.stat-card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.15rem; position: relative; overflow: hidden; height: 100%; background: var(--bs-body-bg); transition: transform .2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-card .stat-label { font-size: .8rem; color: var(--bs-secondary-color); font-weight: 600; }
.stat-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: currentColor; opacity: .05; }
.g-indigo { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.g-sky { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.g-emerald { background: linear-gradient(135deg, #10b981, #14b8a6); }
.g-amber { background: linear-gradient(135deg, #f59e0b, #f97316); }
.g-rose { background: linear-gradient(135deg, #f43f5e, #ec4899); }
.g-slate { background: linear-gradient(135deg, #475569, #1e293b); }

.hero { border-radius: calc(var(--radius) + 4px); padding: 1.5rem 1.6rem; color: #fff; position: relative; overflow: hidden; background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 60%, #db2777 130%); box-shadow: 0 18px 40px -20px var(--brand); }
.hero h2 { font-weight: 800; letter-spacing: -.02em; }
.hero::before { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .08); right: -80px; top: -140px; }
.hero::after { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .07); right: 120px; bottom: -120px; }
.hero > * { position: relative; z-index: 1; }
.hero .chip { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22); padding: .25rem .7rem; border-radius: 99px; font-size: .78rem; font-weight: 600; display: inline-flex; gap: .35rem; align-items: center; }

.quick-link { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .4rem; border-radius: 1rem; background: var(--bs-body-bg); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--bs-body-color); font-size: .78rem; font-weight: 600; text-align: center; transition: all .18s; height: 100%; }
.quick-link i { font-size: 1.45rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #fff; }
.quick-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--brand); }

/* ---------- Timeline ---------- */
.tl { position: relative; padding-left: 1.6rem; }
.tl::before { content: ""; position: absolute; left: .55rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--bs-border-color); }
.tl-item { position: relative; margin-bottom: 1rem; }
.tl-dot { position: absolute; left: -1.6rem; top: .1rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; display: grid; place-items: center; font-size: .6rem; color: #fff; box-shadow: 0 0 0 3px var(--bs-body-bg); }
.tl-card { background: var(--bs-tertiary-bg); border-radius: .8rem; padding: .7rem .9rem; }

/* ---------- Poin meter ---------- */
.poin-ring { --p: 0; --c: #10b981; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bs-tertiary-bg) 0); margin: auto; }
.poin-ring > div { width: 94px; height: 94px; border-radius: 50%; background: var(--bs-body-bg); display: grid; place-items: center; text-align: center; }
.poin-ring b { font-size: 1.6rem; font-weight: 800; line-height: 1; display: block; }

/* ---------- Absensi ---------- */
.absen-opt .btn-check + .btn { min-width: 38px; padding: .3rem .5rem; font-weight: 700; }
.absen-opt .btn-check:checked + .btn-outline-success { background: #10b981; color: #fff; }

/* ---------- Asesmen ---------- */
.soal-card { border: 1px solid var(--bs-border-color-translucent); border-radius: .9rem; padding: 1rem 1.1rem; margin-bottom: .75rem; transition: border-color .2s; }
.soal-card:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 4%, transparent); }
.soal-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; font-size: .8rem; margin-right: .5rem; }
.qr-box { background: #fff; padding: 10px; border-radius: 12px; box-shadow: var(--shadow-sm); min-width: 180px; min-height: 180px; }
.bar-mini { height: 8px; border-radius: 99px; background: var(--bs-tertiary-bg); overflow: hidden; }
.bar-mini > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; }

/* ---------- Chat AI ---------- */
.chat-box { height: 56vh; overflow-y: auto; padding: 1rem; background: var(--bs-tertiary-bg); border-radius: 1rem; }
.msg { max-width: 85%; padding: .7rem 1rem; border-radius: 1rem; margin-bottom: .7rem; white-space: pre-wrap; line-height: 1.5; }
.msg.user { margin-left: auto; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-bottom-right-radius: .3rem; }
.msg.bot { background: var(--bs-body-bg); box-shadow: var(--shadow-sm); border-bottom-left-radius: .3rem; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: linear-gradient(140deg, #1e1b4b, var(--brand) 55%, var(--brand-2)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: rgba(255, 255, 255, .06); left: -160px; bottom: -200px; }
.auth-side > * { position: relative; }
.auth-feature { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1rem; }
.auth-feature i { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .form-control { padding: .75rem 1rem; }
@media (max-width: 991.98px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 12%, #fff), #fff 45%); align-items: flex-start; padding-top: 3rem; }
}

/* ---------- Navigasi bawah HP ---------- */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040; display: flex; justify-content: space-around; background: var(--bs-body-bg); border-top: 1px solid var(--bs-border-color-translucent); box-shadow: 0 -6px 24px -10px rgba(0, 0, 0, .15); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--bs-secondary-color); font-size: .66rem; font-weight: 600; padding: .25rem 0; border-radius: .7rem; }
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav a.active i { transform: translateY(-1px); }

@media (max-width: 991.98px) {
  .app-main { padding-bottom: 5.2rem; }
  .app-footer { margin-bottom: 4.2rem; }
  .page-title { font-size: 1.2rem; }
  .sticky-actions { position: sticky; bottom: 4.3rem; background: var(--bs-body-bg) !important; z-index: 5; box-shadow: 0 -6px 16px -10px rgba(0, 0, 0, .2); }
  .table-premium td, .table-premium th { padding: .6rem .5rem; }
  .stat-card .stat-value { font-size: 1.35rem; }
  .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .hero { padding: 1.2rem; }
}

.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 70% { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

/* Tom Select menyesuaikan */
.ts-wrapper.form-select { padding: 0; } .ts-control { border-radius: .65rem !important; padding: .55rem .8rem !important; }
.ts-dropdown { border-radius: .65rem; box-shadow: var(--shadow); }

/* ---------- Cetak ---------- */
@media print {
  .app-header, .app-sidebar, .bottom-nav, .app-footer, .btn, .filter-bar, .no-print { display: none !important; }
  .app-main { margin: 0 !important; }
  .card-premium { box-shadow: none; }
}
