/* ==========================================
   1. GLOBAL & RESET
   ========================================== */
body {
    background-color: #f8fafc;
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
}

/* Base Layout Wrapper */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 70px);
    width: 100%;
}

.main-content,
.dashboard-main-content,
.profile-main-content {
    flex: 1;
    width: 100%;
    min-width: 0; /* Mencegah overflow horizontal pada tabel/konten */
}

/* ==========================================
   2. STYLING SIDEBAR - TAMPILAN LAPTOP / DESKTOP (> 768px)
   ========================================== */
@media screen and (min-width: 769px) {
    .sidebar {
        position: relative !important;
        top: auto !important;
        left: 0 !important;
        width: 260px !important;
        min-height: 100% !important;
        height: auto !important;
        background-color: #ffffff !important;
        border-right: 1px solid #e2e8f0;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between;
        padding: 2rem 1.5rem !important;
        box-sizing: border-box;
        flex-shrink: 0 !important;
        z-index: 10 !important;
        box-shadow: none !important;
    }

    /* Sembunyikan elemen header khusus mobile di laptop */
    .sidebar-header-mobile,
    .sidebar-overlay {
        display: none !important;
    }
}

/* Common Sidebar Elements (Dipakai Laptop & Mobile) */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar-item:hover,
.sidebar-item.active {
    background-color: #e0f2f1; /* Toska Muda */
    color: #0d9488; /* Toska Tua */
    font-weight: 600;
}

.sidebar-logout {
    color: #ef4444;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
    margin-top: auto;
}

/* ==========================================
   3. STYLING SIDEBAR - TAMPILAN MOBILE (<= 768px)
   ========================================== */
@media screen and (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    /* Slide-Over Drawer Kiri di Mobile */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important; /* Tersembunyi di luar layar kiri */
        width: 280px !important;
        height: 100vh !important;
        background-color: #ffffff !important; /* Putih Bersih */
        border-right: none !important;
        z-index: 99999 !important; /* Selalu di atas elemen apapun */
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 10px 0 25px -5px rgba(0, 0, 0, 0.1) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between;
        padding: 0 1.25rem 1.5rem 1.25rem !important;
        box-sizing: border-box;
    }

    /* Saat terbuka via Javascript (.open) */
    .sidebar.open {
        left: 0 !important;
    }

    /* Overlay Latar Gelap Transparan saat Sidebar Buka */
    .sidebar-overlay {
        display: none;
    }

    .sidebar.open ~ .sidebar-overlay,
    .sidebar-overlay.show {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(
            15,
            23,
            42,
            0.5
        ) !important; /* Dark Slate Semi-Transparan */
        backdrop-filter: blur(4px) !important; /* Efek blur halus ala iOS */
        z-index: 9998 !important;
    }

    .sidebar-header-mobile {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem 0;
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 1rem;
    }

    .sidebar-title {
        font-weight: 700;
        color: #0f172a;
        font-size: 1rem;
    }

    .close-sidebar-btn {
        background: none;
        border: none;
        color: #64748b;
        cursor: pointer;
        padding: 4px;
    }
}

/* ==========================================
   4. HEADER & NAVBAR UTAMA
   ========================================== */
.dashboard-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    height: 40px;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0d9488;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-initial {
    width: 38px;
    height: 38px;
    background-color: #0d9488;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.username {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

/* ==========================================
   5. ISI KONTEN DASHBOARD USER
   ========================================== */
.dashboard-main-content,
.content-body {
    padding: 2rem 2.5rem;
    box-sizing: border-box;
}

.welcome-section {
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem 0;
}

.welcome-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-blue {
    background-color: #e0f2fe;
    color: #0284c7;
}
.icon-orange {
    background-color: #ffedd5;
    color: #ea580c;
}
.icon-green {
    background-color: #dcfce7;
    color: #16a34a;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.stat-unit {
    font-size: 0.75rem;
    color: #64748b;
}

/* ROW TWO COLUMNS */
.dashboard-row {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr;
    gap: 1.5rem;
    align-items: start;
}

/* EMPTY STATE CARD */
.empty-state-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-img,
.empty-state-icon {
    max-width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
}

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.empty-state-desc {
    font-size: 0.85rem;
    color: #64748b;
    max-width: 320px;
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.btn-teal,
.btn-teal-inline {
    background-color: #0d9488;
    color: #ffffff;
    padding: 0.65rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.btn-teal:hover,
.btn-teal-inline:hover {
    background-color: #0f766e;
}

/* TABEL DAFTAR SEKOLAH */
.table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.table-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.custom-dashboard-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.custom-dashboard-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success {
    background: #d1fae5;
    color: #065f46;
}
.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.table-action-footer {
    margin-top: 1rem;
}

/* SUPPORT CARD */
.support-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.support-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0d9488;
    margin: 0 0 0.5rem 0;
}

.support-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.support-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
}

.support-item-icon {
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d9488;
    flex-shrink: 0;
}

.support-item-text {
    font-size: 0.8rem;
    color: #1e293b;
    line-height: 1.4;
}

.support-item-link {
    color: #0284c7;
    text-decoration: none;
    font-weight: 600;
}

.support-item-link:hover {
    text-decoration: underline;
}

/* ==========================================
   6. RESPONSIVE ADJUSTMENTS UNTUK KONTEN MOBILE
   ========================================== */
@media screen and (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }

    .dashboard-main-content,
    .content-body,
    .profile-main-content {
        padding: 1rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    .dashboard-row {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}
