/* =========================================================================
   CONFIG VARIASI WARNA (DEFAULT: GEMINI DARK MODE)
   ========================================================================= */
:root {
    --bg-global: #131314;
    --bg-header: #0a1128;      /* NAVY BLUE PEKAT (BIRU DONGKER TUA KUNCI) */
    --border-line: #2f2f30;
    --text-main: #e3e3e3;
    --text-muted: #8e918f;
    --text-white: #ffffff;
    
    /* Neon Components & Badges */
    --neon-cyan: #00e5ff;
    --neon-green: #39ff14;
    --neon-red: #ff3d00;
    --neon-orange: #ff9800;
    
    /* Container Specifics */
    --bg-card-box: #1e1f20;
    --bg-input-field: #131314;
    --bg-card-tugas: #1e1f20;
    --text-card-tugas: #e3e3e3;
    --border-card-tugas: #474749;
    
    /* Progress Bar Theme Color */
    --fill-create: #2196F3;
    --fill-edit: #ff9800;
    --fill-qc: #4CAF40;
    --progress-bg: #2d2d30;
}

/* =========================================================================
   VARIABEL TEMA TERANG HIGH CONTRAST (HITAM PEKAT, DONGKER & HIJAU TUA)
   ========================================================================= */
body.light-mode {
    --bg-global: #e9eef6;      /* Abu-abu semen teduh Gemini Light */
    --bg-header: #0a1128;      /* KUNCI FIXED: Header tetap Navy Blue pekat */
    --border-line: #b0bec5;    
    --text-main: #0a192f;      /* Teks utama Biru Dongker Tua Pekat */
    --text-muted: #263238;     
    --text-white: #000000;     /* Kalimat judul dipaksa HITAM PEKAT LEGAM */
    
    /* Neon Penyesuaian Mode Terang Kontras Tinggi */
    --neon-cyan: #0b57d0;      /* Biru Google Royal untuk menu aktif */
    --neon-green: #0b6623;     /* Hijau Tua Pekat Murni */
    --neon-red: #b71c1c;       
    --neon-orange: #e65100;
    
    /* Box & Penugasan Mode Terang */
    --bg-card-box: #ffffff;
    --bg-input-field: #f1f3f4;
    --bg-card-tugas: #ffffff;
    --text-card-tugas: #0a192f;
    --border-card-tugas: #b0bec5;
    
    /* Progress Bar */
    --progress-bg: #cbd5e1;
}

/* =========================================================================
   STYLE IMPLEMENTASI VARIABEL GLOBAL
   ========================================================================= */
body { 
    margin: 0; 
    background: var(--bg-global); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    color: var(--text-main); 
    -webkit-font-smoothing: antialiased;
    transition: background 0.2s ease, color 0.2s ease;
}

/* MAIN HEADER: NAVY BLUE TETAP DI KEDUA TEMA */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-line);
    box-sizing: border-box;
}
.header-logo {
    display: flex;
    align-items: center;
    min-width: 0;
}
.logo-image {
    max-height: 32px;
    width: auto;
    display: block;
    object-fit: contain;
}
.profile-area { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.user-badge { 
    background-color: rgba(0, 229, 255, 0.08); 
    color: #00e5ff; 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 13px; 
    font-weight: 500; 
    border: 1px solid rgba(0, 229, 255, 0.3);
}
.btn-logout, .btn-theme-toggle { 
    background: transparent; 
    padding: 6px; 
    font-size: 14px; 
    color: #cbd5e0;
    border: none;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}
.btn-logout:hover { color: var(--neon-red); }
.btn-theme-toggle:hover { transform: scale(1.1); color: #ffffff; }
.mobile-text { display: inline; }

/* KEPALA & TAB MENU */
.kepala { 
    display: block; 
    padding: 15px 20px 0 20px; 
    border-bottom: 1px solid var(--border-line); 
    background: transparent; 
}
.tab-navigation { 
    display: flex; 
    justify-content: flex-start; 
    gap: 16px;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.tab-btn {
    background: transparent; 
    padding: 10px 4px; 
    border: none;
    cursor: pointer;
    font-size: 14px; 
    font-weight: 600; 
    color: var(--text-muted); 
    position: relative;
    transition: color 0.2s ease;
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--neon-cyan); background: transparent; }
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--neon-cyan); 
}

/* AREA KONTEN DATA CONTAINER */
.data-container-dashboard {
    padding: 20px 150px;
    height: 72vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-content h3 {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-white);
    margin-top: 0;
    margin-bottom: 15px;
    border-left: 3px solid var(--neon-cyan);
    padding-left: 8px;
}

/* =========================================================================
   COLLAPSIBLE SILSILAH & KARTU PENUGASAN MINIMALIS
   ========================================================================= */
.silsilah-group { 
    background: transparent; 
    border-radius: 0; 
    margin-bottom: 0; 
    overflow: hidden; 
    box-shadow: none;
    border-bottom: 1px solid var(--border-line);
}
.silsilah-header { 
    background: transparent; 
    padding: 15px 0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: pointer; 
    user-select: none; 
}
.silsilah-title { font-size: 15px; font-weight: bold; color: var(--neon-cyan); }
.silsilah-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.silsilah-content { display: none; padding: 10px 0 20px 0; background: transparent; }
.silsilah-content.open { display: block; }

/* Grid Beban Tugas */
.grid-tugas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card-tugas { 
    background: var(--bg-card-tugas); 
    color: var(--text-card-tugas); 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid var(--border-card-tugas);
    border-left: 5px solid var(--neon-green); 
    box-shadow: none; 
    cursor: pointer; 
    transition: transform 0.2s, border-color 0.2s; 
}
.card-tugas:hover { transform: translateY(-2px); border-color: var(--neon-cyan); }

/* Badge Fleksibel Status */
.badge { font-weight: bold; padding: 2px 6px; border-radius: 4px; color: white; font-size: 10px; display: inline-block; }
.bg-overdue { background: var(--neon-red) !important; } 
.bg-doing { background: var(--neon-orange) !important; } 
.bg-ontime { background: var(--neon-green) !important; }

/* =========================================================================
   TAB GRAFIK PROGRESS BATANG GLOBAL (ALA GEMINI)
   ========================================================================= */
.grid-grafik { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.card-grafik { 
    background: var(--bg-card-box); 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: none;
    border: 1px solid var(--border-line);
}
.card-grafik strong { color: var(--neon-cyan) !important; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-top: 10px; font-weight: 500; color: var(--text-main); }
.progress-bar-container { background: var(--progress-bg); border-radius: 10px; height: 16px; width: 100%; overflow: hidden; margin: 4px 0 10px 0; }
.progress-bar-fill { height: 100%; width: 0%; text-align: right; padding-right: 8px; font-size: 11px; designers: inline-block; line-height: 16px; color: white; font-weight: bold; transition: width 0.5s ease-in-out; box-sizing: border-box; }

.fill-create { background: var(--fill-create); }
.fill-edit { background: var(--fill-edit); }
.fill-qc { background: var(--fill-qc); }

/* MEDIA QUERIES */
@media screen and (max-width: 768px) {
    .tab-btn { font-size: 13px; }
    .main-header { padding: 10px 12px; }
    .kepala, .data-container-dashboard { padding-left: 12px; padding-right: 12px; }
    .user-badge { padding: 6px 10px; max-width: 80px; }
    .data-container-dashboard { padding: 20px;}
}

    /* ==========================================
   🗓️ GOOGLE CALENDAR STYLE TIMELINE PROKER
   ========================================== */
.proker-calendar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    color: #1e293b;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: all 0.3s ease;
}

/* Penyesuaian Otomatis jika dalam Light Mode / Dark Mode Sistem Anda */
body.light-mode .proker-calendar-card {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

body:not(.light-mode) .proker-calendar-card {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

.proker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.proker-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    letter-spacing: -0.2px;
}

body:not(.light-mode) .proker-header h3 {
    color: #f1f5f9;
}

.proker-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px 6px;
    border-radius: 10px;
}

body:not(.light-mode) .proker-nav {
    background: #0f172a;
}

.proker-nav button {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.proker-nav button:hover {
    background: #00adb5;
    color: #ffffff;
    border-color: #00adb5;
}

body:not(.light-mode) .proker-nav button {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

#currentProkerMonthLabel {
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    padding: 0 10px;
}

body:not(.light-mode) #currentProkerMonthLabel {
    color: #38bdf8;
}

/* Container Tabel Scrollbar Halus */
.timeline-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

body:not(.light-mode) .timeline-table-wrapper {
    border-color: #334155;
    background: #0f172a;
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 950px;
    font-size: 12px;
}

.timeline-table th, .timeline-table td {
    border: 1px solid #f1f5f9;
    text-align: center;
    padding: 8px 2px;
    vertical-align: middle;
}

body:not(.light-mode) .timeline-table th, 
body:not(.light-mode) .timeline-table td {
    border-color: #1e293b;
}

/* Header Tanggal Minimalis */
.timeline-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
    min-width: 30px;
    height: 38px;
}

body:not(.light-mode) .timeline-table th {
    background: #1e293b;
    color: #94a3b8;
}

.timeline-table th.col-role {
    min-width: 120px;
    text-align: left;
    padding-left: 16px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
}

body:not(.light-mode) .timeline-table th.col-role {
    background: #0f172a;
    color: #f1f5f9;
}

.timeline-table td.cell-role {
    font-weight: 700;
    text-align: left;
    padding-left: 16px;
    background: #f8fafc;
    color: #0284c7;
    font-size: 13px;
}

body:not(.light-mode) .timeline-table td.cell-role {
    background: #0f172a;
    color: #38bdf8;
}

/* Style Pill-Bar Kegiatan Modern (Soft Google Calendar Colors) */
.task-bar {
    border-radius: 20px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    letter-spacing: 0.2px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin: 2px 4px;
}

.task-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Skema Warna Soft & Pastel ala Google Calendar */
.task-blue {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.task-blue-dark {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.task-blue-navy {
    background-color: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.task-orange {
    background-color: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}


/* ==========================================
   🗓️ SPLIT-VIEW LAYOUT (KIRI KALENDER, KANAN DETAIL)
   ========================================== */
.agenda-split-container {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.agenda-left-panel {
    flex: 1.2;
    min-width: 320px;
}

.agenda-right-panel {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.agenda-module-box {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-line, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    max-height: 520px; /* Batas tinggi maksimum agar panel konsisten */
    box-sizing: border-box;
}

body:not(.light-mode) .agenda-module-box {
    background: rgba(0, 0, 0, 0.2);
    border-color: #334155;
}

#agendaDetailContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto; /* Aktifkan scrollbar vertikal */
    padding-right: 4px; /* Ruang agar scrollbar tidak menutupi teks */
    flex: 1;
}

/* Custom Scrollbar Cantik untuk Agenda Container */
#agendaDetailContainer::-webkit-scrollbar {
    width: 6px;
}

#agendaDetailContainer::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

#agendaDetailContainer::-webkit-scrollbar-thumb {
    background: #00adb5;
    border-radius: 10px;
}
.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    padding: 8px 0;
    color: var(--text-muted, #64748b);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
}

.calendar-day-cell {
    aspect-ratio: 1 / 1;
    min-height: 45px;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-line, #e2e8f0);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-day-cell:hover {
    background: rgba(0, 173, 181, 0.1);
    border-color: #00adb5;
    transform: translateY(-2px);
}

.calendar-day-cell.selected-day {
    border: 2px solid #00adb5 !important;
    background: rgba(0, 173, 181, 0.15) !important;
}

.calendar-day-cell.other-month {
    opacity: 0.2;
    pointer-events: none;
}

.calendar-day-number {
    font-size: 12px;
    font-weight: 600;
}

/* DOT NAVY INDICATOR */
.agenda-navy-dot {
    width: 7px;
    height: 7px;
    background-color: #1e3a8a; /* Color Navy */
    border-radius: 50%;
    margin-bottom: 4px;
    box-shadow: 0 0 4px rgba(30, 58, 138, 0.6);
}

/* ==========================================
   📱 MEDIA QUERIES RESPONSIP AGENDA (DESKTOP TO MOBILE)
   ========================================== */

/* 1. Layar Tablet & Smartphone (< 768px) */
@media screen and (max-width: 768px) {
    /* Ubah Split View Kiri-Kanan menjadi Atas-Bawah */
    .agenda-split-container {
        flex-direction: column;
        gap: 15px;
    }

    .agenda-left-panel, 
    .agenda-right-panel {
        width: 100%;
        min-width: 100%;
        flex: none;
    }

    /* Penyesuaian Header Proker & Agenda */
    .proker-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .proker-header h3 {
        text-align: center;
        font-size: 15px;
    }

    .proker-nav {
        justify-content: center;
        width: 100%;
    }

    .proker-header button {
        width: 100%;
    }

    /* Grid Kalender HP */
    .calendar-month-grid {
        gap: 3px;
    }

    .calendar-day-header {
        font-size: 11px;
        padding: 5px 0;
    }

    .calendar-day-cell {
        min-height: 40px;
        padding: 4px 1px;
        aspect-ratio: auto; /* Hilangkan aspect ratio di mobile agar tidak merenggang berlebihan */
        border-radius: 6px;
    }

    .calendar-day-number {
        font-size: 11px;
    }

    .agenda-navy-dot {
        width: 5px;
        height: 5px;
        margin-bottom: 2px;
    }

    /* Modal Form Agenda di Mobile */
    .modal-content {
        width: 95% !important;
        padding: 16px !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content .form-row,
    .modal-content div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .modal-content div[style*="flex:1"] {
        width: 100% !important;
    }
}

/* 2. Layar Smartphone Sangat Kecil (< 480px) */
@media screen and (max-width: 480px) {
    .calendar-day-cell {
        min-height: 36px;
    }
    
    .agenda-module-box {
        padding: 12px;
    }
    
    #selectedDateTitle {
        font-size: 13px;
    }
}

/* ==========================================================
   HSI CONTROL CENTER V2
   Override CSS Lama
   ========================================================== */

/* ---------- HEADER ---------- */

.main-header{

    box-shadow:0 2px 10px rgba(15,23,42,.08);

    position:sticky;
    top:0;
    z-index:100;

}

/* ---------- TAB ---------- */

.kepala{

    padding-top:18px;

}

.tab-navigation{

    gap:8px;

}

.tab-btn{

    border-radius:10px;

    transition:.2s;

}

.tab-btn:hover{

    background:rgba(255,255,255,.04);

}

body.light-mode .tab-btn:hover{

    background:#eef4fb;

}

.tab-btn.active{

    border-radius:10px 10px 0 0;

}

/* ---------- CONTENT ---------- */

.data-container-dashboard{

    padding-top:24px;

}

/* ---------- GROUP ---------- */

.silsilah-group{

    background:var(--bg-card-box);

    border:1px solid var(--border-line);

    border-radius:14px;

    margin-bottom:18px;

    overflow:hidden;

    transition:.2s;

}

.silsilah-group:hover{

    box-shadow:0 8px 22px rgba(15,23,42,.05);

}

.silsilah-header{

    padding:18px;

}

.silsilah-content{

    padding:0 18px 18px;

}

/* ---------- CARD ---------- */

.card-tugas{

    border-left-width:4px;

    border-radius:14px;

    box-shadow:0 2px 8px rgba(15,23,42,.05);

    transition:
        transform .2s,
        box-shadow .2s,
        border-color .2s;

}

.card-tugas:hover{

    transform:translateY(-3px);

    box-shadow:0 10px 24px rgba(15,23,42,.08);

}

/* ---------- BADGE ---------- */

.badge{

    border-radius:999px;

    padding:4px 8px;

    font-size:11px;

    letter-spacing:.2px;

}

/* ---------- GRAFIK ---------- */

.card-grafik{

    border-radius:16px;

    box-shadow:0 2px 8px rgba(15,23,42,.05);

    transition:.2s;

}

.card-grafik:hover{

    transform:translateY(-2px);

    box-shadow:0 8px 18px rgba(15,23,42,.08);

}

.progress-bar-container{

    border-radius:999px;

}

.progress-bar-fill{

    border-radius:999px;

}

/* ---------- INPUT ---------- */

input,
select,
textarea{

    border-radius:10px;

    transition:.2s;

}

input:focus,
select:focus,
textarea:focus{

    outline:none;

    box-shadow:0 0 0 3px rgba(37,99,235,.15);

}

/* ---------- SCROLLBAR ---------- */

.data-container-dashboard::-webkit-scrollbar{

    width:8px;

}

.data-container-dashboard::-webkit-scrollbar-thumb{

    background:#9ca3af;

    border-radius:20px;

}

.data-container-dashboard::-webkit-scrollbar-track{

    background:transparent;

}

/* ---------- MOBILE ---------- */

@media(max-width:768px){

    .data-container-dashboard{

        padding:16px;

    }

    .grid-tugas{

        gap:10px;

    }

    .grid-grafik{

        grid-template-columns:1fr;

    }

    .silsilah-header{

        padding:14px;

    }

    .silsilah-content{

        padding:0 14px 14px;

    }

    .card-tugas{

        padding:14px;

    }

}