@page {
    size: A4 portrait;
    margin: 0mm;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0mm;
    }
    body {
        padding: 15mm 15mm !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .no-print-bar {
        display: none !important;
    }
}

body {
    font-family: 'Times New Roman', Times, serif;
    color: #000;
    background-color: #fff;
    margin: 0;
    padding: 0;
    font-size: 11pt;
    line-height: 1.4;
}

.no-print-bar {
    background-color: #f1f5f9;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #cbd5e1;
    font-family: system-ui, -apple-system, sans-serif;
}

.btn-print-action {
    padding: 8px 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-print-action:hover {
    background-color: #1d4ed8;
}

.btn-close-action {
    padding: 8px 16px;
    background-color: #64748b;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-close-action:hover {
    background-color: #475569;
}

.rapor-sheet {
    max-width: 800px;
    margin: 20px auto;
    padding: 10px;
    position: relative;
}

/* Kop Surat / Header */
.kop-surat {
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px double #000;
    padding-bottom: 15px;
    margin-bottom: 20px;
    position: relative;
}

.logo-container {
    position: absolute;
    left: 10px;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-family: 'Arial', sans-serif;
    font-weight: 900;
    font-style: italic;
    color: #1e40af; /* Deep blue */
    font-size: 12pt;
    letter-spacing: 2px;
    margin-top: -2px;
}

.header-text-container {
    text-align: center;
    flex-grow: 1;
}

.header-text-container h2 {
    margin: 0;
    font-size: 13pt;
    font-weight: bold;
    letter-spacing: 1px;
}

.header-text-container h3 {
    margin: 3px 0 0 0;
    font-size: 14pt;
    font-weight: bold;
    letter-spacing: 1px;
}

.header-text-container h4 {
    margin: 4px 0 0 0;
    font-size: 11pt;
    font-weight: 500;
}

.subject-title {
    text-align: center;
    font-size: 13pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 15px 0 25px 0;
    letter-spacing: 0.5px;
}

/* Metadata Siswa */
.meta-table {
    width: 100%;
    margin-bottom: 25px;
    border-collapse: collapse;
}

.meta-table td {
    padding: 3px 0;
    vertical-align: top;
}

.meta-table td.label {
    width: 120px;
}

.meta-table td.colon {
    width: 15px;
    text-align: center;
}

/* Section Title */
.section-title {
    font-size: 11pt;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Data Table */
.table-data {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.table-data th, .table-data td {
    border: 1px solid #000;
    padding: 7px 10px;
    vertical-align: middle;
}

.table-data th {
    font-weight: bold;
    text-align: center;
    background-color: #fff;
}

.table-data td.center {
    text-align: center;
}

.table-data td.left {
    text-align: left;
}

.table-data tr.bold-row td {
    font-weight: bold;
}

/* Comment Box */
.comment-box {
    border: 1px solid #000;
    padding: 10px 12px;
    min-height: 80px;
    text-align: justify;
}

/* Signature Section */
.signature-section {
    margin-top: 50px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 11pt;
}

.sig-block {
    position: relative;
    text-align: center;
    width: 280px;
}

.sig-space {
    height: 75px;
    position: relative;
}

.stamp-img {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    height: 95px;
    width: auto;
    opacity: 0.9;
    pointer-events: none;
    z-index: 10;
}

.sig-name {
    font-weight: bold;
    text-decoration: underline;
}

@media print {
    .no-print-bar {
        display: none;
    }
    .rapor-sheet {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    body {
        background-color: #fff;
    }
}
