/* ==========================================================================
   1. VARIABLE WARNA ARTCRAFT & GLOBAL RESET (Wajib Ada)
   ========================================================================== */
:root {
    --forest-dark: #233e28;
    --bamboo-mid: #6da044;
    --bamboo-light: #b8d186;
    --bg-body: #f4f7f4;
    --surface-white: #ffffff;
    --border-color: #dceedc;
    --text-main: #333333;
    --text-muted: #888888;
    --danger-red: #d32f2f;
    
    /* Gradients */
    --grad-primary: linear-gradient(135deg, #8bc34a 0%, #388e3c 100%); /* Hijau */
    --grad-danger: linear-gradient(135deg, #ff5252 0%, #b71c1c 100%);  /* Merah */
}

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

body {
    background-color: #e8eee8; /* Warna di luar bingkai HP */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Container Utama untuk semua halaman */
.mobile-container {
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background-color: var(--forest-dark);
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

/* ==========================================================================
   2. STYLE HALAMAN LOGIN (index.html) (Wajib Ada)
   ========================================================================== */
.header-section { position: relative; height: 35%; width: 100%; }
.image-overlay { width: 100%; height: 100%; overflow: hidden; background-color: var(--forest-dark); }
.image-overlay img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; clip-path: ellipse(100% 80% at 50% 15%); }

.welcome-text { text-align: center; color: white; padding: 0 20px; margin-top: -10px; margin-bottom: 30px; }
.welcome-text h1 { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.welcome-text p { font-size: 0.85rem; color: var(--bamboo-light); margin-top: 5px; }

.form-card { background: var(--surface-white); margin: 0 25px; padding: 30px 25px; border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.3); border: 1px solid var(--border-color); }
.input-group { margin-bottom: 18px; }
.input-group label { display: block; font-size: 0.85rem; color: var(--forest-dark); margin-bottom: 8px; font-weight: 700; }
.input-group input { width: 100%; padding: 12px 15px; border: 2px solid #e8e8e8; border-radius: 10px; background-color: #fafafa; font-size: 1rem; transition: 0.3s; }
.input-group input:focus { border-color: var(--bamboo-mid); outline: none; background-color: #fff; }

.password-wrapper { position: relative; }
.password-wrapper i { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: #999; cursor: pointer; }

.btn-login { width: 100%; padding: 16px; background: var(--grad-primary); border: none; border-radius: 12px; color: white; font-size: 1rem; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(56, 142, 60, 0.3); display: flex; justify-content: center; align-items: center; gap: 12px; }

.footer-brand { margin-top: auto; padding-bottom: 30px; text-align: center; width: 100%; }
.footer-brand p { color: #ffffff !important; font-size: 0.8rem; font-weight: 400; opacity: 0.9; letter-spacing: 0.5px; }

/* ==========================================================================
   3. STYLE HALAMAN HOME & NAVIGATION (Wajib Ada)
   ========================================================================== */
.header-profile { padding: 45px 25px 35px; display: flex; justify-content: space-between; align-items: center; color: white; }
.user-info { display: flex; align-items: center; gap: 15px; }
.avatar-wrapper { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; border: 2px solid var(--bamboo-light); background-color: #eee; }
.avatar { width: 100%; height: 100%; object-fit: cover; }
.user-text h3 { font-size: 1.1rem; font-weight: 700; }
.user-text p { font-size: 0.75rem; color: var(--bamboo-light); }
.logout-btn { color: white; font-size: 1.2rem; background: rgba(255, 255, 255, 0.15); padding: 10px; border-radius: 12px; text-decoration: none; display: flex; align-items: center; justify-content: center; }

.main-content-wrapper { flex: 1; background-color: white; border-radius: 35px 35px 0 0; padding: 30px 20px; overflow-y: auto; padding-bottom: 100px !important; }
.attendance-card { background: white; border-radius: 25px; text-align: center; padding: 25px 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); border: 1px solid #f0f4f0; margin-bottom: 30px; }
.clock-display { font-size: 2.8rem; font-weight: 800; color: var(--forest-dark); margin: 8px 0; }
.date-display { font-size: 0.9rem; color: #f39c12; font-weight: 600; }
.divider { height: 1px; background: #eee; margin: 20px 0; }
.office-time { font-size: 1.1rem; font-weight: 700; color: var(--forest-dark); }

.action-buttons { display: flex; gap: 15px; margin-top: 25px; }
.btn-action { flex: 1; padding: 16px; border: none; border-radius: 15px; color: white; font-weight: 700; font-size: 1rem; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.btn-in { background: var(--grad-primary); box-shadow: 0 6px 15px rgba(56, 142, 60, 0.25); }
.btn-out { background: var(--grad-danger); box-shadow: 0 6px 15px rgba(183, 28, 28, 0.25); }

/* History List Dashboard */
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; color: var(--forest-dark); }
.view-all-label { font-size: 0.75rem; color: var(--bamboo-mid); font-weight: 700; text-decoration: none; border: 1px solid var(--bamboo-mid); padding: 2px 8px; border-radius: 5px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid #f2f2f2; }
.h-date { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.h-time { font-size: 0.85rem; color: #666; display: flex; align-items: center; gap: 6px; }
.h-time.late { color: var(--danger-red); font-weight: 700; }

/* REVISI: BOTTOM NAVIGATION GLOBAL */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 450px; height: 75px;
    background-color: var(--forest-dark); display: flex;
    justify-content: space-around; align-items: center;
    border-top-left-radius: 25px; border-top-right-radius: 25px;
    box-shadow: 0 -8px 25px rgba(0,0,0,0.2); z-index: 9999; padding: 0 10px;
}
.nav-item { display: flex; flex-direction: column; align-items: center; color: rgba(255, 255, 255, 0.6); text-decoration: none; flex: 1; transition: 0.3s; }
.nav-item i { font-size: 1.25rem; margin-bottom: 4px; }
.nav-item span { font-size: 0.65rem; font-weight: 600; }
.nav-item.active { color: #fff !important; }
.qr-wrapper { position: relative; top: -25px; background: white; padding: 5px; border-radius: 50%; }
.qr-btn { width: 55px; height: 55px; background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: white; font-size: 1.5rem; border: none; cursor: pointer; box-shadow: 0 5px 15px rgba(245, 124, 0, 0.4); }

/* ==========================================================================
   4. STYLE HALAMAN MAPS (Wajib Ada)
   ========================================================================== */
.map-section { height: 60%; width: 100%; position: relative; background-color: #e5e3df; z-index: 1; }
.back-btn { position: absolute; top: 20px; left: 20px; width: 45px; height: 45px; background: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; color: var(--forest-dark); text-decoration: none; box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 9999 !important; }
.time-overlay { position: absolute; top: 25px; width: 100%; text-align: center; font-weight: 700; font-size: 1.2rem; color: var(--forest-dark); text-shadow: 0 0 10px rgba(255,255,255,0.8); pointer-events: none; }
.bottom-sheet { position: absolute; bottom: 0; width: 100%; height: 50%; background: white; border-top-left-radius: 30px; border-top-right-radius: 30px; padding: 20px 25px; box-shadow: 0 -10px 30px rgba(0,0,0,0.1); display: flex; flex-direction: column; z-index: 5; overflow-y: auto; }
.marker { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.pin { width: 20px; height: 20px; background: #d32f2f; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid white; }
.pulse { width: 30px; height: 30px; background: rgba(211, 47, 47, 0.2); border-radius: 50%; position: absolute; top: -5px; left: -5px; animation: pulsate 1.5s infinite; }
@keyframes pulsate { 0% { transform: scale(0.1); opacity: 0; } 50% { opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* ==========================================================================
   5. STYLE KHUSUS VIEW DETAIL (history_all.php)
   ========================================================================== */
.history-page .mobile-container { background-color: #f4f7f4; }
.history-page .header-history { padding: 35px 20px 80px; background-color: var(--forest-dark); color: white; position: relative; flex-shrink: 0; z-index: 1; }
.history-page .back-link { color: white; text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; margin-bottom: 12px; }
.history-page .btn-filter-date { position: absolute; right: 20px; top: 55px; background: rgba(255, 255, 255, 0.15); width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; cursor: pointer; border: none; }
.history-page .stats-container-wrapper { padding: 0 15px; margin-top: -55px; position: relative; z-index: 10; flex-shrink: 0; margin-bottom: 25px; }
.history-page .stats-grid-6 { display: flex; justify-content: space-between; align-items: center; background: white; padding: 22px 10px; border-radius: 30px; box-shadow: 0 12px 35px rgba(0,0,0,0.12); text-align: center; }
.history-page .stat-item-small { flex: 1; min-width: 0; }
.history-page .stat-item-small h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 2px; }
.history-page .stat-item-small p { font-size: 0.55rem; color: #999; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2px; }
.history-page .list-container { padding: 0 15px 100px; flex: 1; overflow-y: auto; position: relative; z-index: 5; }
.history-page .history-card-custom { background-color: #ffffff !important; border-radius: 30px; padding: 22px; margin-bottom: 18px; border: 1px solid rgba(0,0,0,0.02); }
.history-page .badge-status { padding: 4px 14px; border-radius: 20px; font-size: 0.62rem; font-weight: 900; text-transform: uppercase; }
.history-page .status-cuti { background-color: #fff9e7 !important; color: #d4a017 !important; }
.history-page .status-off { background-color: #fbebec !important; color: #c62828 !important; }
.history-page .status-hadir { background-color: #e9f5e9 !important; color: #2e7d32 !important; }
.history-page .status-pulang-cepat { background-color: #cf9bec !important; color: #ffffff !important; }
.history-page .status-terlambat { background-color: #ecb9ee !important; color: #ad1457 !important; }
.history-page .status-sakit { background-color: #dfe9fe !important; color: #1976d2 !important; }
.history-page .status-izin { background-color: #ecfafe !important; color: #0288d1 !important; }
.history-page .status-mangkir { background-color: #fbebec !important; color: #c62828 !important; }
.history-page .card-cols { display: flex; align-items: center; text-align: center; margin-top: 15px; }
.history-page .col-data { flex: 1; }
.history-page .col-data h4 { font-size: 1.35rem; font-weight: 800; margin-bottom: 2px; color: #333; }
.history-page .col-data p { font-size: 0.72rem; font-weight: 700; }
.history-page .v-sep { width: 1px; height: 35px; background: rgba(0,0,0,0.08); }
.history-page .label-green-abs { color: #2e7d32 !important; font-weight: 700; } 
.history-page .label-orange-abs { color: #f39c12 !important; font-weight: 700; } 
.history-page .jam-kosong { color: #d32f2f !important; font-weight: 800; }

/* ==========================================================================
   6. FINAL REVISI PROFIL (profile.php)
   ========================================================================== */
.profile-view-page .profile-header-green { background-color: var(--forest-dark); padding: 25px 20px 60px; text-align: center; border-bottom-left-radius: 50% 25%; border-bottom-right-radius: 50% 25%; position: relative; flex-shrink: 0; }
.back-btn-profile { position: absolute; top: 25px; left: 20px; width: 42px; height: 42px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--forest-dark); text-decoration: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 100; }
.profile-view-page .profile-img-container { width: 95px; height: 95px; border-radius: 50%; overflow: hidden; margin: 0 auto 15px; border: 4px solid white; box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
.profile-view-page .profile-img-container img { width: 100%; height: 100%; object-fit: cover; }
.profile-view-page .profile-header-green h3 { color: #fff; font-size: 1.45rem; font-weight: 800; margin-bottom: 5px; }
.profile-view-page .job-tag { background: #6da044; padding: 6px 20px; border-radius: 20px; font-size: 0.72rem; font-weight: 800; color: white; display: inline-block; margin-top: 10px; text-transform: uppercase; }
.profile-main-content { flex: 1; overflow-y: auto; padding: 30px 20px 100px; }
.info-group-box { border-left: 5px solid #6da044; padding-left: 15px; margin-bottom: 10px; }
.info-title { font-size: 1.05rem; font-weight: 800; color: #222; margin-bottom: 18px; }
.info-item { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #f2f2f2; font-size: 0.92rem; }
.info-item span { color: #999; font-weight: 600; }
.info-item b { color: #222; font-weight: 800; }
.raw-log-item { background: #fff; border: 1px solid #f4f4f4; padding: 16px; border-radius: 22px; display: flex; align-items: center; gap: 15px; margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.raw-status-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.75rem; }
.bg-in { background-color: #e9f5e9; color: #2e7d32; }
.bg-out { background-color: #fbebec; color: #c62828; }
.raw-log-text { flex: 1; }
.raw-log-text strong { font-size: 0.88rem; color: #333; display: block; margin-bottom: 4px; }
.raw-log-text p { font-size: 0.75rem; color: #bbb; font-weight: 600; letter-spacing: 0.2px; }
.raw-photo-btn { color: #6da044; font-size: 1.4rem; padding: 5px; }

/* ==========================================================================
   POPUP MODAL GLOBAL (Tampil Sama di Semua Halaman)
   ========================================================================== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); display: none; align-items: center; justify-content: center; z-index: 10000; padding: 20px; backdrop-filter: blur(2px); }
.modal-overlay.show { display: flex; }
.modal-box { background: white; width: 100%; max-width: 320px; border-radius: 30px; padding: 35px 25px; text-align: center; box-shadow: 0 15px 45px rgba(0,0,0,0.2); animation: popupScale 0.3s ease-out; }
@keyframes popupScale { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-icon-circle { width: 80px; height: 80px; border-radius: 50%; background-color: #fff9e7; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.modal-icon-circle i { font-size: 2.2rem; color: #d6ae1e; }
.modal-title { font-size: 1.2rem; font-weight: 800; color: #333; margin-bottom: 12px; }
.modal-message { font-size: 0.85rem; color: #777; line-height: 1.6; margin-bottom: 30px; padding: 0 5px; }
.btn-modal-close { width: 100%; padding: 14px; border: none; border-radius: 15px; background-color: #f0f0f0; color: #555; font-size: 0.9rem; font-weight: 800; cursor: pointer; }

/* Scrollbar Hidden */
::-webkit-scrollbar { width: 0px; }