:root {
    --bsan-navy: #0f2e4d;
    --bsan-teal: #17a2a2;
    --bsan-blue: #5b8def;
    --bsan-soft: #f3f7fc;
    --bsan-line: #e4edf7;
    --bsan-text: #1f3550;
    --bsan-muted: #6b8299;
    --bsan-sidebar-w: 268px;
    --bsan-shadow: 0 12px 30px -18px rgba(15, 46, 77, .35);
}

body.bsan-body {
    background-color: var(--bsan-soft);
    color: var(--bsan-text);
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
    font-size: .95rem;
}

/* ------------------------------------------------------------------ */
/* Shell layout                                                       */
/* ------------------------------------------------------------------ */
.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--bsan-sidebar-w);
    display: flex;
    flex-direction: column;
    background: linear-gradient(170deg, var(--bsan-navy) 0%, #14425c 55%, #0d5c5c 100%);
    color: #e8f2fb;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 1045;
}

.app-sidebar.is-open {
    transform: none;
}

.app-sidebar .sidebar-brand {
    flex: 0 0 auto;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.app-sidebar .sidebar-menu {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .75rem .7rem 1rem;
    scrollbar-width: thin;
}

.app-sidebar .sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar .sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
}

.app-sidebar .sidebar-user {
    flex: 0 0 auto;
    padding: .85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: rgba(6, 24, 40, .28);
}

.brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: #07303a;
    background: linear-gradient(135deg, #9be7dd 0%, #7ec8f5 100%);
    box-shadow: 0 8px 18px -10px rgba(126, 200, 245, .9);
}

.nav-caption {
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(232, 242, 251, .5);
    padding: 1rem .75rem .35rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .75rem;
    border-radius: 11px;
    color: rgba(233, 243, 252, .82);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background .16s ease, color .16s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, .09);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(100deg, rgba(155, 231, 221, .22), rgba(126, 200, 245, .16));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(155, 231, 221, .32);
}

.sidebar-link i {
    font-size: 1.02rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-link .chevron {
    margin-left: auto;
    transition: transform .2s ease;
    font-size: .8rem;
    width: auto;
}

.sidebar-link[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem .5rem 2.4rem;
    border-radius: 10px;
    color: rgba(233, 243, 252, .72);
    text-decoration: none;
    font-size: .86rem;
}

.sidebar-sublink:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sidebar-sublink.active {
    color: #9be7dd;
    background: rgba(155, 231, 221, .12);
}

.app-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.25rem;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bsan-line);
}

.app-content {
    padding: 1.4rem 1.25rem 2.5rem;
    flex: 1 1 auto;
}

.app-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 46, 77, .45);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}

.app-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .app-sidebar {
        transform: none;
        z-index: 1025;
    }

    .app-main {
        margin-left: var(--bsan-sidebar-w);
    }

    .app-backdrop {
        display: none;
    }
}

/* ------------------------------------------------------------------ */
/* Komponen                                                           */
/* ------------------------------------------------------------------ */
.card {
    border: 1px solid var(--bsan-line);
    border-radius: 16px;
    box-shadow: var(--bsan-shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--bsan-line);
    font-weight: 600;
    border-radius: 16px 16px 0 0 !important;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -.01em;
}

.page-subtitle {
    color: var(--bsan-muted);
    font-size: .85rem;
    margin: 0;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

.soft-blue {
    background: linear-gradient(135deg, #e7f0ff, #d6e6ff);
    color: #2f62c4;
}

.soft-teal {
    background: linear-gradient(135deg, #dff7f3, #cdf0ea);
    color: #0f8a7f;
}

.soft-amber {
    background: linear-gradient(135deg, #fff3dd, #ffe6c2);
    color: #b47512;
}

.soft-rose {
    background: linear-gradient(135deg, #ffe6ea, #ffd6dd);
    color: #c33a54;
}

.soft-violet {
    background: linear-gradient(135deg, #eee8ff, #e0d7ff);
    color: #6a55c8;
}

.badge-soft {
    padding: .38rem .62rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .74rem;
}

.bsan-hero {
    border-radius: 20px;
    padding: 1.4rem 1.5rem;
    color: #fff;
    background: linear-gradient(120deg, var(--bsan-navy) 0%, #1a5570 48%, var(--bsan-teal) 100%);
    box-shadow: 0 18px 35px -22px rgba(15, 46, 77, .8);
}

.bsan-hero .hero-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, .16);
}

.btn-panic {
    background: linear-gradient(135deg, #ff6b81, #e63946);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 14px;
    padding: .8rem 1rem;
    box-shadow: 0 14px 26px -16px rgba(230, 57, 70, .9);
}

.btn-panic:hover {
    color: #fff;
    filter: brightness(1.06);
}

.btn-bsan {
    background: linear-gradient(120deg, #4a86e8, #17a2a2);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 14px;
    padding: .75rem 1.25rem;
    box-shadow: 0 14px 26px -18px rgba(74, 134, 232, .9);
}

.btn-bsan:hover {
    color: #fff;
    filter: brightness(1.05);
}

.form-control,
.form-select {
    border: 1px solid #cfdcea;
    border-radius: 12px;
    padding: .6rem .8rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #7ec8f5;
    box-shadow: 0 0 0 .22rem rgba(91, 141, 239, .16);
}

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #33475e;
}

/* Pilihan mood */
.mood-option {
    position: relative;
    display: flex;
    height: 100%;
    cursor: pointer;
}

.mood-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mood-option .mood-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-height: 86px;
    border: 1.5px solid var(--bsan-line);
    border-radius: 16px;
    padding: .7rem .4rem;
    text-align: center;
    transition: all .16s ease;
    background: #fff;
}

.mood-option .mood-emoji {
    font-size: 1.6rem;
    line-height: 1;
}

.mood-option .mood-text {
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.2;
    color: #4b6076;
}

.mood-option:hover .mood-box {
    border-color: #a9cdf0;
    transform: translateY(-2px);
}

.mood-option input:focus-visible + .mood-box {
    box-shadow: 0 0 0 .22rem rgba(91, 141, 239, .22);
}

.mood-option input:checked + .mood-box {
    border-color: var(--bsan-teal);
    background: linear-gradient(160deg, #e9fbf8, #e3f1ff);
    box-shadow: 0 10px 22px -16px rgba(23, 162, 162, .8);
}

.mood-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    background: #f1f6fc;
}

/* Timeline */
.bsan-timeline {
    position: relative;
    padding-left: 1.9rem;
}

.bsan-timeline::before {
    content: "";
    position: absolute;
    left: .62rem;
    top: .35rem;
    bottom: .35rem;
    width: 2px;
    background: linear-gradient(180deg, #bcd8f5, #cdeee9);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.2rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.72rem;
    top: .25rem;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #7ec8f5;
}

.timeline-item.done::before {
    border-color: var(--bsan-teal);
}

.timeline-item.active::before {
    border-color: #f5a623;
    box-shadow: 0 0 0 4px rgba(245, 166, 35, .16);
}

/* Kudos & literasi */
.kudos-item {
    border: 1px solid var(--bsan-line);
    border-radius: 14px;
    padding: .9rem 1rem;
    background: #fff;
}

.kudos-item + .kudos-item {
    margin-top: .7rem;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .82rem;
    background: linear-gradient(135deg, #dbe9ff, #d3f3ee);
    color: #24527a;
    flex: 0 0 auto;
}

img.avatar-circle {
    object-fit: cover;
    padding: 0;
    background: #e9eef5;
}

.literasi-cover {
    height: 165px;
    object-fit: cover;
    width: 100%;
    border-radius: 16px 16px 0 0;
}

.artikel-konten {
    line-height: 1.85;
    color: #2c3e50;
}

.artikel-konten h5 {
    font-weight: 700;
    margin-top: 1.3rem;
    font-size: 1.02rem;
}

.table > :not(caption) > * > * {
    padding: .7rem .75rem;
}

.table thead th {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bsan-muted);
    border-bottom: 1px solid var(--bsan-line);
}

.urgensi-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-right: .4rem;
}

.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    padding: 0;
}

.empty-state {
    text-align: center;
    padding: 2.2rem 1rem;
    color: var(--bsan-muted);
}

.empty-state i {
    font-size: 2.2rem;
    opacity: .5;
}

/* Halaman autentikasi */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(900px 500px at 12% 8%, rgba(23, 162, 162, .38), transparent 60%),
        radial-gradient(700px 420px at 88% 92%, rgba(91, 141, 239, .36), transparent 62%),
        linear-gradient(150deg, #0b2438 0%, #10324a 55%, #0d3f47 100%);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    border: none;
    border-radius: 22px;
    box-shadow: 0 32px 60px -34px rgba(0, 0, 0, .75);
}

.auth-demo {
    background: #f4f8fc;
    border: 1px dashed #c3d8ec;
    border-radius: 14px;
    padding: .85rem .95rem;
}

.public-nav {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bsan-line);
}

.chart-wrap {
    position: relative;
    min-height: 240px;
}

/* Logo aplikasi pada badge brand */
img.brand-badge {
    object-fit: contain;
    padding: 4px;
    background: #fff;
}

/* Tab pengaturan sistem */
.setting-tabs {
    gap: .5rem;
}

.setting-tabs .nav-link {
    border-radius: 14px;
    border: 1px solid var(--bsan-line);
    background: #fff;
    color: var(--bsan-muted);
    font-weight: 600;
    font-size: .87rem;
    padding: .55rem 1rem;
}

.setting-tabs .nav-link:hover {
    color: var(--bsan-text);
    border-color: #cfe0f2;
}

.setting-tabs .nav-link.active {
    background: linear-gradient(120deg, #4a86e8, #17a2a2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 14px 26px -18px rgba(74, 134, 232, .9);
}

/* Pratinjau logo / favicon */
.branding-preview {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    border: 1px dashed #c3d8ec;
    background: #f6fafd;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.branding-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 575.98px) {
    .app-content {
        padding: 1rem .85rem 2.2rem;
    }

    .stat-value {
        font-size: 1.45rem;
    }
}
