/* --- PALET WARNA & CORE STYLE --- */
:root { 
    --gold: #c5a059; 
    --navy: #0a2e36; 
    --green: #27ae60; 
    --light: #f4f7f6; 
    --white: #ffffff; 
    --navy-soft: #2c3e50; /* Warna utama header, nav, dan footer */
    --red: #e74c3c;
    
    /* Gradients untuk Kalender & Kartu */
    --pink-grad: linear-gradient(135deg, #ff758c, #ff7eb3);
    --blue-grad: linear-gradient(135deg, #4ed1ff, #2e86de);
    --red-grad: linear-gradient(135deg, #ff416c, #ff4b2b);
    --yellow-grad: linear-gradient(135deg, #f1c40f, #f39c12);
    --honeymoon-grad: linear-gradient(135deg, #ea4c89, #9b51e0);
    --v-monthly: linear-gradient(135deg, #da4453, #89216b);
    --v-6month: linear-gradient(135deg, #00c6ff, #0072ff);
    --v-annual: linear-gradient(135deg, #f12711, #f5af19);
    --grey-grad: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body { 
    background: var(--light); 
    color: var(--navy); 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent; 
}

/* --- 1. HEADER UTAMA --- */
.main-header {
    background-color: var(--navy-soft);
    color: #ffffff;
    text-align: center;
    padding: 25px 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    user-select: none;
}

.main-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 2px;
}

.main-header h1 span {
    color: var(--gold);
}

.main-header small {
    font-size: 13px;
    color: #bdc3c7;
    font-style: italic;
}

/* --- MINI HEADER STYLE --- */
.mini-header {
    display: none;
    background-color: var(--white);
    text-align: center;
    padding: 15px 10px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.mini-header.active {
    display: block;
    animation: fadeIn 0.4s ease;
}
.mini-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--navy-soft);
    margin-bottom: 4px;
}
.mini-header p {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
}

/* --- 2. NAVIGASI BAR UTAMA --- */
.nav-container {
    background-color: var(--navy-soft);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 4px solid var(--gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.navbar {
    max-width: 600px;
    margin: 0 auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    width: 100%;
    justify-content: space-around;
}

.nav-item {
    flex: 1;
}

.nav-link {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    padding: 14px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.nav-link:hover, .nav-link.active {
    background-color: #34495e;
    color: var(--gold);
}

/* --- 3. LAYOUT KONTEN UTAMA (SPA CONTAINER) --- */
main {
    flex: 1;
    width: 100%;
    max-width: 500px; /* Nilai bawaan mobile */
    margin: 0 auto;
    padding: 20px 10px;
}

.main-section {
    display: none;
}

/* Saat aktif di mobile, tampilkan sebagai block biasa memanjang kebawah */
.main-section.show {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tampilan Berbasis Kartu Komponen */
.rt-card-wrapper {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.generic-card {
    background: var(--white);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-left: 5px solid var(--navy-soft);
}

.generic-card h2 {
    color: var(--navy-soft);
    font-size: 20px;
    margin-bottom: 10px;
}

/* Sub-Tabs di dalam Menu RT & Amalan */
.rt-tabs, .tabs { display: flex; background: #eee; border-bottom: 1px solid #ddd; overflow-x: auto; }
.rt-tab-btn, .tab-btn { flex: 1; padding: 12px 5px; border: none; background: none; cursor: pointer; font-weight: bold; font-size: 0.75rem; color: #777; transition: 0.3s; min-width: 90px; text-align: center; }
.rt-tab-btn.active, .tab-btn.active { color: var(--navy); background: var(--white); border-bottom: 3px solid var(--gold); }

.rt-sub-content, .content-section { display: none; padding-bottom: 20px; }
.rt-sub-content.active, .content-section.active { display: block; }

/* --- DETAIL ELEMEN RT & AMALAN (ORISINAL) --- */
.section-title { background: #f9f9f9; padding: 10px 15px; font-weight: bold; font-size: 0.85rem; border-bottom: 1px solid #eee; color: var(--gold); text-transform: uppercase; margin-top: 15px; }
.note-box { margin: 10px 15px; padding: 12px; font-size: 0.75rem; color: #576574; border-left: 4px solid var(--navy-soft); background: rgba(44, 62, 80, 0.05); border-radius: 0 10px 10px 0; line-height: 1.5; }

/* Kalender Grid */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 10px; }
.day { aspect-ratio: 1/1.2; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; font-size: 0.85rem; border: 1px solid #f1f2f6; background: #fff; cursor: pointer; position: relative; }
.day-num { font-weight: 800; font-size: 0.8rem; }
.day-icon { font-size: 1rem; margin: 2px 0; display: flex; align-items: center; justify-content: center; }
.day-name-cal { font-size: 0.5rem; font-weight: 900; text-transform: uppercase; }

.avatar-circle { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.4); box-shadow: 0 2px 4px rgba(0,0,0,0.08); font-size: 0.9rem; line-height: 1; }

/* Label Status Giliran */
.istri1 { background: var(--pink-grad); color: white; border: none; }
.istri2 { background: var(--blue-grad); color: white; border: none; }
.dinas { background: var(--red-grad); color: white; border: none; }
.liburan-cal { background: var(--yellow-grad); color: white; border: none; }

.day.honeymoon-day { background: var(--honeymoon-grad) !important; color: #ffffff !important; border: 1px solid #9b51e0; }
.day.honeymoon-day .day-num { color: #ffffff; }
.day.honeymoon-day .day-name-cal { color: rgba(255,255,255,0.85); font-weight: 900; }
.day.honeymoon-day::after { content: "HONEYMOON"; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: 0.38rem; font-weight: 900; color: #fff; background: #ea4c89; padding: 1px 4px; border-radius: 3px; letter-spacing: 0.3px; }
.day.honeymoon-start::before { content: "MENIKAH"; position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: 0.38rem; font-weight: 900; color: #fff; background: #27ae60; padding: 1px 4px; border-radius: 3px; letter-spacing: 0.3px; }

.legend { display: flex; justify-content: center; gap: 12px; margin-top: 15px; font-size: 0.75rem; font-weight: bold; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* Tabel Komponen */
.table-responsive { width: 100%; overflow-x: auto; padding: 0 15px; box-sizing: border-box; }
.nafkah-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.8rem; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.nafkah-table th { background: var(--navy-soft); color: var(--gold); padding: 12px 10px; font-weight: bold; text-align: left; border: 1px solid #eee; }
.nafkah-table td { padding: 12px 10px; border: 1px solid #f1f1f1; color: #333; vertical-align: middle; }
.nafkah-table tr:nth-child(even) { background-color: #f9f9f9; }

.total-row { background: #fffde7 !important; font-weight: bold; color: var(--navy-soft); }
.total-row td { border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
.row-total-gaji { background-color: #e3faf2 !important; font-weight: bold; font-size: 0.9rem; color: var(--navy-soft); border-left: 4px solid var(--green); }
.row-kostan { background-color: #e3f2fd !important; font-weight: bold; color: #0d47a1; border-left: 4px solid #1e90ff; }
.row-bonus { background-color: #fff8e1 !important; font-weight: bold; color: #b78103; border-left: 4px solid #ffb300; }

/* Modul Liburan & Amalan */
.v-filter-container { display: flex; justify-content: space-around; padding: 10px 15px; gap: 8px; }
.v-filter-btn { flex: 1; padding: 8px; border: 1px solid #ddd; background: #fff; border-radius: 20px; font-size: 0.72rem; font-weight: bold; cursor: pointer; text-align: center; color: #555; transition: 0.3s; }
.v-filter-btn.active { background: var(--navy-soft); color: var(--gold); border-color: var(--navy-soft); }

/* Formulir Administrasi */
.admin-form-box, .sync-box { display: none; margin: 12px 15px; padding: 15px; background: #f0f4f8; border: 1px solid #d2dbe3; border-radius: 15px; }
.admin-form-box.active { display: block; }
.sync-box { border: 2px dashed var(--gold); text-align: center; background: #fffcf5; }

/* Penyelarasan Tombol Sync Mode Admin Agar Presisi */
.sync-box-content { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; text-align: center; }
.sync-box-content button { margin-top: 5px; display: inline-block; width: auto; min-width: 200px; }

/* Penyelarasan Tombol Bulk Waqiah Mode Admin Agar Sejajar dan Presisi */
.wlh-admin-actions { display: flex; justify-content: center; gap: 10px; padding: 12px 15px; background: #eee; border-bottom: 1px solid #ddd; width: 100%; box-sizing: border-box; }
.wlh-admin-actions .btn-small { flex: 1; max-width: 150px; text-align: center; margin: 0; padding: 8px 16px; font-size: 0.75rem; letter-spacing: 0.5px; }

.form-group { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.72rem; font-weight: bold; color: var(--navy-soft); }
.form-group input, .form-group select, .form-group textarea { padding: 8px 10px; font-size: 0.8rem; border: 1px solid #ccc; border-radius: 8px; font-family: inherit; }

.admin-btn-group { display: flex; gap: 8px; margin-top: 5px; }
.btn-submit-v { flex: 2; background: var(--navy-soft); color: var(--gold); border: none; padding: 10px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 0.8rem; transition: 0.3s; }
.btn-cancel-v { flex: 1; background: #bdc3c7; color: #333; border: none; padding: 10px; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 0.8rem; transition: 0.3s; }

/* Kartu Tampilan Agenda Liburan & Amalan */
.v-card { margin: 12px 15px; border-radius: 15px; background: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.06); border: 1px solid #eee; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.v-card-header { padding: 12px 15px; color: white; display: flex; justify-content: space-between; align-items: center; }
.v-card-body { padding: 15px; font-size: 0.8rem; line-height: 1.4; color: #444; }

.v-badge-type { font-size: 0.58rem; font-weight: 900; color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.5); padding: 2px 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.v-status-select { font-size: 0.65rem; font-weight: bold; padding: 4px 8px; border-radius: 8px; border: none; color: white; cursor: pointer; outline: none; }
.v-sel-planning { background: #f39c12; }
.v-sel-booked { background: #2980b9; }
.v-sel-done { background: #27ae60; }
.v-user-badge { font-size: 0.65rem; font-weight: bold; padding: 4px 8px; border-radius: 8px; color: white; text-transform: uppercase; }
.btn-action-v, .btn-small { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4); color: white; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; cursor: pointer; transition: 0.2s; }
.btn-action-v:hover { background: rgba(255,255,255,0.4); }
.btn-small { border-radius: 4px; width: auto; height: auto; padding: 7px 12px; font-weight: bold; }

.badge-admin { background: var(--green); color: white; padding: 3px 12px; border-radius: 50px; font-size: 0.65rem; font-weight: bold; display: inline-block; margin-bottom: 5px; letter-spacing: 0.5px; }

/* --- STYLES ELEMEN AMALAN (RIYADHOH) --- */
.row { display: grid; grid-template-columns: 1.2fr 1fr; padding: 12px 15px; border-bottom: 1px solid #f1f1f1; align-items: center; background: var(--white); }
.row-label { font-weight: 600; font-size: 0.85rem; }
.row-label small { display: block; font-weight: normal; color: #888; font-size: 0.7rem; }
.input-area { text-align: right; }

input[type="checkbox"] { 
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px; border: 2px solid #bdc3c7; border-radius: 6px;
    background: #fff; vertical-align: middle; cursor: pointer; position: relative; transition: 0.2s;
}
input[type="checkbox"]:checked { background-color: var(--green); border-color: var(--green); }
input[type="checkbox"]:checked::after { content: "✔"; position: absolute; color: white; font-size: 16px; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.num-input { width: 75px; padding: 6px; border: 1px solid #ddd; border-radius: 5px; text-align: center; font-weight: bold; color: var(--navy); }
.date-input { padding: 10px; border-radius: 10px; border: 1px solid var(--gold); font-weight: bold; width: 80%; margin: 15px auto; display: block; text-align: center; background: white; }

.putaran-card { border-bottom: 1px solid #eee; }
.putaran-header { padding: 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: #fff; }
.status-badge { font-size: 0.6rem; padding: 3px 8px; border-radius: 10px; font-weight: bold; }
.khatam { background: var(--green); color: white; }
.pending { background: #eee; color: #999; }
.putaran-content { display: none; background: #fafafa; }
.putaran-content.open { display: block; }
.day-row-wlh { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 15px; border-bottom: 1px solid #f1f1f1; font-size: 0.8rem; background: #fafafa; }

/* --- 4. FOOTER UTAMA --- */
.main-footer { 
    background-color: var(--navy-soft); 
    color: #bdc3c7; 
    padding: 20px; 
    font-size: 0.75rem; 
    text-align: center; 
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto; 
}

/* ==========================================================================
   --- 5. FORCE DESKTOP RESPONSIVE ENGINE REVISI (OVERRIDE UTAN BROWSER) ---
   ========================================================================== */
@media screen and (min-width: 768px) {
    /* Paksa container main untuk melar maksimal di komputer */
    main {
        max-width: 1050px !important;
        padding: 30px 15px !important;
    }

    /* Regangkan navbar atas */
    .navbar {
        max-width: 1050px !important;
    }
    .nav-link {
        padding: 16px 20px !important;
        font-size: 16px !important;
    }

    /* --- BREAK & FORCE GRID KELAS BARU --- */
    /* Blokir aturan display: block bawaan .main-section.show lama */
    .main-section.show.grid-home-desktop {
        display: grid !important;
        grid-template-columns: 1.1fr 0.9fr !important;
        gap: 25px !important;
        align-items: start !important;
    }
    
    .main-section.show.grid-amalan-desktop,
    .content-section.active.grid-amalan-desktop {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 25px !important;
        align-items: start !important;
    }

    /* Atur elemen melintang penuh di baris grid atas */
    #home-gilir-box, .date-input, #sync-area {
        grid-column: span 2 !important;
    }
    
    .date-input {
        max-width: 350px !important;
        margin: 5px auto 15px !important;
    }
    
    .generic-card {
        margin-bottom: 0px !important; /* Diatur simetris oleh gap grid */
    }

    /* Modul List Liburan bercabang 2 kartu */
    #vacation-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }
    .v-card {
        margin: 0 !important;
    }
    .admin-form-box {
        margin: 20px 0 0 0 !important;
    }

    /* Pembesaran spasi tabel nafkah biar lega */
    .nafkah-table th, .nafkah-table td {
        padding: 15px 18px !important;
        font-size: 0.88rem !important;
    }
}
