* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.header {
    background: linear-gradient(to bottom, #ffffff 0%, #e5e5e5 100%);
    padding: 15px 20px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 {
    color: #4a8bc2;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    font-style: italic
}

.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 0;
}

.export-group {
    display: flex;
    justify-content: flex-end; /* Tetap di kanan pada desktop */
    align-items: center;
    flex-wrap: wrap; /* Izinkan pindah baris pada HP */
    gap: 15px;
}

/* Memastikan teks dan tombol di dalam grup tetap menyatu */
.export-sub-group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* Mencegah teks pecah di tengah-tengah grup */
}

.export-group label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.export-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    border-top: 4px solid #4a8bc2;
}

.section-title {
    text-align: center;
    color: #007bff;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 18px;
}

.info-box {
    background-color: #eee;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    font-size: 14px;
    
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    gap: 30px;
}

.input-group {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.info-box label {
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
}

.name-input {
    border: 1px solid #ccc;
    padding: 5px 10px;
    font-size: 14px;
    width: 200px;
    border-radius: 3px;
    background: transparent;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 20px;
}

thead {
    background-color: #e0e0e0;
    font-weight: bold;
}

th, td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

th {
    text-align: center;
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 6px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    font-size: 13px;
    border-radius: 3px;
}

.print-mode input, .print-mode select {
    border: none;
    background: transparent;
}

.sks-input, .sn-input {
    text-align: center;
}

.summary-table {
    width: 35%;
    margin-left: auto;
    background-color: #f9f9f9;
}
.summary-label {
    text-align: right;
    font-weight: bold;
    background-color: #e0e0e0;
}
.summary-value {
    text-align: center;
    font-weight: bold;
}

.btn {
    padding: 8px 15px;
    border: none;
    cursor: pointer;
    border-radius: 3px;
    font-size: 13px;
    margin-right: 5px;
    transition: 0.2s;
    font-weight: bold;
}
.btn:hover { opacity: 0.9; transform: scale(1.02); }
.btn-add { background-color: #28a745; color: white; }
.btn-del { background-color: #dc3545; color: white; padding: 4px 10px; }
.btn-reset { background-color: #dc3545; color: white; font-size: 12px; }

.btn-pdf { background-color: #dc3545; color: white; } 
.btn-png { background-color: #17a2b8; color: white; }

.history-section {
    margin-top: 30px;
    border-top: 2px dashed #ccc;
}

@media screen and (max-width: 600px) {
    .export-group {
        justify-content: center; /* Rata tengah pada HP */
        gap: 10px;
    }

    .container {
        margin: 10px;
        padding: 15px;
    }

    .control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }

    .export-group {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .info-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .input-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .info-box label {
        min-width: unset;
        margin-right: 0;
    }

    .name-input {
        width: 100% !important;
    }

    .summary-table {
        width: 100%;
    }

    #nilaiTable {
        display: block;
        overflow-x: auto;
        width: 100%;
    }
}

.footer-link {
    text-decoration: none;
    color: #4a8bc2;
    font-weight: bold;
    transition: 0.3s;
}

.footer-link:hover {
    color: #333;
}

.footer-link i {
    margin-right: 5px;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .header, 
    .control-bar, 
    #btnAddRow, 
    .btn-reset,
    .aksi-col,
    .btn-guide,
    .app-footer,
    #helperText { 
        display: none !important;
    }

    .container {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        border-top: none !important;
    }

    table, th, td {
        border: 1px solid #000 !important;
    }

    th {
        background-color: #e0e0e0 !important;
    }

    input, select {
        border: none !important;
        background: transparent !important;
        color: #000 !important;
    }

    @page {
        margin: 1cm;
    }
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    overflow-y: auto; 
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 85%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 50px; 
}

.close-guide {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-guide:hover {
    color: black;
}

.guide-body h4 {
    color: #4a8bc2;
    margin-bottom: 5px;
}

.guide-body p {
    font-size: 13px;
    line-height: 1.6;
    margin-top: 0;
}

.btn-guide {
    background-color: #f39c12;
    color: white;
}