/* ==========================================================================
   Soft Pastel Tech - Dashboard Theme
   ========================================================================== */

:root {
    /* Main Colors */
    --bg-body: #F4F7F6;
    --bg-card: #FFFFFF;
    
    /* Text Colors */
    --text-main: #2D3748;
    --text-muted: #718096;
    
    /* Sidebar (Mint Pastel) */
    --sidebar-bg: #D4EDDA;
    --sidebar-text: #1B5E20;
    --sidebar-hover: rgba(27, 94, 32, 0.08);
    --sidebar-active: rgba(27, 94, 32, 0.15);
    
    /* Accents */
    --accent-blue: #81D4FA;
    --accent-blue-dark: #4FC3F7;
    --accent-yellow: #FFF9C4;
    --accent-mint-light: #E8F5E9;
    
    /* Layout */
    --sidebar-width: 250px;
    --topbar-height: 70px;
    
    /* UI Elements */
    --radius-card: 24px; /* rounded-3xl */
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.05);
    
    --transition: 0.3s ease;
}

/* Dark Mode Variables (added via class) */
body.dark-mode {
    --bg-body: #121212;
    --bg-card: #1E1E1E;
    --text-main: #E0E0E0;
    --text-muted: #9E9E9E;
    --sidebar-bg: #1A3021;
    --sidebar-text: #81C784;
    --sidebar-hover: rgba(129, 199, 132, 0.1);
    --sidebar-active: rgba(129, 199, 132, 0.2);
    --accent-yellow: #33301B;
    --accent-mint-light: #1A261D;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color var(--transition), color var(--transition);
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* ================== SIDEBAR ================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.sidebar-logo i {
    font-size: 42px;
    color: var(--sidebar-text);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--sidebar-text);
    font-weight: 500;
    border-radius: 16px;
    transition: var(--transition);
}

.nav-item i {
    font-size: 22px;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
}

.nav-item.active {
    background-color: var(--sidebar-active);
    font-weight: 600;
}

/* ================== MAIN CONTENT ================== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ================== TOPBAR ================== */
.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: transparent;
    margin-top: 10px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: block; /* Selalu tampil untuk minimize desktop & buka mobile */
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    color: var(--accent-blue-dark);
}

/* ================== SIDEBAR COLLAPSED (DESKTOP) ================== */
body.sidebar-collapsed .sidebar {
    width: 80px;
    padding: 24px 10px;
}

body.sidebar-collapsed .nav-item span {
    display: none; /* Sembunyikan teks menu */
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

body.sidebar-collapsed .nav-item i {
    margin: 0;
}

body.sidebar-collapsed .main-wrapper {
    margin-left: 80px;
}

.topbar-left h1 {
    font-size: 20px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.05);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--text-main);
    transform: scale(1.05);
}

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

.greeting {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.user-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--sidebar-bg); /* Pastel border */
    object-fit: cover;
}

/* ================== CONTENT AREA (GRID) ================== */
.content-area {
    padding: 24px 32px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Utility to span 2 columns */
.span-2 {
    grid-column: span 2;
}

/* ================== CARDS ================== */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* Pemberitahuan Penting Card (Yellow Accent) */
.card-warning {
    background-color: var(--accent-yellow);
}
body.dark-mode .card-warning {
    background-color: var(--bg-card);
    border-left: 6px solid #FBC02D;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #F57F17;
}

.card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 16px;
}

.btn-action {
    align-self: flex-start;
    padding: 10px 20px;
    background-color: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.btn-action:hover {
    background-color: rgba(0,0,0,0.02);
}

/* Stats Card (Progress Bars) */
.progress-wrapper {
    margin-bottom: 12px;
}
.mt-3 {
    margin-top: 16px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background-color: rgba(0,0,0,0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--accent-blue-dark);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.progress-bar-fill.orange {
    background-color: #FFB74D;
}

/* Schedule Card (Minimalist Table) */
.card-table {
    padding: 0;
    overflow: hidden;
}

.card-table .card-header {
    padding: 24px 24px 0 24px;
}

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

.pastel-table {
    width: 100%;
    border-collapse: collapse;
}

.pastel-table th, 
.pastel-table td {
    padding: 18px 24px;
    text-align: left;
    font-size: 15px;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.pastel-table th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.pastel-table tbody tr {
    border-bottom: 1px solid rgba(0,0,0,0.02);
}

/* Mint pastel accent row */
.pastel-table tbody tr.highlight {
    background-color: var(--accent-mint-light);
}

/* ================== RESPONSIVE DESIGN ================== */
@media (max-width: 992px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width); /* Kembalikan width normal di mobile */
        padding: 24px 20px;
    }
    body.sidebar-collapsed .nav-item span {
        display: inline-block;
    }
    body.sidebar-collapsed .nav-item {
        justify-content: flex-start;
        padding: 12px 20px;
    }

/* ================== PROFILE DROPDOWN ================== */
.user-profile {
    position: relative;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 15px;
    background-color: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    width: 200px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: rgba(0,0,0,0.03);
}
body.dark-mode .dropdown-item:hover {
    background-color: rgba(255,255,255,0.05);
}

.dropdown-item i {
    font-size: 20px;
}

.dropdown-divider {
    height: 1px;
    background-color: rgba(0,0,0,0.05);
    margin: 5px 0;
}
body.dark-mode .dropdown-divider {
    background-color: rgba(255,255,255,0.05);
}

.text-danger {
    color: #ef4444;
}
.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.05);
}

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-md);
    }
    
    .main-wrapper, body.sidebar-collapsed .main-wrapper {
        margin-left: 0;
    }
    
    .topbar {
        padding: 0 20px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .greeting {
        display: none;
    }
}

/* ================== PROFILE DROPDOWN ================== */
.user-profile {
    position: relative;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 15px;
    background-color: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    width: 200px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: rgba(0,0,0,0.03);
}
body.dark-mode .dropdown-item:hover {
    background-color: rgba(255,255,255,0.05);
}

.dropdown-item i {
    font-size: 20px;
}

.dropdown-divider {
    height: 1px;
    background-color: rgba(0,0,0,0.05);
    margin: 5px 0;
}
body.dark-mode .dropdown-divider {
    background-color: rgba(255,255,255,0.05);
}

.text-danger {
    color: #ef4444;
}
.text-danger:hover {
    background-color: rgba(239, 68, 68, 0.05);
}


/* Custom Print Modal Buttons */
.btn-cetak-solid {
    background-color: #4338ca !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;


/* Custom Print Modal Buttons */
.btn-cetak-solid {
    background-color: #4338ca !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    margin-left: 10px !important;
}
.btn-batal-outline {
    background-color: #ffffff !important;
    color: #4338ca !important;
    border: 1px solid #4338ca !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
}
.swal-print-actions {
    justify-content: flex-end !important;
    padding-right: 20px !important;
    padding-bottom: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Custom Responsive Grid for Waka Sarpras */
.waka-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
}

@media (max-width: 992px) {
    .waka-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .waka-stats-grid {
        grid-template-columns: 1fr !important;
    }
    /* Sembunyikan nama sekolah dan perkecil logo di mobile untuk hemat space */
    #sidebar-school-name {
        display: none !important;
    }
    .sidebar-logo {
        margin-bottom: 20px !important;
    }
    .sidebar-logo img {
        width: 48px !important;
        height: 48px !important;
    }
    .topbar-left h1 {
        display: none !important; /* Hide to save topbar space completely on small screens */
    }
}
