/* ==========================================
   FILE: wali.css
   FUNGSI: Gaya Visual, Tata Letak, Tema, dan Animasi Portal Wali Murid
   ========================================== */

:root {
    /* Palet Warna Latar & Permukaan */
    --bg-body: #F8FAFC; 
    --bg-surface: #FFFFFF;
    --border-color: #E2E8F0; 
    --border-focus: #93C5FD; 
    
    /* Palet Teks */
    --text-main: #0F172A; 
    --text-muted: #475569; 
    --text-light: #94A3B8; 
    
    /* Aksen Warna Primer (Biru) */
    --primary: #2563EB; 
    --primary-hover: #1D4ED8; 
    --primary-light: #EFF6FF; 
    
    /* Aksen Status (Sukses, Peringatan, Bahaya) */
    --success: #10B981; 
    --success-bg: #ECFDF5;
    --success-text: #047857;
    
    --warning: #F59E0B; 
    --warning-bg: #FFFBEB;
    --warning-text: #B45309;
    
    --danger: #EF4444; 
    --danger-bg: #FEF2F2;
    --danger-text: #B91C1C;

    /* Aksen Spesial (AI & Premium) */
    --purple-ai: #8B5CF6;
    --purple-bg: #F5F3FF;
    --purple-text: #5B21B6;
    
    /* Border Radius & Bayangan */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);
    --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.4);
    
    /* Variabel Tata Letak */
    --bottom-nav-height: 65px;
}

/* ==========================================
   RESET & DASAR TATA LETAK
   ========================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
    outline: none; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.5; 
    -webkit-font-smoothing: antialiased; 
    overflow-x: hidden; 
    scroll-behavior: smooth; 
}

h1, h2, h3, h4, h5 { 
    color: var(--text-main); 
    font-weight: 600; 
    letter-spacing: -0.01em; 
}

.text-muted { 
    color: var(--text-muted); 
    font-size: 13px; 
}

/* PERBAIKAN BUG SVG: Mencegah Ikon Lucide Gepeng di dalam Flexbox */
svg, i[data-lucide] {
    flex-shrink: 0;
}

/* ==========================================
   TOMBOL & INPUT INTERAKTIF
   ========================================== */
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    padding: 10px 16px; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--border-color); 
    background: var(--bg-surface); 
    color: var(--text-main); 
    cursor: pointer; 
    transition: all 0.2s ease-in-out; 
    box-shadow: var(--shadow-sm); 
}
.btn:hover { background: #F1F5F9; border-color: #CBD5E1; }
.btn:focus-visible { box-shadow: var(--shadow-focus); border-color: var(--primary); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: var(--shadow-md); }

.btn-ghost { border: none; background: transparent; box-shadow: none; color: var(--text-muted); padding: 8px 12px; }
.btn-ghost:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }

.input-group { margin-bottom: 16px; }
.input-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.input-field { 
    width: 100%; 
    padding: 12px 16px; 
    font-size: 14px; 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-md); 
    background: var(--bg-surface); 
    color: var(--text-main); 
    transition: border-color 0.2s, box-shadow 0.2s; 
}
.input-field::placeholder { color: var(--text-light); }
.input-field:focus { border-color: var(--primary); box-shadow: var(--shadow-focus); }

/* ==========================================
   BADGE & PILL COMPONENT
   ========================================== */
.badge { 
    display: inline-flex; 
    align-items: center; 
    padding: 4px 8px; 
    font-size: 11px; 
    font-weight: 700; 
    border-radius: var(--radius-sm); 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}
.badge-neutral { background: #F1F5F9; color: var(--text-muted); border: 1px solid var(--border-color); }
.badge-premium { 
    background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 100%); 
    color: #78350F; 
    border: 1px solid #D97706; 
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1); 
}

.pill { 
    display: inline-flex; 
    align-items: center; 
    padding: 6px 12px; 
    font-size: 12px; 
    font-weight: 600; 
    border-radius: var(--radius-full); 
    white-space: nowrap; 
    transition: all 0.2s; 
    border: 1px solid var(--border-color); 
    background: var(--bg-surface); 
    color: var(--text-muted); 
    cursor: pointer; 
    gap: 6px; 
}
.pill:hover { background: #F1F5F9; color: var(--text-main); border-color: #CBD5E1; }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2); }

.q-pill { display: inline-flex; align-items: center; padding: 4px 8px; font-size: 11px; font-weight: 600; border-radius: var(--radius-sm); white-space: nowrap; gap: 4px; }
.q-pill-excelent { background: var(--success-bg); color: var(--success-text); border: 1px solid #A7F3D0; }
.q-pill-good { background: var(--primary-light); color: var(--primary-hover); border: 1px solid #BFDBFE; }
.q-pill-fair { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #FDE68A; }
.q-pill-poor { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #FECACA; }

/* ==========================================
   CARDS & PROGRESS BARS
   ========================================== */
.card { 
    background: var(--bg-surface); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-sm); 
    padding: 20px; 
    position: relative; 
    overflow: hidden; 
    transition: all 0.3s ease; 
}
.card-header-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary) 0%, #60A5FA 100%); }

.section-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; margin-bottom: 12px; margin-top: 16px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }

.progress-block { margin-top: 16px; background: #F8FAFC; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.progress-labels { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-main); align-items: center; }
.progress-track { width: 100%; height: 8px; background: #E2E8F0; border-radius: var(--radius-full); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, #60A5FA 100%); border-radius: var(--radius-full); width: 0%; transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3); }

/* ==========================================
   MUTABA'AH SHOLAT BUTTONS
   ========================================== */
.sholat-btn { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    background: var(--bg-surface); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-md); 
    padding: 12px 4px; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: var(--shadow-sm); 
    -webkit-tap-highlight-color: transparent; 
}
.sholat-btn span { font-size: 10px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; text-align: center;}
.sholat-btn .sholat-icon { width: 36px; height: 36px; border-radius: 50%; background: #F8FAFC; color: var(--text-light); display: flex; align-items: center; justify-content: center; transition: all 0.2s; border: 1px solid var(--border-color); }

.sholat-btn:hover:not(.locked) { border-color: var(--border-focus); transform: translateY(-2px); }

.sholat-btn.status-berjamaah { background: var(--success-bg); border-color: #A7F3D0; box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.15); }
.sholat-btn.status-berjamaah span { color: var(--success-text); }
.sholat-btn.status-berjamaah .sholat-icon { background: var(--success); color: white; box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3); border-color: var(--success); }

.sholat-btn.status-sendiri { background: var(--primary-light); border-color: #BFDBFE; box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15); }
.sholat-btn.status-sendiri span { color: var(--primary-hover); }
.sholat-btn.status-sendiri .sholat-icon { background: var(--primary); color: white; box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3); border-color: var(--primary); }

.sholat-btn.status-udzur { background: var(--warning-bg); border-color: #FDE68A; box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.15); }
.sholat-btn.status-udzur span { color: var(--warning-text); }
.sholat-btn.status-udzur .sholat-icon { background: var(--warning); color: white; box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3); border-color: var(--warning); }

.sholat-btn.status-tidak { background: var(--danger-bg); border-color: #FECACA; box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.15); }
.sholat-btn.status-tidak span { color: var(--danger-text); }
.sholat-btn.status-tidak .sholat-icon { background: var(--danger); color: white; box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3); border-color: var(--danger); }

.sholat-btn.locked { opacity: 0.55; cursor: not-allowed; background: #F1F5F9; border-style: dashed; }
.sholat-btn.locked .sholat-icon { background: #E2E8F0; border-color: #CBD5E1; color: #94A3B8; }

.sholat-option-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); cursor: pointer; transition: all 0.2s; text-align: left; }
.sholat-option-btn:hover { background: #F8FAFC; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.sholat-option-btn .icon-wrap { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.opt-berjamaah { border-color: #A7F3D0; }
.opt-berjamaah .icon-wrap { background: var(--success-bg); color: var(--success); border: 1px solid #A7F3D0; }
.opt-berjamaah.active { box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2); transform: scale(1.02); background: var(--success-bg); border-width: 2px;}

.opt-sendiri { border-color: #BFDBFE; }
.opt-sendiri .icon-wrap { background: var(--primary-light); color: var(--primary); border: 1px solid #BFDBFE; }
.opt-sendiri.active { box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2); transform: scale(1.02); background: var(--primary-light); border-width: 2px;}

.opt-udzur { border-color: #FDE68A; }
.opt-udzur .icon-wrap { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #FDE68A; }
.opt-udzur.active { box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2); transform: scale(1.02); background: var(--warning-bg); border-width: 2px;}

.opt-tidak { border-color: #FECACA; }
.opt-tidak .icon-wrap { background: var(--danger-bg); color: var(--danger); border: 1px solid #FECACA; }
.opt-tidak.active { box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2); transform: scale(1.02); background: var(--danger-bg); border-width: 2px;}

/* ==========================================
   TAB POTENSI: RADAR, SWOT & AI FORECAST
   ========================================== */
.radar-container { width: 100%; max-width: 380px; min-height: 320px; margin: 16px auto; position: relative; padding-bottom: 10px; }

.gamification-badge { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%); border: 1px solid #FDE68A; padding: 10px 16px; border-radius: var(--radius-full); margin: 0 auto 16px; width: max-content; box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1); animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.gamification-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: #F59E0B; color: white; border-radius: 50%; box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3); }
.gamification-text { font-size: 14px; font-weight: 800; color: #92400E; letter-spacing: -0.01em; }

.time-lapse-container { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; -webkit-overflow-scrolling: touch; border-bottom: 1px solid var(--border-color); }
.time-lapse-container::-webkit-scrollbar { display: none; }

.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
@media (max-width: 480px) { .swot-grid { grid-template-columns: 1fr; } }

.swot-card { padding: 16px; border-radius: var(--radius-md); border: 1px solid; display: flex; flex-direction: column; gap: 8px; }
.swot-strength { background: var(--success-bg); border-color: #A7F3D0; }
.swot-focus { background: var(--warning-bg); border-color: #FDE68A; }
.swot-header { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.swot-strength .swot-header { color: var(--success-text); }
.swot-focus .swot-header { color: var(--warning-text); }
.swot-title { font-size: 15px; font-weight: 800; color: var(--text-main); line-height: 1.2; }
.swot-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* AI Forecast Modern Card */
.ai-forecast-card { 
    margin-top: 20px; 
    padding: 20px; 
    border-radius: var(--radius-lg); 
    background: linear-gradient(135deg, #F5F3FF 0%, #EEF2FF 100%); 
    border: 1px solid #DDD6FE; 
    display: flex; 
    flex-direction: column; 
    gap: 16px; 
    box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.12); 
    position: relative; 
    overflow: hidden; 
}
.ai-forecast-card::before { 
    content: ''; 
    position: absolute; 
    top: -20px; 
    right: -20px; 
    width: 120px; 
    height: 120px; 
    background: rgba(139, 92, 246, 0.15); 
    filter: blur(25px); 
    border-radius: 50%; 
    z-index: 0; 
}
.ai-forecast-header { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; border-bottom: 1px dashed #C4B5FD; padding-bottom: 12px; }
.ai-icon-wrapper { 
    width: 44px; 
    height: 44px; 
    border-radius: 12px; 
    background: linear-gradient(135deg, var(--purple-ai) 0%, #4F46E5 100%); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    flex-shrink: 0; 
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3); 
}
.ai-title-wrap { display: flex; flex-direction: column; }
.ai-title { font-size: 15px; font-weight: 800; color: #4338CA; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.ai-subtitle { font-size: 11px; font-weight: 600; color: var(--purple-ai); }
.ai-body { display: flex; flex-direction: row; gap: 16px; position: relative; z-index: 1; align-items: center; }
.ai-metric-box { background: rgba(255, 255, 255, 0.8); border: 1px solid #E0E7FF; padding: 12px; border-radius: var(--radius-md); text-align: center; min-width: 90px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.ai-metric-val { font-size: 20px; font-weight: 800; color: #3730A3; line-height: 1.1; }
.ai-metric-lbl { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }
.ai-text { flex: 1; font-size: 13px; color: var(--text-main); line-height: 1.6; font-weight: 500; }
.ai-text strong { color: #312E81; font-weight: 800; background: rgba(199, 210, 254, 0.4); padding: 2px 6px; border-radius: 4px; }

/* ==========================================
   TAB PESAN: CHAT & QUICK REPLIES
   ========================================== */
.chat-container { background: #F8FAFC; border: 1px solid var(--border-color); border-radius: var(--radius-md); display: flex; flex-direction: column; height: 420px; overflow: hidden; }
.chat-history { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.chat-row { display: flex; flex-direction: column; max-width: 85%; }
.chat-row.ortu { align-self: flex-end; align-items: flex-end; }
.chat-row.guru { align-self: flex-start; align-items: flex-start; }

.chat-bubble { padding: 12px 16px; font-size: 13.5px; line-height: 1.5; box-shadow: var(--shadow-sm); position: relative; word-wrap: break-word; }
.chat-row.ortu .chat-bubble { background: var(--primary); color: #fff; border-radius: 16px 16px 4px 16px; }
.chat-row.guru .chat-bubble { background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 16px 16px 16px 4px; }
.chat-meta { font-size: 11px; color: var(--text-light); margin-top: 6px; font-weight: 500; display: flex; align-items: center; gap: 4px; }

.chat-input-area { background: var(--bg-surface); padding: 12px; border-top: 1px solid var(--border-color); }
.quick-replies { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px dashed var(--border-color); -webkit-overflow-scrolling: touch; }
.quick-replies::-webkit-scrollbar { display: none; }

/* ==========================================
   TAB RIWAYAT: TIMELINE
   ========================================== */
.timeline { display: flex; flex-direction: column; gap: 16px; position: relative; padding-left: 12px; }
.timeline::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 0; width: 2px; background: #E2E8F0; border-radius: 2px; }
.timeline-item { position: relative; padding-left: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -5px; top: 6px; width: 12px; height: 12px; background: var(--bg-surface); border: 2px solid var(--primary); border-radius: 50%; z-index: 2; box-shadow: 0 0 0 3px var(--bg-body); }
.timeline-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 12px 16px; box-shadow: var(--shadow-sm); transition: transform 0.2s, border-color 0.2s; }
.timeline-card:hover { transform: translateY(-1px); border-color: #CBD5E1; }
.timeline-date { font-size: 11px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-surah { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.timeline-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================
   TATA LETAK UTAMA: LAYOUT, NAVIGASI & LOGIN
   ========================================== */
.view-section { display: none; width: 100%; min-height: 100vh; background: var(--bg-body); }
.view-section.active { display: block; animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1); }

.tab-content { display: none; animation: fadeIn 0.3s ease-out; }
.tab-content.active { display: block; }
.tab-content.slide-left { animation: slideInLeft 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.tab-content.slide-right { animation: slideInRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* Z-Index diatur untuk mencegah bentrok */
.app-bar { position: sticky; top: 0; left: 0; width: 100%; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-color); padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; z-index: 40; }
.app-bar-brand { font-size: 16px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }

.dashboard-container { max-width: 600px; margin: 0 auto; padding: 20px 16px calc(var(--bottom-nav-height) + 20px); display: flex; flex-direction: column; gap: 20px; min-height: 100vh; }

/* Menjamin Bottom Nav selalu ada di atas elemen halaman tapi di bawah Modal */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-height); background: var(--bg-surface); border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: center; z-index: 100; box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.05); padding-bottom: env(safe-area-inset-bottom); }

.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-light); font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; height: 100%; -webkit-tap-highlight-color: transparent; position: relative; }
.nav-item:hover { color: var(--text-muted); }
.nav-item.active { color: var(--primary); }

.nav-item i, .nav-item svg { width: 22px; height: 22px; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.nav-item.active i, .nav-item.active svg { transform: scale(1.15); stroke-width: 2.5; }

.login-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%); }
.login-card { width: 100%; max-width: 380px; padding: 48px 32px; text-align: center; background: var(--bg-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.8); }
.safety-card { width: 100%; max-width: 380px; padding: 32px 24px; text-align: center; background: var(--bg-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.8); border-top: 4px solid var(--danger); margin-bottom: 24px; }
.logo-box { width: 80px; height: 80px; background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 100%); border-radius: 20px; margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 8px 15px -3px rgba(37, 99, 235, 0.3); }

/* ==========================================
   BANNER & NOTIFIKASI SPESIAL (GLASSMORPHISM)
   ========================================== */
.billing-banner { 
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.8) 0%, rgba(254, 226, 226, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #FECACA; 
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-md); 
    padding: 16px; 
    display: none; 
    align-items: flex-start; 
    flex-direction: column; 
    gap: 12px; 
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.1), 0 4px 6px -4px rgba(239, 68, 68, 0.05);
    animation: slideDownGlass 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: -4px;
}
.billing-banner::before { content: ''; position: absolute; top: -20px; right: -20px; width: 80px; height: 80px; background: rgba(239, 68, 68, 0.1); filter: blur(15px); border-radius: 50%; z-index: 0; }
.billing-banner.show { display: flex; }
.billing-content-wrapper { display: flex; align-items: flex-start; gap: 12px; width: 100%; position: relative; z-index: 1;}
.billing-content { flex: 1;}
.billing-content h4 { font-size: 14px; color: var(--danger-text); margin-bottom: 4px; font-weight: 700; display: flex; align-items: center; gap: 6px;}
.billing-content p { font-size: 12px; color: var(--danger-text); opacity: 0.95; line-height: 1.5; font-weight: 500;}
.billing-amount { font-size: 18px; font-weight: 800; color: #991B1B; margin-top: 8px; display: block; }
.billing-denda { font-size: 11px; font-weight: 600; color: #DC2626; background: rgba(239, 68, 68, 0.1); padding: 4px 8px; border-radius: 12px; display: inline-block; margin-top: 6px; border: 1px solid rgba(239, 68, 68, 0.2); }

.glass-banner { 
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.5); 
    border-radius: var(--radius-lg); 
    padding: 20px; 
    text-align: center; 
    position: relative; 
    overflow: hidden; 
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(37, 99, 235, 0.1); 
}
.circular-chart { display: block; margin: 0 auto; max-width: 72px; max-height: 72px; }
.circle-bg { fill: none; stroke: #E2E8F0; stroke-width: 3.5; }
.circle { fill: none; stroke-width: 3.5; stroke-linecap: round; transition: stroke-dasharray 1s ease-out; }
.percentage { fill: var(--text-main); font-family: 'Inter', sans-serif; font-weight: 800; font-size: 9px; text-anchor: middle; dominant-baseline: central; }

.glass-notif { 
    background: rgba(255, 255, 255, 0.7); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.8); 
    border-radius: var(--radius-md); 
    padding: 12px 16px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15); 
    animation: slideDownGlass 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
    position: relative; 
    overflow: hidden; 
    margin-bottom: 16px; 
}
.glass-notif::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 100%); }

.toast { position: fixed; top: 24px; right: 24px; left: 24px; margin: 0 auto; max-width: 340px; padding: 12px 16px; background: #1E293B; color: #FFFFFF; font-size: 13px; font-weight: 500; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; transform: translateY(-150%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 3000; }
@media (min-width: 640px) { .toast { left: auto; top: 24px; right: 24px; transform: translateY(-150%); } }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--primary); }
.toast.show { transform: translateY(0); }

/* ==========================================
   FITUR KAKAK BERADIK (MULTI-CHILD)
   ========================================== */
.sibling-selector-wrapper { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 16px; margin-bottom: -4px; box-shadow: var(--shadow-sm); display: none; animation: fadeIn 0.4s ease-out; }
.sibling-chips-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.sibling-chips-scroll::-webkit-scrollbar { display: none; }

/* ==========================================
   GALERI LENCANA & TROPHY
   ========================================== */
.trophy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.trophy-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: space-between; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: var(--shadow-sm); min-height: 164px; }
.trophy-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #CBD5E1; }
.trophy-card.locked { filter: grayscale(1); opacity: 0.6; background: #F8FAFC; border: 1px dashed #CBD5E1; }

.trophy-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; position: relative; }
.trophy-card.unlocked .trophy-icon { background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%); color: #D97706; box-shadow: 0 0 15px rgba(245, 158, 11, 0.4), inset 0 2px 4px rgba(255,255,255,0.8); border: 2px solid #FBBF24; }
.trophy-card.locked .trophy-icon { background: #F1F5F9; color: var(--text-light); border: 2px solid #E2E8F0; }

.trophy-title { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 6px; line-height: 1.3; }
.trophy-date { font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 4px 10px; background: #F1F5F9; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 4px; }

.btn-twibbon-mini { margin-top: 16px; background: var(--bg-surface); border: 1px solid var(--primary); color: var(--primary); padding: 8px 12px; font-size: 12px; font-weight: 600; border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 6px; width: 100%; justify-content: center; box-shadow: var(--shadow-sm); }
.btn-twibbon-mini:hover { background: var(--primary-light); box-shadow: var(--shadow-md); }

/* ==========================================
   MODAL & TWIBBON STUDIO
   ========================================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); z-index: 2000; display: none; justify-content: center; align-items: center; padding: 20px; opacity: 0; transition: opacity 0.2s ease; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-container { width: 100%; max-width: 400px; transform: scale(0.95); transition: transform 0.2s ease; background: var(--bg-body); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 90vh; }
.modal-overlay.active .modal-container { transform: scale(1); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: var(--bg-surface); flex-shrink: 0;}
.modal-body { padding: 20px; overflow-y: auto; flex: 1;}

.twibbon-preview-area { width: 100%; aspect-ratio: 1/1; background: #E2E8F0; border-radius: var(--radius-md); border: 2px dashed #94A3B8; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; margin-bottom: 8px; touch-action: none; }
.twibbon-preview-area canvas { width: 100%; height: 100%; cursor: move; }
.file-upload-btn { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px); color: white; padding: 8px 16px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); z-index: 10; }

.zoom-slider-container { display: none; margin-bottom: 20px; background: var(--bg-surface); padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }

/* CUSTOM UI SLIDER (ENTERPRISE STANDARD) */
.zoom-slider { 
    -webkit-appearance: none;
    width: 100%; 
    height: 6px;
    background: #E2E8F0;
    border-radius: var(--radius-full);
    outline: none;
    transition: background 0.2s;
}
.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 2px solid #FFFFFF;
    transition: transform 0.1s, box-shadow 0.2s;
}
.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}
.zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 2px solid #FFFFFF;
    transition: transform 0.1s, box-shadow 0.2s;
}
.zoom-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* ==========================================
   SYSTEM OVERLAYS & SCROLLBAR
   ========================================== */
.system-update-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); display: none; justify-content: center; align-items: center; z-index: 99999; color: white; flex-direction: column; text-align: center; }
.system-update-overlay.active { display: flex; }
.loader-spinner { width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.1); border-left-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 24px; }

#maintenance-overlay { z-index: 100000; background: #0F172A; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: white; padding: 20px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

/* ==========================================
   KEYFRAME ANIMATIONS
   ========================================== */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(0.9) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes slideDownGlass { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.highlight-pulse { animation: pulseBorder 2s infinite; border-color: var(--primary) !important; }
@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.pulse-animation i, .pulse-animation svg { animation: pulse-ai 2s infinite; }
@keyframes pulse-ai {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}