* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --bg: #faf5ff;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 8px 30px rgba(0,0,0,0.08);
    --radius: 20px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 50%, #ede9fe 100%);
    color: var(--text);
    min-height: 100vh;
}

.admin-header {
    background: linear-gradient(135deg, #1a1a2e, #4c1d95, #1a1a2e);
    color: white;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(135deg, #a78bfa, #8b5cf6, #7c3aed) 1;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left .logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    animation: bounce-logo 3s ease-in-out infinite;
}

@keyframes bounce-logo {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05) rotate(-5deg); }
}

.header-left h1 {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #c4b5fd, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-left small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
    -webkit-text-fill-color: rgba(255,255,255,0.7);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-right .date-time {
    font-size: 14px;
    opacity: 0.8;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 30px;
}

/* ============================================
   BACK TO MENU BUTTON
   ============================================ */
.btn-back-menu {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-back-menu:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-back-menu i {
    font-size: 16px;
}

/* ============================================
   CONTAINER & HERO
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 40px;
}

.hero-section {
    text-align: center;
    padding: 40px 24px 30px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    border-radius: var(--radius);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.hero-section h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 8px;
    animation: fadeInUp 0.5s ease;
}

.hero-section p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease 0.1s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    animation: fadeInUp 0.5s ease 0.2s both;
}

.stat-card-hero {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 16px 32px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.stat-number {
    font-size: 36px;
    font-weight: 800;
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-section {
    margin-bottom: 24px;
}

.toolbar {
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius);
    padding: 16px 24px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: var(--shadow);
    border: 2px solid rgba(255,255,255,0.5);
}

.toolbar-left {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 10px 20px;
    border-radius: 60px;
    border: 2px solid var(--border);
    min-width: 200px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text);
}

.search-box input:focus {
    outline: none;
}

.filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 18px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 30px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text);
}

.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.view-toggle {
    display: flex;
    gap: 6px;
}

.view-btn {
    padding: 8px 18px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 30px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.view-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.card-grid.timeline {
    grid-template-columns: 1fr;
}

.prestasi-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 2px solid rgba(255,255,255,0.5);
}

.prestasi-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

.card-gradient {
    height: 8px;
    width: 100%;
}

.card-content {
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.kategori-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.tingkat-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.card-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.3;
}

.card-penerima {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-detail {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--border);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-item i {
    width: 18px;
    color: var(--primary);
}

.sertifikat-preview {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid var(--border);
    text-align: center;
}

.sertifikat-preview img {
    max-width: 100%;
    max-height: 250px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    object-fit: contain;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sertifikat-preview img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-color: var(--primary);
}

.sertifikat-preview .preview-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.foto-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #ede9fe;
    color: #5b21b6;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.btn-bukti {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-bukti:hover {
    opacity: 0.9;
    transform: scale(0.98);
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255,255,255,0.8);
    border-radius: 24px;
    grid-column: 1 / -1;
    border: 3px dashed var(--border);
}

.empty-state i {
    font-size: 64px;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 60px;
    color: var(--primary);
    grid-column: 1 / -1;
}

.loading i {
    font-size: 40px;
    margin-bottom: 12px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

#previewBody {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    padding: 20px;
}

#previewBody img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
    object-fit: contain;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid var(--border);
    flex-shrink: 0;
}

.btn-secondary {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 10px 24px;
    border-radius: 14px;
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--border);
}

.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border-radius: 16px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    animation: slideIn 0.4s ease;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.toast.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.toast.info { background: linear-gradient(135deg, #6366f1, #4f46e5); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

footer {
    text-align: center;
    padding: 32px;
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    margin-top: 48px;
}

footer p {
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .admin-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-left h1 { font-size: 16px; }
    .header-left small { display: none; }
    .header-right .date-time { display: none; }

    .container {
        padding: 16px;
    }

    .hero-section h1 {
        font-size: 24px;
    }
    
    .hero-stats {
        gap: 16px;
    }
    
    .stat-card-hero {
        padding: 12px 20px;
        min-width: 80px;
    }
    
    .stat-number {
        font-size: 28px;
    }

    .toolbar {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        flex-direction: column;
    }

    .search-box {
        min-width: auto;
    }

    .filter-group {
        justify-content: center;
    }
    
    .view-toggle {
        justify-content: center;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .btn-back-menu {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    .btn-back-menu i {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .stat-info h3 {
        font-size: 18px;
    }

    .stat-info p {
        font-size: 11px;
    }

    .card-content {
        padding: 16px;
    }

    .card-title {
        font-size: 17px;
    }

    .btn-back-menu {
        padding: 4px 12px;
        font-size: 11px;
    }
    
    .btn-back-menu i {
        font-size: 11px;
    }
}