@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-main: #f1f5f9;
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-text: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition-speed: 0.3s;
    --sidebar-width: 260px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    overflow-x: hidden;
}

/* --- Layout Wrapper --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: none;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-speed) ease;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    height: 35px;
    margin-right: 10px;
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 700;
    color: #ffffff;
    font-size: 1.2rem;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    padding: 0 15px;
    margin-bottom: 2px;
}

.sidebar-menu a,
.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-menu a i,
.sidebar-menu .nav-link i {
    width: 25px;
    font-size: 1rem;
    margin-right: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu .nav-link:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 100%);
    color: #ffffff !important;
    border-left: 3px solid #38bdf8;
    border-radius: 0 8px 8px 0;
    transform: translateX(3px);
}

.sidebar-menu a.active,
.sidebar-menu .nav-link.active {
    background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
    color: #ffffff !important;
    border-left: 3px solid #38bdf8;
    border-radius: 0 8px 8px 0;
}

.sidebar-menu a:hover i,
.sidebar-menu .nav-link:hover i {
    transform: scale(1.1);
}

/* Override Bootstrap nav-link default color on dark sidebar */
.sidebar .nav-link { color: #94a3b8 !important; }
.sidebar .nav-link:hover,
.sidebar .nav-link:focus { color: #ffffff !important; }

/* Sidebar Menu Group Labels */
.sidebar-menu li.menu-label,
.sidebar-menu .menu-label {
    display: block;
    padding: 1rem 15px 0.5rem 15px;
    margin: 0;
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b !important;
    pointer-events: none;
    cursor: default;
}

.sidebar-menu li.menu-label:first-child { padding-top: 0.5rem; }

/* Badge in sidebar nav */
.sidebar-menu .badge { font-size: 10px; }


.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all var(--transition-speed) ease;
}

/* --- Topbar --- */
.topbar {
    height: 70px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    border-top: 3px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(90deg, #4f46e5, #3b82f6, #06b6d4);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-main);
    cursor: pointer;
    display: none;
}

@media (min-width: 992px) {
    .sidebar-toggle.desktop-toggle {
        display: block;
    }
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 10px;
    border: 2px solid var(--primary-color);
}

.user-info {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Cards & General Components --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-wrapper {
    padding: 25px;
    flex: 1;
    animation: fadeInUp 0.5s ease-out forwards;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    background-color: var(--card-bg);
    transition: box-shadow 0.2s;
    margin-bottom: 20px;
}

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

.card-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
}

.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #2563eb 100%);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.btn-adobe {
    background: linear-gradient(135deg, #ed2224, #c62828);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(237, 34, 36, 0.2);
}

.btn-adobe:hover {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(237, 34, 36, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    color: white !important;
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
    color: white !important;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
    color: white !important;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 8px -1px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
    color: white !important;
}
.btn-info:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 6px 8px -1px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
    color: white !important;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(100, 116, 139, 0.3);
    color: white !important;
}
.btn-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 6px 8px -1px rgba(100, 116, 139, 0.4);
    transform: translateY(-1px);
    color: white !important;
}

/* --- Global Table Styling Upgrade --- */
.table {
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 1.5rem;
}

.table thead th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border-color);
    border-top: none;
}

.table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    color: var(--text-main);
    border-bottom: 1px dashed var(--border-color);
    background-color: transparent;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover td {
    background-color: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Responsive Wrapper Enhancement */
.table-responsive {
    border-radius: 12px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px var(--border-color);
    padding: 0;
}

.table-responsive .table {
    margin-bottom: 0;
}

/* Badge styling specifically for tables to look better */
.table .badge {
    padding: 0.5em 0.8em;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 6px;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .desktop-toggle {
        display: none !important;
    }
}

/* Collapsed Sidebar on Desktop */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}
body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* Stat Card */
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}
.stat-card .icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-right: 15px;
}
.stat-card .details h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}
.stat-card .details p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

/* Jurnal Content Responsiveness */
.jurnal-content img, .konten-box img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px;
    object-fit: contain;
}
.jurnal-content table, .konten-box table {
    max-width: 100% !important;
}

.bg-gradient-primary { background: linear-gradient(135deg, #4f46e5, #3b82f6); }
.bg-gradient-success { background: linear-gradient(135deg, #10b981, #34d399); }
.bg-gradient-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.bg-gradient-info { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.bg-gradient-danger { background: linear-gradient(135deg, #ef4444, #f87171); }

/* Dropdown User */
.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: 12px;
}
.dropdown-item {
    padding: 10px 20px;
    font-weight: 500;
    color: var(--text-main);
}
.dropdown-item i {
    margin-right: 10px;
    color: var(--text-muted);
}
.dropdown-item:hover {
    background-color: var(--bg-main);
    color: var(--primary-color);
}
.dropdown-item:hover i {
    color: var(--primary-color);
}

/* --- EDUCORE PKL NEW DASHBOARD STYLES --- */
.bg-gradient-primary-purple { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.bg-gradient-primary-soft { background: linear-gradient(135deg, #e0e7ff, #ede9fe); }
.text-primary-purple { color: #4f46e5; }
.card-new { border-radius: 12px; border: 1px solid #f1f5f9; box-shadow: 0 4px 12px rgba(0,0,0,0.02); background: #ffffff; }
.stat-card-new { border-radius: 16px; transition: transform 0.2s, box-shadow 0.2s; background: white; border: 1px solid #f1f5f9; position: relative; overflow: hidden; }
.stat-card-new:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.icon-box-sm { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.sparkline-container { height: 30px; width: 60px; }
.progress-sm { height: 6px; border-radius: 10px; background-color: #f1f5f9; }

/* Timeline Activity */
.activity-timeline { position: relative; padding-left: 20px; border-left: 2px solid #e2e8f0; margin-left: 10px; }
.activity-item { position: relative; margin-bottom: 20px; }
.activity-item::before {
    content: ''; position: absolute; left: -26px; top: 0; width: 12px; height: 12px;
    border-radius: 50%; background: #4f46e5; border: 2px solid #fff; box-shadow: 0 0 0 1px #4f46e5;
}
.activity-item.success::before { background: #10b981; box-shadow: 0 0 0 1px #10b981; }
.activity-item.warning::before { background: #f59e0b; box-shadow: 0 0 0 1px #f59e0b; }

/* Quick Action Grid */
.quick-action-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 15px 10px; border-radius: 12px; transition: all 0.2s; border: 1px solid transparent; text-decoration: none;
}
.quick-action-btn:hover { background-color: #f8fafc; border-color: #e2e8f0; transform: translateY(-2px); }
.quick-action-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 10px; }

/* Map */
#dashboardMap { height: 260px; width: 100%; border-radius: 12px; z-index: 1; }

/* ---- VISIBILITY FIXES ---- */

/* Hero banner: pastikan semua teks putih */
.bg-gradient-primary-purple h2,
.bg-gradient-primary-purple h6,
.bg-gradient-primary-purple p { color: inherit; }

/* Stat card teks selalu hitam gelap */
.stat-card-new h3 { color: #1e293b !important; }
.stat-card-new .text-muted { color: #64748b !important; }

/* card-new teks */
.card-new h6 { color: #1e293b !important; }
.card-new .text-muted { color: #64748b !important; }
.card-new .fw-bold { color: #1e293b; }

/* Progress list dalam card */
.progress-list .fw-bold { color: #1e293b !important; }

/* Activity timeline teks */
.activity-item .fw-bold { color: #1e293b !important; }
.activity-item .text-muted { color: #64748b !important; }

/* Kalender teks */
.card-new .text-dark { color: #1e293b !important; }

/* Quick action teks label */
.quick-action-btn span { color: #1e293b !important; }

/* Topbar override - pastikan icon terlihat */
.topbar .far, .topbar .fas { color: #64748b; }
.topbar .cursor-pointer:hover .far,
.topbar .cursor-pointer:hover .fas { color: #4f46e5; }
.cursor-pointer { cursor: pointer; }
