/* ==========================================================================
   GLOBAL RESET & MAIN BODY
   ========================================================================== */
body {
    min-height: 100vh;
    background-color: #f5f7fa !important;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

body.login-page {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
    padding: 10px !important;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 20px 15px;
    border-radius: 12px;
}

/* ==========================================================================
   NAVBAR & HEADER FIX
   ========================================================================== */
.navbar-fixed nav {
    background-color: #1565c0 !important;
}

.brand-logo-custom {
    font-size: 1.1rem !important;
    font-weight: bold !important;
    white-space: nowrap !important;
}

.brand-logo-mobile {
    font-size: 0.95rem !important;
    margin-left: 55px !important;
    font-weight: bold !important;
    white-space: nowrap !important;
}

.main-wrapper {
    padding-top: 25px;
    padding-bottom: 40px;
}

/* ==========================================================================
   FORM PRESENSI TOGGLE BUTTONS
   ========================================================================== */
.jenis-absen-container {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    margin-top: 8px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
}

.jenis-absen-container label {
    flex: 1 1 0px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    display: block !important;
}

.jenis-absen-container input[type="radio"].radio-mode,
.jenis-absen-container [type="radio"]:not(:checked),
.jenis-absen-container [type="radio"]:checked {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

.btn-absen-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 12px 8px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    font-size: 13px !important;
    text-align: center !important;
    transition: all 0.25s ease-in-out !important;
    border: 2px solid transparent !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08) !important;
    user-select: none !important;
    box-sizing: border-box !important;
}

.btn-absen-toggle i.material-icons {
    font-size: 18px !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.btn-masuk {
    background-color: #e3f2fd !important;
    color: #1565c0 !important;
    border-color: #90caf9 !important;
}

.btn-pulang {
    background-color: #ffebee !important;
    color: #c62828 !important;
    border-color: #ef9a9a !important;
}

.btn-izin {
    background-color: #fff3e0 !important;
    color: #e65100 !important;
    border-color: #ffe0b2 !important;
}

.jenis-absen-container input[type="radio"]:checked + .btn-masuk {
    background-color: #1565c0 !important;
    color: #ffffff !important;
    border-color: #0d47a1 !important;
    box-shadow: 0 4px 10px rgba(21, 101, 192, 0.4) !important;
}

.jenis-absen-container input[type="radio"]:checked + .btn-pulang {
    background-color: #c62828 !important;
    color: #ffffff !important;
    border-color: #b71c1c !important;
    box-shadow: 0 4px 10px rgba(198, 40, 40, 0.4) !important;
}

.jenis-absen-container input[type="radio"]:checked + .btn-izin {
    background-color: #e65100 !important;
    color: #ffffff !important;
    border-color: #bf360c !important;
    box-shadow: 0 4px 10px rgba(230, 81, 0, 0.4) !important;
}

/* ==========================================================================
   KAMERA, PREVIEW & RESPONSIVE BOX
   ========================================================================== */
.webcam-responsive-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#webcam, #photoPreview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000000;
}

.mirror-mode {
    transform: scaleX(-1);
}

.camera-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 520px;
    margin: 0 auto 8px auto;
}

.camera-action-wrapper {
    margin-top: 10px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   MAP & HELPER CLASSES
   ========================================================================== */
#map {
    width: 100%;
    height: 220px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.select-custom {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    background-color: #fff;
}

.input-field-margin { margin-top: 15px; }
.font-14 { font-size: 14px; }
.font-13 { font-size: 13px; }
.font-11 { font-size: 1.1rem; }
.margin-top-10 { margin-top: 10px; }
.margin-top-15 { margin-top: 15px; }
.margin-top-20 { margin-top: 20px; }
.margin-bottom-0 { margin-bottom: 0; }
.width-100 { width: 100%; }
.section-kantor-box { margin-bottom: 15px; }
.select-margin-top { margin-top: 5px; }

.section-izin-box {
    background: #fff8e1;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ffe0b2;
    margin-bottom: 20px;
}

.btn-submit-presensi {
    width: 100%;
    font-weight: bold;
    border-radius: 8px;
}

.geo-status-box {
    margin-top: 10px;
    padding: 10px;
    font-size: 12px;
}

.btn-round {
    border-radius: 20px;
}

/* ==========================================================================
   FIX THUMBNAIL TABEL RIWAYAT ABSEN (PENTING)
   ========================================================================== */
table.table-riwayat td img.riwayat-img-thumb,
.riwayat-img-thumb {
    width: 50px !important;
    height: 40px !important;
    max-width: 50px !important;
    max-height: 40px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    border: 1px solid #1565c0 !important;
    display: inline-block !important;
}

/* Responsive Mobile Adjustments */
@media (max-width: 480px) {
    .btn-absen-toggle {
        font-size: 11px !important;
        padding: 10px 4px !important;
    }
    .btn-absen-toggle i.material-icons {
        font-size: 15px !important;
    }
}

/* ==========================================================================
   ALERT BANNER PRESENSI PULANG
   ========================================================================== */
.alert-pulang-banner {
    width: 100%;
    padding: 8px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 996;
    position: relative;
}

.alert-banner-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 15px;
}

.alert-banner-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}

.alert-banner-text i.material-icons {
    font-size: 22px;
}

.alert-btn-absen {
    border-radius: 20px !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}

/* Responsif Layar Smartphone */
@media (max-width: 600px) {
    .alert-banner-content {
        flex-direction: column !important;
        text-align: center;
        gap: 8px;
    }
    
    .alert-banner-text {
        font-size: 0.8rem;
    }

    .alert-btn-absen {
        width: 100%;
    }
}