/* ============================================================
   assets/css/report-builder.css
============================================================ */

body {
    background-color: #f8f9fa;
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden; /* Prevent body scroll, use panel scroll */
}

/* TOP BAR */
.topbar {
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
}
.brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    color: #333;
}
.brand-icon {
    background-color: #0d6efd;
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 10px;
}
.topbar-title {
    font-weight: 600;
    color: #6c757d;
}

/* BUILDER SPLIT SCREEN */
.builder {
    display: flex;
    height: calc(100vh - 60px);
}

/* KIRI: FORM PANEL */
.form-panel {
    width: 45%;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 20px 30px;
}
.form-header h4 {
    font-weight: 700;
    color: #212529;
}
.form-header p {
    color: #6c757d;
    font-size: 14px;
}
.section-card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    overflow: hidden;
}
.section-header {
    background-color: #f8f9fa;
    padding: 12px 20px;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-body {
    padding: 20px;
}
.live-input {
    font-size: 14px;
}
.small-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* 3 KOTAK UPLOAD GAMBAR & BUTANG X */
.image-upload-box {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    height: 120px;
    background-color: #f8f9fa;
    position: relative;
    text-align: center;
    transition: all 0.2s;
    overflow: hidden;
}
.image-upload-box:hover {
    border-color: #0d6efd;
    background-color: #e9ecef;
}
.upload-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    cursor: pointer;
    color: #6c757d;
}
.upload-label i {
    font-size: 24px;
}
.preview-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
}
.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.btn-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.btn-remove:hover {
    background-color: #bb2d3b;
}

/* LOGO UPLOAD (SINGLE) */
.logo-upload {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    display: block;
    background-color: #f8f9fa;
}
.logo-upload:hover { border-color: #0d6efd; }

/* KANAN: PREVIEW PANEL (A4) */
.preview-panel {
    width: 55%;
    background-color: #525659;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.a4-paper {
    width: 210mm;
    min-height: 297mm;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    padding: 20mm;
    font-family: 'Arial', sans-serif;
    color: #000;
}

/* GAMBAR DALAM A4 PREVIEW */
.report-images {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.report-images img {
    height: 150px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border: 1px solid #eee;
    padding: 2px;
}

/* RESPONSIVE UNTUK MOBILE */
@media (max-width: 992px) {
    .builder { flex-direction: column; height: auto; }
    .form-panel, .preview-panel { width: 100%; height: auto; overflow: visible; }
}

/* PRINT CSS - HANYA CETAK KERTAS A4 */
@media print {
    body * { visibility: hidden; }
    .a4-paper, .a4-paper * { visibility: visible; }
    .a4-paper {
        position: absolute;
        left: 0; top: 0;
        margin: 0; padding: 15mm;
        box-shadow: none; width: 100%; height: 100%;
    }
}