/* Import Font Google & Font Awesome */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');

/* 1. PENGATURAN DASAR & RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    background-color: #f8f9fa;
    color: #333;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #ece7db;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.app-topbar-left,
.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-topbar-left {
    flex: 1;
    min-width: 0;
}

.app-topbar-left:empty {
    display: none;
}

.topbar-school-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-height: 0;
    padding: 0 0 0 10px;
    border-radius: 0;
    background: transparent;
    border: none;
    color: #111111;
    box-shadow: none;
    min-width: 0;
    max-width: min(560px, calc(100vw - 360px));
}

.topbar-school-chip i {
    display: none;
}

.topbar-school-chip span {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 20px;
    font-weight: 700;
    color: #111111;
}

.topbar-search {
    flex: 1;
    max-width: 540px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-height: 48px;
    background: #f7f5ef;
    border: 1px solid #ede8db;
    border-radius: 999px;
    color: #8a8578;
}

.topbar-search input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
}

.topbar-search input::placeholder {
    color: #999282;
}

.topbar-icon-button {
    width: 46px;
    height: 46px;
    border: 1px solid #ece7db;
    border-radius: 14px;
    background: #fff;
    color: #555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.topbar-icon-button:hover,
.topbar-user-trigger:hover {
    background: #f7faf8;
    border-color: #d7eee6;
}

.notification-dot {
    position: absolute;
    top: 11px;
    right: 11px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b57;
    border: 2px solid #fff;
}

.topbar-user-menu {
    position: relative;
}

.topbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #ece7db;
    border-radius: 16px;
    background: #fff;
    padding: 8px 12px 8px 8px;
    cursor: pointer;
    min-height: 46px;
    transition: all 0.2s ease;
}

.topbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00A97F, #0c7d61);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
}

.topbar-user-avatar.has-photo {
    background: #ffffff;
}

.topbar-user-avatar.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.topbar-user-meta strong {
    font-size: 13px;
    color: #333;
}

.topbar-user-meta small {
    font-size: 11px;
    color: #8b8578;
}

.topbar-user-caret {
    color: #9a9385;
    font-size: 12px;
}

.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ece7db;
    border-radius: 16px;
    box-shadow: 0 18px 35px rgba(0,0,0,0.08);
    display: none;
    z-index: 1100;
}

.topbar-user-menu.is-open .topbar-user-dropdown {
    display: block;
}

.topbar-user-dropdown a,
.topbar-user-dropdown button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    border-radius: 12px;
    padding: 10px 12px;
    color: #444;
    text-decoration: none;
    cursor: pointer;
}

.topbar-user-dropdown a:hover,
.topbar-user-dropdown button:hover {
    background: #f3fbf8;
    color: #00885e;
}

.topbar-logout-form {
    margin: 0;
}

.topbar-notification-menu {
    position: relative;
}

.notification-dot.is-hidden {
    display: none;
}

.topbar-notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    padding: 12px;
    background: #fff;
    border: 1px solid #ece7db;
    border-radius: 18px;
    box-shadow: 0 18px 35px rgba(0,0,0,0.08);
    display: none;
    z-index: 1100;
}

.topbar-notification-menu.is-open .topbar-notification-dropdown {
    display: block;
}

.topbar-notification-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0ebe0;
}

.topbar-notification-header strong {
    display: block;
    font-size: 15px;
    color: #24324a;
}

.topbar-notification-header small {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #8a8477;
}

.topbar-notification-read-btn {
    border: none;
    background: transparent;
    color: #00A97F;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.topbar-notification-read-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.topbar-notification-list {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.topbar-notification-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    padding: 11px 10px;
    border: 1px solid #efe9de;
    border-radius: 14px;
    background: #fffdfa;
}

.topbar-notification-item.is-unread {
    background: linear-gradient(180deg, #fbfffd 0%, #f2fbf8 100%);
    border-color: #d8eee5;
}

.topbar-notification-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3faf7;
    color: #00A97F;
}

.topbar-notification-copy strong {
    display: block;
    font-size: 13px;
    color: #24324a;
    margin-bottom: 4px;
}

.topbar-notification-copy p {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.55;
    color: #687487;
}

.topbar-notification-copy span {
    font-size: 11px;
    color: #9a9385;
}

.topbar-notification-empty {
    padding: 18px 12px;
    border-radius: 14px;
    background: #fffdfa;
    border: 1px dashed #e6ddd0;
    text-align: center;
    font-size: 13px;
    color: #7f796d;
}

/* 2. SIDEBAR INTERAKTIF */
.sidebar {
    width: 270px;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
    border-right: 1px solid #ece6db;
    padding: 12px 14px 10px;
    z-index: 1001;
    transition: left 0.3s ease-in-out, width 0.3s ease-in-out, padding 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 169, 127, 0.18) transparent;
}

.sidebar-toggle-edge {
    position: absolute;
    top: 18px;
    right: -15px;
    width: 30px;
    height: 30px;
    border: 1px solid #ece6db;
    border-radius: 50%;
    background: #ffffff;
    color: #5c6072;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    z-index: 1015;
    transition: all 0.25s ease;
}

.sidebar-toggle-edge:hover {
    background: #f8faf8;
    color: #23263a;
}

.sidebar-toggle-edge i {
    font-size: 11px;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 4px 0 10px;
    margin-bottom: 6px;
}

.sidebar-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: #fff8ef;
    border: 1px solid #f0e3cf;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}

.sidebar-brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar-brand-text strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #2d3142;
}

.sidebar-brand-text span {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9d978b;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    text-decoration: none;
    color: #555f73;
    font-weight: 600;
    border-radius: 15px;
    margin-bottom: 4px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.sidebar-nav li a:hover {
    background-color: #f5f2eb;
    color: #23263a;
}

.sidebar-nav li a.active {
    background-color: #f1f1f1;
    color: #23263a;
}

.sidebar-link-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 11px;
    background: #f5f3ee;
    color: #6b6678;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.sidebar-nav li a.active .sidebar-link-icon {
    background: #2f3448;
    color: #fff;
}

.sidebar-section-label {
    margin: 8px 0 6px;
    padding-top: 10px;
    border-top: 1px solid #f0ebe0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #aaa395;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    padding-bottom: 2px;
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-logout-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #3b4050;
    font-weight: 600;
    cursor: pointer;
}

.sidebar-logout-button:hover {
    background: #f7f4ee;
}

/* 3. KONTEN UTAMA */
.main-content {
    width: calc(100% - 270px);
    margin-left: 270px;
    padding: 20px 30px;
    transition: width 0.3s ease-in-out, margin-left 0.3s ease-in-out;
}

body.sidebar-collapsed .sidebar {
    width: 92px;
    padding: 12px 10px 10px;
}

body.sidebar-collapsed .sidebar-toggle-edge {
    right: -15px;
}

body.sidebar-collapsed .sidebar-toggle-edge i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .main-content {
    width: calc(100% - 92px);
    margin-left: 92px;
}

body.sidebar-collapsed .sidebar-brand {
    padding-bottom: 8px;
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-nav li a span:not(.sidebar-link-icon),
body.sidebar-collapsed .sidebar-logout-button span {
    display: none;
}

body.sidebar-collapsed .sidebar-nav li a,
body.sidebar-collapsed .sidebar-logout-button {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-link-icon {
    margin: 0;
}

body.sidebar-collapsed .sidebar-brand-logo {
    width: 48px;
    height: 48px;
}

body.sidebar-collapsed .sidebar-brand-logo img {
    width: 28px;
    height: 28px;
}

body.sidebar-collapsed .sidebar-nav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.sidebar-collapsed .sidebar-footer {
    display: flex;
    justify-content: center;
}

body:not(.sidebar-state-ready) .sidebar,
body:not(.sidebar-state-ready) .main-content,
body:not(.sidebar-state-ready) .sidebar-toggle-edge {
    transition: none !important;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.power-icon {
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.power-icon:hover {
    color: #333;
}

/* 4. TATA LETAK DASHBOARD (GRID LAYOUT) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    gap: 25px;
    grid-template-areas:
        "welcome welcome headmaster headmaster"
        "stats stats uts uts"
        "carousel carousel carousel carousel";
}

.grid-item {
    background-color: #fff;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.welcome-section { grid-area: welcome; background: none; box-shadow: none; padding: 0;}
.headmaster-card { grid-area: headmaster; }
.stats-container { grid-area: stats; }
.uts-container { grid-area: uts; }
.guru-carousel { grid-area: carousel; }

/* Styling Item Grid */
.welcome-section h1 {
    font-size: 42px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}
.welcome-section .app-description {
    font-size: 18px;
    color: #777;
    margin-top: 5px;
}
.welcome-section .semester-info {
    margin-top: 15px;
    font-size: 24px;
    font-weight: 600;
}
.welcome-section .semester-info .ganjil {
    color: #E24848;
    margin-right: 10px;
}

/* ================================================================= */
/* == KODE FINAL: KARTU KEPALA MADRASAH (PECI KELUAR LINGKARAN) == */
/* ================================================================= */

.headmaster-card {
    display: flex;
    align-items: center;
    position: relative;
    grid-area: headmaster;
    min-height: 140px; 
    padding: 20px 25px;
    border-radius: 28px;
    background: linear-gradient(105deg, #e0f2f1, #17a4a4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    overflow: hidden; /* Mencegah foto keluar dari batas kartu */
}

/* Lingkaran Gradasi Dekoratif di Latar Belakang */
.headmaster-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(0, 169, 127, 0.2), rgba(23, 164, 164, 0.05));
    border-radius: 50%;
    z-index: 1; /* Lapisan 1 (Paling Bawah) */
}

.headmaster-info {
    z-index: 4; /* Lapisan 4 (Paling Atas, agar tidak tertutup foto) */
    max-width: calc(100% - 160px); 
}

.headmaster-info .title {
    font-size: 14px;
    font-weight: 500;
    color: #0f4a42;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.headmaster-info .name {
    font-size: 22px;
    font-weight: 600;
    color: #0f4a42;
}

/* Kontainer untuk memposisikan foto dan lingkaran */
.headmaster-photo-container {
    position: absolute;
    right: 15px;
    bottom: -20px; /* Sedikit ke bawah untuk efek 3D */
    width: 200px; 
    height: 200px;
}

/* Foto Kepala Madrasah */
.headmaster-photo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 180px; 
    height: auto;
    z-index: 3; /* KUNCI: Lapisan 3 (Di depan lingkaran) */
    object-fit: contain;
    object-position: bottom center;
}

/* ========================================================== */
/* == KODE RESPONSIF UNTUK KARTU KEPALA MADRASAH == */
/* ========================================================== */

/* --- Untuk Tampilan Tablet --- */
@media (max-width: 992px) {
    /* Mengatur sidebar untuk mode mobile */
    .sidebar {
        left: -250px;
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
    }
    .sidebar.is-open {
        left: 0;
    }
    .main-content {
        width: 100%;
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .top-bar {
        justify-content: space-between;
    }

    .app-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .app-topbar-left,
    .app-topbar-right {
        width: 100%;
    }

    .app-topbar-right {
        justify-content: space-between;
    }

    .topbar-search {
        max-width: none;
    }
    
    /* Menyesuaikan grid dasbor di tablet */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "welcome welcome"
            "headmaster headmaster"
            "stats uts"
            "carousel carousel";
    }
}

@media (max-width: 640px) {
    .topbar-user-meta {
        display: none;
    }

    .topbar-user-trigger {
        padding-right: 10px;
    }
}

@media (max-width: 992px) {
    .app-topbar {
        gap: 12px;
        padding: 12px 14px;
        border-radius: 16px;
    }

    .app-topbar-left {
        min-width: 0;
    }

    .app-topbar-right {
        gap: 10px;
    }

    .topbar-search {
        min-height: 44px;
    }

    .sidebar {
        width: 270px;
        left: -270px;
        box-shadow: 0 18px 36px rgba(0,0,0,0.16);
    }

    .sidebar.is-open {
        left: 0;
    }

    .sidebar-toggle-edge {
        position: fixed;
        top: 16px;
        left: 14px;
        right: auto;
        width: 36px;
        height: 36px;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    }

    .sidebar.is-open .sidebar-toggle-edge {
        left: 226px;
    }

    .sidebar-toggle-edge i {
        transform: rotate(180deg);
    }

    .sidebar.is-open .sidebar-toggle-edge i {
        transform: rotate(0deg);
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        width: 100%;
        margin-left: 0;
        padding: 18px 16px 24px;
    }

    body.sidebar-collapsed .sidebar {
        width: 270px;
        padding: 16px 16px;
    }

    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar-section-label,
    body.sidebar-collapsed .sidebar-nav li a span:not(.sidebar-link-icon),
    body.sidebar-collapsed .sidebar-logout-button span {
        display: initial;
    }

    body.sidebar-collapsed .sidebar-nav li a,
    body.sidebar-collapsed .sidebar-logout-button {
        justify-content: flex-start;
        padding-left: 12px;
        padding-right: 12px;
    }

    body.sidebar-collapsed .sidebar-nav ul {
        display: block;
    }

    body.sidebar-collapsed .sidebar-footer {
        display: block;
    }
}

@media (max-width: 768px) {
    .app-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .app-topbar-left,
    .app-topbar-right {
        width: 100%;
    }

    .app-topbar-right {
        justify-content: space-between;
    }

    .topbar-search {
        max-width: none;
        width: 100%;
    }

    .topbar-user-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
    }
}

@media (max-width: 576px) {
    .app-topbar {
        margin-bottom: 18px;
        padding: 10px 12px;
    }

    .app-topbar-right {
        gap: 8px;
    }

    .topbar-search {
        padding: 0 12px;
        min-height: 42px;
        gap: 10px;
    }

    .topbar-search input {
        font-size: 13px;
    }

    .topbar-icon-button {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .topbar-user-trigger {
        min-height: 42px;
        padding: 4px 8px 4px 4px;
        gap: 8px;
    }

    .topbar-user-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .topbar-user-caret {
        font-size: 11px;
    }

    .sidebar {
        width: min(270px, calc(100vw - 56px));
        padding: 14px 14px 16px;
    }

    .sidebar.is-open .sidebar-toggle-edge {
        left: calc(min(270px, calc(100vw - 56px)) - 44px);
    }

    .sidebar-brand {
        padding-top: 4px;
    }

    .sidebar-brand-logo {
        width: 56px;
        height: 56px;
    }

    .sidebar-brand-logo img {
        width: 32px;
        height: 32px;
    }

    .sidebar-nav li a {
        padding: 9px 10px;
        gap: 12px;
        margin-bottom: 5px;
    }

    .sidebar-link-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .sidebar-toggle-edge {
        top: 12px;
        left: 12px;
        width: 34px;
        height: 34px;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        padding: 14px 12px 22px;
    }
}

/* ======================================================= */
/* == FINAL MOBILE CLEANUP: SIDEBAR + TOPBAR            == */
/* ======================================================= */
@media (max-width: 768px) {
    .app-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        margin-bottom: 18px;
        position: relative;
    }

    .app-topbar-left {
        width: auto;
        min-width: 0;
        padding-left: 34px;
    }

    .app-topbar-right {
        width: auto;
        min-width: 0;
        justify-content: flex-end;
        gap: 8px;
    }

    .topbar-search {
        width: 100%;
        max-width: none;
        min-height: 42px;
        padding: 0 12px;
        gap: 10px;
    }

    .topbar-search input {
        font-size: 13px;
    }

    .topbar-icon-button {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 12px;
    }

    .topbar-user-trigger {
        min-height: 40px;
        padding: 4px 8px 4px 4px;
        gap: 8px;
        border-radius: 12px;
    }

    .topbar-user-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .topbar-user-caret {
        font-size: 10px;
    }

    .topbar-user-dropdown {
        top: calc(100% + 8px);
        right: 0;
        left: auto;
        min-width: 168px;
        padding: 8px;
    }

    .sidebar {
        width: min(270px, calc(100vw - 52px));
        left: calc(-1 * min(270px, calc(100vw - 52px)));
        padding: 14px 14px 16px;
    }

    .sidebar.is-open {
        left: 0;
    }

    .sidebar-toggle-edge {
        position: fixed;
        top: 18px;
        left: 10px;
        width: 34px;
        height: 34px;
        border-radius: 12px;
        z-index: 1016;
    }

    .sidebar.is-open .sidebar-toggle-edge {
        left: calc(min(270px, calc(100vw - 52px)) - 18px);
    }

    .sidebar-brand {
        padding: 4px 0 12px;
        margin-bottom: 8px;
    }

    .sidebar-nav li a {
        padding: 9px 10px;
        gap: 12px;
        margin-bottom: 5px;
    }

    .sidebar-link-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .sidebar-section-label {
        margin: 8px 0 6px;
        padding-top: 10px;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        width: 100%;
        margin-left: 0;
        padding: 12px 10px 20px;
    }

    body.sidebar-collapsed .sidebar {
        width: min(270px, calc(100vw - 52px));
        padding: 14px 14px 16px;
    }

    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar-section-label,
    body.sidebar-collapsed .sidebar-nav li a span:not(.sidebar-link-icon),
    body.sidebar-collapsed .sidebar-logout-button span {
        display: initial;
    }

    body.sidebar-collapsed .sidebar-nav li a,
    body.sidebar-collapsed .sidebar-logout-button {
        justify-content: flex-start;
        padding-left: 10px;
        padding-right: 10px;
    }

    body.sidebar-collapsed .sidebar-nav ul {
        display: block;
    }

    body.sidebar-collapsed .sidebar-footer {
        display: block;
    }
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 169, 127, 0.18);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 420px) {
    .app-topbar-left {
        padding-left: 30px;
    }

    .topbar-search input::placeholder {
        font-size: 12px;
    }

    .topbar-user-dropdown {
        min-width: 154px;
    }

    .sidebar-toggle-edge {
        top: 14px;
        left: 8px;
        width: 32px;
        height: 32px;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        padding: 10px 8px 18px;
    }
}

/* --- Untuk Tampilan HP (DI BAWAH 768px) --- */
@media (max-width: 768px) {
    .main-content { 
        padding: 20px 15px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "welcome"
            "headmaster"
            "stats"
            "uts"
            "carousel";
        gap: 20px;
    }

    /* === PERBAIKAN UTAMA KARTU KEPALA MADRASAH DI HP === */
    .headmaster-card {
        flex-direction: column;
        align-items: center;          /* ← UBAH: Pusatkan semua konten */
        text-align: center;           /* ← TAMBAH: Text rata tengah */
        padding: 30px 20px;           /* ← UBAH: Padding lebih besar */
        min-height: auto;
    }

    .headmaster-info {
        max-width: 100%;
        margin-bottom: 30px;          /* ← UBAH: Jarak lebih besar */
        text-align: center;           /* ← TAMBAH: Text rata tengah */
    }

    .headmaster-info .title {
        font-size: 12px;              /* ← TAMBAH: Ukuran font label */
        margin-bottom: 8px;
    }

    .headmaster-info .name {
        font-size: 18px;              /* ← TAMBAH: Ukuran font nama */
        line-height: 1.3;
    }
    
    .headmaster-photo-container {
        position: relative;
        margin: 0 auto;
        width: 100%;                  /* ← Lebar penuh */
        max-width: 280px;             /* ← Batasi lebar maksimal */
        height: auto;                 /* ← Tinggi otomatis */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Pastikan lingkaran berada di lapisan bawah */
    .headmaster-photo-container::after {
        display: none !important;     /* ← KUNCI: Sembunyikan lingkaran */
    }

    /* Posisikan ulang foto agar di atas lingkaran */
    .headmaster-photo {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;                 /* ← DIPERBESAR dari 180px */
        max-width: 280px;
        height: auto;
        z-index: 2;
        object-fit: contain;
        object-position: center;
        border-radius: 0;
        border: none;
    }
    
    
    /* Menyesuaikan item dasbor lainnya di HP */
    .stats-container, .uts-container {
        flex-direction: column;
        gap: 25px;
        align-items: flex-start;
        text-align: left;
    }
    .guru-cards-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;
        overflow-x: visible;
        padding-bottom: 0;
    }
    .guru-card {
        width: 100%;
    }
    .carousel-nav {
        display: none;
    }
}

.stats-container, .uts-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
}
.stats-item, .uts-item { text-align: center; }
.stats-item p, .uts-item p { font-size: 14px; color: #999; margin-bottom: 8px; }
.stats-item span { font-size: 32px; font-weight: 700; color: #3f3750; }
.uts-item span { font-size: 16px; font-weight: 600; color: #3f3750; }
.uts-item .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.uts-item .dot.ganjil { background-color: #A36BEE; }
.uts-item .dot.genap { background-color: #72B9EE; }

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.carousel-header h2 { font-size: 22px; font-weight: 600; }
.carousel-nav .arrow-btn {
    background-color: #f0f0f0;
    border: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer; margin-left: 10px;
    transition: all 0.2s ease;
}
.carousel-nav .arrow-btn:hover { background-color: #00A97F; color: white; }
.guru-cards-wrapper { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 15px; scrollbar-width: none; }
.guru-cards-wrapper::-webkit-scrollbar { display: none; }
.guru-card {
    flex-shrink: 0;
    width: 160px;
    text-align: center;
    padding: 20px 15px;
    border-radius: 18px;
    background-color: #f8f9fa;
    border: 1px solid #f0f0f0;
}
.guru-card img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; border: 3px solid #00A97F; }
.guru-card h3 { font-size: 16px; font-weight: 600; }
.guru-card p { font-size: 13px; color: #888; }

/* 5. GAYA HALAMAN LAIN (PROFIL, GURU, SISWA, ROMBEL) */
.main-header {
    display: flex;
    align-items: center;
    gap: 15px; /* Memberi jarak antara ikon dan judul */
}

.main-header h1 {
    font-size: 28px;
    border-left: 5px solid #00A97F;
    padding-left: 15px;
}
.content-table { width: 100%; border-collapse: collapse; background-color: white; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.content-table thead tr { background-color: #f8f9fa; }
.content-table th, .content-table td { padding: 15px 20px; text-align: left; }
.content-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.guru-info { display: flex; align-items: left; }
.guru-info img { width: 40px; height: 40px; border-radius: 50%; margin-right: 15px; object-fit: cover; }
.rombel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.rombel-card { background-color: white; border-radius: 10px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }

/* 6. MEDIA QUERIES (RESPONSIVE) */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-areas:
            "welcome welcome welcome welcome"
            "headmaster headmaster headmaster headmaster"
            "stats stats uts uts"
            "carousel carousel carousel carousel";
    }
}

/* ===================================== */
/* == GAYA BARU UNTUK HALAMAN PROFIL  == */
/* ===================================== */

.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr; /* Kolom kiri 300px, sisanya kolom kanan */
    gap: 30px;
    align-items: flex-start;
}

/* Kolom Kiri */
.profile-sidebar {
    background-color: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    text-align: center;
    position: sticky; /* Tetap di posisi saat scroll */
    top: 30px;
}

.profile-logo {
    width: 120px;
    margin-bottom: 15px;
}

.profile-sidebar h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 5px;
}

.profile-sidebar p {
    color: #888;
    margin-bottom: 30px;
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    margin-bottom: 30px;
}

.profile-nav .nav-link {
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.profile-nav .nav-link:hover {
    background-color: #f0f5f5;
    color: #00885e;
}

.profile-nav .nav-link.active {
    background-color: #00A97F;
    color: white;
    font-weight: 600;
}

/* Kolom Kanan */
.profile-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.tab-pane {
    display: none; /* Sembunyikan semua konten tab secara default */
}

.tab-pane.active {
    display: block; /* Tampilkan hanya tab yang aktif */
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 kolom */
    gap: 25px;
}

.info-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
}

.info-item p {
    font-size: 13px;
    color: #999;
    margin-bottom: 5px;
}

.info-item span {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.info-item.full-width {
    grid-column: 1 / -1; /* Buat item ini memakan lebar 2 kolom */
}


/* Penyesuaian Responsif untuk Halaman Profil */
@media (max-width: 1024px) {
    .profile-container {
        grid-template-columns: 1fr; /* Tumpuk kolom menjadi 1 */
    }
    .profile-sidebar {
        position: static; /* Hapus sticky di layar kecil */
    }
}

/* ===================================== */
/* == GAYA BARU UNTUK HALAMAN GURU    == */
/* ===================================== */

/* Penyesuaian lebar kolom status & aksi */
.content-table .status-col { width: 100px; text-align: center; }
.content-table .action-col { width: 80px; text-align: center; }

/* Tautan pada Nama Guru - DIPERBAIKI */
.guru-link,
.guru-link:link,
.guru-link:visited,
.guru-link:active,
.guru-link:hover {
    text-decoration: none !important;
    color: inherit !important;
    display: inline-block;
}

/* Hover effect hanya untuk nama */
.guru-link:hover .guru-info strong {
    color: #00A97F;
}


/* Tombol Aksi (Edit) */
.action-btn {
    font-size: 18px;
    color: #888;
    transition: color 0.2s ease;
}
.action-btn:hover {
    color: #00A97F;
}

/* Tombol ON/OFF (Toggle Switch) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

/* Sembunyikan checkbox HTML asli */
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Gaya untuk 'slider' atau trek tombol */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 28px;
    transition: background-color 0.4s;
}

/* Gaya untuk 'knob' atau bulatan di dalam slider */
.slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.4s;
}

/* Perubahan saat tombol di-klik (status ON) */
input:checked + .slider {
    background-color: #00A97F; /* Warna hijau aktif */
}

input:checked + .slider::before {
    transform: translateX(22px); /* Geser knob ke kanan */
}

/* Pastikan Anda memiliki kode ini di style.css */

.guru-info {
    display: flex;       /* Membuat foto dan blok teks berdampingan */
    align-items: center;
}

.guru-info div {
    display: flex;
    flex-direction: column; /* INI KUNCINYA: Mengatur item di dalamnya (nama & NIP) menjadi vertikal */
}

/* Sedikit penyesuaian agar lebih rapi */
.guru-info strong {
    font-size: 15px;
    line-height: 1.4;
}

.guru-info span {
    font-size: 12px;
    color: #888;
}

/* ===================================== */
/* == GAYA BARU UNTUK HALAMAN SISWA   == */
/* ===================================== */

/* Baris Aksi (Filter & Tombol) */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}
#filter-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 300px;
    font-size: 14px;
}
.btn-primary { background-color: #00A97F; color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 500; transition: background-color 0.2s ease; }
.btn-primary:hover { background-color: #00885e; }
.btn-primary i { margin-right: 8px; }

/* GANTI KODE LAMA .btn-secondary DENGAN INI */

.btn-secondary {
    background-color: transparent; /* Latar transparan */
    color: #888; /* Warna teks abu-abu */
    border: 1px solid #ccc; /* Garis tepi abu-abu muda */
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #f5f5f5; /* Efek hover dengan latar sedikit abu-abu */
    color: #333;
    border-color: #bbb;
}

/* Tombol Aksi di Tabel */
.action-btn-icon { background: none; border: none; cursor: pointer; font-size: 18px; color: #aaa; margin: 0 5px; }
.action-btn-icon.edit-btn:hover { color: #3a7bd5; }
.action-btn-icon.delete-btn:hover { color: #ff5858; }
.table-wrapper { overflow-x: auto; } /* Agar tabel bisa di-scroll di HP */

/* ==================== MODAL SISWA - DESAIN CLEAN & MODERN ==================== */

/* Overlay Modal */
#student-modal.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

#student-modal.modal[style*="flex"] {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Konten Modal - CLEAN DESIGN */
#student-modal .modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Tombol Close (X) - FIXED POSITION */
#student-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background-color: white;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#student-modal .modal-close:hover {
    background-color: #ff5858;
    color: white;
    border-color: #ff5858;
    transform: rotate(90deg);
}

/* Tab Navigation - INSIDE MODAL */
#student-modal .modal-nav {
    display: flex;
    background: linear-gradient(135deg, #00A97F 0%, #00885e 100%);
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
}

#student-modal .nav-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#student-modal .nav-tab:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

#student-modal .nav-tab.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

#student-modal .nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 3px;
    background-color: white;
    border-radius: 2px 2px 0 0;
}

/* Body Modal */
#student-modal .modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: white;
}

/* Scrollbar Custom */
#student-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#student-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#student-modal .modal-body::-webkit-scrollbar-thumb {
    background: #00A97F;
    border-radius: 10px;
}

/* Tab Pane */
#student-modal .tab-pane {
    display: none;
    animation: fadeInContent 0.3s ease;
}

#student-modal .tab-pane.active {
    display: block;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Judul Modal */
#student-modal .modal-body h2 {
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    padding-left: 15px;
    border-left: 5px solid #00A97F;
}

/* Form Group */
#student-modal .form-group {
    margin-bottom: 20px;
}

#student-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

#student-modal .form-group input,
#student-modal .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

#student-modal .form-group input:focus,
#student-modal .form-group select:focus {
    outline: none;
    border-color: #00A97F;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 169, 127, 0.1);
}

/* Form Actions */
#student-modal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* Upload Area */
#student-modal .upload-area {
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

#student-modal .upload-area:hover {
    border-color: #00A97F;
    background-color: #f0f9f6;
    transform: translateY(-2px);
}

#student-modal .upload-area.file-selected {
    border-color: #00A97F;
    border-style: solid;
    background-color: #e8f5f1;
}

#student-modal .upload-area i {
    font-size: 48px;
    color: #00A97F;
    margin-bottom: 15px;
    display: block;
}

#student-modal .upload-area p {
    font-size: 15px;
    color: #555;
    margin: 8px 0;
    line-height: 1.6;
}

#student-modal .upload-link {
    color: #00A97F;
    font-weight: 600;
    text-decoration: underline;
}

#student-modal #file-name-display {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #00A97F;
}

/* Upload Instructions */
#student-modal .upload-instructions {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #856404;
}

#student-modal .upload-instructions strong {
    display: block;
    margin-bottom: 5px;
    color: #664d03;
}

/* Responsive */
@media (max-width: 768px) {
    #student-modal .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    #student-modal .modal-body {
        padding: 25px 20px;
    }
    
    #student-modal .nav-tab {
        padding: 14px 15px;
        font-size: 14px;
    }
    
    #student-modal .modal-body h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    #student-modal .upload-area {
        padding: 30px 15px;
    }
}

@media (max-width: 480px) {
    #student-modal .modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    #student-modal .modal-body h2 {
        font-size: 18px;
    }
    
    #student-modal .form-actions {
        flex-direction: column;
    }
    
    #student-modal .form-actions button {
        width: 100%;
    }
}

/* ==================== MODAL KONFIRMASI HAPUS ==================== */

#confirm-modal.modal {
    display: none;
    position: fixed;
    z-index: 3000; /* Lebih tinggi dari modal siswa */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

#confirm-modal.modal[style*="flex"] {
    display: flex !important;
}

/* Konten Modal Konfirmasi */
#confirm-modal .modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 0;
    overflow: hidden;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Header Modal Konfirmasi */
#confirm-modal .modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 25px 20px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
}

#confirm-modal .modal-header i {
    font-size: 56px;
    color: #f39c12;
    margin-bottom: 15px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

#confirm-modal .modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

/* Body Modal Konfirmasi */
#confirm-modal .modal-body {
    padding: 25px 30px;
    text-align: center;
}

#confirm-modal .modal-body p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Footer Modal Konfirmasi */
#confirm-modal .modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 30px 30px;
}

#confirm-modal .modal-footer button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#confirm-modal .btn-secondary {
    background-color: #f0f0f0;
    color: #666;
}

#confirm-modal .btn-secondary:hover {
    background-color: #e0e0e0;
    color: #333;
}

#confirm-modal .btn-danger {
    background-color: #e74c3c;
    color: white;
}

#confirm-modal .btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    #confirm-modal .modal-content {
        width: 95%;
    }
    
    #confirm-modal .modal-header {
        padding: 25px 20px 15px;
    }
    
    #confirm-modal .modal-header i {
        font-size: 48px;
    }
    
    #confirm-modal .modal-header h2 {
        font-size: 20px;
    }
    
    #confirm-modal .modal-body {
        padding: 20px 25px;
    }
    
    #confirm-modal .modal-footer {
        flex-direction: column;
        padding: 15px 20px 25px;
    }
    
    #confirm-modal .modal-footer button {
        width: 100%;
    }
}

/* ==================== MODAL GURU - MODERN & CENTERED ==================== */

#guruModal.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

#guruModal.modal[style*="flex"] {
    display: flex !important;
}

/* Konten Modal Guru - Override Style Lama */
#guruModal .modal-content-modern {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    position: relative;
    padding: 0 !important;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Form Grid Modern - Pastikan Layout Benar */
#guruModal .guru-form-modern {
    display: grid;
    grid-template-columns: 250px 1fr;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

/* Photo Uploader Side */
#guruModal .photo-uploader {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

#guruModal #fotoPreviewModern {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #00A97F;
    margin-bottom: 20px;
    background-color: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#guruModal .upload-btn {
    background-color: #00A97F;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

#guruModal .upload-btn:hover {
    background-color: #00885e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 169, 127, 0.3);
}

#guruModal .remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    margin-top: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s ease;
}

#guruModal .remove-btn:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Form Fields Side */
#guruModal .form-fields {
    padding: 30px 35px;
    overflow-y: auto;
    max-height: 90vh;
}

/* Scrollbar Custom */
#guruModal .form-fields::-webkit-scrollbar {
    width: 6px;
}

#guruModal .form-fields::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#guruModal .form-fields::-webkit-scrollbar-thumb {
    background: #00A97F;
    border-radius: 10px;
}

#guruModal .form-fields h2 {
    margin: 0 0 25px 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    padding-left: 15px;
    border-left: 5px solid #00A97F;
}

#guruModal .form-group {
    margin-bottom: 20px;
}

#guruModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

#guruModal .form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

#guruModal .form-group input[type="text"]:focus {
    outline: none;
    border-color: #00A97F;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 169, 127, 0.1);
}

/* Form Grid - 2 Columns */
#guruModal .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Form Actions */
#guruModal .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

/* Responsive */
@media (max-width: 768px) {
    #guruModal .modal-content-modern {
        width: 95%;
        max-height: 95vh;
    }
    
    #guruModal .guru-form-modern {
        grid-template-columns: 1fr;
    }
    
    #guruModal .photo-uploader {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 25px 20px;
    }
    
    #guruModal .form-fields {
        padding: 25px 20px;
    }
    
    #guruModal .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    #guruModal .form-fields h2 {
        font-size: 20px;
    }
    
    #guruModal .form-actions {
        flex-direction: column;
    }
    
    #guruModal .form-actions button {
        width: 100%;
    }
}

/* TAMBAHKAN KODE CSS BARU DI BAWAH INI KE BAGIAN AKHIR style.css */

/* ================================================= */
/* GAYA UNTUK HALAMAN SISWA */

/* Kartu Ringkasan Kelas (Model Kompak) */
.class-summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.class-summary-card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.class-summary-header {
    background-color: #00A97F;
    color: white;
    padding: 10px;
    font-size: 16px;
    font-weight: 600;
}
.class-summary-total {
    font-size: 48px;
    font-weight: 700;
    color: #333;
    padding: 20px 10px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.class-summary-footer {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #f0f0f0;
}
.gender-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
}
.gender-item i.fa-male { color: #3a7bd5; }
.gender-item i.fa-female { color: #f857a6; }

/* ===================================== */
/* == GAYA BARU UNTUK MODAL DENGAN TAB == */
/* ===================================== */

/* Navigasi Tab */
.modal-nav {
    display: flex;
    border-bottom: 1px solid #eee;
    margin: -30px -30px 20px -30px; /* Tarik ke ujung modal content */
    padding: 0 30px;
}
.nav-tab {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #888;
    border-bottom: 3px solid transparent;
}
.nav-tab.active {
    color: #00A97F;
    border-bottom-color: #00A97F;
}

/* Konten Tab */
.tab-pane {
    display: none; /* Sembunyikan semua pane */
}
.tab-pane.active {
    display: block; /* Tampilkan pane yang aktif */
}

/* Area Upload File */
.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
}
.upload-area:hover {
    background-color: #f9f9f9;
}
.upload-area i {
    font-size: 48px;
    color: #00A97F;
    margin-bottom: 15px;
}
.upload-area p {
    font-size: 16px;
    color: #555;
    margin: 0;
}
.upload-area span {
    font-size: 12px;
    color: #999;
}
.upload-area input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-instructions {
    margin-top: 15px;
    font-size: 13px;
    color: #777;
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 5px;
}

/* ===================================== */
/* == GAYA MODERN: FLOATING ACTION BAR == */
/* ===================================== */

.floating-action-bar {
    position: fixed;
    bottom: -100px; /* Posisi awal di luar layar */
    left: 50%;
    transform: translateX(-50%);
    
    display: flex;
    align-items: center;
    gap: 25px;
    
    background-color: #2c3e50; /* Warna gelap modern */
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    z-index: 1999;
    
    transition: bottom 0.3s ease-in-out; /* Animasi muncul/hilang */
}

/* Kelas 'visible' untuk menampilkan bar */
.floating-action-bar.visible {
    bottom: 30px; /* Posisi saat muncul di dalam layar */
}

#selected-count-text {
    font-weight: 500;
}

.btn-danger {
    background-color: #e74c3c; /* Merah menyala */
    color: white;
    border: none; /* Hilangkan border */
    padding: 10px 20px;
    border-radius: 8px; /* Sesuaikan dengan tombol lain */
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: inline-flex; /* Untuk icon jika ada */
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background-color: #c0392b; /* Merah lebih gelap saat hover */
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

/* ===================================== */
/* == GAYA BARU UNTUK MODAL KONFIRMASI == */
/* ===================================== */

.confirm-modal-content {
    max-width: 400px; /* Buat modal konfirmasi lebih kecil */
    text-align: center;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header i {
    font-size: 48px;
    color: #f39c12; /* Warna kuning peringatan */
    margin-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
}

.modal-body p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

/* ===================================== */
/* == GAYA BARU: TOAST NOTIFICATION   == */
/* ===================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: white;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.5s forwards, fadeOut 0.5s 4s forwards;
}

.toast i {
    font-size: 20px;
    margin-right: 15px;
}

/* Variasi Warna Notifikasi */
.toast.success { background-color: #27ae60; }
.toast.error { background-color: #e74c3c; }
.toast.warning { background-color: #f39c12; }

/* Animasi Muncul dan Hilang */
@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(100%); }
}

/* ===================================== */
/* == GAYA BARU UNTUK HALAMAN ROMBEL  == */
/* ===================================== */

.total-students-container {
    margin-bottom: 30px;
}

.total-students-card {
    background: linear-gradient(45deg, #00A97F, #00885e);
    color: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: 0 5px 15px rgba(0, 136, 94, 0.3);
}

.total-students-card i {
    font-size: 48px;
    opacity: 0.8;
}

.total-students-card .info span {
    font-size: 36px;
    font-weight: 700;
}

.total-students-card .info p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

/* Membuat kartu rombel bisa diklik */
.rombel-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.rombel-card-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* ===================================== */
/* == GAYA BARU: PAGINATION           == */
/* ===================================== */

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-top: 10px;
}

.items-per-page-selector label {
    margin-right: 10px;
    font-size: 14px;
    color: #555;
}

.items-per-page-selector select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.pagination-controls button:hover {
    background-color: #f0f0f0;
}

.pagination-controls button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: #f9f9f9;
}

#page-info {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* ===================================== */
/* == DESAIN BARU UNTUK HALAMAN LEGER == */
/* ===================================== */

/* Mengatur body khusus untuk halaman leger */
.leger-body {
    display: block; /* Menghilangkan layout flex dari body utama */
    background-color: #eef2f5;
}

.leger-main-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.leger-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.leger-title-group h1 {
    margin: 0;
    font-size: 28px;
}
.leger-title-group h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #555;
}
.class-badge {
    background-color: #00A97F;
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 14px;
    margin-left: 10px;
}

.leger-action-group {
    display: flex;
    gap: 10px;
}

/* Menu Dropdown Aksi */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    overflow: hidden;
}
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dropdown-content a:hover { background-color: #f1f1f1; }
.dropdown-content.show { display: block; }

/* Wrapper Tabel & Sticky Header */
.table-wrapper-leger {
    max-height: 70vh; /* Atur tinggi maksimal tabel sebelum scroll */
    overflow-y: auto;
}
.leger-table thead {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 1;
}

/* Penyesuaian Tabel Leger */
.leger-table th, .leger-table td {
    text-align: center;
    padding: 10px 8px;
    min-width: 60px;
    font-size: 13px;
    white-space: nowrap;
}
.leger-table .nama-siswa {
    text-align: left;
    min-width: 200px;
    white-space: normal;
}
.leger-table td:last-child {
    font-weight: bold;
}

/* ===================================== */
/* == CSS KHUSUS UNTUK PRINT (DIPERBAIKI) == */
/* ===================================== */

@media print {
  /* Sembunyikan panel kontrol, sidebar, dan kolom aksi */
  .leger-control-panel-v2,
  .sidebar,
  th.action-col,
  td .action-btn-icon,
  td .btn-input-score {
      display: none !important;
      visibility: hidden !important;
  }

  /* Atur layout tabel saat print */
  .table-wrapper-scroll {
      overflow: visible !important;
      max-height: none !important;
  }

  .leger-table-v2 thead,
  .leger-table-v2 .nama-siswa-sticky {
      position: static !important;
  }
}

/* ===================================== */
/* == DESAIN BARU V2 UNTUK HALAMAN LEGER == */
/* ===================================== */

.leger-v2-body {
    display: block;
    background-color: #f0f2f5;
}

.leger-v2-container {
    max-width: 1100px;     /* <--- dari sebelumnya 95% layar, ubah ke lebar yang lebih ramping */
    margin: 20px auto;     /* <--- posisi di tengah */
    padding: 20px 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* Panel kontrol bagian atas */
.leger-control-panel-v2 {
    padding: 10px 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.panel-info h1 {
    font-size: 20px;          /* Lebih kecil agar rapi */
    margin: 0;
    margin-right: 15px;
}

.class-selector-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.class-selector-wrapper label {
    font-weight: 500;
}

.class-selector-wrapper select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.panel-actions .btn-primary,
.panel-actions .btn-secondary {
    padding: 6px 12px;          /* Tombol lebih kecil */
    font-size: 14px;
    border-radius: 6px;
}

.leger-table-card {
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
}

.table-wrapper-scroll {
    overflow-x: auto;
    max-height: 75vh;
}

.leger-table-v2 {
    width: 100%;
}

.leger-table-v2 thead {
    position: sticky; /* Membuat header tabel menempel di atas */
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

.leger-table-v2 .nama-siswa-sticky {
    position: sticky; /* Membuat kolom nama menempel di kiri */
    left: 0;
    background-color: #fff; /* Warna latar agar tidak transparan */
    z-index: 5;
    text-align: left;
    min-width: 220px;
}

.leger-table-v2 thead .nama-siswa-sticky {
    background-color: #f8f9fa; /* Samakan warna dengan header lain */
}

.leger-table-v2 .highlight {
    font-weight: 600;
    background-color: #f8f9fa;
}

.leger-table-v2 .rank {
    font-size: 14px;
    color: #00A97F;
}

/* Penyesuaian saat di-print */
@media print {
    .leger-v2-body { background-color: white; }
    .leger-v2-container { margin: 0; padding: 0; max-width: 100%; }
    .leger-control-panel-v2 { display: none; }
    .leger-table-card { box-shadow: none; border: 1px solid #ddd; }
    .table-wrapper-scroll { overflow: visible; max-height: none; }
    .leger-table-v2 .nama-siswa-sticky { position: static; }
}

/* Penyesuaian Responsif untuk Tabel Leger Lebar */
@media (max-width: 1600px) {
    .leger-table-v2 th, .leger-table-v2 td {
        padding: 8px 6px;
        font-size: 12px;
        min-width: 55px;
    }
    .leger-table-v2 .nama-siswa-sticky { min-width: 200px; }
    .leger-table-v2 .rank { font-size: 13px; }
}

@media (max-width: 1366px) {
    .leger-table-v2 th, .leger-table-v2 td {
        padding: 8px 5px;
        font-size: 11px;
        min-width: 50px;
    }
    .leger-table-v2 .nama-siswa-sticky { min-width: 180px; }
}

/* ===================================== */
/* == GAYA BARU UNTUK KOLOM PERILAKU  == */
/* ===================================== */

.behavior-col {
    font-weight: bold;
    text-align: center;
    font-size: 14px;
}

/* Beri warna berdasarkan nilai */
.behavior-col[data-grade="A"] {
    color: #27ae60; /* Hijau */
}
.behavior-col[data-grade="B"] {
    color: #2980b9; /* Biru */
}
.behavior-col[data-grade="C"] {
    color: #f39c12; /* Kuning */
}
.behavior-col[data-grade="D"] {
    color: #e74c3c; /* Merah */
}

/* ===================================== */
/* == GAYA UNTUK MODAL INPUT NILAI    == */
/* ===================================== */

.modal-lg {
    max-width: 800px;
}

.score-grid {
    display: grid;
    /* Membuat layout grid yang responsif, menampilkan 2 hingga 4 kolom */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

/* Gaya untuk pemisah dan grid perilaku di dalam modal */
.modal-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 25px 0;
}

.behavior-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

/* ===================================== */
/* == GAYA BARU UNTUK HEADER LEGER    == */
/* ===================================== */

.report-header {
    max-width: 800px;      /* <--- batasi lebar header laporan */
    margin: 0 auto 20px;   /* <--- posisi di tengah dengan margin bawah */
    text-align: center;
    padding-bottom: 10px;
}

.report-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}
.report-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}
.report-header h3 {
    font-size: 15px;
    font-weight: 500;
    color: #777;
    margin-bottom: 15px;
}
.report-details {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 14px;
}
.detail-item { font-size: 15px; }
.detail-item strong { font-weight: 600; }

/* === Responsive Table for Leger === */
.leger-table-v2 {
    width: 100%;
    table-layout: auto;        /* biarkan kolom menyesuaikan konten */
    border-collapse: collapse;
}

/* Pastikan sel tabel tidak terlalu lebar */
.leger-table-v2 th,
.leger-table-v2 td {
    padding: 6px 8px;
    font-size: 14px;
    white-space: nowrap;       /* cegah teks patah */
}

/* Ukuran font & padding mengecil di layar sedang */
@media (max-width: 1200px) {
    .leger-table-v2 th,
    .leger-table-v2 td {
        padding: 5px 6px;
        font-size: 12px;
    }
}

/* Ukuran font & padding lebih kecil di layar tablet */
@media (max-width: 992px) {
    .leger-table-v2 th,
    .leger-table-v2 td {
        padding: 4px 5px;
        font-size: 11px;
    }
}

/* Untuk layar sangat kecil (HP), biarkan scroll horizontal */
@media (max-width: 768px) {
    .table-wrapper-scroll {
        overflow-x: auto;      /* tetap bisa discroll di HP */
    
    }
    .guru-cards-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Membuat 2 kolom */
        overflow-x: visible;           /* Matikan scroll horizontal */
        padding-bottom: 0;
    }

    .guru-card {
        width: 100%; /* Kartu akan mengisi ruang kolom secara otomatis */
    }

    /* Sembunyikan tombol panah navigasi di mobile */
    .carousel-nav {
        display: none;
    }
}

/* ===================================== */
/* == GAYA BARU UNTUK HALAMAN RAPOR   == */
/* ===================================== */

.report-body { display: block; background-color: #eef2f5; }
.page-actions {max-width: 210mm; margin: 20px auto;display: flex;justify-content: space-between;align-items: center;}
.page {
    background: white;
    width: 210mm;          /* Ukuran A4 */
    min-height: 297mm;     /* Tinggi minimum satu halaman */
    margin: 0 auto;
    padding: 20mm;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    page-break-inside: avoid; /* Hindari pemotongan isi */
    overflow: visible;         /* Pastikan konten panjang tetap muncul */
}


/* ================================================= */
/* == GAYA BARU KOP RAPOR (DIPERBAIKI & PRESISI) == */
/* ================================================= */

.report-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center; /* KUNCI: Membuat semua item sejajar di tengah secara vertikal */
    border-bottom: 3px double #000;
    padding-bottom: 5px;
    gap: 20px; /* Memberi jarak aman antar elemen */
}

.logo {
    height: 75px; /* Sesuaikan tinggi logo */
    width: auto;  /* Biarkan lebar proporsional */
}

.logo-sekolah {
    height: 75px; /* Samakan tinggi dengan logo Kemenag */
    width: auto;
}

.header-text {
    text-align: center;
    flex-grow: 1; /* Biarkan blok teks mengisi ruang kosong di tengah */
    line-height: 1.5; /* Atur jarak antar baris */
}

.header-text p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.header-text h2 {
    margin: 4px 0;
    font-size: 18px;
    font-weight: 600;
}

/* ===================================== */
/* == GAYA BARU IDENTITAS SISWA RAPOR == */
/* ===================================== */

.student-identity {
    margin: 20px 0;
    font-size: 14px;
}

.identity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Membuat 2 kolom */
    gap: 2px 20px; /* Jarak vertikal 5px, horizontal 20px */
}

.identity-item {
    display: grid;
    grid-template-columns: 100px 1fr; /* Kolom untuk label dan untuk value */
}

.identity-item .label {
    font-weight: 500;
}
.report-content .section-title { font-size: 15px; font-weight: bold; }
.grades-table, .behavior-table { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid #000; }
.grades-table th, .grades-table td, .behavior-table th, .behavior-table td { border: 1px solid #000; padding: 8px; text-align: left; }
.grades-table td:nth-child(4),
.grades-table td:nth-child(5) {
        text-align: center;
    }
.grades-table th, .behavior-table th { background-color: #f2f2f2; font-weight: bold; text-align: center; }
.grades-table td:first-child, .grades-table td:nth-child(3), .grades-table td:nth-child(4) { text-align: center; }
.behavior-table td:nth-child(2) { text-align: center; }
.grades-table .group-header { font-weight: bold; background-color: #f8f8f8; }
.report-footer { margin-top: 20px; }
.signatures {
    font-size: 14px;
    text-align: center;
}

.signature-row {
    display: flex;
}

.signature-row.top-row {
    justify-content: space-between; /* Mendorong item ke ujung */
}

.signature-row.bottom-row {
    justify-content: center; /* Memusatkan item ke tengah */
    margin-top: 0px; /* Jarak dari baris atas */
}

.signature-box {
    width: 40%; /* Beri lebar agar tidak terlalu mepet */
}

/* Khusus untuk box kepala sekolah agar tidak terlalu lebar */
.bottom-row .signature-box {
    width: auto;
    min-width: 300px;
}

.signature-space {
    height: 60px; /* Ruang untuk tanda tangan */
}

.name-line {
    margin-top: 5px;
}

/* ======================================================= */
/* == GAYA CETAK LEGER (FINAL - PAKSA SATU HALAMAN)      == */
/* ======================================================= */

@media print {
    /* 1. Atur layout kertas & margin paling minimal */
    @page {
        size: A4 landscape;
        margin: 0.7cm; 
    }

    /* Atur ulang body untuk print */
    body, .leger-v2-body {
        background-color: #fff !important;
        padding: 0;
        margin: 0;
    }
    .leger-v2-container {
        padding: 0;
        margin: 0;
    }

    /* 2. Rapatkan header semaksimal mungkin */
    #print-header {
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: center;
        margin-bottom: 5px; /* Jarak bawah sangat kecil */
        border-bottom: 2px double #000;
        padding-bottom: 3px;
    }
    .logo-print {
        height: 50px;
    }
    .header-text-print {
        flex-grow: 1;
    }
    #print-header h1, #print-header h2, #print-header h3 {
        margin: 0; /* Hilangkan margin vertikal */
        line-height: 1.2; /* Rapatkan jarak antar baris teks */
    }
    #print-header h1 { font-size: 13pt; }
    #print-header h2 { font-size: 11pt; }
    #print-header h3 { font-size: 10pt; font-weight: normal; }
    
    /* 3. Sembunyikan elemen yang tidak perlu */
    .leger-control-panel-v2,
    .hide-on-print,
    .action-col-leger,
    .behavior-col {
        display: none !important;
    }

    /* Rapatkan info kelas & semester */
    .leger-details {
        font-size: 9pt;
        padding: 0 0 2px 0; /* Jarak ke tabel sangat kecil */
    }
    
    /* 4. Rapatkan baris tabel secara drastis */
    .leger-table-v2 {
        font-size: 7.5pt; /* Font diperkecil lagi */
        line-height: 1.5; /* KUNCI: Tinggi setiap baris dipadatkan */
    }
    .leger-table-v2 th, .leger-table-v2 td {
        padding: 1px 3px; /* Padding vertikal minimal */
    }
    
    /* 5. Rapatkan bagian tanda tangan */
    #signature-section {
        display: block;
        margin-top: 8px; /* Jarak dari tabel sangat kecil */
        page-break-inside: avoid;
    }
    .signatures {
        font-size: 8pt;
    }
    .signature-space {
        height: 30px; /* Ruang ttd paling minimal */
    }

    /* Pastikan elemen lain tidak mengganggu */
    .table-wrapper-scroll {
        overflow: visible;
        max-height: none;
    }
    .leger-table-v2 .nama-siswa-sticky {
        position: static;
    }
}

/* ================================================= */
/* == PENYESUAIAN HALAMAN LEGER (PERMINTAAN BARU) == */
/* ================================================= */

/* 1. Membuat kontainer utama menjadi full-width */
.leger-v2-container {
    max-width: 100%; /* Hapus batasan lebar */
    margin: 0;       /* Hapus margin atas/bawah */
    padding: 20px 30px; /* Pertahankan padding kiri/kanan */
    border-radius: 0; /* Hapus sudut melengkung */
    box-shadow: none;   /* Hapus bayangan */
}

/* 2. Gaya untuk info Kelas dan Semester */
.leger-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    background-color: #f8f9fa;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
}

/* 3. Sembunyikan header cetak dan tanda tangan secara default */
#print-header,
#signature-section {
    display: none;
}

/* ======================================================= */
/* == GAYA CETAK LEGER (VERTIKAL LEBIH RAPAT) == */
/* ======================================================= */

@media print {
    /* Atur ulang body untuk print */
    body, .leger-v2-body {
        background-color: #fff !important;
        padding: 0;
        margin: 0;
    }
    .leger-v2-container {
        padding: 0;
        margin: 0;
    }

    #print-header {
        display: flex;
        align-items: center;
        gap: 20px;
        text-align: center;
        margin-bottom: 10px; /* Jarak bawah dikurangi */
        border-bottom: 2px double #000;
        padding-bottom: 4px; /* Padding bawah dikurangi */
    }
    .logo-print {
        height: 55px; /* Logo sedikit diperkecil */
    }
    .header-text-print {
        flex-grow: 1;
    }
    #print-header h1, #print-header h2, #print-header h3 {
        margin: 1px 0; /* Jarak vertikal teks dibuat sangat rapat */
    }
    #print-header h1 { font-size: 14pt; }
    #print-header h2 { font-size: 12pt; }
    #print-header h3 { font-size: 11pt; font-weight: normal; }
    
    /* 3. Sembunyikan elemen yang tidak perlu */
    .leger-control-panel-v2,
    .hide-on-print,
    .action-col-leger,
    .behavior-col {
        display: none !important;
    }

    /* Rapatkan info kelas & semester */
    .leger-details {
        background-color: transparent;
        border: none;
        font-size: 10pt;
        padding: 0 0 5px 0; /* Jarak ke tabel dikurangi */
    }
    
    /* 4. Rapatkan baris tabel secara vertikal */
    .leger-table-v2 {
        font-size: 8pt;
    }
    .leger-table-v2 th, .leger-table-v2 td {
        /* KUNCI UTAMA: Padding vertikal diperkecil dari 4px menjadi 2px */
        padding: 2px 3px; 
    }
    
    /* 5. Rapatkan bagian tanda tangan */
    #signature-section {
        display: block;
        margin-top: 20px; /* Jarak dari tabel dikurangi */
        page-break-inside: avoid;
    }
    .signatures {
        font-size: 9pt;
    }
    /* Asumsi ada class ini dari HTML rapor, untuk merapatkan ruang ttd */
    .signature-space {
        height: 40px; 
    }

    /* Pastikan elemen lain tidak mengganggu */
    .table-wrapper-scroll {
        overflow: visible;
        max-height: none;
    }
    .leger-table-v2 .nama-siswa-sticky {
        position: static;
    }
}

/* === PERBAIKAN HEADER LEGER CETAK & PENYELARASAN KOLOM === */

@media print {
  #print-header {
    display: flex;
    align-items: center;
    gap: 15px;                /* Lebih rapat antar logo dan teks */
    text-align: center;
    margin-bottom: 5px;
    border-bottom: 2px double #000;
    padding-bottom: 3px;
  }

  #print-header img.logo-print {
    height: 55px;             /* Logo sedikit lebih kecil agar proporsional */
  }

  #print-header .header-text-print h1,
  #print-header .header-text-print h2,
  #print-header .header-text-print h3 {
    margin: 1px 0;
    line-height: 1.2;         /* Jarak antar baris teks lebih rapat */
  }

  /* Semua kolom angka dan identitas center */
  .leger-table-v2 th,
  .leger-table-v2 td {
    text-align: center !important;
    vertical-align: middle !important;
  }

  /* Kolom nama siswa tetap rata kiri */
  .leger-table-v2 .nama-siswa-sticky,
  .leger-table-v2 td.nama-siswa-sticky {
    text-align: left !important;
  }
}


/* ================================================= */
/* == PERBAIKAN LAYOUT LEGER MENJADI FULL BROWSER == */
/* ================================================= */

/* 1. Menghilangkan efek 'box' pada kontainer utama */
.leger-v2-body .leger-v2-container {
    max-width: none;      /* Hapus batas lebar maksimum */
    margin: 0;            /* Hapus margin otomatis */
    padding: 20px 30px;   /* Pertahankan padding samping */
    box-shadow: none;       /* Hapus bayangan kotak */
    border-radius: 0;     /* Hapus sudut melengkung */
    background-color: transparent; /* Jadikan latar belakang transparan */
}

/* 3. Pastikan scroll horizontal tetap ada untuk layar kecil */
.leger-v2-body .table-wrapper-scroll {
    overflow-x: auto;
}

/* ================================================= */
/* == PERBAIKAN LEGER AGAR TAMPIL FULL BROWSER    == */
/* ================================================= */

.leger-v2-body .leger-v2-container {
    max-width: none;      /* Menghapus batas lebar maksimum */
    margin: 0;            /* Menghapus margin agar menempel ke tepi */
    padding: 20px 30px;   /* Tetap beri padding agar konten tidak terlalu mepet */
    box-shadow: none;       /* Menghapus bayangan kotak */
    border-radius: 0;     /* Menghapus sudut yang melengkung */
    background-color: transparent; /* Membuat latar belakang menyatu dengan body */
}

/* ===================================== */
/* == GAYA CETAK (PRINT) UNTUK RAPOR  == */
/* ===================================== */

@media print {

    /* Sembunyikan elemen yang tidak perlu */
    .sidebar,
    .page-actions {
        display: none !important;
    }

    /* Atur ulang layout utama */
    body, .report-body {
        background-color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: 98% !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    /* === KONTEN DIPADATKAN SECARA MAKSIMAL === */

    /* Perkecil Kop Surat */
    .report-header-main {
        padding-bottom: 5px;
        margin-bottom: 8px;
    }
    .logo, .logo-sekolah {
        height: 50px;
    }
    .header-text h2 { font-size: 14pt; }
    .header-text p { font-size: 9pt; line-height: 1.2; }

    /* Rapatkan Identitas Siswa */
    .student-identity {
        margin: 8px 0;
        font-size: 9pt;
    }
    .student-identity td { padding: 0 5px; }

    /* Rapatkan Tabel Nilai */
    .report-content .section-title {
        font-size: 10pt;
        margin: 8px 0 5px 0;
    }
    .grades-table, .behavior-table {
        font-size: 8pt;
    }
    .grades-table th, .grades-table td,
    .behavior-table th, .behavior-table td {
        padding: 2px 4px; /* Perkecil padding sel secara drastis */
    }

    .grades-table .subject-name {
        width: 25%; /* Atur lebar kolom Mata Pelajaran */
    }
    .grades-table .desc-col {
        width: 45%; /* Atur lebar kolom Deskripsi */
    }
    
    .grades-table tfoot td { padding: 3px 5px; }
    
    /* Rapatkan Bagian Tanda Tangan */
    .report-footer {
        margin-top: 15px; /* Kurangi jarak dari tabel di atasnya */
        break-inside: avoid; /* Mencegah elemen ini pindah halaman */
    }
    .signatures {
        font-size: 9pt;
    }
    .signature-space {
        height: 50px; /* Perkecil ruang untuk ttd */
    }
    .bottom-row {
        margin-top: 20px; /* Kurangi jarak antar baris ttd */
    }
}

/* ========================================= */
/* == GAYA BARU UNTUK HALAMAN MATA PELAJARAN == */
/* ========================================= */

.mapel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.mapel-card {
    background-color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mapel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.mapel-card-icon {
    height: 100px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 48px;
}

.mapel-card-info {
    padding: 20px;
    flex-grow: 1;
}

.mapel-card-info h3 {
    margin-top: 0;
    font-size: 18px;
}

.mapel-card-info p {
    margin-bottom: 0;
    color: #888;
    font-size: 14px;
}

.mapel-card-action {
    background-color: #f8f9fa;
    padding: 15px 20px;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.mapel-card-action:hover {
    background-color: #00A97F;
    color: white;
}

/* ======================================== */
/* == GAYA BARU HALAMAN INPUT NILAI MAPEL == */
/* ======================================== */

.input-nilai-panel {
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.input-nilai-controls {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.input-nilai-controls .form-group {
    max-width: 400px;
    margin-bottom: 0;
}

.input-nilai-controls .form-group label {
    font-weight: 600;
    font-size: 16px;
}

.input-nilai-class-lock {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    min-width: 240px;
    padding: 14px 18px;
    border: 1px solid #e6eadf;
    border-radius: 18px;
    background: #fbfdf8;
}

.class-lock-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #74806f;
}

.class-lock-value {
    font-size: 22px;
    font-weight: 700;
    color: #1f2d3d;
}

.nilai-col {
    width: 150px;
    text-align: center;
}

.nilai-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.text-center {
    text-align: center;
    color: #888;
    padding: 20px;
}

.input-nilai-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

/* ================================================= */
/* == GAYA BARU UNTUK PROFIL MODE EDIT            == */
/* ================================================= */

/* Header di dalam setiap tab (untuk judul dan tombol edit) */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.tab-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* Tombol Edit (hanya ikon) */
.btn-edit-profile {
    background: none;
    border: 1px solid #ddd;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-profile:hover {
    background-color: #f5f5f5;
    color: #00A97F;
    border-color: #00A97F;
}

/* Ganti nama class span dan input agar lebih spesifik */
.info-item .info-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.info-item .info-input {
    display: none; /* Sembunyikan input secara default */
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

/* Aksi di bagian bawah tab (untuk tombol simpan) */
.tab-actions {
    display: none; /* Sembunyikan secara default */
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

/* === KONDISI SAAT MODE EDIT AKTIF === */
.tab-pane.is-editing .info-value {
    display: none; /* Sembunyikan teks saat mode edit */
}

.tab-pane.is-editing .info-input {
    display: block; /* Tampilkan input saat mode edit */
}

.tab-pane.is-editing .btn-edit-profile {
    display: none; /* Sembunyikan tombol edit saat mode edit */
}

.tab-pane.is-editing .tab-actions {
    display: block; /* Tampilkan tombol simpan saat mode edit */
}

/* ================================================= */
/* == PERBAIKAN TAMPILAN LINK KARTU GURU DI DASBOR == */
/* ================================================= */
/* Ganti blok .guru-card Anda dengan yang ini */
.guru-card {
    flex-shrink: 0;
    width: 160px;
    height: 225px; /* KUNCI 1: Memberi tinggi yang sama untuk semua kartu */
    text-align: center;
    padding: 20px 15px;
    border-radius: 18px;
    background-color: #f8f9fa;
    border: 1px solid #f0f0f0;
    display: flex; /* Menggunakan flexbox untuk alignment yang lebih baik */
    flex-direction: column; /* Menyusun item (foto, nama, mapel) secara vertikal */
    align-items: center; /* Memastikan semua item terpusat secara horizontal */
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.guru-card h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    width: 100%;
    height: 42px; 
    margin-top: 15px;
    margin-bottom: 5px;
    /* Teknik untuk memotong teks setelah 2 baris */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* <-- Tambahkan baris ini */
}

.guru-card p {
    font-size: 13px;
    color: #888;
    width: 100%;
    /* Teknik untuk memotong teks setelah 1 baris */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Biarkan kode .guru-card-link ini tetap ada */
.guru-card-link {
    text-decoration: none;
    color: inherit;
}

.guru-card-link:hover .guru-card {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* --- TAMBAHKAN SEMUA KODE DI BAWAH INI KE AKHIR FILE --- */

/* ======================================================= */
/* == KODE BARU: Tombol Menu, Overlay, & Sidebar Mobile == */
/* ======================================================= */
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #fff;
    border: 1px solid #ece7db;
    border-radius: 14px;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    background: #f7faf8;
    border-color: #d7eee6;
}

.sidebar-overlay {
    display: none; /* Sembunyi di layar besar */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}
.sidebar-overlay.is-open {
    display: block;
}

/* ======================================================= */
/* == KODE BARU & PERBAIKAN: MEDIA QUERIES RESPONSIVE   == */
/* ======================================================= */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-areas:
            "welcome welcome"
            "headmaster headmaster"
            "stats uts"
            "carousel carousel";
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) { /* Breakpoint untuk tablet dan di bawahnya */
    .sidebar {
        left: -250px; /* 1. Sembunyikan sidebar ke kiri */
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
    }
    .sidebar.is-open {
        left: 0; /* 2. Tampilkan sidebar jika class 'is-open' ditambahkan */
    }
    .main-content {
        width: 100%; /* 3. Buat konten utama menjadi full width */
        margin-left: 0;
    }
    .top-bar {
        justify-content: space-between; /* Atur agar hamburger di kiri, power di kanan */
    }
    .welcome-section h1 { font-size: 32px; }
    .headmaster-info .name { font-size: 20px; }
}

@media (max-width: 768px) {
    .main-content { padding: 20px 15px; } /* Kurangi padding di HP */
    .dashboard-grid {
        grid-template-columns: 1fr; /* 5. Buat grid menjadi 1 kolom di HP */
        grid-template-areas:
            "welcome"
            "headmaster"
            "stats"
            "uts"
            "carousel";
        gap: 20px;
    }
    .headmaster-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .headmaster-photo {
        width: 85px;                 /* Atur lebar foto */
        height: 85px;                /* Atur tinggi foto */
        border-radius: 50%;          /* KUNCI: Membuat foto menjadi bulat sempurna */
        object-fit: cover;           /* Memastikan gambar mengisi lingkaran tanpa gepeng */
        border: 4px solid white;     /* KUNCI: Menambahkan bingkai putih tebal */
        margin-left: auto;           /* Mendorong foto ke kanan di layar besar */
        position: relative;          /* Pastikan foto di atas elemen lain */
        z-index: 2;
    }
}

@media (max-width: 576px) {
    .stats-container, .uts-container {
        flex-direction: column;
        gap: 25px;
        align-items: flex-start;
        text-align: left;
    }
}

/* ==================== HALAMAN PENGATURAN - MODERN DESIGN ==================== */

#pengaturan-page .main-content {
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #f8f9fa 100%);
    min-height: 100vh;
}

/* Judul Halaman */
#pengaturan-page .main-header {
    margin-bottom: 30px;
}

#pengaturan-page .main-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    border-left: 5px solid #00A97F;
    padding-left: 15px;
}

/* Settings Container */
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Settings Card */
.settings-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.settings-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Card Header with Icon */
.settings-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-card h2 i {
    font-size: 24px;
    color: #00A97F;
    background: linear-gradient(135deg, #e8f5f1 0%, #d5ede5 100%);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.settings-card p {
    color: #666;
    font-size: 14px;
    margin: 0 0 25px 0;
    line-height: 1.6;
}

/* Form Group */
.settings-card .form-group {
    margin-bottom: 20px;
}

.settings-card label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

.settings-card input[type="text"],
.settings-card input[type="date"],
.settings-card input[type="password"],
.settings-card select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    font-family: 'Poppins', sans-serif;
}

.settings-card input[type="text"]:focus,
.settings-card input[type="date"]:focus,
.settings-card input[type="password"]:focus,
.settings-card select:focus {
    outline: none;
    border-color: #00A97F;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 169, 127, 0.1);
}

/* Select Dropdown Modern */
.settings-card select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Button Group */
.settings-card .button-group {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.settings-card .btn-primary,
.settings-card .btn-secondary {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-card .btn-primary {
    background: linear-gradient(135deg, #00A97F 0%, #00885e 100%);
    color: white;
}

.settings-card .btn-primary:hover {
    background: linear-gradient(135deg, #00885e 0%, #006644 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 169, 127, 0.3);
}

.settings-card .btn-secondary {
    background-color: #f0f0f0;
    color: #666;
}

.settings-card .btn-secondary:hover {
    background-color: #e0e0e0;
    color: #333;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 50%, #fff3cd 100%);
    border-left: 4px solid #ffc107;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #856404;
}

.info-box strong {
    display: block;
    margin-bottom: 5px;
    color: #664d03;
}

/* Responsive */
@media (max-width: 1024px) {
    .settings-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #pengaturan-page .main-content {
        padding: 20px 15px;
    }
    
    .settings-card {
        padding: 25px 20px;
    }
    
    .settings-card h2 {
        font-size: 18px;
    }
    
    .settings-card .button-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .settings-container {
        gap: 20px;
    }
    
    .settings-card h2 i {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Action Button Group */
.action-button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button i {
    margin-right: 10px;
}

.btn-backup {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-backup:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-restore {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.btn-restore:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-reset {
    background: linear-gradient(135deg, #dc3545 0%, #a71d2a 100%);
    color: white;
}

.btn-reset:hover {
    background: linear-gradient(135deg, #a71d2a 0%, #7d1520 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Form Actions */
.form-actions {
    margin-top: 25px;
    text-align: right;
}

.btn-primary {
    background: linear-gradient(135deg, #00A97F 0%, #00885e 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00885e 0%, #006644 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 169, 127, 0.3);
}

.btn-primary i {
    margin-right: 8px;
}

/* Password Change Status */
#passwordChangeStatus {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 6px;
    display: none;
}

#passwordChangeStatus.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    display: block;
}

#passwordChangeStatus.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: linear-gradient(135deg, #00A97F 0%, #059669 100%);
    border-radius: 20px 20px 0 0;
    padding: 0;
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 18px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.tab-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ffffff;
}

.tab-btn i {
    margin-right: 8px;
}

.close-modal-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Upload Container */
.upload-container {
    padding: 30px 40px;
}

.upload-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    color: #333;
    border-left: 4px solid #00A97F;
    padding-left: 10px;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-info {
    background-color: #e7f5ff;
    border: 1px solid #b3e0ff;
    color: #0c5a8a;
}

.alert-heading {
    margin: 0 0 10px 0;
    font-size: 15px;
    font-weight: 600;
}

.alert ol {
    margin: 0;
    padding-left: 20px;
}

.alert li {
    margin: 5px 0;
}

.download-section {
    text-align: center;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.btn-download {
    display: inline-block;
    background: #00A97F;
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 169, 127, 0.2);
}

.btn-download:hover {
    background: #00885e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 169, 127, 0.3);
}

.btn-download i {
    margin-right: 8px;
}

.text-muted {
    color: #6c757d;
    font-size: 13px;
    margin-top: 10px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-control:hover {
    border-color: #00A97F;
}

.form-control:focus {
    outline: none;
    border-color: #00A97F;
    border-style: solid;
}

.form-text {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
}

.progress-wrapper {
    margin: 20px 0;
    background: #e9ecef;
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00A97F, #059669);
    width: 0%;
    transition: width 0.3s ease;
}

/* Alert Messages */
.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert-dismissible {
    position: relative;
    padding-right: 40px;
}

.btn-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* ==================== MODERN FILE UPLOAD ==================== */
.upload-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.file-upload-wrapper {
    position: relative;
}

.file-input-hidden {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.file-upload-area:hover {
    border-color: #00A97F;
    background: #f0fdf4;
}

.file-upload-area.dragover {
    border-color: #00A97F;
    background: #d1fae5;
    border-style: solid;
}

.upload-icon {
    margin-bottom: 15px;
}

.upload-icon i {
    font-size: 48px;
    color: #00A97F;
    opacity: 0.6;
}

.upload-text .main-text {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.upload-text .sub-text {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* File Preview */
.file-preview {
    border: 2px solid #00A97F;
    border-radius: 12px;
    padding: 20px;
    background: #f0fdf4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.file-icon {
    font-size: 32px;
    color: #00A97F;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
}

.remove-file-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Progress Bar Modern */
.progress-wrapper {
    margin: 20px 0;
    background: #e5e7eb;
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00A97F, #059669);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #1f2937;
}

/* ==================== FINAL SIDEBAR/TOPBAR RESPONSIVE FIX ==================== */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid #eadfce;
    border-radius: 16px;
    background: #fffdfa;
    color: #5b6475;
    box-shadow: 0 14px 32px rgba(180, 156, 120, 0.12);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    color: #24324a;
    border-color: #d8cab2;
}

@media (max-width: 992px) {
    .sidebar-toggle-edge {
        display: none !important;
    }

    .menu-toggle {
        display: inline-flex !important;
    }

    .sidebar {
        left: -320px !important;
        transform: none !important;
        box-shadow: 24px 0 60px rgba(15, 23, 42, 0.18);
        z-index: 1200;
    }

    .sidebar.is-open {
        left: 0 !important;
    }

    .sidebar-overlay {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 1190;
    }

    .sidebar-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .app-topbar {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .app-topbar-left {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        width: 100%;
        min-width: 0;
        padding-left: 0 !important;
    }

    .app-topbar-right {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .topbar-search {
        width: 100%;
        max-width: none !important;
        min-width: 0;
    }

    .topbar-search input {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .app-shell {
        overflow-x: hidden;
    }

    .app-topbar {
        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) 48px auto !important;
        align-items: center;
        justify-content: stretch;
        padding: 14px;
        border-radius: 22px;
        gap: 10px;
    }

    .app-topbar-left {
        display: contents !important;
    }

    .app-topbar-right {
        display: contents !important;
    }

    .menu-toggle {
        grid-column: 1;
        grid-row: 1;
    }

    .topbar-search {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        width: 100%;
        padding: 0 14px;
        height: 54px;
    }

    .topbar-search input {
        font-size: 14px;
    }

    .topbar-icon-button {
        grid-column: 3;
        grid-row: 1;
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .topbar-user-menu {
        grid-column: 4;
        grid-row: 1;
        min-width: 0;
    }

    .topbar-user-trigger {
        min-width: 0;
        padding: 8px 10px;
        gap: 8px;
        height: 48px;
    }

    .topbar-user-meta {
        display: none;
    }

    .topbar-user-avatar {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .topbar-user-dropdown {
        right: 0;
        left: auto;
        min-width: 190px;
    }

    .content-wrapper,
    .main-content {
        overflow-x: hidden;
    }
}

@media (max-width: 420px) {
    .app-topbar {
        padding: 12px;
        gap: 8px;
        grid-template-columns: 42px minmax(0, 1fr) 42px auto !important;
    }

    .menu-toggle,
    .topbar-icon-button {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 14px;
    }

    .topbar-user-trigger {
        padding: 8px;
        height: 42px;
    }

    .topbar-search {
        height: 46px;
        padding: 0 12px;
    }

    .topbar-search input {
        font-size: 13px;
    }
}

/* ==================== DASHBOARD REFINEMENT ==================== */
#dashboard-page {
    background:
        radial-gradient(circle at top left, rgba(0, 169, 127, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(23, 164, 164, 0.06), transparent 24%),
        linear-gradient(180deg, #f8f6f1 0%, #f6f8fb 100%);
}

#dashboard-page .main-content {
    position: relative;
}

#dashboard-page .dashboard-grid {
    position: relative;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

#dashboard-page .welcome-section,
#dashboard-page .grid-item,
#dashboard-page .headmaster-card {
    position: relative;
    border: 1px solid rgba(228, 220, 205, 0.95);
    box-shadow: 0 18px 40px rgba(31, 41, 55, 0.06);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

#dashboard-page .welcome-section:hover,
#dashboard-page .grid-item:hover,
#dashboard-page .headmaster-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 52px rgba(31, 41, 55, 0.1);
    border-color: rgba(201, 224, 215, 0.95);
}

#dashboard-page .welcome-section {
    overflow: hidden;
    padding: 24px 26px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.95), rgba(255,255,255,0.72) 34%, transparent 35%),
        linear-gradient(135deg, rgba(255,255,255,0.98), rgba(247, 248, 243, 0.92));
}

#dashboard-page .welcome-section::before,
#dashboard-page .grid-item::before,
#dashboard-page .headmaster-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.18;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.28), transparent 72%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.28), transparent 72%);
}

#dashboard-page .welcome-section h1 {
    max-width: 580px;
    font-size: 38px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #24324a;
    margin-bottom: 8px;
}

#dashboard-page .welcome-section .app-description {
    margin-top: 0;
    font-size: 15px;
    color: #7e7a6d;
}

#dashboard-page .welcome-section .semester-info {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(229, 221, 208, 0.9);
    font-size: 16px;
}

#dashboard-page .welcome-section .tahun-ajaran {
    color: #5e6472;
}

#dashboard-page .headmaster-card {
    min-height: 190px;
    padding: 22px 22px 22px 24px;
    align-items: flex-start;
    justify-content: space-between;
    background: linear-gradient(135deg, #ddf4ef 0%, #47c3bf 100%);
}

#dashboard-page .headmaster-card::after {
    opacity: 0.12;
}

#dashboard-page .headmaster-info {
    max-width: calc(100% - 140px);
}

#dashboard-page .headmaster-info .title {
    font-size: 12px;
    letter-spacing: 0.12em;
    color: rgba(22, 67, 62, 0.72);
    margin-bottom: 8px;
}

#dashboard-page .headmaster-info .name {
    font-size: 28px;
    line-height: 1.12;
    color: #163e3b;
}

#dashboard-page .headmaster-photo-container {
    right: 22px;
    bottom: 16px;
}

#dashboard-page .headmaster-photo {
    width: 92px;
    height: 92px;
    border: 5px solid rgba(255,255,255,0.95);
    box-shadow: 0 18px 30px rgba(22, 62, 59, 0.18);
}

#dashboard-page .grid-item {
    overflow: hidden;
    border-radius: 24px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfbf8 100%);
}

#dashboard-page .stats-container,
#dashboard-page .uts-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

#dashboard-page .stats-item,
#dashboard-page .uts-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 122px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf8 0%, #f7faf8 100%);
    border: 1px solid rgba(232, 225, 214, 0.95);
    text-align: left;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

#dashboard-page .stats-item:hover,
#dashboard-page .uts-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(31, 41, 55, 0.08);
    border-color: rgba(195, 227, 214, 0.95);
}

#dashboard-page .stats-item p,
#dashboard-page .uts-item p {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8c8678;
}

#dashboard-page .stats-item span {
    font-size: 34px;
    line-height: 1;
    color: #25324a;
}

#dashboard-page .uts-item span {
    font-size: 15px;
    line-height: 1.4;
    color: #25324a;
}

#dashboard-page .guru-carousel {
    min-height: 280px;
}

#dashboard-page .carousel-header {
    margin-bottom: 14px;
}

#dashboard-page .carousel-header h2 {
    font-size: 22px;
    color: #24324a;
}

#dashboard-page .carousel-nav .arrow-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(230, 222, 209, 0.95);
    background: #fffdfa;
    color: #6f6a5d;
    box-shadow: 0 10px 22px rgba(31, 41, 55, 0.05);
}

#dashboard-page .carousel-nav .arrow-btn:hover {
    transform: translateY(-2px);
    background: #00A97F;
    color: #fff;
}

#dashboard-page .guru-cards-wrapper {
    gap: 14px;
    padding: 4px 4px 8px;
}

#dashboard-page .guru-card {
    width: 152px;
    height: 204px;
    padding: 18px 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffdfa 0%, #f5f8f7 100%);
    border: 1px solid rgba(232, 225, 214, 0.95);
    box-shadow: 0 12px 26px rgba(31, 41, 55, 0.05);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

#dashboard-page .guru-card-link:hover .guru-card {
    transform: translateY(-6px);
    box-shadow: 0 20px 36px rgba(31, 41, 55, 0.12);
    border-color: rgba(192, 226, 212, 0.95);
}

#dashboard-page .guru-card img {
    width: 70px;
    height: 70px;
    margin-bottom: 12px;
    border-width: 4px;
}

#dashboard-page .guru-card h3 {
    height: auto;
    min-height: 38px;
    margin-top: 0;
    color: #25324a;
    font-size: 14px;
}

#dashboard-page .guru-card p {
    color: #7f7a6d;
    font-size: 12px;
}

@media (max-width: 1200px) {
    #dashboard-page .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "welcome welcome"
            "headmaster headmaster"
            "stats uts"
            "carousel carousel";
    }

    #dashboard-page .welcome-section h1 {
        font-size: 34px;
    }
}

@media (max-width: 768px) {
    #dashboard-page .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "welcome"
            "headmaster"
            "stats"
            "uts"
            "carousel";
        gap: 16px;
    }

    #dashboard-page .welcome-section,
    #dashboard-page .grid-item,
    #dashboard-page .headmaster-card {
        border-radius: 24px;
    }

    #dashboard-page .welcome-section {
        padding: 20px 18px;
    }

    #dashboard-page .welcome-section h1 {
        font-size: 28px;
        line-height: 1.08;
    }

    #dashboard-page .welcome-section .app-description {
        font-size: 15px;
    }

    #dashboard-page .welcome-section .semester-info {
        width: 100%;
        border-radius: 16px;
        font-size: 14px;
        gap: 6px 10px;
    }

    #dashboard-page .headmaster-card {
        min-height: 0;
        padding: 18px;
        flex-direction: row;
        align-items: center;
    }

    #dashboard-page .headmaster-info {
        max-width: calc(100% - 112px);
    }

    #dashboard-page .headmaster-info .name {
        font-size: 22px;
    }

    #dashboard-page .headmaster-photo-container {
        position: relative;
        right: auto;
        bottom: auto;
        margin-left: auto;
    }

    #dashboard-page .headmaster-photo {
        position: static;
        transform: none;
        width: 76px;
        height: 76px;
        border-width: 4px;
    }

    #dashboard-page .grid-item {
        padding: 16px;
    }

    #dashboard-page .stats-container,
    #dashboard-page .uts-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #dashboard-page .stats-item,
    #dashboard-page .uts-item {
        min-height: 0;
        padding: 18px;
    }

    #dashboard-page .stats-item span {
        font-size: 30px;
    }

    #dashboard-page .carousel-header h2 {
        font-size: 20px;
    }

    #dashboard-page .guru-cards-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        overflow: visible;
        padding: 0;
    }

    #dashboard-page .guru-card {
        width: 100%;
        height: 100%;
        min-height: 188px;
        padding: 16px 12px;
    }

    #dashboard-page .carousel-nav {
        display: none;
    }
}

@media (max-width: 520px) {
    #dashboard-page .welcome-section h1 {
        font-size: 24px;
    }

    #dashboard-page .headmaster-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    #dashboard-page .headmaster-info {
        max-width: 100%;
    }

    #dashboard-page .headmaster-photo-container {
        margin-left: 0;
    }

    #dashboard-page .guru-cards-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ==================== DASHBOARD LAYOUT V3 ==================== */
#dashboard-page .dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#dashboard-page .dashboard-hero,
#dashboard-page .dashboard-metrics-row,
#dashboard-page .dashboard-workspace {
    display: grid;
    gap: 18px;
}

#dashboard-page .dashboard-hero {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
}

#dashboard-page .dashboard-intro-panel,
#dashboard-page .dashboard-headmaster-panel,
#dashboard-page .dashboard-metric-card,
#dashboard-page .dashboard-teacher-panel,
#dashboard-page .dashboard-side-block {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(231, 224, 212, 0.95);
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(25, 35, 52, 0.05);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

#dashboard-page .dashboard-intro-panel:hover,
#dashboard-page .dashboard-headmaster-panel:hover,
#dashboard-page .dashboard-metric-card:hover,
#dashboard-page .dashboard-teacher-panel:hover,
#dashboard-page .dashboard-side-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(25, 35, 52, 0.08);
    border-color: rgba(205, 228, 218, 0.95);
}

#dashboard-page .dashboard-intro-panel {
    padding: 26px 28px;
    background:
        radial-gradient(circle at top left, rgba(0, 169, 127, 0.1), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(251,249,244,0.94));
}

#dashboard-page .dashboard-intro-panel::after,
#dashboard-page .dashboard-headmaster-panel::after,
#dashboard-page .dashboard-side-block::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.18;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.22), transparent 76%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.22), transparent 76%);
}

#dashboard-page .dashboard-eyebrow,
#dashboard-page .panel-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8d8a7d;
    margin-bottom: 10px;
}

#dashboard-page .dashboard-intro-panel h1 {
    font-size: 32px;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #24324a;
    margin-bottom: 10px;
}

#dashboard-page .dashboard-description {
    max-width: 640px;
    font-size: 15px;
    line-height: 1.65;
    color: #6d7280;
}

#dashboard-page .dashboard-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

#dashboard-page .dashboard-meta-pill {
    min-width: 170px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(232, 225, 214, 0.95);
}

#dashboard-page .meta-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #908a79;
    margin-bottom: 6px;
}

#dashboard-page .dashboard-meta-pill strong {
    font-size: 16px;
    color: #25324a;
}

#dashboard-page .dashboard-headmaster-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 22px;
    background: linear-gradient(135deg, #f4fbf8 0%, #e4f4f2 100%);
}

#dashboard-page .headmaster-panel-copy {
    max-width: 250px;
}

#dashboard-page .headmaster-panel-copy h3 {
    font-size: 24px;
    line-height: 1.16;
    color: #183c3a;
    margin-bottom: 10px;
}

#dashboard-page .panel-note {
    font-size: 14px;
    line-height: 1.6;
    color: #5d6e72;
}

#dashboard-page .dashboard-headmaster-visual {
    position: relative;
    width: 118px;
    height: 118px;
    flex: 0 0 118px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dashboard-page .headmaster-halo {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 169, 127, 0.24), rgba(0, 169, 127, 0.04) 70%);
}

#dashboard-page .dashboard-headmaster-panel .headmaster-photo {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 5px solid #ffffff;
    object-fit: cover;
    box-shadow: 0 16px 28px rgba(17, 75, 74, 0.12);
}

#dashboard-page .dashboard-metrics-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

#dashboard-page .dashboard-metric-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    min-height: 118px;
}

#dashboard-page .metric-copy p {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #918a79;
    margin-bottom: 10px;
}

#dashboard-page .metric-copy strong {
    font-size: 28px;
    line-height: 1.12;
    color: #25324a;
}

#dashboard-page .metric-icon,
#dashboard-page .metric-badge {
    flex: 0 0 auto;
}

#dashboard-page .metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5faf8;
    border: 1px solid rgba(214, 234, 225, 0.95);
    color: #00A97F;
}

#dashboard-page .metric-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#dashboard-page .metric-badge.ganjil {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

#dashboard-page .metric-badge.genap {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

#dashboard-page .schedule-card .metric-copy strong {
    font-size: 16px;
    line-height: 1.45;
}

#dashboard-page .dashboard-workspace {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
    align-items: start;
}

#dashboard-page .dashboard-teacher-panel {
    padding: 20px;
}

#dashboard-page .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

#dashboard-page .panel-header h2 {
    font-size: 22px;
    line-height: 1.18;
    color: #24324a;
}

#dashboard-page .dashboard-teacher-panel .carousel-nav {
    display: flex;
    gap: 8px;
}

#dashboard-page .dashboard-teacher-panel .arrow-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(231, 224, 212, 0.95);
    background: #fffdfa;
    color: #6c675d;
    cursor: pointer;
    transition: all 0.2s ease;
}

#dashboard-page .dashboard-teacher-panel .arrow-btn:hover {
    background: #00A97F;
    color: #fff;
    border-color: #00A97F;
}

#dashboard-page .dashboard-teacher-panel .arrow-btn.is-disabled,
#dashboard-page .dashboard-teacher-panel .arrow-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    background: #f6f3eb;
    color: #a49d90;
    border-color: rgba(231, 224, 212, 0.95);
}

#dashboard-page .guru-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    overflow: visible;
    padding: 0;
}

#dashboard-page .guru-card-link {
    display: block;
}

#dashboard-page .guru-card {
    width: 100%;
    height: 100%;
    min-height: 184px;
    padding: 18px 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffdfa 0%, #f7faf8 100%);
    border: 1px solid rgba(232, 225, 214, 0.95);
    box-shadow: none;
}

#dashboard-page .guru-card img {
    width: 68px;
    height: 68px;
    margin-bottom: 12px;
    border-width: 4px;
}

#dashboard-page .guru-card h3 {
    font-size: 14px;
    min-height: 36px;
    margin-bottom: 6px;
}

#dashboard-page .guru-card p {
    font-size: 12px;
}

#dashboard-page .dashboard-side-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#dashboard-page .dashboard-side-block {
    padding: 18px;
}

#dashboard-page .dashboard-side-block.accent {
    background: linear-gradient(180deg, #fbfffd 0%, #eef8f3 100%);
}

#dashboard-page .dashboard-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

#dashboard-page .dashboard-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #5f6776;
    font-size: 14px;
    line-height: 1.6;
}

#dashboard-page .dashboard-checklist li span {
    width: 10px;
    height: 10px;
    margin-top: 7px;
    border-radius: 50%;
    background: #00A97F;
    flex: 0 0 10px;
}

#dashboard-page .focus-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#dashboard-page .focus-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

#dashboard-page .focus-item strong {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid rgba(214, 234, 225, 0.95);
    color: #00A97F;
    font-size: 14px;
}

#dashboard-page .focus-item h4 {
    font-size: 14px;
    color: #24324a;
    margin-bottom: 4px;
}

#dashboard-page .focus-item p {
    font-size: 13px;
    line-height: 1.55;
    color: #6f7582;
}

@media (max-width: 1200px) {
    #dashboard-page .dashboard-hero,
    #dashboard-page .dashboard-workspace {
        grid-template-columns: 1fr;
    }

    #dashboard-page .dashboard-metrics-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #dashboard-page .dashboard-shell,
    #dashboard-page .dashboard-hero,
    #dashboard-page .dashboard-metrics-row,
    #dashboard-page .dashboard-workspace {
        gap: 14px;
    }

    #dashboard-page .dashboard-intro-panel,
    #dashboard-page .dashboard-headmaster-panel,
    #dashboard-page .dashboard-metric-card,
    #dashboard-page .dashboard-teacher-panel,
    #dashboard-page .dashboard-side-block {
        border-radius: 20px;
    }

    #dashboard-page .dashboard-intro-panel {
        padding: 20px;
    }

    #dashboard-page .dashboard-intro-panel h1 {
        font-size: 26px;
    }

    #dashboard-page .dashboard-description {
        font-size: 14px;
    }

    #dashboard-page .dashboard-meta-row {
        gap: 10px;
    }

    #dashboard-page .dashboard-meta-pill {
        min-width: 0;
        width: 100%;
    }

    #dashboard-page .dashboard-headmaster-panel {
        padding: 18px;
    }

    #dashboard-page .headmaster-panel-copy {
        max-width: none;
    }

    #dashboard-page .headmaster-panel-copy h3 {
        font-size: 20px;
    }

    #dashboard-page .dashboard-headmaster-visual {
        width: 92px;
        height: 92px;
        flex-basis: 92px;
    }

    #dashboard-page .dashboard-headmaster-panel .headmaster-photo {
        width: 72px;
        height: 72px;
    }

    #dashboard-page .dashboard-metrics-row {
        grid-template-columns: 1fr;
    }

    #dashboard-page .dashboard-metric-card {
        min-height: 0;
        padding: 16px;
    }

    #dashboard-page .metric-copy strong {
        font-size: 24px;
    }

    #dashboard-page .schedule-card .metric-copy strong {
        font-size: 15px;
    }

    #dashboard-page .dashboard-teacher-panel,
    #dashboard-page .dashboard-side-block {
        padding: 16px;
    }

    #dashboard-page .panel-header {
        align-items: flex-start;
    }

    #dashboard-page .panel-header h2 {
        font-size: 20px;
    }

    #dashboard-page .dashboard-teacher-panel .carousel-nav {
        display: none;
    }

    #dashboard-page .guru-cards-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #dashboard-page .guru-card {
        min-height: 176px;
    }
}

@media (max-width: 520px) {
    #dashboard-page .dashboard-headmaster-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    #dashboard-page .dashboard-headmaster-visual {
        align-self: flex-start;
    }

    #dashboard-page .guru-cards-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ==================== TOPBAR NO-SEARCH OVERRIDE ==================== */
.app-topbar {
    justify-content: flex-end;
}

@media (max-width: 992px) {
    .app-topbar {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .app-topbar-left {
        display: inline-flex !important;
        width: auto;
        min-width: 0;
    }

    .app-topbar-right {
        width: auto;
        margin-left: auto;
        justify-content: flex-end;
    }

    .topbar-school-chip {
        max-width: min(360px, calc(100vw - 250px));
    }
}

@media (max-width: 768px) {
    .app-topbar {
        grid-template-columns: 48px minmax(0, 1fr) 48px auto !important;
    }

    .app-topbar-left {
        display: contents !important;
    }

    .app-topbar-right {
        display: contents !important;
    }

    .menu-toggle {
        grid-column: 1;
        grid-row: 1;
    }

    .topbar-school-chip {
        grid-column: 2;
        grid-row: 1;
        max-width: none;
        min-width: 0;
        padding: 0 0 0 8px;
        min-height: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .topbar-school-chip span {
        font-size: 16px;
    }

    .topbar-notification-menu {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .topbar-icon-button {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .topbar-user-menu {
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
    }
}

@media (max-width: 520px) {
    .topbar-school-chip {
        padding: 0 0 0 6px;
    }

    .topbar-school-chip span {
        font-size: 14px;
    }
}

/* ==================== FINAL SIDEBAR EDGE TOGGLE LAYER FIX ==================== */
.sidebar {
    z-index: 1300 !important;
    overflow: hidden !important;
    scrollbar-width: none !important;
}

.sidebar-toggle-edge {
    position: fixed !important;
    top: 18px !important;
    left: 255px !important;
    right: auto !important;
    z-index: 4000 !important;
    pointer-events: auto;
}

.sidebar::-webkit-scrollbar {
    display: none !important;
}

body.sidebar-collapsed .sidebar-toggle-edge {
    left: 77px !important;
}

.main-content {
    position: relative;
    z-index: 1;
}
