#egp-wrapper {
    background-color: #e0e5ec; font-family: 'Segoe UI', Tahoma, sans-serif;
    display: flex; flex-direction: column; height: 95vh; min-height: 800px;
    border: 1px solid #ccc; box-sizing: border-box; color: #333; position: relative;
}
#egp-wrapper * { box-sizing: border-box; }

/* HEADER */
#egp-wrapper #header {
    background: #2c3e50; color: white; padding: 0 20px; height: 60px;
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
#egp-wrapper .logo { font-weight: 700; font-size: 18px; margin-right: 20px; }
#egp-wrapper .tab-container { display: flex; gap: 5px; flex: 1; }
#egp-wrapper .tab-btn {
    background: transparent; color: #ccc; border: none; padding: 10px 20px;
    font-weight: 600; cursor: pointer; height: 100%;
}
#egp-wrapper .tab-btn.active { background: white; color: #2c3e50; border-radius: 5px 5px 0 0; }

/* MAIN CONTENT */
#egp-wrapper #main-content { flex: 1; overflow: hidden; display: flex; position: relative; }
#egp-wrapper #paper-editor-view { display: flex; width: 100%; height: 100%; }

/* SIDEBAR */
#egp-wrapper #sidebar {
    width: 380px; background: white; border-right: 1px solid #ccc; padding: 15px;
    overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px;
}
#egp-wrapper .input-group { display: flex; flex-direction: column; margin-bottom: 8px; }
#egp-wrapper label { font-size: 11px; font-weight: bold; color: #666; text-transform: uppercase; margin-bottom: 3px; }
#egp-wrapper input, #egp-wrapper select, #egp-wrapper textarea {
    padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; background: #f9f9f9; width: 100%;
}
#egp-wrapper .btn-primary { background: #2563eb; color: white; padding: 10px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; }
#egp-wrapper .btn-add-type { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; padding: 5px; cursor: pointer; font-size: 12px; font-weight: bold; }

/* SECTIONS */
#egp-wrapper .section-block { background: white; border: 1px solid #ddd; padding: 10px; border-radius: 6px; margin-bottom: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
#egp-wrapper .section-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
#egp-wrapper .section-title { font-weight: bold; font-size: 14px; }
#egp-wrapper .q-block { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 3px solid #3b82f6; padding: 8px; margin-bottom: 5px; font-size: 13px; }
#egp-wrapper .q-block-header { display: flex; justify-content: space-between; margin-bottom: 5px; color: #64748b; font-size: 11px; font-weight: bold; }

/* PREVIEW & PRINT */
#egp-wrapper #preview-area { flex: 1; background: #525659; overflow: auto; padding: 30px; display: flex; justify-content: center; }
#egp-wrapper .page {
    background: white; width: 210mm; height: 297mm; padding: 10mm; margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); display: flex; flex-direction: column;
    font-family: "Times New Roman", serif; color: black;
}
#egp-wrapper .exam-copy { height: 48%; border-bottom: 1px dashed #999; margin-bottom: 2%; overflow: hidden; }
#egp-wrapper .exam-copy:last-child { border: none; margin: 0; }
#egp-wrapper .header-text { text-align: center; font-weight: bold; font-size: 14px; text-transform: uppercase; line-height: 1.3; }
#egp-wrapper .meta-row { display: flex; justify-content: space-between; border-top: 2px solid black; margin-top: 5px; padding-top: 2px; font-weight: bold; font-size: 12px; }
#egp-wrapper .divider { border-bottom: 2px solid black; margin-bottom: 10px; }
#egp-wrapper .section-title-preview { background: #eee; font-weight: bold; padding: 2px 5px; margin: 5px 0; display: flex; justify-content: space-between; }
#egp-wrapper ol { margin: 0; padding-left: 20px; }
#egp-wrapper li { font-size: 13px; line-height: 1.4; text-align: justify; margin-bottom: 2px; }
#egp-wrapper .mcq-options { display: flex; flex-wrap: wrap; gap: 10px; font-style: italic; margin-top: 2px; }

/* BANK FULL VIEW */
#egp-wrapper #bank-full-view { display: none; width: 100%; height: 100%; flex-direction: column; background: #f1f5f9; }
#egp-wrapper .bank-view-header { background: white; padding: 15px; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; }
#egp-wrapper #bank-full-content { flex: 1; display: flex; overflow: hidden; }
#egp-wrapper #bank-full-list { flex: 1; padding: 20px; overflow-y: auto; }
#egp-wrapper #bank-full-editor { width: 0; background: white; border-left: 1px solid #ddd; transition: width 0.3s; overflow-y: auto; }
#egp-wrapper #bank-full-editor.expanded { width: 400px; padding: 20px; }
#egp-wrapper .bank-item { background: white; padding: 10px; margin-bottom: 8px; border-radius: 6px; display: flex; align-items: center; gap: 10px; border: 1px solid #e2e8f0; }
#egp-wrapper .badge { font-size: 10px; padding: 3px 6px; border-radius: 4px; color: white; font-weight: bold; }
#egp-wrapper .badge-chapter { background: #8b5cf6; }
#egp-wrapper .bank-q-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
#egp-wrapper .btn-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 4px; cursor: pointer; color: white; }
#egp-wrapper .btn-add-bank { background: #10b981; }
#egp-wrapper .btn-del-bank { background: #ef4444; }

/* PDF EXPORT MODE (CRITICAL) */
#egp-wrapper .pdf-export-mode .page { margin: 0 !important; box-shadow: none !important; }