/* =========================================================
   ENNEAGRAM EXECUTIVE PDF REPORT STYLES (A4 MULTI-PAGE)
   Thiết kế chuẩn in ấn A4 (210mm x 297mm) cho xuất PDF chất lượng cao
   ========================================================= */

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

:root {
    --report-primary: #0284c7;
    --report-primary-dark: #0369a1;
    --report-accent: #6366f1;
    --report-dark: #0f172a;
    --report-text: #1e293b;
    --report-text-muted: #64748b;
    --report-border: #e2e8f0;
    --report-bg-subtle: #f8fafc;
    --report-gold: #d97706;
    --report-emerald: #059669;
    --report-rose: #e11d48;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

body {
    background-color: #e2e8f0;
    color: var(--report-text);
    line-height: 1.55;
    font-size: 13.5px;
}

/* Thanh điều khiển nổi trên đầu trang (Ẩn hoàn toàn khi in/xuất PDF) */
.report-top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #0f172a;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.top-bar-info {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
}

.top-bar-info strong {
    color: #38bdf8;
}

.top-bar-actions {
    display: flex;
    gap: 12px;
}

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

.btn-primary-action {
    background: #0284c7;
    color: #fff;
}
.btn-primary-action:hover { background: #0369a1; }

.btn-secondary-action {
    background: #334155;
    color: #fff;
}
.btn-secondary-action:hover { background: #475569; }

/* Khung hiển thị trang A4 */
.report-document {
    max-width: 210mm;
    margin: 24px auto;
}

.report-page {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    padding: 16mm 18mm 18mm 18mm;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    page-break-after: always;
    break-after: page;
    display: flex;
    flex-direction: column;
}

/* Header & Footer trang A4 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid var(--report-border);
    padding-bottom: 8px;
    margin-bottom: 18px;
    font-size: 11px;
    color: var(--report-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.page-header .brand-tag {
    font-weight: 700;
    color: var(--report-primary);
}

.page-footer {
    margin-top: auto;
    border-top: 1px solid var(--report-border);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    color: var(--report-text-muted);
}

.page-num::after {
    content: "Trang " counter(page);
}

/* ================= TRANG 1: BÌA BÁO CÁO ================= */
.cover-page {
    justify-content: space-between;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 60%, #f0fdf4 100%);
    border: 1px solid var(--report-border);
}

.cover-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cover-logo-circle {
    width: 44px;
    height: 44px;
    background: var(--report-primary);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-brand-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--report-dark);
    letter-spacing: 0.5px;
}

.cover-brand-subtitle {
    font-size: 11px;
    color: var(--report-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cover-hero-content {
    margin: 40px 0;
    text-align: center;
}

.cover-badge {
    display: inline-block;
    background: #e0f2fe;
    color: var(--report-primary-dark);
    border: 1px solid #bae6fd;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.cover-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--report-dark);
    line-height: 1.25;
    margin-bottom: 12px;
}

.cover-subtitle {
    font-size: 15px;
    color: var(--report-text-muted);
    max-width: 500px;
    margin: 0 auto 30px auto;
}

/* Hộp thông tin người nhận ở bìa */
.cover-recipient-card {
    background: #ffffff;
    border: 2px solid var(--report-border);
    border-radius: 12px;
    padding: 24px 30px;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    text-align: left;
}

.cover-recipient-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13.5px;
    border-bottom: 1px dashed #f1f5f9;
    padding-bottom: 6px;
}

.cover-recipient-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cover-recipient-label {
    color: var(--report-text-muted);
}

.cover-recipient-val {
    font-weight: 700;
    color: var(--report-dark);
}

.cover-dominant-preview {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    margin-top: 25px;
}

.cover-dominant-preview h3 {
    font-size: 20px;
    color: var(--report-primary-dark);
    margin-bottom: 4px;
}

.cover-dominant-preview p {
    font-size: 13px;
    font-style: italic;
    color: #475569;
}

.cover-footer-note {
    text-align: center;
    font-size: 11px;
    color: var(--report-text-muted);
    border-top: 1px solid var(--report-border);
    padding-top: 12px;
}

/* ================= CÁC PHẦN NỘI DUNG CHÍNH ================= */
.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid var(--report-primary);
    padding-left: 12px;
    margin-bottom: 16px;
}

.section-title-wrap h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--report-dark);
}

/* Grid & Cards */
.report-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.report-card {
    background: var(--report-bg-subtle);
    border: 1px solid var(--report-border);
    border-radius: 8px;
    padding: 14px 16px;
}

.report-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--report-primary-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Radar Chart Canvas trong PDF */
.radar-pdf-container {
    text-align: center;
    padding: 10px 0;
}

.radar-pdf-container canvas {
    max-width: 320px;
    max-height: 320px;
    margin: 0 auto;
}

/* Bảng xếp hạng 9 nhóm */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 6px;
}

.ranking-table th {
    background: #f1f5f9;
    color: var(--report-dark);
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--report-border);
    font-weight: 700;
}

.ranking-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.ranking-table tr.dominant-row {
    background: #e0f2fe;
    font-weight: 700;
}

/* 3 Trung tâm năng lượng */
.triad-box-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12.5px;
}

.triad-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.triad-bar-fill {
    height: 100%;
    border-radius: 999px;
}

/* Danh sách điểm mạnh & điểm yếu */
.bullet-list-check, .bullet-list-warn {
    list-style: none;
    padding-left: 0;
}

.bullet-list-check li, .bullet-list-warn li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.bullet-list-check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--report-emerald);
    font-weight: 800;
}

.bullet-list-warn li::before {
    content: "⚠";
    position: absolute;
    left: 0;
    color: var(--report-rose);
    font-weight: 800;
}

/* Khung trích dẫn / Lời khuyên */
.callout-box {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.6;
}

.callout-integration {
    background: #ecfdf5;
    border-left: 4px solid var(--report-emerald);
    color: #065f46;
}

.callout-disintegration {
    background: #fff1f2;
    border-left: 4px solid var(--report-rose);
    color: #9f1239;
}

.callout-advice {
    background: #eff6ff;
    border-left: 4px solid var(--report-primary);
    color: #1e40af;
}

/* Nghề nghiệp tags */
.careers-inline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.c-tag {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: var(--report-primary-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

/* Khung chữ ký xác thực ở trang cuối */
.report-sign-block {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--report-border);
}

.sign-col {
    text-align: center;
    width: 200px;
}

.sign-title {
    font-size: 12px;
    color: var(--report-text-muted);
    margin-bottom: 45px;
}

.sign-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--report-dark);
}

/* ================= PRINT MEDIA ================= */
@media print {
    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-top-bar {
        display: none !important;
    }

    .report-document {
        margin: 0 !important;
        max-width: 100% !important;
    }

    .report-page {
        margin: 0 !important;
        padding: 10mm 15mm 15mm 15mm !important;
        box-shadow: none !important;
        page-break-after: always !important;
        break-after: page !important;
        min-height: auto !important;
        height: 297mm !important;
    }
}
