/* =========================================
   1. GLOBAL & VARIABLES
   ========================================= */
:root {
    --primary-green: #00AA13;       /* Warna Utama Gojek */
    --dark-green: #00880f;          /* Warna Hover/Dark */
    --light-green-bg: #e6f7e8;      /* Background Hijau Muda */
    --text-dark: #333333;
    --text-grey: #888888;
    --bg-body: #f8f9fa;
    --max-width: 480px;             /* Lebar Maksimal Tampilan HP */
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    background-color: #fff;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    padding-bottom: 90px; /* Space aman untuk Navbar/Button Bawah */
    position: relative;
    color: var(--text-dark);
}

a { text-decoration: none; }

/* =========================================
   2. NAVIGATION & BOTTOM ACTIONS
   ========================================= */
/* Bottom Navbar (Menu Utama) */
.custom-navbar {
    background: white;
    border-top: 1px solid #eee;
    padding: 10px 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
    max-width: var(--max-width);
    margin: 0 auto;
    left: 0; 
    right: 0;
    z-index: 1000;
}

.nav-link {
    color: var(--text-grey);
    font-size: 0.75rem;
    text-align: center;
    padding: 5px 0;
    transition: color 0.2s;
}

.nav-link i {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.nav-link.active {
    color: var(--primary-green);
    font-weight: 600;
}

/* Sticky Bottom Action Bar (Tombol Simpan/Kirim) */
.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    background: white;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    z-index: 200;
}

/* Floating Action Button (FAB - Tombol Tambah Bulat) */
.fab-add {
    position: fixed;
    bottom: 80px; 
    right: calc(50% - 220px); 
    width: 56px;
    height: 56px;
    background-color: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 170, 19, 0.4);
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    z-index: 900;
}
@media (max-width: 480px) {
    .fab-add { right: 20px; }
}

/* ========================================================
       FIX IOS SAFARI AUTO-ZOOM PADA INPUT
       ======================================================== */
    input[type="text"],
    input[type="number"],
    input[type="date"],
    select,
    .form-control,
    .form-control-sm,
    .form-select,
    .form-select-sm {
        font-size: 16px !important; /* Paksa minimal 16px agar iOS tidak zoom */
    }


/* =========================================
   3. HEADERS
   ========================================= */
/* Header Lengkung (Halaman Utama/Home) */
.app-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: white;
    padding: 20px 20px 40px 20px;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    position: relative;
}

/* Header Putih Simple (Halaman List/Form/Edit) */
.page-header, .form-header {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.btn-back {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin-right: 15px;
}

/* =========================================
   4. FORMS & INPUTS
   ========================================= */
.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 8px;
}

.form-control {
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 170, 19, 0.1);
    background-color: white;
}

.form-control[readonly] {
    background-color: #e9ecef;
    color: #6c757d;
}

/* Input Group (Untuk Show/Hide Password) */
.input-group .form-control {
    border-right: none;
}
.input-group .input-group-text {
    background-color: white;
    border-left: none;
}
.input-group .form-control:focus {
    border-color: #dee2e6;
    box-shadow: none;
    border-right: none;
}
.input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(0, 170, 19, 0.1);
    border-radius: 0.375rem;
}
/* Warna border hijau saat fokus */
.input-group:focus-within .form-control, 
.input-group:focus-within .input-group-text {
    border-color: var(--primary-green);
}

/* Upload Area (Kotak Putus-putus) */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 15px;
    background-color: #fcfcfc;
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.upload-area:hover, .upload-area.active {
    border-color: var(--primary-green);
    background-color: #f0fff4;
}

.upload-icon {
    font-size: 2.5rem;
    color: #aaa;
    margin-bottom: 10px;
}

.upload-text {
    color: var(--text-grey);
    font-size: 0.85rem;
    text-align: center;
}

#imagePreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    display: none;
}

.btn-remove-photo {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 30px; height: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    color: red;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 20;
}

/* Tombol Submit Lebar */
.btn-submit {
    background: var(--primary-green);
    color: white;
    width: 100%;
    padding: 15px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 170, 19, 0.3);
}

.btn-submit:active {
    background: var(--dark-green);
    transform: scale(0.98);
}

/* =========================================
   5. HALAMAN ABSENSI (HOME)
   ========================================= */
.info-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-top: -30px;
    margin-left: 20px;
    margin-right: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.clock-container {
    text-align: center;
    margin: 30px 0;
}

.digital-clock {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.date-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Tombol Absen Besar */
.absen-btn-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.btn-absen {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary-green), #00c416);
    border: 8px solid var(--light-green-bg);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 170, 19, 0.3);
    transition: transform 0.2s;
    cursor: pointer;
}

.btn-absen:active {
    transform: scale(0.95);
}

.btn-absen i {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.btn-absen span {
    font-weight: 600;
    font-size: 1rem;
}

/* Riwayat List (Home) */
.history-section {
    padding: 0 20px;
}

.section-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.history-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.icon-in { background-color: var(--light-green-bg); color: var(--primary-green); }
.icon-out { background-color: #ffe8e8; color: #dc3545; }


/* =========================================
   6. HALAMAN LIST (LEMBUR / RIWAYAT)
   ========================================= */
.summary-card {
    background: linear-gradient(135deg, var(--primary-green) 0%, #029412 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 4px 15px rgba(0, 170, 19, 0.2);
}

.lembur-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin: 0 20px 15px 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}

.lembur-item:active {
    transform: scale(0.98);
}

.stat-card {
            background: white;
            border-radius: 15px;
            padding: 15px 10px;
            text-align: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.03);
            border: 1px solid #f0f0f0;
            flex: 1;
        }
        .stat-number { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }
        .stat-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }

        /* Filter Box (Input Month) */
        .filter-box {
            background: #f1f3f5;
            border-radius: 10px;
            padding: 8px 15px;
            display: flex;
            align-items: center;
            font-weight: 600;
            color: #555;
            border: 1px solid #eee;
            width: 100%;
            outline: none;
        }

        /* Attendance List Card */
        .att-card {
            background: white;
            border-radius: 12px;
            padding: 15px;
            margin: 0 20px 12px 20px;
            border: 1px solid #f0f0f0;
            box-shadow: 0 2px 6px rgba(0,0,0,0.02);
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            transition: transform 0.2s;
            cursor: pointer;
        }
        .att-card:active { transform: scale(0.98); background: #fafafa; }
        
        /* Garis Indikator Warna di Kiri Card */
        .att-card::before {
            content: '';
            position: absolute;
            left: 0; top: 0; bottom: 0;
            width: 5px;
        }
        .att-card.status-ok::before { background-color: var(--primary-green); }
        .att-card.status-late::before { background-color: #ffc107; } /* Kuning */
        .att-card.status-absent::before { background-color: #dc3545; } /* Merah */
        
        /* Tanggal di dalam Card */
        .date-box {
            text-align: center;
            min-width: 50px;
            margin-right: 15px;
            padding-right: 15px;
            border-right: 1px solid #eee;
        }
        .date-day { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); line-height: 1; }
        .date-month { font-size: 0.75rem; color: #888; text-transform: uppercase; margin-top: 3px; }

        /* Jam Masuk/Pulang */
        .time-row { font-size: 0.9rem; color: #555; margin-bottom: 2px; }
        .time-row i { width: 20px; text-align: center; margin-right: 5px; opacity: 0.6; }
        
        /* Badge Status (Pojok Kanan) */
        .badge-status {
            font-size: 0.7rem;
            padding: 4px 10px;
            border-radius: 20px;
            margin-left: auto; /* Push ke kanan */
            font-weight: 600;
            white-space: nowrap;
        }
        .bg-soft-green { background-color: #e6f7e8; color: var(--primary-green); }
        .bg-soft-yellow { background-color: #fff8e1; color: #f57c00; }
        .bg-soft-red { background-color: #ffebee; color: #dc3545; }
        .status-pending { background-color: #fff8e1; color: #f57c00; }
        .status-approved { background-color: var(--light-green-bg); color: var(--primary-green); }
        .status-rejected { background-color: #ffebee; color: #d32f2f; }


/* =========================================
   7. HALAMAN PROFILE & EDIT
   ========================================= */
.profile-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, #00880f 100%);
    padding: 30px 20px 70px 20px; /* Padding bawah besar untuk avatar */
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    text-align: center;
    color: white;
    position: relative;
}

.profile-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin: -50px 20px 20px 20px; /* Overlap ke header */
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    position: relative;
    text-align: center;
}

/* Avatar Read-Only (Profile Page) */
.avatar-box {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    object-fit: cover;
    margin-top: -60px; /* Naik ke atas card */
    background-color: #eee;
}

/* Avatar Editor (Edit Profile Page) */
.avatar-upload-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 30px auto;
}
.avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.camera-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35px;
    height: 35px;
    background-color: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.camera-btn:active {
    transform: scale(0.9);
}

/* Menu List Styling */
.menu-list {
    background: white;
    border-radius: 15px;
    padding: 10px 0;
    margin: 0 20px 20px 20px;
    border: 1px solid #f0f0f0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}
.menu-item:hover {
    background-color: #f9f9f9;
}
.menu-item:not(:last-child) {
    border-bottom: 1px solid #f8f9fa;
}

.menu-icon {
    width: 35px;
    height: 35px;
    background-color: #f0fcf2;
    color: var(--primary-green);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.1rem;
}

.menu-text {
    flex-grow: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.menu-arrow {
    color: #ccc;
    font-size: 1rem;
}

/* Logout Style */
.menu-item.logout .menu-icon {
    background-color: #ffebee;
    color: #dc3545;
}
.menu-item.logout .menu-text {
    color: #dc3545;
}


/* Menu Pintas (Quick Action) */
.quick-menu-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.quick-menu-item {
    text-align: center;
    color: var(--text-dark);
    text-decoration: none;
    transition: transform 0.2s;
}
.quick-menu-item:hover { transform: translateY(-3px); }
.quick-menu-item:active { transform: scale(0.95); }

.quick-menu-icon {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-green);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 5px;
    border: 1px solid #f0f0f0;
}

.quick-menu-label {
    font-size: 0.75rem;
    font-weight: 600;
}

  /* Card Limit (Green Gradient) */
        .limit-card {
            background: linear-gradient(135deg, var(--primary-green) 0%, #00880f 100%);
            color: white;
            border-radius: 20px;
            padding: 25px;
            margin: 20px;
            box-shadow: 0 10px 20px rgba(0, 170, 19, 0.2);
            position: relative;
            overflow: hidden;
        }
        .limit-card::after {
            content: '';
            position: absolute;
            bottom: -30px;
            right: -30px;
            width: 150px;
            height: 150px;
            background: rgba(255,255,255,0.1);
            border-radius: 50%;
        }

        /* Form Pengajuan Box */
        .loan-form-card {
            background: white;
            border-radius: 20px;
            padding: 25px 20px;
            margin: 0 20px 25px 20px;
            border: 1px solid #f0f0f0;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
            text-align: center;
        }

        /* Custom Range Slider */
        .range-container {
            margin: 30px 0;
            position: relative;
        }

        input[type=range] {
            -webkit-appearance: none;
            width: 100%;
            height: 10px;
            border-radius: 5px;
            background: #e9ecef;
            outline: none;
        }

        /* Slider Thumb (Tombol Geser) */
        input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--primary-green);
            cursor: pointer;
            box-shadow: 0 0 0 4px rgba(0, 170, 19, 0.2);
            transition: background .15s ease-in-out;
            margin-top: -9px; /* Posisi vertikal */
        }
        input[type=range]::-webkit-slider-runnable-track {
            width: 100%;
            height: 10px;
            cursor: pointer;
            background: #e9ecef;
            border-radius: 5px;
        }

        .amount-display {
            font-size: 2rem;
            font-weight: 800;
            color: var(--primary-green);
            margin-bottom: 5px;
        }

        /* History Item Style (Mirip att-card) */
        .history-item {
            background: white;
            border-radius: 12px;
            padding: 15px;
            margin: 0 20px 12px 20px;
            border: 1px solid #f0f0f0;
            box-shadow: 0 2px 6px rgba(0,0,0,0.02);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: transform 0.2s;
        }
        .history-item:active { transform: scale(0.98); }

         /* Container Mobile */
        .login-container {
            width: 100%;
            max-width: 420px; /* Sedikit lebih kecil dari main app agar fokus */
            background: white;
            padding: 40px 30px;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05);
            /* Animasi Masuk */
            animation: fadeUp 0.6s ease-out;
        }

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

        /* Logo Area */
        .logo-area {
            text-align: center;
            margin-bottom: 40px;
        }
        .app-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #00AA13 0%, #00880f 100%);
            color: white;
            border-radius: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            margin-bottom: 15px;
            box-shadow: 0 10px 20px rgba(0, 170, 19, 0.2);
        }

        /* Form Styling */
        .form-floating > .form-control {
            border-radius: 12px;
            border: 1px solid #eee;
            background-color: #fdfdfd;
        }
        .form-floating > .form-control:focus {
            border-color: #00AA13;
            box-shadow: 0 0 0 0.25rem rgba(0, 170, 19, 0.1);
        }
        .form-floating > label {
            color: #888;
        }

        /* Custom Checkbox */
        .form-check-input:checked {
            background-color: #00AA13;
            border-color: #00AA13;
        }

        /* Tombol Login */
        .btn-login {
            background: #00AA13;
            color: white;
            width: 100%;
            padding: 14px;
            border-radius: 12px;
            font-weight: 700;
            font-size: 1rem;
            border: none;
            transition: all 0.2s;
            box-shadow: 0 5px 15px rgba(0, 170, 19, 0.2);
        }
        .btn-login:hover {
            background: #00880f;
            transform: translateY(-2px);
        }
        .btn-login:active {
            transform: scale(0.98);
        }

        /* Footer Link */
        .auth-footer {
            text-align: center;
            margin-top: 30px;
            font-size: 0.9rem;
            color: #666;
        }
        .auth-footer a {
            color: #00AA13;
            text-decoration: none;
            font-weight: 600;
        }

        /* Password Toggle Icon */
        .password-group {
            position: relative;
        }
        .toggle-password {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
            color: #888;
            z-index: 10;
        }