/* =========================================================================
 * bao_cao.css — CSS in PDF cho Báo cáo Định giá & Thông tin BĐS
 * Register: Product · Tông chuyên nghiệp, Navy + Gold + restrained
 * ========================================================================= */

/* ========= RESET & BASE ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f5f5f5;
}

body {
    padding: 8px;
    margin: 0;
}

/* ========= PAGE SETUP ========= */
@page {
    size: A4;
    margin: 15mm;
}

/* ========= HEADER ========= */
.bc-header {
    background: #ffffff;
    border-bottom: 2px solid #1a365d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bc-header-top {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bc-logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.bc-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    print-color-adjust: exact;
}

.bc-brand {
    flex: 1;
}

.bc-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a365d;
    line-height: 1.2;
    margin-bottom: 2px;
}

.bc-subtitle {
    font-size: 12px;
    color: #666;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.bc-nav-main {
    flex-shrink: 0;
}

.bc-nav-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    color: #1a365d;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: all 150ms ease;
}

.bc-nav-link:hover {
    background: #f0f0f0;
    border-color: #1a365d;
}

/* ========= TOOLBAR ========= */
.bc-toolbar {
    padding: 12px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.bc-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bc-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.bc-label-text {
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

.bc-report-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    text-decoration: none;
    transition: all 150ms ease;
    white-space: nowrap;
}

.bc-btn:hover {
    background: #f0f0f0;
    border-color: #1a365d;
    color: #1a365d;
}

.bc-btn:focus-visible {
    outline: 2px solid #1a365d;
    outline-offset: 2px;
}

.bc-btn:active {
    background: #e8e8e8;
}

.bc-btn-primary {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 10px 8px;
    gap: 4px;
}

.bc-btn-print {
    background: #1a365d;
    color: #ffffff;
    border-color: #1a365d;
}

.bc-btn-print:hover {
    background: #0d1f3c;
    border-color: #0d1f3c;
}

.bc-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bc-badge-demo {
    background: #fff3cd;
    color: #856404;
}

.bc-badge-live {
    background: #d4edda;
    color: #155724;
}

.bc-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    color: #1a1a1a;
    background: #ffffff;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 150ms ease;
}

.bc-select:hover {
    border-color: #1a365d;
}

.bc-select:focus-visible {
    outline: 2px solid #1a365d;
    outline-offset: 2px;
}

/* ========= MAIN CONTENT ========= */
.bc-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.bc-content {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    background: #ffffff;
}

.bc-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

/* ========= FOOTER ========= */
.bc-footer {
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.bc-footer-text {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bc-sep {
    color: #ddd;
}

/* ========= REPORT STRUCTURE (shared with S2) ========= */
.bc-report {
    margin-bottom: 24px;
    background: #fafafa;
    padding: 16px;
    border-radius: 6px;
    break-inside: avoid;
}

.bc-report-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #1a365d;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-report-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a365d;
    margin: 0;
}

.bc-report-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 0 0;
}

.bc-status-label {
    display: inline-block;
    padding: 4px 8px;
    background: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ========= SECTIONS & CONTENT ========= */
.bc-section {
    margin-bottom: 20px;
    break-inside: avoid;
}

.bc-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
}

.bc-section-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.bc-muc {
    margin-bottom: 16px;
    padding: 12px;
    background: #fafafa;
    border-left: 3px solid #0066cc;
    border-radius: 4px;
    break-inside: avoid;
}

.bc-muc-title {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    font-size: 14px;
}

.bc-muc-content {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* ========= TABLES ========= */
.bc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    break-inside: avoid;
    font-size: 13px;
}

.bc-table th {
    background: #f0f0f0;
    padding: 8px;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    border: 1px solid #ddd;
}

.bc-table td {
    padding: 8px;
    border: 1px solid #ddd;
    color: #333;
}

.bc-table tr:nth-child(even) {
    background: #fafafa;
}

.bc-table tbody tr:hover {
    background: #f0f7ff;
}

/* ========= LIST & GRID ========= */
.bc-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.bc-list li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.bc-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #0066cc;
    font-weight: bold;
}

.bc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.bc-card {
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    break-inside: avoid;
}

.bc-card-title {
    font-weight: 600;
    color: #0066cc;
    font-size: 13px;
    margin-bottom: 4px;
}

.bc-card-content {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

/* ========= PRICE RANGE DISPLAY ========= */
.bc-price-range {
    font-size: 18px;
    font-weight: 600;
    color: #0066cc;
    margin: 8px 0;
    font-family: "Monaco", "Courier New", monospace;
}

.bc-range-min,
.bc-range-max {
    display: inline;
    margin: 0 4px;
}

/* ========= WARNING BOX ========= */
.bc-warning {
    padding: 12px;
    background: #fff9e6;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
    line-height: 1.5;
    margin: 12px 0;
    break-inside: avoid;
    print-color-adjust: exact;
}

/* ========= SOURCE LIST ========= */
.bc-sources {
    margin-top: 16px;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
}

.bc-sources-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.bc-source-item {
    padding: 4px 0;
    line-height: 1.4;
}

/* ========= RESPONSIVE ========= */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .bc-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .bc-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .bc-toolbar-left {
        width: 100%;
    }

    .bc-report-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .bc-btn {
        flex: 1;
        min-width: 90px;
    }

    .bc-select {
        width: 100%;
    }

    .bc-btn-print {
        width: 100%;
    }

    .bc-content {
        padding: 12px;
    }

    .bc-placeholder {
        padding: 30px 12px;
    }
}

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

    /* Ẩn thanh điều khiển */
    .bc-toolbar {
        display: none !important;
    }

    #chon-ho-so {
        display: none !important;
    }

    #btn-in {
        display: none !important;
    }

    .bc-nav-main {
        display: none !important;
    }

    /* Header giữ lại nhưng không có đường viền */
    .bc-header {
        background: #ffffff;
        border-bottom: 1px solid #999;
    }

    .bc-header-top {
        padding: 16px 0;
        flex-direction: row;
    }

    .bc-nav-link {
        display: none;
    }

    /* Content full width, no padding */
    .bc-main {
        overflow: visible;
    }

    .bc-content {
        padding: 0;
        overflow: visible;
        background: #ffffff;
    }

    .bc-placeholder {
        display: none;
    }

    /* Footer giữ lại */
    .bc-footer {
        border-top: 1px solid #999;
        padding: 8px 0;
        font-size: 11px;
    }

    /* Report elements */
    .bc-report,
    .bc-section,
    .bc-muc,
    .bc-card,
    .bc-table,
    .bc-warning {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Logo: giữ màu */
    .bc-logo {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* Các khối nền màu */
    .bc-muc,
    .bc-card,
    .bc-warning {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    /* Links */
    a {
        color: #1a365d;
        text-decoration: underline;
    }

    /* Hide scrollbar */
    ::-webkit-scrollbar {
        display: none;
    }

    * {
        overflow: visible !important;
    }
}
