:root {
    --brand: #327b5b;
    --brand-dark: #215c44;
    --brand-deep: #174a39;
    --brand-soft: #e8f3e7;
    --ink: #263d32;
    --muted: #78867b;
    --page: #f8f7ef;
    --surface: #fffefb;
    --line: #e8e8dc;
    --sun: #f0c45e;
    --coral: #e88969;
    --shadow: 0 12px 32px rgba(38, 72, 53, .075);
}

html { min-height: 100%; }
body {
    min-height: 100vh;
    color: var(--ink);
    background: radial-gradient(circle at 92% 2%, rgba(242, 218, 151, .18), transparent 23%), var(--page);
    font-family: 'Nunito', sans-serif;
    font-size: .96rem;
}
.wrapper { display: flex; align-items: stretch; min-height: 100vh; }
#sidebar {
    width: 276px;
    min-width: 276px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 100% 0%, rgba(240,196,94,.14), transparent 25%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 1px, transparent 1px 13px),
        linear-gradient(160deg, #215c44 0%, #174a39 100%);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    transition: transform .25s ease;
    overflow-y: auto;
    box-shadow: 8px 0 32px rgba(23, 74, 57, .12);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 21px 18px;
}
.sidebar-brand-mark {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,.23);
    border-radius: 15px;
    background: rgba(255,255,255,.12);
    color: #ffe29a;
    font-size: 1.15rem;
}
.sidebar-brand strong, .sidebar-brand small { display: block; line-height: 1.2; }
.sidebar-brand strong { color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: -.2px; }
.sidebar-brand small { color: rgba(255,255,255,.67); font-size: .72rem; margin-top: 4px; }
#sidebar .sidebar-profile {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 15px 12px;
    padding: 14px 12px;
    text-align: left;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(255,255,255,.075);
}
.profile-img { width: 43px; height: 43px; flex: 0 0 auto; border-radius: 14px; border: 2px solid rgba(255,255,255,.55); object-fit: cover; }
.sidebar-user-details { min-width: 0; }
.user-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: .86rem; margin: 0 0 3px; color: #fff; }
.user-status { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; color: #f4d98d; font-weight: 700; }
.user-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #a9d68e; }
.menu-label { font-size: .65rem; text-transform: uppercase; font-weight: 800; color: rgba(255,255,255,.52); padding: 18px 22px 7px; letter-spacing: 1.35px; }
#sidebar ul.components {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.28) transparent;
    padding: 0 0 18px;
}
#sidebar ul.components::-webkit-scrollbar { width: 6px; }
#sidebar ul.components::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 6px; }
#sidebar ul.components::-webkit-scrollbar-track { background: transparent; }
#sidebar ul li a {
    margin: 3px 12px;
    padding: 10px 13px;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    transition: color .18s ease, background .18s ease, transform .18s ease;
    font-size: .82rem;
    font-weight: 700;
    border-radius: 12px;
    border-left: 0;
}
#sidebar ul li a:hover, #sidebar ul li.active > a, #sidebar a[aria-expanded="true"] {
    color: #fff;
    background: rgba(255,255,255,.13);
    border-left: 0;
    transform: translateX(2px);
}
#sidebar ul li.active > a { box-shadow: inset 3px 0 #f0c45e; background: rgba(255,255,255,.16); }
#sidebar ul li a i { width: 26px; color: #f2d88f; font-size: .92rem; }
#sidebar hr { opacity: .18; }
#content { width: calc(100% - 276px); min-width: 0; padding: 36px 42px 48px; margin-left: 276px; }
.mobile-toolbar { display: none; }
.sidebar-backdrop { display: none; }

.card, .card-custom {
    border: 1px solid rgba(229, 231, 218, .9);
    border-radius: 20px;
    box-shadow: var(--shadow);
    background: var(--surface);
}
.card-custom { transition: transform .2s ease, box-shadow .2s ease; }
.card-custom:hover { transform: translateY(-2px); box-shadow: 0 17px 38px rgba(38,72,53,.11); }
.card-header { border-radius: 20px 20px 0 0 !important; }
.bg-white { background-color: var(--surface) !important; }
.bg-light { background-color: #f4f4e9 !important; }
.bg-soft-primary { background-color: #e9f0dc !important; color: #537440 !important; }
.bg-soft-success { background-color: #e4f2e5 !important; color: #327b5b !important; }
.bg-soft-warning { background-color: #fff3d5 !important; color: #a97b1b !important; }
.bg-soft-danger { background-color: #ffebe2 !important; color: #bd6249 !important; }
.bg-soft-info { background-color: #e5f1e8 !important; color: #397854 !important; }
.btn-soft-warning { background: #fff3d5; color: #8d681a; border: 0; }
.btn-soft-danger { background: #ffebe2; color: #bd6249; border: 0; }
.btn { border-radius: 11px; font-weight: 700; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary, .btn-success {
    background: var(--brand); border-color: var(--brand); color: #fff;
    border-radius: 11px; padding: 9px 18px; font-weight: 800;
    box-shadow: 0 5px 12px rgba(50,123,91,.14);
}
.btn-primary:hover, .btn-success:hover, .btn-primary:focus, .btn-success:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-primary { color: var(--brand-dark); border-color: #a7c9ae; border-radius: 10px; }
.btn-outline-primary:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-outline-secondary { color: #59685c; border-color: #cbd2c7; }
.text-primary { color: var(--brand-dark) !important; }
.form-control, .form-select {
    min-height: 44px;
    border-radius: 11px;
    border-color: #dfe4d8;
    padding: 9px 13px;
    color: var(--ink);
    background-color: #fff;
}
.achievement-filter-form .form-select,
.achievement-filter-form .form-select option { text-align: left; direction: ltr; }
.achievement-filter-form .form-select { width: 100%; min-width: 0; text-align: left; }
.achievement-assessment-table { min-width: 800px; }
.achievement-assessment-table th:first-child,
.achievement-assessment-table td:first-child {
    position: sticky;
    left: 0;
    min-width: 180px;
    width: 180px;
    background-color: #fff;
    box-shadow: 3px 0 8px rgba(38,72,53,.08);
}
.achievement-assessment-table th:first-child { z-index: 3; background-color: #eff2e7; }
.achievement-assessment-table td:first-child { z-index: 2; }
.achievement-assessment-table tbody tr:hover td:first-child { background-color: #f5f6ed; }
.form-control:focus, .form-select:focus { border-color: #8fbd98; box-shadow: 0 0 0 .22rem rgba(50,123,91,.13); }
.form-label { color: #3e5d49; font-weight: 800; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.table { --bs-table-color: var(--ink); --bs-table-hover-bg: #f5f6ed; }
.table thead th {
    background: #eff2e7;
    border: 0;
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .65px;
    color: #667765;
    padding: 13px 15px;
    white-space: nowrap;
}
.table tbody td { padding: 13px 15px; border-bottom: 1px solid #eff0e8; vertical-align: middle; }
.table tfoot td { background: #f6f6ee; }
.table-responsive { border-radius: inherit; }
.alert { border-radius: 14px; }
.badge { font-weight: 800; letter-spacing: .05px; }
.progress { height: 9px; border-radius: 20px; background: #edf0e8; }
.progress-bar { border-radius: 20px; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 800; letter-spacing: -.35px; }
.text-muted { color: var(--muted) !important; }
.master-import-actions { flex: 0 0 auto; }
.master-import-details { position: relative; }
.master-import-details > summary { list-style: none; cursor: pointer; }
.master-import-details > summary::-webkit-details-marker { display: none; }
.master-import-popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1100; width: min(90vw, 350px); }
.master-import-preview-table { max-height: 65vh; }
.master-import-preview-table td { min-width: 110px; }
.master-import-preview-table td:last-child { min-width: 240px; }
/* Master data workspace */
.master-data-page #content > .row > :first-child,
.master-page-banner,
.master-import-header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    min-height: 132px;
    padding: 43px 28px 23px;
    margin-bottom: 0 !important;
    border: 1px solid #dfead7;
    border-radius: 23px;
    background: linear-gradient(108deg, #e3f0df 0%, #eff4e2 59%, #fff0c9 100%);
    box-shadow: 0 10px 28px rgba(48,94,66,.055);
}
.master-data-page #content > .row > :first-child::before,
.master-page-banner::before,
.master-import-header::before {
    content: 'RUANG PENGELOLAAN DATA';
    position: absolute;
    z-index: -1;
    top: 16px;
    left: 29px;
    color: #63816a;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: 1.4px;
}
.master-data-page #content > .row > :first-child::after,
.master-page-banner::after,
.master-import-header::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 160px;
    height: 160px;
    top: -100px;
    right: 9%;
    border: 23px solid rgba(255,255,255,.31);
    border-radius: 50%;
    pointer-events: none;
}
.master-data-page #content > .row > :first-child h3,
.master-page-banner h3,
.master-import-header h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 5px;
    color: var(--ink) !important;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 900;
    letter-spacing: -.55px;
}
.master-data-page #content > .row > :first-child h3::before,
.master-page-banner h3::before,
.master-import-header h1::before {
    content: '\f1c0';
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(50,123,91,.12);
    border-radius: 15px;
    background: rgba(255,255,255,.66);
    color: var(--brand);
    font-family: 'Font Awesome 6 Free';
    font-size: 1rem;
    font-weight: 900;
}
.master-data-page #content > .row > :first-child p,
.master-page-banner p,
.master-import-header p { margin: 0; color: #627766 !important; font-size: .9rem; line-height: 1.55; }
.master-data-page #content > .row > :first-child > h3 + p { flex-basis: 100%; }
.master-page-banner > *, .master-import-header > *,
.master-data-page #content > .row > :first-child > * { position: relative; z-index: 1; }
.master-data-page .master-import-actions { position: relative; z-index: 2; }
.master-data-page #content > .row > :first-child,
.master-page-banner { overflow: visible; }
.master-data-page #content > .row > :first-child::after,
.master-page-banner::after { top: 0; width: 112px; height: 112px; border-width: 16px; }
.master-data-page .card-custom { border-color: #e5e8dc; box-shadow: 0 10px 28px rgba(38,72,53,.065); }
.master-data-page .card-custom:hover { box-shadow: 0 15px 34px rgba(38,72,53,.1); }
.master-data-page .card-custom > form,
.master-data-page .card-custom form { min-width: 0; }
.master-data-page .card-custom > h5 { margin-bottom: 18px; color: var(--brand-dark); font-weight: 900; }
.master-data-page .form-label { margin-bottom: 7px; font-size: .82rem; }
.master-data-page .form-control, .master-data-page .form-select { background-color: #fff; }
.master-data-page .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #fafbf7;
    --bs-table-hover-bg: #f1f6ed;
    min-width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}
.master-data-page .table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 15px 17px;
    border-bottom: 1px solid #dfe7db;
    background: linear-gradient(180deg, #f5f7ef 0%, #eaf0e5 100%);
    box-shadow: inset 0 3px 0 #d0e1c8;
    color: #506b55;
    font-size: .67rem;
    letter-spacing: .75px;
}
.master-data-page .table thead th:first-child { border-top-left-radius: 12px; }
.master-data-page .table thead th:last-child { border-top-right-radius: 12px; }
.master-data-page .table tbody tr { background: #fff; transition: background-color .16s ease; }
.master-data-page .table tbody tr:nth-child(even) { background: #fcfdf9; }
.master-data-page .table tbody tr:hover { background: #f1f6ed; }
.master-data-page .table tbody td {
    padding: 14px 17px;
    border-bottom: 1px solid #edf0e8;
    color: #3c5142;
    font-size: .88rem;
}
.master-data-page .table tbody tr:last-child td { border-bottom: 0; }
.master-data-page .table tbody td:first-child { color: #2f4938; font-weight: 800; }
.master-data-page .table td:last-child { min-width: 116px; }
.master-data-page .table td .btn { padding: 6px 11px; font-size: .75rem; }
.master-data-page .table td .btn-outline-primary { border-color: #bdd3bf; background: #fbfdf9; }
.master-data-page .table td .btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.master-data-page .table td .btn-outline-danger { border-color: #e5c7bd; background: #fffaf8; }
.master-data-page .table td .btn-outline-danger:hover { background: #bd6249; border-color: #bd6249; color: #fff; }
.master-data-page .master-status,
.master-data-page .master-role {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}
.master-data-page .master-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.master-data-page .master-status.is-active { color: #327b5b; background: #e8f3e7; border-color: #d4e8d3; }
.master-data-page .master-status.is-inactive { color: #9b6758; background: #f8eae3; border-color: #f0d8cd; }
.master-data-page .master-role { color: #526d55; background: #f2f5e9; border-color: #e2e9d9; }
.master-data-page .master-role-admin { color: #765b9b; background: #f2eef9; border-color: #e6ddf2; }
.master-data-page .master-role-guru { color: #327b5b; background: #e8f3e7; border-color: #d4e8d3; }
.master-data-page .master-role-orang_tua { color: #a07821; background: #fff3d5; border-color: #f5e5b8; }
.master-data-page .table details > summary { list-style: none; cursor: pointer; }
.master-data-page .table details > summary::-webkit-details-marker { display: none; }
.master-data-page .table details[open] form { display: block; min-width: 220px; max-width: 320px; margin: 8px 0; padding: 13px !important; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 9px 22px rgba(38,72,53,.08); }
.master-data-page .table td form { display: inline-block; vertical-align: top; margin: 3px 4px 3px 0; }
.master-data-page .table details[open] form { display: block; }
.master-data-page .table td form button { white-space: nowrap; }
.master-data-page .table-responsive { border-radius: inherit; }
.master-data-page .card-footer { background: var(--surface) !important; }
.master-import-header { margin-bottom: 22px !important; }
.master-import-header h1 { margin-bottom: 5px !important; }
.session-matrix { min-width: 820px; }
.session-matrix thead th { background: #285d48; color: #fff; vertical-align: middle; min-width: 155px; }
.session-matrix thead th:first-child { min-width: 170px; }
.session-matrix td { min-width: 155px; }
.session-percent { color: #397854; font-size: 1.35rem; font-weight: 900; }
.session-percent.text-danger { color: #dc3545 !important; }

.public-form-page {
    min-height: 100vh;
    padding: 30px 18px;
    background:
        radial-gradient(circle at 12% 5%, rgba(213,235,209,.8) 0, transparent 30%),
        radial-gradient(circle at 90% 90%, rgba(255,229,168,.58) 0, transparent 28%),
        var(--page);
}
.public-form-shell { width: min(100%, 980px); margin: 0 auto; }
.public-form-brand { display: flex; align-items: center; gap: 11px; width: fit-content; margin: 0 auto 24px; color: var(--brand-dark); }
.public-form-brand strong, .public-form-brand small { display: block; line-height: 1.2; }
.public-form-brand strong { font-weight: 900; }
.public-form-brand small { color: var(--muted); font-size: .75rem; margin-top: 3px; }
.public-form-mark { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 15px; background: var(--brand); color: #ffe29a; font-size: 1.25rem; font-weight: 900; box-shadow: 0 7px 17px rgba(50,123,91,.22); }

.dashboard-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 205px;
    padding: 30px 36px;
    margin-bottom: 24px;
    border-radius: 25px;
    color: var(--ink);
    background:
        radial-gradient(circle at 93% 18%, rgba(255,255,255,.77) 0 4px, transparent 5px),
        radial-gradient(circle at 86% 65%, rgba(255,255,255,.48) 0 3px, transparent 4px),
        linear-gradient(108deg, #e3f0df 0%, #eef4df 58%, #fff0c9 100%);
    border: 1px solid #dfead7;
    box-shadow: 0 10px 28px rgba(48,94,66,.055);
}
.achievement-page { width: 100%; max-width: 1440px; margin-inline: auto; }
.dashboard-hero::before, .dashboard-hero::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.dashboard-hero::before { width: 230px; height: 230px; right: 18%; top: -154px; background: rgba(255,255,255,.4); }
.dashboard-hero::after { width: 118px; height: 118px; right: 47%; bottom: -86px; background: rgba(240,196,94,.2); }
.dashboard-hero-copy { position: relative; z-index: 1; max-width: 650px; }
.dashboard-hero-copy .eyebrow { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-dark); font-weight: 900; font-size: .72rem; text-transform: uppercase; letter-spacing: 1.25px; }
.dashboard-hero-copy h1 { margin: 9px 0; font-size: clamp(1.55rem, 2.5vw, 2.15rem); font-weight: 900; letter-spacing: -.8px; }
.dashboard-hero-copy p { color: #5d7460; margin: 0; max-width: 580px; line-height: 1.65; }
.dashboard-hero-art { position: relative; z-index: 1; width: min(34%, 260px); min-width: 170px; height: 150px; }
.dashboard-hero-art svg { width: 100%; height: 100%; overflow: visible; }
.dashboard-stat-icon { flex: 0 0 auto; }

/* Standalone login screen */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 14%, rgba(219,238,211,.92) 0, transparent 30%),
        radial-gradient(circle at 90% 86%, rgba(255,232,177,.72) 0, transparent 27%),
        var(--page);
}
.login-container { max-width: 1000px; width: 100%; }
.login-card { border: 1px solid #e5e7da; border-radius: 25px; box-shadow: 0 22px 65px rgba(36,78,54,.14); overflow: hidden; }
.login-branding {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 90% 8%, rgba(240,196,94,.18), transparent 25%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 14px),
        linear-gradient(150deg, #327b5b, #174a39);
    color: #fff;
    padding: 45px 38px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-branding::before, .login-branding::after { content: ''; position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.login-branding::before { width: 280px; height: 280px; left: -110px; top: -120px; }
.login-branding::after { width: 220px; height: 220px; right: -105px; bottom: -100px; }
.login-branding > * { position: relative; z-index: 1; }
.login-branding .brand-icon { width: 84px; height: 84px; margin: 0 auto 22px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 26px; background: rgba(255,255,255,.13); color: #ffe29a; font-size: 2.25rem; }
.login-branding h2 { color: #fff; }
.login-form-container { background: var(--surface); padding: 52px 48px; }
.login-form-container .form-control { min-height: 48px; }
.login-form-container h3 { font-weight: 900; }

@media (max-width: 991.98px) {
    #content { padding: 27px 25px; }
}
@media (max-width: 767.98px) {
    #sidebar { transform: translateX(-100%); width: 286px; min-width: 286px; }
    body.sidebar-open #sidebar { transform: translateX(0); }
    #content { width: 100%; margin-left: 0; padding: 12px 16px 28px; }
    .mobile-toolbar { display: flex; position: sticky; top: 0; z-index: 1020; align-items: center; gap: 12px; padding: 8px 0 13px; margin-bottom: 5px; background: rgba(248,247,239,.94); backdrop-filter: blur(10px); }
    .mobile-menu-toggle { width: 43px; height: 43px; flex: 0 0 auto; border: 0; border-radius: 14px; background: var(--brand); color: #fff; box-shadow: 0 5px 12px rgba(50,123,91,.22); }
    .mobile-toolbar-label { font-weight: 900; color: var(--brand-dark); }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1030; background: rgba(24,47,36,.44); opacity: 0; visibility: hidden; transition: .2s ease; }
    body.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
    .dashboard-hero { min-height: 175px; padding: 23px; }
    .dashboard-hero-art { width: 30%; min-width: 112px; height: 118px; }
    .dashboard-hero-copy p { font-size: .9rem; }
    .login-form-container { padding: 36px 25px; }
    .master-data-page #content > .row > :first-child,
    .master-page-banner,
    .master-import-header { align-items: flex-start; gap: 12px; padding: 42px 18px 18px; border-radius: 19px; }
    .master-data-page #content > .row > :first-child::before,
    .master-page-banner::before,
    .master-import-header::before { left: 19px; }
    .master-data-page .master-import-actions { width: 100%; }
    .master-data-page .card-custom { border-radius: 17px; }
}
@media (max-width: 480px) {
    .dashboard-hero { padding: 20px 18px; gap: 4px; }
    .dashboard-hero-art { min-width: 92px; width: 34%; height: 100px; }
    .dashboard-hero-copy h1 { font-size: 1.35rem; }
    #content .row { --bs-gutter-x: 1rem; }
    .card, .card-custom { border-radius: 17px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
