* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #e8edf4;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: #fff;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    transition: all 0.3s;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-text h1 {
    font-size: 16px;
    font-weight: 800;
}

.logo-text p {
    font-size: 9px;
    opacity: 0.6;
}

.sidebar-close {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.profile {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1e3a5f;
}

.profile-info h3 {
    font-size: 14px;
    font-weight: 700;
}

.role-badge {
    font-size: 9px;
    background: rgba(255, 140, 66, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 4px;
    color: #FF8C42;
}

/* ==================== NAVIGASI ==================== */
.nav-menu {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item i:first-child {
    width: 20px;
    font-size: 16px;
}

.nav-item span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 140, 66, 0.1);
    color: white;
}

.nav-item.active {
    background: linear-gradient(90deg, #FF8C42, #0f172a);
    color: white;
    border-left: 3px solid #FF8C42;
}

/* ==================== SIDEBAR FOOTER ==================== */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    text-align: center;
}

.system-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 11px;
}

.system-status i {
    font-size: 8px;
    color: #10b981;
}

.btn-back-menu {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #3b82f6;
    padding: 8px 16px;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-back-menu:hover {
    background: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.sidebar-footer p {
    font-size: 9px;
    opacity: 0.4;
}

/* ==================== MAIN CONTENT ==================== */
.main {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    background: #e8edf4;
}

.header {
    background: #f5f7fa;
    padding: 0 28px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d1d9e6;
    position: sticky;
    top: 0;
    z-index: 99;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #1e293b;
}

.title-section h1 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.title-section p {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
}

.notification-icon {
    position: relative;
    color: #64748b;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.notification-icon:hover {
    background: #e8edf4;
    color: #FF8C42;
}

.notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    display: none;
    border: 2px solid #f5f7fa;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ==================== PAGES ==================== */
.pages-container {
    padding: 28px 32px;
    background: #e8edf4;
    min-height: calc(100vh - 70px);
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== WELCOME BANNER ==================== */
.welcome-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #d1d9e6;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 100% 0%, rgba(255, 140, 66, 0.1), transparent 70%);
    pointer-events: none;
}

.welcome-text {
    flex: 1;
    z-index: 1;
}

.greeting {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.greeting i {
    font-size: 32px;
    color: #fbbf24;
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

.greeting h2 {
    font-size: 24px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.student-name {
    color: #FF8C42;
}

.welcome-message {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 20px;
}

.motivation-quote {
    background: rgba(255, 140, 66, 0.1);
    padding: 12px 20px;
    border-radius: 12px;
    border-left: 4px solid #FF8C42;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.motivation-quote i {
    color: #FF8C42;
    font-size: 14px;
    opacity: 0.7;
}

.motivation-quote i:first-child {
    align-self: flex-start;
}

.motivation-quote i:last-child {
    align-self: flex-end;
}

.motivation-quote span {
    color: #cbd5e1;
    font-size: 13px;
    font-style: italic;
    flex: 1;
    text-align: center;
}

.welcome-illustration {
    background: linear-gradient(135deg, #1e3a5f, #0f172a);
    width: 100px;
    height: 100px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #334155;
}

.welcome-illustration i {
    font-size: 50px;
    color: #FF8C42;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s;
    border: 1px solid #d1d9e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: #b8c4d4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card.primary .stat-icon { 
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6; 
}
.stat-card.success .stat-icon { 
    background: rgba(16, 185, 129, 0.15);
    color: #10b981; 
}
.stat-card.warning .stat-icon { 
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b; 
}
.stat-card.info .stat-icon { 
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6; 
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
}

.stat-info p {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
}

/* ==================== CARDS ==================== */
.card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #d1d9e6;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid #d1d9e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #f5f7fa;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: #FF8C42;
}

.card-body {
    padding: 20px 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* ==================== BADGES ==================== */
.badge-count {
    background: linear-gradient(135deg, #FF8C42, #E67A2E);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.3;
    display: block;
}

.empty-state h4 {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 13px;
}

/* ==================== TEMPLATE CARD ==================== */
.template-card {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 1px solid #d1d9e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    flex-wrap: wrap;
    gap: 12px;
}

.template-card:hover {
    border-color: #FF8C42;
    transform: translateX(4px);
    background: #ffffff;
}

.template-card-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 200px;
}

.template-card-info i {
    font-size: 32px;
    color: #3b82f6;
}

.template-card-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.template-card-info p {
    font-size: 12px;
    color: #64748b;
    margin: 2px 0;
}

.template-card-info .from-guru {
    font-size: 11px;
    color: #FF8C42;
}

.template-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-download-template {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-download-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-view-template {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-view-template:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ==================== ANECDOTE ==================== */
.anecdote-item {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 1px solid #d1d9e6;
    cursor: pointer;
    transition: all 0.2s;
}

.anecdote-item:hover {
    border-color: #FF8C42;
    transform: translateX(4px);
    background: #ffffff;
}

.anecdote-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.anecdote-type {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.anecdote-type.peringatan { 
    background: rgba(239, 68, 68, 0.15); 
    color: #ef4444; 
}
.anecdote-type.prestasi { 
    background: rgba(16, 185, 129, 0.15); 
    color: #10b981; 
}
.anecdote-type.tugas { 
    background: rgba(59, 130, 246, 0.15); 
    color: #3b82f6; 
}
.anecdote-type.informasi { 
    background: rgba(139, 92, 246, 0.15); 
    color: #8b5cf6; 
}

.anecdote-date {
    font-size: 11px;
    color: #94a3b8;
    margin-left: auto;
}

.anecdote-message {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.6;
    margin-bottom: 8px;
}

.anecdote-target {
    font-size: 11px;
    color: #FF8C42;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================== PROFILE ==================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #d1d9e6;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.profile-avatar {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #d1d9e6;
}

.profile-edit-btn {
    background: linear-gradient(135deg, #FF8C42, #E67A2E);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
}

.profile-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.4);
}

.profile-edit-btn i {
    font-size: 14px;
}

.profile-header-info h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.profile-header-info p {
    color: #64748b;
    font-size: 14px;
    margin: 4px 0;
}

.profile-header-info p i {
    color: #FF8C42;
    width: 20px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-card {
    background: #f5f7fa;
    border-radius: 12px;
    border: 1px solid #d1d9e6;
    overflow: hidden;
}

.info-card-header {
    padding: 12px 18px;
    background: #ffffff;
    border-bottom: 1px solid #d1d9e6;
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card-header i {
    color: #FF8C42;
}

.info-card-body {
    padding: 12px 18px;
}

.info-row {
    display: flex;
    padding: 6px 0;
    border-bottom: 1px solid #e8edf4;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 100px;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
}

.info-value {
    flex: 1;
    font-size: 13px;
    color: #1e293b;
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #ffffff;
    margin: 3% auto;
    width: 90%;
    max-width: 700px;
    border-radius: 16px;
    border: 1px solid #d1d9e6;
    animation: slideDown 0.3s ease;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #d1d9e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f5f7fa;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    color: #1e293b;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: #FF8C42;
}

.modal-close {
    color: #94a3b8;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
    color: #1e293b;
}

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid #d1d9e6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f5f7fa;
    border-radius: 0 0 16px 16px;
}

/* ==================== TOAST NOTIFICATION ==================== */
#toastContainer {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 100%;
    max-width: 500px;
    pointer-events: none;
}

.toast-notification {
    background: #1e293b;
    color: #f1f5f9;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #334155;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-notification.success {
    background: linear-gradient(135deg, #065f46, #047857);
    border-color: #10b981;
}

.toast-notification.error {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border-color: #ef4444;
}

.toast-notification .toast-icon {
    font-size: 20px;
}

/* ==================== BUTTONS ==================== */
.btn-cancel {
    background: #e8edf4;
    color: #1e293b;
    border: 1px solid #d1d9e6;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #d1d9e6;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1001;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .sidebar-close {
        display: block;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .welcome-banner {
        flex-direction: column;
        text-align: center;
    }
    .greeting {
        justify-content: center;
    }
    .motivation-quote {
        justify-content: center;
    }
    .welcome-illustration {
        margin-top: 20px;
    }
    .pages-container {
        padding: 20px 24px;
    }
}

@media (max-width: 768px) {
    .pages-container {
        padding: 16px;
        background: #e8edf4;
    }
    .main {
        background: #e8edf4;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .welcome-banner {
        padding: 20px;
    }
    .greeting h2 {
        font-size: 18px;
    }
    .motivation-quote span {
        font-size: 11px;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    #toastContainer {
        max-width: 90%;
        top: 70px;
    }
    .header {
        background: #f5f7fa;
        padding: 0 16px;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    .profile-header-info {
        text-align: center;
    }
    .template-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .template-card-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .template-card-info {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .header-left {
        flex-direction: column;
        gap: 8px;
    }
    .title-section h1 {
        font-size: 16px;
    }
    .date-display {
        display: none;
    }
    .pages-container {
        padding: 12px;
        background: #e8edf4;
    }
    .profile-avatar img {
        width: 80px;
        height: 80px;
    }
    .profile-header-info h2 {
        font-size: 20px;
    }
}