/* ==========================================================================
   GLOBAL REPORT DESIGN SYSTEM - SIAD DESA SIOFA BANUA
   Official Government Document & Report Stylesheet
   ========================================================================== */

/* Page Setup & Reset */
@page {
    size: A4 portrait;
    margin: 12mm 15mm 15mm 15mm;
}

@page landscape {
    size: A4 landscape;
    margin: 12mm 15mm 15mm 15mm;
}

body.report-body {
    font-family: 'Times New Roman', Times, serif;
    color: #000000;
    background-color: #ffffff;
    font-size: 11pt;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

/* Floating Action Bar (Screen Only) */
.report-action-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #0f766e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.report-action-bar h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.report-action-bar .btn-group {
    display: flex;
    gap: 10px;
}

.report-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.report-btn-print {
    background-color: #ffffff;
    color: #0f766e;
}

.report-btn-print:hover {
    background-color: #f0fdf4;
    color: #115e59;
}

.report-btn-back {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.report-btn-back:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.report-container {
    max-width: 210mm;
    margin: 70px auto 30px auto;
    padding: 20mm 15mm;
    background: #ffffff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.report-container.landscape {
    max-width: 297mm;
}

/* KOP SURAT RESMI PEMERINTAHAN */
.kop-surat {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.kop-logo {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 75px;
    height: auto;
    max-height: 85px;
    object-fit: contain;
}

.kop-text {
    width: 100%;
    padding: 0 85px;
}

.kop-text .header-pemkab {
    font-size: 13pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
}

.kop-text .header-kecamatan {
    font-size: 14pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 2px 0 0 0;
    line-height: 1.2;
}

.kop-text .header-desa {
    font-size: 16pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 2px 0 0 0;
    line-height: 1.2;
}

.kop-text .header-alamat {
    font-size: 9.5pt;
    font-style: italic;
    margin: 4px 0 0 0;
    line-height: 1.3;
    color: #111111;
}

/* DOUBLE KOP LINE (Garis Pemisah Resmi 3px + 1px) */
.kop-divider {
    border: none;
    border-top: 3px solid #000000;
    border-bottom: 1px solid #000000;
    height: 3px;
    margin: 4px 0 16px 0;
    padding: 0;
}

/* JUDUL LAPORAN */
.report-title-section {
    text-align: center;
    margin-bottom: 16px;
}

.report-title-section .title {
    font-size: 14pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
    text-decoration: underline;
}

.report-title-section .subtitle {
    font-size: 10.5pt;
    font-weight: normal;
    color: #222222;
    margin: 0;
}

/* INFORMASI METADATA LAPORAN (2 KOLOM) */
.report-meta-box {
    width: 100%;
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    border-radius: 4px;
    padding: 10px 14px;
    box-sizing: border-box;
    font-size: 9.5pt;
}

.report-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
}

.report-meta-item {
    display: flex;
}

.report-meta-item .meta-label {
    width: 110px;
    font-weight: bold;
    color: #334155;
}

.report-meta-item .meta-colon {
    width: 12px;
}

.report-meta-item .meta-value {
    flex: 1;
    color: #0f172a;
}

/* RINGKASAN STATISTIK CARDS */
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.report-summary-card {
    border: 1px solid #94a3b8;
    background-color: #f1f5f9;
    border-radius: 4px;
    padding: 8px 10px;
    text-align: center;
    box-sizing: border-box;
}

.report-summary-card .card-title {
    font-size: 8.5pt;
    text-transform: uppercase;
    font-weight: bold;
    color: #475569;
    margin-bottom: 2px;
}

.report-summary-card .card-value {
    font-size: 13pt;
    font-weight: bold;
    color: #0f172a;
}

/* TABEL LAPORAN RESMI */
.report-table-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

table.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
}

table.report-table th,
table.report-table td {
    border: 1px solid #334155;
    padding: 6px 8px;
    vertical-align: middle;
}

table.report-table th {
    background-color: #e2e8f0 !important;
    color: #0f172a;
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
    font-size: 9pt;
    letter-spacing: 0.3px;
}

table.report-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

table.report-table td.text-center { text-align: center; }
table.report-table td.text-right { text-align: right; }
table.report-table td.text-left { text-align: left; }

/* BADGES IN PRINT */
.report-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8.5pt;
    font-weight: bold;
    text-align: center;
    border: 1px solid #94a3b8;
}

.report-badge-success { background-color: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.report-badge-warning { background-color: #fefce8; color: #854d0e; border-color: #fef08a; }
.report-badge-danger  { background-color: #fef2f2; color: #991b1b; border-color: #fecaca; }
.report-badge-info    { background-color: #f0f9ff; color: #075985; border-color: #bae6fd; }
.report-badge-secondary{ background-color: #f8fafc; color: #334155; border-color: #cbd5e1; }

/* BLOK TANDA TANGAN */
.signature-section {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    page-break-inside: avoid;
}

.signature-box {
    width: 250px;
    text-align: center;
    font-size: 10pt;
}

.signature-box .sig-city-date {
    margin-bottom: 4px;
}

.signature-box .sig-title {
    font-weight: bold;
    margin-bottom: 60px; /* Space for physical signature / stamp */
}

.signature-box .sig-name {
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 2px;
}

.signature-box .sig-nip {
    font-size: 9pt;
    color: #1e293b;
}

/* FOOTER DOKUMEN */
.report-footer {
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8.5pt;
    color: #64748b;
    font-style: italic;
    page-break-inside: avoid;
}

/* PRINT MEDIA OVERRIDES */
@media print {
    .report-action-bar {
        display: none !important;
    }

    body.report-body {
        background: #ffffff !important;
    }

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

    table.report-table {
        page-break-inside: auto;
    }

    table.report-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    table.report-table thead {
        display: table-header-group;
    }

    table.report-table tfoot {
        display: table-footer-group;
    }
}
