/* ==========================================================
   Ruang Dengar - SRT 35 Bandar Lampung
   Tema: biru malam dengan aksen emas benang tapis Lampung
   ========================================================== */

:root {
    --ink: #1e1b2e;
    --ink-2: #45405f;
    --muted: #6b6785;
    --line: #e6e2f0;
    --line-2: #d6d0e6;
    --paper: #f5f3fa;
    --surface: #ffffff;
    --surface-2: #faf9fd;

    --night: #2b2350;
    --night-700: #211a40;
    --night-600: #3a3168;
    --night-50: #eeebf7;
    --night-100: #ddd7ef;

    --gold: #d9a441;
    --gold-700: #8f6516;
    --gold-50: #fbf3e2;

    --sage: #2f7d5f;   --sage-50: #e3f2ea;
    --rose: #c03b3b;   --rose-50: #fbe8e8;
    --sky: #2e5f9e;    --sky-50: #e5edf8;
    --amber: #a86d12;  --amber-50: #fcf0d9;

    --font-display: 'Bricolage Grotesque', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;

    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 10px;
    --shadow-1: 0 1px 2px rgba(43, 35, 80, .06);
    --shadow-2: 0 12px 32px -12px rgba(43, 35, 80, .22);

    --sidebar-w: 268px;
    --tapis: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 13 7 6 14 13 21 6 28 13' fill='none' stroke='%23d9a441' stroke-width='1.6'/%3E%3Cpath d='M14 0l3 3-3 3-3-3z M0 0l3 3-3 3z M28 0l-3 3 3 3z' fill='%23d9a441'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--night-600); text-decoration: none; }
a:hover { color: var(--night); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
.ic { flex-shrink: 0; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.brand-text small { font-size: 12px; opacity: .72; }
.brand-dark, .brand-dark:hover { color: var(--ink); }
.brand-light, .brand-light:hover { color: #fff; }
.logo-mark {
    flex-shrink: 0; display: inline-block; box-sizing: border-box;
    padding: 5px; border-radius: 12px; background: #fff;
    box-shadow: 0 0 0 1px rgba(43, 35, 80, .1), 0 2px 6px rgba(43, 35, 80, .12);
}
.logo-mark picture, .logo-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

.tapis-band { height: 14px; background-image: var(--tapis); background-repeat: repeat-x; opacity: .9; }

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
    font: 600 14.5px/1.2 var(--font-body); cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--night); color: #fff; }
.btn-primary:hover { background: var(--night-700); color: #fff; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #cb9533; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--night); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--night-50); color: var(--night); }
.btn-soft { background: var(--night-50); color: var(--night); }
.btn-soft:hover { background: var(--night-100); color: var(--night); }
.btn-danger { background: var(--rose-50); color: var(--rose); }
.btn-danger:hover { background: #f6d3d3; color: var(--rose); }
.btn-success { background: var(--sage); color: #fff; }
.btn-success:hover { background: #26684f; color: #fff; }
.btn-sm { padding: 8px 13px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn {
    position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--night-50); color: var(--night); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--night-600); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Badge ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-muted   { background: #efedf4; color: #5f5b75; }
.badge-info    { background: var(--sky-50); color: var(--sky); }
.badge-primary { background: var(--night-50); color: var(--night); }
.badge-success { background: var(--sage-50); color: var(--sage); }
.badge-danger  { background: var(--rose-50); color: var(--rose); }
.badge-warn    { background: var(--amber-50); color: var(--amber); }
.badge-gold    { background: var(--gold-50); color: var(--gold-700); }
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; background: var(--night-50); color: var(--night); font-weight: 500; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--night)); }

/* ---------- Avatar ---------- */
.avatar {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--av, var(--night)); color: #fff; font-weight: 700; font-size: 13.5px; flex-shrink: 0; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-anon { background: #e7e3f1; color: var(--muted); }

/* ---------- Form ---------- */
.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; padding: 11px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2);
    background: var(--surface); font: 15px/1.4 var(--font-body); color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--night-600); box-shadow: 0 0 0 4px var(--night-50); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .input { padding-left: 40px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; }
.check input { width: 18px; height: 18px; accent-color: var(--night); margin-top: 2px; flex-shrink: 0; }
.req { color: var(--rose); }

/* Pilihan kartu (radio) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
    display: flex; gap: 14px; align-items: flex-start; height: 100%;
    padding: 16px; border: 1.5px solid var(--line-2); border-radius: var(--r-md); background: var(--surface);
    transition: border-color .15s, background .15s;
}
.choice-body .choice-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--night-50); color: var(--night); flex-shrink: 0; }
.choice-body strong { display: block; font-size: 15.5px; margin-bottom: 2px; color: var(--ink); }
.choice-body span { color: var(--muted); font-size: 13.5px; }
.choice input:checked + .choice-body { border-color: var(--night); background: var(--night-50); box-shadow: inset 0 0 0 1px var(--night); }
.choice input:checked + .choice-body .choice-ic { background: var(--night); color: var(--gold); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--gold); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg .choice-body { padding: 9px 14px; border-radius: 999px; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.seg-urgent input:checked + .choice-body { border-color: var(--rose); background: var(--rose-50); box-shadow: inset 0 0 0 1px var(--rose); color: var(--rose); }

/* Rating bintang */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; }
.stars label { cursor: pointer; color: #d6d0e6; }
.stars label .ic { width: 30px; height: 30px; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--gold); }
.stars input:checked ~ label .ic, .stars label:hover .ic, .stars label:hover ~ label .ic { fill: var(--gold); }
.stars-static { color: var(--gold); display: inline-flex; gap: 2px; }
.stars-static .ic.on { fill: var(--gold); }
.stars-static .ic.off { color: #d6d0e6; }

/* ---------- Alert ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: var(--r-md);
    margin-bottom: 16px; font-size: 14.5px; border: 1px solid transparent;
}
.alert > span { flex: 1; }
.alert-success { background: var(--sage-50); color: #1f5a43; border-color: #c7e5d5; }
.alert-error   { background: var(--rose-50); color: #8e2626; border-color: #f2cccc; }
.alert-info    { background: var(--sky-50); color: #234b7e; border-color: #cbdcf1; }
.alert-warn    { background: var(--amber-50); color: #7a4f0d; border-color: #f1dcb4; }
.alert-close { background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; padding: 0; }
.alert-close:hover { opacity: 1; }

/* ==========================================================
   Aplikasi (setelah login)
   ========================================================== */
.app-body { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
    background: var(--night); color: #d8d3ea; display: flex; flex-direction: column;
    padding: 22px 16px 16px; overflow-y: auto;
}
.sidebar .brand { padding: 0 6px; }
.sidebar .tapis-band { margin: 18px -16px 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
    color: #cfc9e4; font-weight: 500; font-size: 14.5px;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.active { background: rgba(217, 164, 65, .14); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-link.active .ic { color: var(--gold); }
.sidebar-help {
    margin-top: auto; padding: 14px; border-radius: var(--r-md); font-size: 13px; line-height: 1.5;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: #cfc9e4;
}
.sidebar-help p { margin: 0 0 4px; }
.sidebar-help strong, .sidebar-help b { color: #fff; }
.nav-logout { margin-top: 10px; }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
    padding: 14px 32px; background: rgba(245, 243, 250, .88); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 22px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.user-chip:hover { border-color: var(--line-2); color: var(--ink); }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip-text strong { font-size: 13.5px; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 12px; color: var(--muted); }
.dot-count { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--rose); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); }
.only-mobile { display: none; }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-width: calc(100vw - 24px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2);
    padding: 6px; display: none; z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 14px; }
.dropdown-empty { padding: 18px 10px; color: var(--muted); font-size: 14px; margin: 0; text-align: center; }
.notif-item { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; color: var(--ink); font-size: 13.5px; }
.notif-item:hover { background: var(--surface-2); color: var(--ink); }
.notif-item span { color: var(--ink-2); }
.notif-item small { color: var(--muted); font-size: 12px; }
.notif-item.unread { background: var(--gold-50); }
.notif-item.unread strong::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-right: 7px; vertical-align: middle; }

.content { padding: 28px 32px 40px; flex: 1; width: 100%; max-width: 1320px; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 32px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Panel */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-size: 17px; margin: 0; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.panel-body { padding: 22px; }
.panel-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.panel + .panel { margin-top: 20px; }
.stack > * + * { margin-top: 20px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.grid-main-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }

/* Ringkasan angka: satu strip, bukan kartu-kartu identik */
.stat-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 22px; overflow: hidden;
}
.stat { padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.stat-label .ic { color: var(--c, var(--night-600)); }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.stat-note { font-size: 12.5px; color: var(--muted); }

/* Sambutan */
.welcome {
    position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 28px 30px 36px; margin-bottom: 22px;
    background: var(--night); color: #e7e3f4;
}
.welcome::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background-image: var(--tapis); background-repeat: repeat-x; }
.welcome h2 { color: #fff; font-size: 28px; margin-bottom: 6px; }
.welcome p { max-width: 60ch; color: #cfc9e4; margin-bottom: 18px; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.welcome .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.welcome-row { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.welcome-date { font-size: 13.5px; color: #b9b2d6; text-align: right; }
.welcome-date strong { display: block; font-family: var(--font-display); font-size: 20px; color: var(--gold); }

/* Mood */
.mood-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.mood-opt { position: relative; }
.mood-opt input { position: absolute; opacity: 0; }
.mood-opt span {
    display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; padding: 10px 2px;
    border-radius: 14px; border: 1.5px solid var(--line-2); cursor: pointer; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.2;
}
.mood-opt { min-width: 0; }
.mood-opt span b { font-size: 26px; font-weight: 400; line-height: 1; }
.mood-opt input:checked + span { border-color: var(--night); background: var(--night-50); color: var(--night); font-weight: 600; }
.mood-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.mood-week { display: flex; gap: 6px; margin-top: 14px; }
.mood-day { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); }
.mood-day b { display: grid; place-items: center; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 19px; font-weight: 400; margin-bottom: 4px; }

/* Daftar item */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--ink); }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); color: var(--ink); }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.list-meta span { display: inline-flex; align-items: center; gap: 5px; }
.list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.unread-pill { background: var(--rose); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; }

/* Grafik batang CSS */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { height: 12px; background: var(--night-50); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--c, var(--night)); min-width: 2px; }
.bar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.columns { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 10px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 12.5px; color: var(--muted); }
.col-bar { width: 100%; max-width: 44px; background: var(--night); border-radius: 10px 10px 4px 4px; min-height: 3px; position: relative; }
.col-bar.gold { background: var(--gold); }
.col-stack { width: 100%; max-width: 44px; display: flex; flex-direction: column; min-height: 4px; border-radius: 10px 10px 4px 4px; overflow: hidden; background: var(--night-50); }
.col-seg { background: var(--night); min-height: 2px; }
.col-seg.gold { background: var(--gold); }
.col-stack, .col-seg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.col-num { font-weight: 700; color: var(--ink); font-size: 13px; }

/* Tabel */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user strong { display: block; font-weight: 600; white-space: nowrap; }
.cell-user small { white-space: nowrap; }
.cell-user small { color: var(--muted); font-size: 12.5px; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Toolbar & tab */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.toolbar .input-icon { flex: 1; min-width: 200px; }
.toolbar .select { width: auto; min-width: 150px; }
.tabs { display: flex; gap: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 9px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.active { background: var(--night); color: #fff; }
.tab .count { background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.tab.active .count { background: rgba(255, 255, 255, .18); }

/* Kosong */
.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .empty-ic { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--night-50); color: var(--night); }
.empty h3 { font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.empty p { max-width: 42ch; margin: 0 auto 16px; }

/* ---------- Detail konseling ---------- */
.detail-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.detail-head h2 { font-size: 26px; margin: 6px 0 8px; max-width: 30ch; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.back-link:hover { color: var(--night); }

.progress { display: flex; gap: 0; margin: 0 0 20px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.step { flex: 1; display: flex; align-items: center; gap: 10px; position: relative; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.step + .step::before { content: ""; position: absolute; left: -12px; right: calc(100% + 6px); }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--surface); flex-shrink: 0; font-weight: 700; font-size: 13px; }
.step-line { flex: 1; height: 2px; background: var(--line-2); margin: 0 10px; }
.step.done { color: var(--ink); }
.step.done .step-dot { background: var(--night); border-color: var(--night); color: var(--gold); }
.step.done .step-line { background: var(--night); }
.step.current .step-dot { border-color: var(--gold); color: var(--gold-700); background: var(--gold-50); }
.step.current { color: var(--ink); font-weight: 700; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.info-item small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.info-item div { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.story { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; white-space: pre-wrap; margin: 0 0 20px; line-height: 1.65; }

.chat { display: flex; flex-direction: column; height: 560px; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; background: linear-gradient(var(--surface-2), var(--surface)); }
.msg { display: flex; flex-direction: column; max-width: 78%; align-self: flex-start; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-bubble { padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.msg.mine .msg-bubble { background: var(--night); color: #fff; border-color: var(--night); border-radius: 16px 16px 4px 16px; }
.msg-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.msg-system { align-self: center; font-size: 12.5px; color: var(--ink-2); background: var(--gold-50); border: 1px solid #f0e0bb; border-radius: 999px; padding: 4px 14px; text-align: center; max-width: 90%; }
.chat-form { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form .textarea { min-height: 46px; max-height: 140px; resize: none; border-radius: 14px; }
.chat-form .btn { height: 46px; }
.chat-closed { padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.chat-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; max-width: 34ch; }

.action-box + .action-box { margin-top: 12px; }
details.action-box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
details.action-box > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
details.action-box > summary::-webkit-details-marker { display: none; }
details.action-box > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 18px; font-weight: 400; }
details.action-box[open] > summary::after { content: "\2212"; }
details.action-box[open] > summary { border-bottom: 1px solid var(--line); }
details.action-box .action-inner { padding: 14px; }
.sum-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--night-50); color: var(--night); }
.sum-ic.rose { background: var(--rose-50); color: var(--rose); }
.sum-ic.sage { background: var(--sage-50); color: var(--sage); }
.sum-ic.gold { background: var(--gold-50); color: var(--gold-700); }

.note-item { padding: 14px 0; border-top: 1px dashed var(--line-2); font-size: 14px; }
.note-item:first-child { border-top: 0; padding-top: 0; }
.note-item p { white-space: pre-wrap; margin-bottom: 6px; }
.note-item .note-follow { background: var(--gold-50); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.note-item small { color: var(--muted); }
.private-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--gold-700); background: var(--gold-50); padding: 3px 10px; border-radius: 999px; font-weight: 600; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); font-size: 14px; }
.callout .ic { margin-top: 2px; }
.callout-rose { background: var(--rose-50); color: #7f2424; }
.callout-gold { background: var(--gold-50); color: #6d4c10; }
.callout-night { background: var(--night-50); color: var(--night); }
.callout strong { display: block; margin-bottom: 2px; }
.callout p { margin: 0; }

/* Profil */
.profile-card { text-align: center; padding: 28px 22px; }
.profile-card .avatar-lg { margin-bottom: 12px; }
.profile-card h3 { margin-bottom: 4px; font-size: 20px; }
.profile-meta { list-style: none; padding: 0; margin: 18px 0 0; text-align: left; font-size: 14px; }
.profile-meta li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.profile-meta li span { color: var(--muted); }

/* Artikel admin */
.article-thumb { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--night-50); color: var(--night); flex-shrink: 0; }

/* ==========================================================
   Halaman publik
   ========================================================== */
.public-body { background: var(--paper); }
.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(245, 243, 250, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav > a:not(.btn) { color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.site-nav > a:not(.btn):hover { color: var(--night); }

.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--gold-700); background: var(--gold-50); padding: 6px 14px; border-radius: 999px; font-size: 14px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 800; line-height: 1.0; letter-spacing: -.035em; margin-bottom: 22px; color: var(--night); max-width: 13ch; }
.hero-lead { font-size: 18px; color: var(--ink-2); max-width: 46ch; margin-bottom: 26px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; color: var(--ink-2); font-size: 14.5px; }
.hero-trust span { display: inline-flex; gap: 8px; align-items: center; }
.hero-trust .ic { color: var(--sage); }

.doors { display: grid; gap: 14px; }
.door {
    display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 24px; border-radius: 22px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink); position: relative;
    transition: border-color .15s, box-shadow .15s;
}
.door:hover { color: var(--ink); border-color: var(--night-100); box-shadow: var(--shadow-2); }
.door-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--night-50); color: var(--night); }
.door h3 { font-size: 21px; margin-bottom: 6px; }
.door p { color: var(--muted); margin-bottom: 14px; font-size: 14.5px; }
.door-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--night); font-size: 14.5px; }
.door-dark { background: var(--night); border-color: var(--night); color: #fff; overflow: hidden; padding-bottom: 36px; }
.door-dark::after { content: ""; position: absolute; inset: auto 0 0 0; height: 14px; background-image: var(--tapis); background-repeat: repeat-x; }
.door-dark:hover { color: #fff; border-color: var(--night); }
.door-dark h3 { color: #fff; }
.door-dark p { color: #cfc9e4; }
.door-dark .door-ic { background: rgba(217, 164, 65, .16); color: var(--gold); }
.door-dark .door-cta { color: var(--gold); }

.band { height: 14px; background-color: var(--night); background-image: var(--tapis); background-repeat: repeat-x; background-position: 0 0; }

.section { padding: 76px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -.025em; color: var(--night); }
.section-head p { color: var(--ink-2); font-size: 17px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--night); }
.feature { padding: 26px 28px 8px 0; }
.feature + .feature { padding-left: 28px; border-left: 1px solid var(--line); }
.feature .ic { color: var(--gold-700); margin-bottom: 14px; }
.feature h3 { font-size: 19px; }
.feature p { color: var(--ink-2); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-top: 58px; }
.steps li::before {
    content: counter(s); position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center; background: var(--night); color: var(--gold); font: 800 19px var(--font-display);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 22px; left: 56px; right: -16px; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); }
.steps h3 { font-size: 18px; }
.steps p { color: var(--ink-2); font-size: 15px; }

.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.article-card { display: flex; flex-direction: column; padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.article-card:hover { color: var(--ink); border-color: var(--night-100); }
.article-card .chip { align-self: flex-start; margin-bottom: 14px; }
.article-card h3 { font-size: 20px; line-height: 1.25; }
.article-card p { color: var(--ink-2); font-size: 14.5px; flex: 1; }
.article-card small { color: var(--muted); font-size: 13px; }

.sos { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; padding: 30px 34px; border-radius: 24px; background: var(--rose-50); border: 1px solid #f1caca; }
.sos h2 { font-size: 26px; color: #6e1f1f; margin-bottom: 6px; }
.sos p { color: #7f2a2a; margin: 0; max-width: 56ch; }
.sos-nums { display: flex; gap: 12px; flex-wrap: wrap; }
.sos-num { background: #fff; border-radius: 16px; padding: 12px 18px; text-align: center; min-width: 120px; border: 1px solid #f1caca; }
.sos-num strong { display: block; font: 800 26px var(--font-display); color: var(--rose); }
.sos-num span { font-size: 12.5px; color: #7f2a2a; }

.site-footer { background: var(--night); color: #cfc9e4; margin-top: 0; }
.site-footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 48px 0 28px; font-size: 14.5px; }
.site-footer h4 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.site-footer p { margin: 0 0 6px; }
.site-footer b { color: var(--gold); }
.footer-note { margin-top: 14px !important; max-width: 40ch; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 18px 0 26px; font-size: 13px; color: #a8a1c7; }

/* Artikel publik */
.page-hero { padding: 52px 0 28px; }
.page-hero h1 { font-size: clamp(32px, 4.5vw, 50px); font-weight: 800; letter-spacing: -.03em; color: var(--night); margin-bottom: 10px; }
.page-hero p { color: var(--ink-2); font-size: 17px; max-width: 56ch; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 0; }
.filter-chips a { padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-weight: 600; font-size: 14px; background: var(--surface); }
.filter-chips a.active, .filter-chips a:hover { background: var(--night); border-color: var(--night); color: #fff; }

.prose-wrap { max-width: 720px; margin: 0 auto; padding: 44px 0 72px; }
.prose-wrap .back-link { margin-bottom: 22px; }
.prose-wrap h1 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; letter-spacing: -.03em; color: var(--night); }
.prose-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 14px; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.prose-meta span { display: inline-flex; gap: 6px; align-items: center; }
.prose { font-size: 17.5px; line-height: 1.75; color: var(--ink); }
.prose p { margin-bottom: 1.1em; }
.prose h3 { font-size: 23px; margin: 1.6em 0 .5em; color: var(--night); }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--gold); }
.prose-lead { font-size: 19px; color: var(--ink-2); line-height: 1.6; }

/* ---------- Halaman masuk/daftar ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-art { position: relative; background: var(--night); color: #e7e3f4; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background-image: var(--tapis); background-repeat: repeat-x; }
.auth-quote { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; font-weight: 700; color: #fff; letter-spacing: -.025em; max-width: 14ch; margin: 0 0 18px; }
.auth-art p { color: #c4bddd; max-width: 42ch; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.auth-points .ic { color: var(--gold); margin-top: 2px; }
.auth-form-side { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { font-size: 32px; font-weight: 800; color: var(--night); letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); margin-bottom: 26px; }
.auth-alt { text-align: center; margin-top: 22px; color: var(--muted); font-size: 14.5px; }
.auth-alt a { font-weight: 700; }
.demo-box { margin-top: 26px; border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 4px 14px; font-size: 13.5px; background: var(--surface); }
.demo-box summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--ink-2); }
.demo-box table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.demo-box td { padding: 6px 4px; border-top: 1px solid var(--line); }
.demo-box code { background: var(--night-50); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px; }
.pw-toggle:hover { color: var(--night); }

/* ==========================================================
   Responsif
   ========================================================== */
@media (max-width: 1100px) {
    .grid-main, .grid-main-wide { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(20, 16, 40, .45); z-index: 35; }
    .main { margin-left: 0; }
    .only-mobile { display: inline-grid; }
    .topbar { padding: 12px 16px; }
    .content { padding: 20px 16px 32px; }
    .app-footer { padding: 16px; }
    .user-chip-text { display: none; }
    .user-chip { padding: 3px; }

    .hero { padding: 40px 0; }
    .hero-grid { grid-template-columns: 1fr; gap: 34px; }
    .features { grid-template-columns: 1fr; }
    .feature, .feature + .feature { padding: 22px 0 6px; border-left: 0; border-top: 1px solid var(--line); }
    .feature:first-child { border-top: 0; }
    .steps { grid-template-columns: 1fr 1fr; }
    .steps li::after { display: none; }
    .articles { grid-template-columns: 1fr; }
    .sos { grid-template-columns: 1fr; }
    .site-footer-inner { grid-template-columns: 1fr; gap: 26px; }
    .site-nav > a:not(.btn) { display: none; }
    .auth { grid-template-columns: 1fr; }
    .auth-art { padding: 28px 24px 40px; }
    .auth-points { display: none; }
    .auth-quote { font-size: 28px; }
}
@media (max-width: 640px) {
    .grid-2, .grid-3, .form-row, .info-grid { grid-template-columns: 1fr; }
    .stat { border-left: 0; border-top: 1px solid var(--line); }
    .stat:first-child { border-top: 0; }
    .steps { grid-template-columns: 1fr; }
    .progress { overflow-x: auto; }
    .step-text { display: none; }
    .step.current .step-text { display: inline; }
    .welcome { padding: 22px 20px 32px; }
    .welcome h2 { font-size: 23px; }
    .welcome-date { text-align: left; }
    .bar-row { grid-template-columns: 96px 1fr 32px; font-size: 13px; }
    .msg { max-width: 90%; }
    .chat { height: 70vh; }
    .list-item { padding: 14px 16px; align-items: flex-start; }
    .panel-head, .panel-body { padding: 16px; }
    .toolbar { padding: 12px 16px; }
    .toolbar .select { flex: 1; }
    .topbar-title h1 { font-size: 18px; }
}

/* ---------- Cetak ---------- */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .alert { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; max-width: none; }
    body { background: #fff; font-size: 12px; }
    .panel { box-shadow: none; break-inside: avoid; }
    .print-only { display: block; }
    .bar-fill, .col-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
