/* --- Diambil apa adanya dari Report UPS (index.html) agar output PDF identik --- */
:root { --primary: #2563eb; --danger: #ef4444; --warning: #f59e0b; --bg: #f3f4f6; --text: #1f2937; --border-light: #e5e7eb; }
body { font-family: Arial, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 0; }
* { box-sizing: border-box; }

/* --- UI SCREEN (INPUT) --- */
.navbar { background: white; padding: 15px 30px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 18px; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.brand img { height: 30px; }
.input-wrapper { max-width: 1300px; margin: 20px auto; padding: 0 20px; display: grid; grid-template-columns: 280px 1fr; gap: 20px; }

.card { background: white; border-radius: 8px; border: 1px solid var(--border-light); padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.card-header { font-size: 13px; font-weight: 700; color: #6b7280; text-transform: uppercase; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; }
label { display: block; font-size: 11px; font-weight: 700; color: #4b5563; margin-bottom: 4px; }
input, select { width: 100%; padding: 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; }
.btn { width: 100%; padding: 12px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 13px; margin-top: 10px; transition: 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #4b5563; color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-success { background: #10b981; color: white; }
.btn-info { background: #3b82f6; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-print { background: #059669; color: white; display: none; }
.btn:disabled { background: #ccc; cursor: not-allowed; }

.input-area { background: white; border-radius: 8px; border: 1px solid var(--border-light); padding: 20px; min-height: 500px; }
textarea { width: 100%; font-family: Arial, sans-serif; font-size: 12px; border: 1px solid #ccc; padding: 5px; }
#processStatus { font-size: 11px; color: var(--primary); font-weight: bold; margin-top: 5px; display: none; }

/* --- DEFAULT SETTINGS POPUP --- */
#biznetDefaultsPopup { position:fixed; inset:0; background:rgba(17,24,39,.55); z-index:9999; display:flex; align-items:center; justify-content:center; }
.defaults-dialog { width:340px; background:#fff; border-radius:8px; border:1px solid var(--border-light); padding:22px; box-shadow:0 12px 35px rgba(0,0,0,.25); }
.defaults-title { font-size:16px; font-weight:800; color:var(--primary); margin-bottom:18px; }
.defaults-dialog label { margin-top:10px; }
.defaults-dialog button { width:100%; margin-top:18px; padding:11px; border:0; border-radius:4px; background:var(--primary); color:#fff; font-weight:700; cursor:pointer; }

/* --- REPORT CONTAINER --- */
#reportContainer {
    display: none; background: #555; padding: 40px; flex-direction: column;
    align-items: center; gap: 20px; margin-top: 40px; border-top: 5px solid #333;
}

/* --- PRINT ENGINE --- */
@media print {
    .navbar, .input-wrapper { display: none !important; }
    body { background: white; margin: 0; padding: 0; }
    #reportContainer { display: block !important; background: white; padding: 0; margin: 0; border: none; }
    @page { size: A4; margin: 0; }
    .page { box-shadow: none !important; margin: 0 !important; page-break-after: always; }
}

/* --- REPORT LAYOUT --- */
.page {
    width: 210mm; height: 296mm; background: white;
    padding: 10mm 15mm 5mm 15mm;
    display: flex; flex-direction: column; position: relative; overflow: hidden;
    font-family: Arial, sans-serif; color: #000;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.header-area { margin-bottom: 15px; }
.title-box { display: flex; align-items: center; border: 2px solid #000; padding: 5px 10px; margin-bottom: 5px; height: 70px; }
.tb-logo { width: 20%; display: flex; align-items: center; justify-content: flex-start; }
.tb-logo img { max-height: 50px; max-width: 100%; }
.tb-text { width: 80%; text-align: center; }
.tb-text h1 { font-size: 22px; font-weight: bold; margin: 0; text-transform: uppercase; color: #000; }

table.meta-box { width: 100%; border-collapse: collapse; font-size: 11px; border: 2px solid #000; }
table.meta-box td { border: 1px solid #000; padding: 4px 8px; vertical-align: middle; }
.m-lbl { font-weight: bold; background-color: #f0f0f0; width: 15%; white-space: nowrap; }
.m-val { width: 35%; }

.section-bar {
    background: transparent; color: #000; font-size: 14px; font-weight: 800;
    padding: 5px 0; margin-bottom: 10px; text-transform: uppercase;
    border-bottom: 2px solid #000;
}

.content-area { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 15px; margin-bottom: 10px; overflow: hidden; }
.print-card { border: 1px solid #000; display: flex; flex-direction: column; height: 100%; overflow: hidden; background: white; }
.photo-part { flex: 1 1 auto; min-height: 0; border-bottom: 1px solid #000; display: flex; align-items: center; justify-content: center; background: #fff; padding: 5px; }
.photo-part img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: none !important; }
.data-part { flex: 0 0 auto; background: white; padding: 8px 10px; font-size: 11px; }
.d-head { font-weight: bold; font-size: 12px; color: #000; margin-bottom: 5px; padding-bottom: 2px; border-bottom: 2px solid #000; display: flex; justify-content: space-between; }
.d-cap { font-size: 11px; line-height: 1.35; white-space: pre-wrap; color: #000; }

.footer-area { flex: 0 0 auto; border-top: 2px solid #000; padding-top: 8px; font-size: 10px; text-align: left; line-height: 1.4; color: #444; }
.footer-bold { font-weight: bold; font-size: 11px; color: #000; }

/* --- TAMBAHAN: editor foto (weekly & AC) --- */
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.slot { border: 1px solid var(--border-light); border-radius: 6px; background: #fff; overflow: hidden; }
.slot.dragging { opacity: 0.4; }
.slot.over { outline: 2px dashed var(--primary); }
.slot-head { display: flex; justify-content: space-between; align-items: center; background: #f8fafc; padding: 6px 8px; font-size: 11px; font-weight: 700; color: #374151; border-bottom: 1px solid var(--border-light); cursor: grab; }
.slot-thumb { height: 130px; display: flex; align-items: center; justify-content: center; background: #f3f4f6; }
.slot-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.slot-body { padding: 8px; }
.slot-body textarea { height: 60px; resize: vertical; border-radius: 4px; }
.x-btn { background: var(--danger); color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 10px; padding: 3px 7px; }
.pg-badge { background: var(--primary); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 10px; }

/* Page list (AC) */
.pagelist { display: flex; flex-direction: column; gap: 8px; }
.pageitem { border: 1px solid var(--border-light); border-radius: 6px; padding: 8px; background: #fff; cursor: grab; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pageitem.active { border-color: var(--primary); background: #eff6ff; }
.pageitem.dragging { opacity: 0.4; }
.pageitem.over { outline: 2px dashed var(--primary); }
.pageitem .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#photoViewer { display:none; position:fixed; inset:0; z-index:10000; background:rgba(0,0,0,.82); align-items:center; justify-content:center; padding:40px; }
#photoViewer.open { display:flex; }
#photoViewer img { max-width:95%; max-height:95%; object-fit:contain; }
#photoViewer button { position:absolute; top:16px; right:22px; border:0; background:transparent; color:#fff; font-size:38px; cursor:pointer; }
.weekly-photo, .ac-photo { cursor:zoom-in; }
@media print { #photoViewer { display:none !important; } }
