html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

@page {
    size: A4 landscape;
    /* Lề thật trên mọi trang (trang 1 đáy + trang 2 đỉnh). Ẩn URL bằng title trống + @top/@bottom none trong JS. */
    margin: 8mm;
}

@media print {
    html,
    body {
        height: auto !important;
        overflow: visible !important;
        width: 100% !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Không scoped — áp dụng cả Tiến độ và Dự toán. */
    .progress-page {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .progress-page,
    .progress-page .progress-table,
    .progress-page .legend,
    .progress-page .legend-color,
    .progress-page .timeline-cell,
    .progress-page thead th {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .progress-page .table-wrapper {
        display: block !important;
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        width: 100% !important;
        border: 0 !important;
        background: transparent !important;
    }

    .progress-page .progress-table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        /* separate + chỉ viền phải/dưới: Chrome collapse hay mất nét đứng khi in nhiều trang. */
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    .progress-page .progress-table th,
    .progress-page .progress-table td {
        border: 0 !important;
        border-right: 0.75pt solid #000 !important;
        border-bottom: 0.75pt solid #000 !important;
    }

    .progress-page .progress-table thead th {
        border-top: 0.75pt solid #000 !important;
    }

    .progress-page .progress-table .col-no {
        border-left: 0.75pt solid #000 !important;
    }

    .progress-page .gantt-header-track {
        position: absolute !important;
        inset: 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        align-items: stretch !important;
    }

    .progress-page td.gantt-cell,
    .progress-page th.col-gantt {
        position: relative !important;
        height: 1px !important;
        min-height: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
        vertical-align: top !important;
        background-color: #ffffff !important;
        background-image: none !important;
    }

    .progress-page .gantt-track {
        position: absolute !important;
        inset: 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        align-items: stretch !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .progress-page .gantt-header-day,
    .progress-page .gantt-track > .timeline-cell {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        align-self: stretch !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        border-right: 0.75pt solid #000 !important;
        background-image: none !important;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .progress-page .gantt-header-day {
        height: 100% !important;
        min-height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }

    .progress-page .gantt-track > .timeline-cell {
        height: 100% !important;
        min-height: 100% !important;
    }

    .progress-page .gantt-header-day:last-child,
    .progress-page .gantt-track > .timeline-cell:last-child {
        border-right: 0 !important;
        background-image: none !important;
    }

    .progress-page .timeline-cell.actual-progress,
    .progress-page .timeline-cell.sunday.actual-progress {
        background-color: #00bf8f !important;
        box-shadow: none !important;
    }

    .progress-page .timeline-cell.today-progress,
    .progress-page .timeline-cell.sunday.today-progress {
        background-color: #63efbe !important;
        box-shadow: none !important;
    }

    .progress-page .timeline-cell.ahead-progress,
    .progress-page .timeline-cell.sunday.ahead-progress {
        background-color: #00e5e5 !important;
        box-shadow: none !important;
    }

    .progress-page .timeline-cell.slow-progress,
    .progress-page .timeline-cell.sunday.slow-progress {
        background-color: #f4b900 !important;
        box-shadow: none !important;
    }

    .progress-page .timeline-cell.overdue,
    .progress-page .timeline-cell.sunday.overdue {
        background-color: #ff1010 !important;
        box-shadow: none !important;
    }

    .progress-page .timeline-cell.sunday:not(.actual-progress):not(.today-progress):not(.ahead-progress):not(.slow-progress):not(.overdue) {
        background-color: #eeeeee !important;
        box-shadow: none !important;
    }

    .progress-page tr.virtual-spacer {
        display: none !important;
    }

    .progress-page .progress-table td:not(.gantt-cell),
    .progress-page .progress-table th:not(.col-gantt) {
        height: auto !important;
        min-height: 0 !important;
    }

    .progress-page .progress-table input,
    .progress-page .progress-table select,
    .progress-page .progress-table textarea,
    .progress-page .progress-table span,
    .progress-page .progress-table .task-name-cell,
    .progress-page .progress-table .task-number {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0.08mm 0.3mm !important;
        line-height: 1.12 !important;
        font-size: 6.5pt !important;
    }

    .progress-page .header-actions,
    .progress-page .header-admin-flyout,
    .progress-page .filter-toggle,
    .progress-page .filter-dropdown,
    .progress-page .filter-backdrop,
    .progress-page .sheet-toast,
    .progress-page .context-menu,
    .progress-page .logout-button,
    .progress-page .user-info,
    .progress-page .col-sheet-line,
    .progress-page .confirm-overlay,
    .progress-page .sheet-locked-banner {
        display: none !important;
    }
}

.placeholder-page {
    padding: 24px 24px 24px 56px;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2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LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    background: rgba(248, 249, 251, 0.94);
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal .reconnect-dialog {
    max-width: 28rem;
    margin: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid #c5ccd6;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: #1f2a37;
    text-align: center;
}

#components-reconnect-modal .reconnect-dialog p {
    white-space: pre-line;
}

#components-reconnect-modal .show,
#components-reconnect-modal .failed,
#components-reconnect-modal .rejected {
    display: none;
    margin: 0;
}

#components-reconnect-modal.components-reconnect-show .show,
#components-reconnect-modal.components-reconnect-failed .failed,
#components-reconnect-modal.components-reconnect-rejected .rejected {
    display: block;
}
