:root {
    --border-color: #333;
    --bg-gray: #f5f5f5;
}

body {
    font-family: "Times New Roman", Times, serif;
    background-color: #e0e0e0;
    margin: 0;
    padding: 20px;
    font-size: 16px; /* Ukuran font default PC */
}

.document-container {
    background-color: white;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.print-btn-container {
    text-align: right;
    margin-bottom: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px double var(--border-color);
    padding-bottom: 15px;
}

.header h2 { margin: 5px 0; font-size: 1.5em; }
.header h3 { margin: 5px 0; font-size: 1.2em; }
.header p { margin: 5px 0; font-style: italic; }

.year-input {
    width: 60px;
    font-family: inherit;
    font-size: inherit;
    font-style: italic;
    border: 1px solid #ccc;
    text-align: center;
}

.financial-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.financial-table th, .financial-table td {
    padding: 8px;
    border: 1px solid var(--border-color);
}

.financial-table th { background-color: var(--bg-gray); text-align: center; }
.financial-table td:nth-child(2) { width: 200px; text-align: right; }
.financial-table td.pph-calc { text-align: right; }

.section-title { font-weight: bold; background-color: #fafafa; }
.subtotal td { font-weight: bold; }
.total td { font-weight: bold; font-size: 1.1em; background-color: var(--bg-gray); }

input.currency-input {
    width: 100%;
    box-sizing: border-box;
    text-align: right;
    border: 1px dashed #ccc;
    padding: 5px;
    font-family: inherit;
    font-size: inherit;
}

input.currency-input:focus {
    outline: none;
    border-color: #0056b3;
    background-color: #f0f8ff;
}

.neraca-container { display: flex; gap: 20px; }
.neraca-col { flex: 1; }

.balance-check {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.balanced { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.unbalanced { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.signature {
    margin-top: 50px;
    width: 300px;
    float: right;
    text-align: center;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}


/* =========================================================
   PENGATURAN RESPONSIVE UNTUK LAYAR HP (MOBILE DEVICES)
   ========================================================= */
@media screen and (max-width: 768px) {
    body {
        padding: 5px; /* Kurangi jarak luar di HP */
        font-size: 12px; /* Kecilkan font dasar agar muat */
    }

    .document-container {
        padding: 15px; /* Kurangi padding dalam dokumen */
    }

    .header h2 { font-size: 1.3em; }
    .header h3 { font-size: 1.1em; }

    .financial-table th, .financial-table td {
        padding: 4px; /* Kurangi spasi dalam tabel */
    }

    /* Jangan paksa lebar 200px di HP, biarkan fleksibel menyesuaikan layar */
    .financial-table td:nth-child(2) {
        width: 35%; 
        min-width: 100px;
    }

    .total td { font-size: 1em; } /* Kecilkan sedikit font TOTAL */

    /* Ubah Neraca Kiri-Kanan menjadi Atas-Bawah */
    .neraca-container {
        flex-direction: column;
        gap: 0;
    }

    .signature {
        float: none;
        width: 100%;
        margin-top: 30px;
    }

    /* Tumpuk tombol agar mudah diklik di HP */
    .print-btn-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .btn-save, .print-btn {
        width: 100%;
        margin-right: 0 !important;
        padding: 12px !important;
        font-size: 14px;
    }
}


/* =========================================================
   PENGATURAN SAAT DICETAK (PRINT / PDF)
   ========================================================= */
@media print {
    body { background-color: white; padding: 0; font-size: 12pt; }
    .document-container { box-shadow: none; max-width: 100%; padding: 0; margin: 0; }
    .print-btn-container { display: none; }
    #pesan-notifikasi { display: none !important; }
    
    input.currency-input, .year-input { 
        border: none; 
        background: transparent; 
        -webkit-appearance: none;
        padding: 0;
    }
    
    .page-break { page-break-before: always; }
    .neraca-container { flex-direction: row; gap: 20px; } /* Kembalikan kiri-kanan saat print */
    .signature { float: right; width: 300px; }
}