html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Danh mục bán hàng có hiệu lực theo thời gian. Các trang này dùng CSS
   toàn cục vì được chia sẻ giữa danh mục màu và chiết khấu. */
.sales-catalog-page { width: 100%; color: #334155; }
.sales-catalog-page * { box-sizing: border-box; }
.sales-catalog-page .page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sales-catalog-page .page-header h1 { margin: 0; color: #0f2744; font-size: 28px; font-weight: 750; line-height: 1.25; }
.sales-catalog-page .page-header p { margin: 6px 0 0; color: #64748b; font-size: 13px; }
.sales-catalog-page .header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.sales-catalog-page .form-card,
.sales-catalog-page .data-card { width: 100%; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 5px 18px rgba(15,39,68,.035); }
.sales-catalog-page .form-card { padding: 20px; }
.sales-catalog-page .data-card { margin-top: 18px; }
.sales-catalog-page .sales-catalog-form h2 { margin: 0 0 18px; color: #0f2744; font-size: 18px; font-weight: 750; }
.sales-catalog-page .sales-catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; align-items: end; }
.sales-catalog-page .sales-catalog-product { grid-column: span 2; }
.sales-catalog-page .form-field { min-width: 0; display: flex; flex-direction: column; }
.sales-catalog-page .form-field label { min-height: 20px; margin: 0 0 7px; color: #334155; font-size: 12px; font-weight: 700; }
.sales-catalog-page .form-field label span { color: #b91c1c; }
.sales-catalog-page .form-control { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1e293b; font-size: 13px; outline: none; }
.sales-catalog-page .form-control:focus { border-color: #173b63; box-shadow: 0 0 0 3px rgba(23,59,99,.09); }
.sales-catalog-page .sales-catalog-check { display: flex; align-items: center; gap: 9px; min-height: 42px; margin: 0; color: #334155; font-size: 13px; font-weight: 700; }
.sales-catalog-page .sales-catalog-check input { width: 18px; height: 18px; accent-color: #173b63; }
.sales-catalog-page .sales-catalog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.sales-catalog-page .primary-button,
.sales-catalog-page .secondary-button,
.sales-catalog-page .import-button,
.sales-catalog-page .edit-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border-radius: 8px; font-size: 12px; font-weight: 750; text-decoration: none; cursor: pointer; }
.sales-catalog-page .primary-button { border: 0; background: #173b63; color: #fff; }
.sales-catalog-page .secondary-button { border: 1px solid #cbd5e1; background: #fff; color: #173b63; }
.sales-catalog-page .import-button { border: 1px solid #bbd7c5; background: #f0fdf4; color: #166534; }
.sales-catalog-page .edit-button { min-height: 32px; padding: 0 11px; border: 1px solid #cbd5e1; background: #fff; color: #173b63; }
.sales-catalog-page button:disabled { opacity: .55; cursor: not-allowed; }
.sales-catalog-page .alert-error,
.sales-catalog-page .alert-success { margin: 0 0 16px; padding: 11px 13px; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.sales-catalog-page .alert-error { border: 1px solid #fecdd3; background: #fff1f2; color: #9f1239; }
.sales-catalog-page .alert-success { border: 1px solid #bbf7d0; background: #ecfdf5; color: #166534; }
.sales-catalog-page .table-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid #e2e8f0; }
.sales-catalog-page .table-header > div { display: flex; flex-direction: column; gap: 4px; }
.sales-catalog-page .table-header strong { color: #0f2744; font-size: 14px; }
.sales-catalog-page .table-header span { color: #94a3b8; font-size: 11px; }
.sales-catalog-page .table-wrapper { width: 100%; overflow-x: auto; }
.sales-catalog-page .data-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12px; }
.sales-catalog-page .data-table th { padding: 11px 13px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; text-align: left; white-space: nowrap; }
.sales-catalog-page .data-table td { padding: 12px 13px; border-bottom: 1px solid #edf1f5; color: #334155; vertical-align: middle; }
.sales-catalog-page .data-table tbody tr:hover { background: #fbfdff; }
.sales-catalog-page .data-table tbody tr:last-child td { border-bottom: 0; }
.sales-catalog-page .number-column { text-align: right !important; }
.sales-catalog-page .status-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.sales-catalog-page .status-badge.active { background: #ecfdf5; color: #15803d; }
.sales-catalog-page .status-badge.inactive { background: #f1f5f9; color: #64748b; }
.sales-catalog-page .empty-row { padding: 28px !important; color: #64748b !important; text-align: center; }
@media (max-width: 800px) {
    .sales-catalog-page .page-header { align-items: flex-start; flex-direction: column; }
    .sales-catalog-page .sales-catalog-grid { grid-template-columns: 1fr; }
    .sales-catalog-page .sales-catalog-product { grid-column: auto; }
    .sales-catalog-page .header-actions { justify-content: flex-start; }
}

/* Màn hình xem trước import Excel cho hai danh mục bán hàng. */
.catalog-import-page { width: 100%; color: #334155; }
.catalog-import-page * { box-sizing: border-box; }
.catalog-import-page .page-header { margin-bottom: 20px; }
.catalog-import-page .back-link { display: inline-flex; margin-bottom: 8px; color: #64748b; text-decoration: none; font-size: 12px; font-weight: 650; }
.catalog-import-page .page-header h1 { margin: 0; color: #0f2744; font-size: 26px; font-weight: 750; }
.catalog-import-page .page-header p { margin: 6px 0 0; color: #64748b; font-size: 13px; }
.catalog-import-page .form-card,
.catalog-import-page .data-card { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; }
.catalog-import-page .section-header,
.catalog-import-page .table-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid #e2e8f0; }
.catalog-import-page .section-header h2 { margin: 0; color: #0f2744; font-size: 15px; }
.catalog-import-page .section-header p,
.catalog-import-page .table-header span { display: block; margin: 4px 0 0; color: #94a3b8; font-size: 11px; }
.catalog-import-page .table-header > div { display: flex; flex-direction: column; }
.catalog-import-page .table-header strong { color: #0f2744; font-size: 14px; }
.catalog-import-page .upload-body { min-height: 78px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 16px 18px; }
.catalog-import-page .upload-body input[type=file] { max-width: 100%; color: #334155; font-size: 12px; }
.catalog-import-page .file-name { color: #173b63; font-size: 12px; font-weight: 750; }
.catalog-import-page .template-link { margin-left: auto; color: #166534; font-size: 12px; font-weight: 750; text-decoration: none; }
.catalog-import-page .alert-error,
.catalog-import-page .alert-warning,
.catalog-import-page .alert-success { margin: 14px 0; padding: 12px 14px; border-radius: 8px; font-size: 12px; line-height: 1.55; }
.catalog-import-page .upload-card .alert-error,
.catalog-import-page .upload-card .alert-success { margin: 0 18px 18px; }
.catalog-import-page .alert-error { border: 1px solid #fecdd3; background: #fff1f2; color: #9f1239; }
.catalog-import-page .alert-warning { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; }
.catalog-import-page .alert-success { border: 1px solid #bbf7d0; background: #ecfdf5; color: #166534; }
.catalog-import-page .summary-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.catalog-import-page .summary-card { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; }
.catalog-import-page .summary-card span { color: #64748b; font-size: 11px; }
.catalog-import-page .summary-card strong { margin-top: 5px; color: #173b63; font-size: 22px; }
.catalog-import-page .summary-card.warning strong { color: #b45309; }
.catalog-import-page .table-wrapper { max-height: 62vh; overflow: auto; }
.catalog-import-page .data-table { width: 100%; min-width: 1100px; border-collapse: collapse; font-size: 11px; }
.catalog-import-page .data-table th { position: sticky; z-index: 2; top: 0; padding: 10px 9px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; text-align: left; white-space: nowrap; }
.catalog-import-page .data-table td { padding: 8px 9px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
.catalog-import-page .data-table tr.row-error { background: #fff8f8; }
.catalog-import-page .cell-input { width: 100%; min-height: 34px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; font-size: 11px; outline: none; }
.catalog-import-page .cell-input:focus { border-color: #173b63; box-shadow: 0 0 0 2px rgba(23,59,99,.08); }
.catalog-import-page .code-input { min-width: 105px; color: #173b63; font-weight: 750; }
.catalog-import-page .name-input { min-width: 220px; }
.catalog-import-page .number-input { min-width: 110px; text-align: right; }
.catalog-import-page .date-input { min-width: 132px; }
.catalog-import-page .error-detail { display: block; max-width: 260px; margin-top: 4px; color: #b91c1c; line-height: 1.4; }
.catalog-import-page .import-status { display: inline-flex; min-height: 23px; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.catalog-import-page .import-status.ready { background: #eff6ff; color: #1d4ed8; }
.catalog-import-page .import-status.update { background: #f5f3ff; color: #6d28d9; }
.catalog-import-page .import-status.error { background: #fff1f2; color: #be123c; }
.catalog-import-page .import-status.done { background: #ecfdf5; color: #15803d; }
.catalog-import-page .primary-button,
.catalog-import-page .secondary-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border-radius: 8px; font-size: 12px; font-weight: 750; cursor: pointer; text-decoration: none; }
.catalog-import-page .primary-button { border: 0; background: #173b63; color: #fff; }
.catalog-import-page .secondary-button { border: 1px solid #cbd5e1; background: #fff; color: #173b63; }
.catalog-import-page button:disabled { opacity: .55; cursor: not-allowed; }
.catalog-import-page .form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.catalog-import-page .state-panel { margin-top: 16px; padding: 28px; color: #64748b; }
.catalog-import-page .number-column { text-align: right !important; }
@media (max-width: 760px) {
    .catalog-import-page .summary-grid { grid-template-columns: 1fr; }
    .catalog-import-page .upload-body { align-items: flex-start; flex-direction: column; }
    .catalog-import-page .template-link { margin-left: 0; }
}

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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Unified confirmation dialog for status/chốt/hủy actions. */
/* =========================================================
   GLOBAL MODAL - OVERRIDE TOÀN BỘ CSS ISOLATION CŨ
   ========================================================= */

.confirm-box {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;

    z-index: 5000 !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;

    gap: 0 !important;

    width: min(460px, calc(100vw - 32px)) !important;
    max-height: calc(100vh - 40px) !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow-y: auto !important;

    border: 1px solid #d9e2ec !important;
    border-radius: 14px !important;

    background: #ffffff !important;

    /*
       Shadow thứ nhất = nền tối toàn màn hình.
       Shadow thứ hai = shadow modal.
       Không dùng ::before màu tối nữa vì nó phủ lên modal.
    */
    box-shadow:
        0 0 0 100vmax rgba(15, 39, 68, 0.48),
        0 22px 60px rgba(15, 39, 68, 0.24) !important;
}


/* Không cho pseudo-element cũ phủ màu lên modal */
.confirm-box::before,
.confirm-box::after {
    display: none !important;
    content: none !important;
}


/* Header */
.confirm-box > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;

    gap: 5px !important;

    width: 100% !important;

    box-sizing: border-box !important;

    margin: 0 !important;
    padding: 20px 22px !important;

    background: #ffffff !important;

    border: 0 !important;
}


.confirm-box > div:first-child > strong {
    display: block !important;

    margin: 0 !important;

    color: #102f50 !important;

    font-size: 18px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
}


.confirm-box > div:first-child > span {
    display: block !important;

    margin: 0 !important;

    color: #64748b !important;

    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
}


/* Lý do */
.confirm-box .modal-reason {
    display: block !important;

    width: 100% !important;

    box-sizing: border-box !important;

    margin: 14px 0 0 !important;
}


.confirm-box .modal-reason label {
    display: block !important;

    margin: 0 0 7px !important;

    color: #334155 !important;

    font-size: 13px !important;
    font-weight: 700 !important;
}


.confirm-box .modal-reason textarea,
.confirm-box textarea {
    display: block !important;

    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;

    min-height: 96px !important;

    box-sizing: border-box !important;

    margin: 0 !important;
    padding: 11px 12px !important;

    resize: vertical !important;

    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;

    background: #ffffff !important;

    color: #1e293b !important;

    font: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;

    outline: none !important;
}


.confirm-box textarea:focus {
    border-color: #173b63 !important;

    box-shadow:
        0 0 0 3px rgba(23, 59, 99, 0.10) !important;
}


/* Footer */
.confirm-box .confirm-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;

    gap: 9px !important;

    width: 100% !important;

    box-sizing: border-box !important;

    margin: 0 !important;
    padding: 14px 22px 18px !important;

    border-top: 1px solid #edf2f7 !important;

    background: #ffffff !important;
}


/* Buttons */
.confirm-box .confirm-actions button {
    flex: 0 0 auto !important;

    min-width: 90px !important;
    min-height: 38px !important;

    padding: 0 15px !important;

    border-radius: 8px !important;

    font-size: 13px !important;
    font-weight: 700 !important;

    cursor: pointer !important;
}


.confirm-box .secondary-button {
    border: 1px solid #cbd5e1 !important;

    background: #ffffff !important;

    color: #334155 !important;
}


.confirm-box .secondary-button:hover:not(:disabled) {
    background: #f8fafc !important;
}


.confirm-box .confirm-button {
    border: 1px solid #173b63 !important;

    background: #173b63 !important;

    color: #ffffff !important;
}


.confirm-box .confirm-button:hover:not(:disabled) {
    background: #102f50 !important;
}


.confirm-box button:disabled {
    opacity: .55 !important;
    cursor: not-allowed !important;
}


@media (max-width: 520px) {
    .confirm-box {
        width: calc(100vw - 24px) !important;
    }

    .confirm-box .confirm-actions {
        flex-direction: column-reverse !important;
    }

    .confirm-box .confirm-actions button {
        width: 100% !important;
    }
}.status-message {
    position: fixed !important; right: 24px !important; top: 92px !important; z-index: 3100 !important;
    max-width: 460px; padding: 14px 16px !important; border-radius: 10px !important;
    background:#fff !important; color:#173b63 !important; border:1px solid #cbd5e1 !important;
    box-shadow:0 14px 36px rgba(15,39,68,.18) !important;
}
.modal-reason { margin-top:16px; }
.modal-reason label { display:block; margin-bottom:6px; font-weight:700; color:#334155; }
.modal-reason textarea { width:100%; min-height:96px; resize:vertical; box-sizing:border-box; padding:10px 12px; border:1px solid #cbd5e1; border-radius:8px; }
.draft-expired-warning { margin:16px 0; padding:14px 16px; border:1px solid #f59e0b; border-radius:10px; background:#fffbeb; color:#92400e; }
.auto-code { padding:11px 12px; border:1px dashed #94a3b8; border-radius:8px; background:#f8fafc; color:#475569; font-weight:700; }
.field-error { display:block; margin-top:6px; color:#b91c1c; font-size:13px; font-weight:600; }
