/* Reset Dasar dan Font */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    position: relative; /* Untuk penempatan absolute tombol logout */
}

/* --- Logo dan Judul --- */
.logo-container {
    text-align: center;
    margin-bottom: 10px;
}

.company-logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

h1 {
    color: #004d99;
    text-align: center;
    margin-bottom: 10px;
}

/* KOREKSI: Gaya Welcome Message */
.welcome-message {
    text-align: center;
    color: #007bff; /* Warna biru yang ramah */
    font-size: 1.2em; /* Ukuran tidak bersaing dengan H1 */
    font-weight: bold; /* Dibuat bold agar tetap jelas */
    font-style: italic; 
    margin-top: 5px;
    margin-bottom: 25px; 
    padding-bottom: 5px;
    border-bottom: 1px dashed #e0e0e0;
}

p {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

/* --- Form Input Styling (Termasuk SELECT) --- */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #004d99;
}

/* KOREKSI UTAMA: Menyatukan styling untuk input dan select */
input[type="number"],
input[type="text"],
input[type="password"],
select { /* MENYATUKAN SEMUA INPUT + SELECT */
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: white; /* Untuk Select */

    /* Menghilangkan default arrow pada select */
    -webkit-appearance: none; 
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%20176.6c-4.4%204.4-10.9%207-17.4%207s-13-2.6-17.4-7L146.2%2069.8%2040.8%20176.6c-4.4%204.4-10.9%207-17.4%207s-13-2.6-17.4-7c-9.5-9.4-9.5-24.6%200-33.9L130.6%205.4c4.4-4.4%2010.9-7%2017.4-7s13%202.6%2017.4%207l124.6%20127.3c9.4%209.3%209.4%2024.5-.1%2033.9z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 0.6em auto;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
select:focus { /* KOREKSI: Tambahkan SELECT:focus */
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
}

/* --- Tombol Aksi (Utama & Login) --- */
.actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Gaya dasar untuk semua tombol aksi (termasuk login/hitung) */
#hitungButton, #loginButton, .secondary-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    flex-grow: 1; 
}

/* Gaya tombol Primer (Hitung / Login) */
#hitungButton, #loginButton {
    background-color: #007bff;
    color: white;
}

#hitungButton:hover, #loginButton:hover {
    background-color: #0056b3;
}

/* Gaya tombol Sekunder (Reset) */
.secondary-btn {
    background-color: #ccc;
    color: #333;
}

.secondary-btn:hover {
    background-color: #bbb;
}

/* --- Tombol Logout (Di sudut kanan atas) --- */
.logout-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 0.95em;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 10;
    flex-grow: 0 !important;

    background-color: #dc3545; /* Merah menyala */
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.logout-btn:hover {
    background-color: #c82333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* --- Output Hasil Styling --- */
.result-section {
    margin-top: 30px;
}

.result-section h2 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
}

/* Tampilan Grid */
.result-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr; 
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden; 
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.grid-header, .grid-label, .grid-value {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.grid-header {
    font-weight: bold;
    background-color: #e9f0f7;
    text-align: center;
    color: #004d99;
}

.grid-header.deviasi {
    color: #cc0000; /* Warna merah untuk biaya Hadiah Umroh */
}

.grid-header:first-child {
    text-align: left;
}

.grid-label {
    font-weight: 500;
    background-color: #f7f9fb;
    color: #333;
}

.grid-value {
    text-align: right;
    font-weight: bold;
}

.sub-info {
    font-size: 0.9em;
    color: #666;
    background-color: #f0f0f0;
}
.sub-info.grid-value {
    font-weight: normal;
}

.net-highlight {
    font-weight: bold !important;
    background-color: #e6ffec;
    border-bottom: none;
    color: #006400;
}

/* Kartu Penekanan */
.cost-of-deviation-card {
    background-color: #ffebe6;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #ff4d4d;
    text-align: center;
    position: relative;
}

.cost-of-deviation-card h3 {
    color: #cc0000;
    margin-top: 0;
    font-size: 1.2em;
}

.highlight-cost-net {
    color: #cc0000 !important;
    font-size: 2.5em;
    font-weight: bold;
    margin: 5px 0 10px 0;
    display: block;
}

.cost-info-kotor {
    font-size: 0.9em;
    color: #666;
}

/* Garis pemisah */
hr {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 30px 0;
}

/* --- Indikator Risiko & Ringkasan --- */
.risk-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    top: -10px;
    right: -10px;
    border: 3px solid #ffffff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.risk-flag.low { background-color: #28a745; }
.risk-flag.medium { background-color: #ffc107; }
.risk-flag.high { background-color: #dc3545; }

.summary-section {
    margin-top: 30px;
    padding: 20px;
    border: 1px dashed #004d99;
    border-radius: 8px;
    background-color: #f0f7ff;
}
.summary-content {
    text-align: left !important;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #333;
}

.copy-btn {
    background-color: #004d99 !important;
    color: white !important;
    flex-grow: 0 !important;
    display: block;
    width: 100%;
}
.copy-btn:hover {
    background-color: #003366 !important;
}

/* --- Custom Alert/Modal Styling --- */
.custom-alert-overlay {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-alert-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.custom-alert-content h3 {
    color: #dc3545;
    margin-top: 0;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
}
.close-btn:hover {
    color: #333;
}


/* --- MODAL CONFIRMATION LOGOUT (50:50) --- */
.confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

.confirm-actions button {
    flex-grow: 1; /* Membuat kedua tombol berukuran 50:50 */
    width: 50%;
    padding: 12px 15px;
}

/* Gaya untuk tombol Batal (abu-abu netral) */
.alert-close-btn {
    background-color: #6c757d !important;
    color: white !important;
}
.alert-close-btn:hover {
    background-color: #5a6268 !important;
}

/* Gaya untuk tombol Konfirmasi Logout (merah primer) */
.logout-confirm-btn {
    background-color: #dc3545 !important;
    color: white !important;
    border-radius: 6px !important;
}
.logout-confirm-btn:hover {
    background-color: #c82333 !important;
}

/* Media Query Responsivitas */
@media (max-width: 650px) {
    .container {
        padding: 20px 15px;
    }
    h1 {
        font-size: 1.8em;
    }
    .actions {
        flex-direction: column;
    }
    .logout-btn {
        right: 15px;
        top: 15px;
        padding: 8px 12px;
        font-size: 0.85em;
    }
}

/* style.css (Tambahkan di bagian Output Hasil Styling) */

.percentage-detail {
    display: block; /* PENTING: Memastikan persentase di baris baru */
    font-size: 0.8em; 
    font-weight: normal; 
    color: #444; 
    margin-top: 2px;
}

/* KOREKSI: Pastikan styling baris net-highlight menyesuaikan dua baris teks */
.grid-value.net-highlight {
    line-height: 1.2; 
    padding-top: 8px; 
    padding-bottom: 8px;
    /* Pastikan nilai nominal tetap tebal */
    font-weight: bold; 
}

/* Style khusus untuk persentase biaya Hadiah agar menonjol */
#bungaDeviasiBersihResult .percentage-detail {
    color: #cc0000; 
}

/* style.css (Tambahkan di bagian Output Hasil Styling/cost-of-deviation-card) */

.target-compliance-info {
    font-size: 1em;
    font-weight: bold;
    color: #004d99; /* Warna korporat */
    margin-bottom: 5px;
}
.target-compliance-info span {
    color: #333;
    font-weight: bold;
}