:root {
    --bg-color: #F2F2F7;
    --card-color: #FFFFFF;
    --text-primary: #000000;
    --accent: #007AFF;
    --danger: #FF3B30;
    --success: #34C759;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: 0.4s ease;
    margin: 0; min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.wrapper { max-width: 430px; margin: 0 auto; padding: 40px 20px; padding-bottom: 120px; }

/* HEADER & SCHEDULE */
.header-section { text-align: center; margin-bottom: 30px; }
.logo-container {
    width: 80px; height: 80px; margin: 0 auto 15px;
    background: var(--card-color); border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.grid-system {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px; margin-bottom: 25px;
}
.grid-item {
    background: var(--card-color); padding: 16px 8px;
    border-radius: 18px; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: transform 0.2s ease;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.grid-item:active { transform: scale(0.96); }

.map-frame {
    width: 100%;
    height: 100%;
    border: 0;
    filter: grayscale(20%); /* Sedikit abu-abu biar elegan */
    transition: filter 0.5s ease;
}

/* Style Peta Saat Mode Gelap (Invert Colors) */
body.dark-mode .map-frame {
    /* Trik: Balik warna putih jadi hitam, lalu putar hue agar laut tetap biru */
    filter: invert(90%) hue-rotate(180deg) brightness(0.9) contrast(1.1);
}

/* Biar Container Kartu Lokasi Mengikuti Variabel Tema */
.location-card {
    background-color: var(--card-color);
    transition: background-color 0.4s ease;
}

/* LIGHTBOX & MODALS */
.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95);
    z-index: 2000; display: none; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease;
}
.lightbox-active { display: flex; opacity: 1; }
.lightbox-content {
    max-width: 90%; max-height: 80vh; border-radius: 8px;
    transform: scale(0.9); transition: transform 0.3s;
}
.lightbox-active .lightbox-content { transform: scale(1); }
.lightbox-close {
    position: absolute; top: 20px; right: 20px; width: 40px; height: 40px;
    background: rgba(255,255,255,0.2); border-radius: 50%; color: white;
    display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer;
}

.dock-container {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(25px);
    padding: 5px 6px; border-radius: 100px; border: 1px solid rgba(0,0,0,0.05);
    display: flex; align-items: center; gap: 5px; box-shadow: 0 10px 40px rgba(0,0,0,0.1); z-index: 50;
}
.dock-btn { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.3rem; color: #8E8E93; transition: 0.3s; }
.dock-btn.main-trigger { color: var(--text-primary); background: rgba(0,0,0,0.05); font-size: 1.1rem; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none;
    align-items: flex-end; z-index: 1000; backdrop-filter: blur(4px);
}
.modal-sheet {
    background: var(--card-color); width: 100%; border-radius: 30px 30px 0 0;
    padding: 30px 25px; transform: translateY(100%); transition: transform 0.3s;
    padding-bottom: 50px; max-height: 90vh; overflow-y: auto;
}
.modal-visible { transform: translateY(0); }
.action-btn {
    width: 100%; padding: 16px; border-radius: 16px; margin-bottom: 10px;
    display: flex; align-items: center; gap: 15px; font-weight: 600;
    background: var(--bg-color); color: var(--text-primary); border: none; font-family: inherit;
}
.action-btn.support { background: #FFF0F0; color: #FF3B30; }

/* CARD & MENU */
.warta-card {
    background: var(--card-color); border-radius: 20px; padding: 18px 20px;
    display: flex; align-items: center; gap: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    text-decoration: none; color: inherit; transition: 0.2s; margin-bottom: 12px;
}
.grid-half { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.mini-card {
    background: var(--card-color); border-radius: 20px; padding: 16px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    color: inherit; transition: 0.2s; position: relative;
}
.live-dot {
    width: 8px; height: 8px; background: #34C759; border-radius: 50%;
    position: absolute; top: 15px; right: 15px; animation: blink 1.5s infinite;
}
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* FORMS */
.form-group { margin-bottom: 15px; text-align: left; }
.form-label { font-size: 12px; font-weight: 700; color: #8E8E93; margin-bottom: 6px; display: block; text-transform: uppercase; }
.ios-input {
    width: 100%; background: var(--bg-color); border: none; padding: 14px 16px;
    border-radius: 12px; font-size: 14px; color: var(--text-primary);
    font-family: inherit; outline: none; box-sizing: border-box;
}
.ios-input:focus { box-shadow: 0 0 0 2px var(--accent); }
.file-upload-wrapper input[type=file] { padding: 10px; background: var(--bg-color); width: 100%; border-radius: 12px; }
.form-divider { height: 1px; background: #e5e5ea; margin: 30px 0; position: relative; }

/* ATM CARD */
.atm-card {
    background: linear-gradient(135deg, #007AFF 0%, #00C6FF 100%);
    border-radius: 20px; padding: 25px; color: white; position: relative;
    overflow: hidden; box-shadow: 0 10px 30px rgba(0, 122, 255, 0.3); margin-bottom: 20px;
}
.atm-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); pointer-events: none;
}
.chip {
    width: 40px; height: 30px; background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    border-radius: 6px; margin-bottom: 20px; opacity: 0.8;
}

/* LIST MENU ITEM (INFO/PDF) */
.menu-list-btn {
    width: 100%; text-align: left; padding: 16px; background: var(--bg-color); 
    border-radius: 16px; margin-bottom: 10px; font-weight: 600; display: flex; 
    align-items: center; justify-content: space-between; color: var(--text-primary);
}
.btn-sub-text { font-size: 11px; color: #8E8E93; font-weight: normal; margin-top: 2px;}

/* --- NEW MODERN CALENDAR STYLE --- */
.cal-modern-list { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; /* Jarak antar item dirapatkan (sebelumnya 20px) */
}

.cal-modern-item {
    display: flex; 
    gap: 15px; /* Jarak widget tanggal ke teks */
    align-items: flex-start; 
    padding-bottom: 12px; /* Padding bawah dikurangi biar mepet */
    
    /* Garis pembatas (separator) yang keren (putus-putus halus) */
    border-bottom: 1px dashed #cbd5e1; 
    position: relative;
}
.cal-modern-item:last-child { border-bottom: none; }

/* Widget Tanggal Kiri */
.cal-date-widget {
    width: 60px; height: 60px; border-radius: 16px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    background: #F3F4F6; /* Default Gray */
}
.cal-date-widget.active { background: #EFF6FF; } /* Blue bg for active */

.cal-day-name { font-size: 10px; font-weight: 700; color: #9CA3AF; text-transform: uppercase; line-height: 1; margin-bottom: 2px; }
.cal-date-num { font-size: 22px; font-weight: 800; color: #374151; line-height: 1; }
.cal-month-name { font-size: 10px; font-weight: 700; color: #9CA3AF; text-transform: uppercase; line-height: 1; margin-top: 2px; }

/* Warna khusus widget aktif */
.cal-date-widget.active .cal-day-name, 
.cal-date-widget.active .cal-month-name { color: #60A5FA; }
.cal-date-widget.active .cal-date-num { color: #2563EB; }

/* Konten Kanan */
.cal-content { flex: 1; }
.cal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.cal-desc { font-size: 13px; color: #6B7280; font-weight: 400; margin-bottom: 8px; line-height: 1.4; }
.cal-time-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: #F3F4F6; padding: 4px 10px; border-radius: 8px;
    font-size: 11px; font-weight: 600; color: #6B7280;
}
.cal-date-widget.active ~ .cal-content .cal-time-badge { background: #EFF6FF; color: #2563EB; }

/* Separator Line (Garis putus-putus konteks hari ini) */
.cal-separator {
    display: flex; align-items: center; gap: 15px; margin: 10px 0 25px 0; opacity: 0.6;
}
.cal-line { height: 1px; flex: 1; background-image: linear-gradient(to right, #ccc 50%, transparent 50%); background-size: 8px 1px; }
.cal-now-text { font-size: 10px; font-family: 'Space Mono', monospace; color: #8E8E93; }

/* DASHBOARD MODERN */
.dash-header {
    background: linear-gradient(135deg, #1c1c1e 0%, #3a3a3c 100%);
    color: white; padding: 25px 20px; border-radius: 24px; margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); text-align: left;
}
.dash-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.stat-card {
    background: var(--card-color); padding: 15px; border-radius: 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); text-align: left;
}
.stat-value { font-size: 20px; font-weight: 800; display: block; margin-bottom: 2px; }
.stat-label { font-size: 10px; color: #8E8E93; font-weight: 600; text-transform: uppercase; }
.dash-menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.dash-menu-item {
    background: var(--card-color); border-radius: 16px; aspect-ratio: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: 0.2s; cursor: pointer;
}
.dash-menu-item.active { background: var(--accent); color: white; }
.dash-menu-item i { font-size: 18px; margin-bottom: 6px; }
.dash-menu-item span { font-size: 9px; font-weight: 700; }
.crud-container { background: var(--card-color); border-radius: 24px; padding: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); min-height: 300px; }

/* DEVOTIONAL CALENDAR */
.dev-calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 15px;
}
.dev-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 12px; font-weight: 700; background: var(--bg-color);
    color: var(--text-primary); transition: 0.2s; cursor: pointer;
}
.dev-day.locked { opacity: 0.3; pointer-events: none; background: #e5e5ea; }
.dev-day.today { background: var(--accent); color: white; border: 2px solid rgba(255,255,255,0.5); }
.dev-day.has-content { border: 1px solid var(--accent); color: var(--accent); background: white; }
.dev-day:active { transform: scale(0.9); }

/* UTILS */
.hidden { display: none !important; }
.view-section { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.result-card {
    background: var(--card-color); border-radius: 16px; padding: 16px;
    margin-top: 15px; border: 1px solid rgba(0,0,0,0.05); display: none;
}
.result-found { border-left: 4px solid #34C759; }
.result-not-found { border-left: 4px solid #FF3B30; }
.pdf-frame { width: 100%; height: 65vh; border-radius: 12px; border: none; background: #f0f0f0; }

/* SEGMENTED CONTROL */
.segmented-control {
    display: flex; background: var(--bg-color); padding: 4px; border-radius: 12px;
    margin-bottom: 25px; position: relative; gap: 5px;
}
.segment-btn {
    flex: 1; padding: 10px; border: none; background: transparent; 
    color: #8E8E93; font-weight: 600; font-size: 13px; border-radius: 8px;
    transition: 0.3s; z-index: 2; cursor: pointer; display: flex;
    align-items: center; justify-content: center; gap: 6px;
}
.segment-btn.active { background: var(--card-color); color: var(--text-primary); shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* --- ORGANISASI RE-DESIGN (CURVED & COLORFUL) --- */
.org-tree-container {
    padding: 30px 15px;
    /* Background Gradient Halus (Tidak Polos) */
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

/* Hiasan Background Abstrak (Opsional) */
.org-tree-container::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 150px; height: 150px; background: rgba(59, 130, 246, 0.05);
    border-radius: 50%; z-index: 0;
}

.org-layout-wrapper {
    display: flex;
    justify-content: center; /* Pusatkan konten */
    gap: 20px; /* Jarak aman antara Pembimbing & Ketua */
    position: relative; z-index: 1;
}

/* --- KOLOM KIRI: PEMBIMBING --- */
.org-advisor-area {
    display: flex; flex-direction: column;
    justify-content: flex-start;
    padding-top: 0; /* Sejajar dengan Ketua */
}

/* Label Spesial Pembimbing */
.advisor-badge {
    background: #f1f5f9; color: #64748b;
    font-size: 8px; font-weight: 800; text-transform: uppercase;
    padding: 4px 8px; border-radius: 20px;
    text-align: center; margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}

/* --- KOLOM KANAN: STRUKTUR UTAMA --- */
.org-main-stack {
    display: flex; flex-direction: column; align-items: center;
}

.org-level {
    display: flex; justify-content: center; gap: 10px;
    position: relative; margin-bottom: 35px; /* Jarak vertikal antar level */
}

/* --- GARIS KONEKTOR MELENGKUNG (CURVED LINES) --- */
/* Garis Vertikal Pendek Turun dari Kartu */
.org-level::after {
    content: ''; position: absolute; bottom: -18px; left: 50%;
    width: 2px; height: 18px; background: #cbd5e1; transform: translateX(-50%);
}
.org-level:last-child::after { display: none; }

/* Garis Cabang Lengkung untuk Anak (Sek/Ben) */
.org-level.multi-node { align-items: flex-start; padding-top: 20px; }

/* Garis Horizontal Top untuk cabang */
.org-level.multi-node::before {
    content: ''; position: absolute; top: 0; 
    left: 50%; transform: translateX(-50%);
    width: 80%; /* Lebar cakupan cabang */
    height: 20px; /* Tinggi lengkungan */
    border-top: 2px solid #cbd5e1;
    border-left: 2px solid #cbd5e1;
    border-right: 2px solid #cbd5e1;
    border-radius: 15px 15px 0 0; /* Membuat sudut melengkung */
    z-index: 0;
}

/* Hapus garis default lama */
.org-main-stack > .org-level:first-child::after { height: 35px; bottom: -35px; } 

/* --- KARTU PENGURUS (CARD STYLE) --- */
.org-card-modern {
    background: white;
    width: 90px; /* Ukuran pas di HP */
    padding: 12px 8px;
    border-radius: 16px;
    text-align: center;
    position: relative; z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #fff;
    transition: transform 0.2s;
}
.org-card-modern:active { transform: scale(0.95); }

/* Styling Khusus per Role */
/* 1. Pembimbing (Elegan Abu) */
.org-card-modern.advisor { 
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}
/* 2. Ketua & Wakil (Standout Biru) */
.org-card-modern.leader { 
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    border-bottom: 3px solid #3b82f6; 
}
/* 3. Staff (Simpel Hijau) */
.org-card-modern.staff { 
    border-bottom: 3px solid #10b981; 
}

/* Avatar Styling */
.org-avatar-img {
    width: 38px; height: 38px;
    border-radius: 10px; /* Rounded Square modern */
    object-fit: cover;
    margin: 0 auto 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    background: #e2e8f0;
}
.org-avatar-initial {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #f1f5f9; color: #64748b;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; margin: 0 auto 6px;
    border: 1px solid #e2e8f0;
}

/* Teks Nama & Jabatan */
.org-role-text {
    font-size: 7px; font-weight: 800; text-transform: uppercase;
    color: #94a3b8; letter-spacing: 0.5px; margin-bottom: 2px;
}
.org-name-text {
    font-size: 9px; font-weight: 700; color: #1e293b;
    line-height: 1.25; word-wrap: break-word;
}
.leader .org-role-text { color: #3b82f6; } /* Biru untuk ketua */
.advisor .org-name-text { font-size: 10px; } /* Nama pembimbing sedikit lebih besar */

/* --- 2. MODERN PROKER LIST (USER SIDE) --- */
.proker-modern-item {
    background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px;
    border: 1px solid #f1f5f9; position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02); transition: all 0.2s;
}
.proker-modern-item:active { transform: scale(0.98); background: #f8fafc; }
.proker-date-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 50px; height: 50px; background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.pk-month { font-size: 9px; font-weight: 800; text-transform: uppercase; color: #94a3b8; }
.pk-year { font-size: 11px; font-weight: 700; color: #475569; }
.proker-info { flex: 1; }
.proker-title { font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.proker-status { 
    font-size: 9px; display: inline-flex; align-items: center; gap: 4px; 
    background: #ecfdf5; color: #059669; padding: 2px 8px; border-radius: 100px; font-weight: 600; 
}

/* --- 3. PROFESSIONAL CALENDAR REALTIME SEPARATOR --- */
.live-timeline-separator {
    display: flex; align-items: center; justify-content: center;
    margin: 25px 0; position: relative;
}
.live-line {
    flex: 1; height: 1px; background: #e2e8f0;
}
.live-badge-capsule {
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px);
    border: 1px solid #fee2e2; padding: 6px 16px; border-radius: 50px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15); z-index: 2;
}
.live-pulse-dot {
    width: 8px; height: 8px; background: #ef4444; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red 2s infinite;
}
#live-clock-text {
    font-size: 11px; font-weight: 700; color: #dc2626; font-family: 'Space Mono', monospace;
}
@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Tombol Kembali Model Kapsul Kaca */
.glass-back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 6px; /* Padding kanan lebih kecil karena ada gap */
    padding-right: 14px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.glass-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: rgba(255, 255, 255, 0.4);
}

.glass-back-btn:active {
    transform: scale(0.95);
}

/* Penyesuaian Dark Mode untuk Glass Card Login */
@media (prefers-color-scheme: dark) {
    #view-login input {
        background-color: rgba(0, 0, 0, 0.3) !important;
        border-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
    #view-login input:focus {
        background-color: rgba(0, 0, 0, 0.5) !important;
        border-color: rgba(59, 130, 246, 0.5);
    }
    
    /* Warna teks icon di dark mode */
    .glass-back-btn i { color: white; }
    .glass-back-btn span.text-\[var\(--text-primary\)\] { color: white; }
    
    /* Background kartu login di dark mode */
    #view-login .max-w-\[340px\] {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.05);
    }
}

/* --- MODERN IOS SWITCH --- */
.switch-ios {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch-ios input { opacity: 0; width: 0; height: 0; }

.slider-ios {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e2e8f0; /* Abu-abu saat OFF */
    transition: .4s;
    border-radius: 34px;
}

.slider-ios:before {
    position: absolute; content: "";
    height: 20px; width: 20px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1); /* Efek membal halus */
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider-ios {
    background-color: #4f46e5; /* Indigo/Ungu saat ON (Sesuai tema Dashboard) */
}

input:checked + .slider-ios:before {
    transform: translateX(20px);
}

.tech-badge {
    display: flex; flex-direction: column; items-center: center; justify-content: center;
    padding: 10px; border-radius: 12px; border-width: 1px; 
    transition: transform 0.2s; text-align: center;
}
.tech-badge:hover { transform: translateY(-2px); }