:root {
    --portal-bg: #f4f8f3;
    --portal-surface: #ffffff;
    --portal-surface-soft: #eef6ee;
    --portal-border: #d7e5d6;
    --portal-text: #163120;
    --portal-text-soft: #5a7061;
    --portal-primary: #00923f;
    --portal-primary-dark: #006c2f;
    --portal-primary-deep: #004f22;
    --portal-warning: #f1b94f;
    --portal-danger: #cf5a4d;
    --portal-shadow: 0 24px 60px rgba(16, 54, 32, 0.12);
    --portal-radius-xl: 28px;
    --portal-radius-lg: 20px;
    --primary-green: #0b6b36;
    --primary-green-hover: #0d7f40;
    --primary-green-light: #1fa463;
}

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(141, 211, 139, 0.18), transparent 28%),
        linear-gradient(180deg, #f9fcf8 0%, var(--portal-bg) 100%);
    color: var(--portal-text);
    font-family: Poppins, sans-serif;
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.portal-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.portal-sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.12) 100%),
        linear-gradient(180deg, #005726 0%, #007634 42%, #00863a 72%, #00913f 100%);
    color: #eff7ef;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.portal-logo,
.login-brandline,
.portal-topbar-user,
.header-actions,
.footer-summary,
.form-actions,
.login-secondary-actions,
.toolbar-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.form-actions {
    margin-top: 10px;
}

.portal-logo strong,
.cell-title,
.page-header h1,
.section-heading h2,
.portal-topbar-user strong {
    display: block;
    font-weight: 700;
}

.portal-logo span,
.cell-subtitle,
.page-subtitle,
.section-heading p,
.portal-help,
.portal-topbar-user span,
.portal-empty-inline {
    color: var(--portal-text-soft);
}

.portal-logo span {
    color: rgba(239, 247, 239, 0.72);
}

.portal-logo-mark,
.portal-empty-icon,
.login-brandmark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #2db267 0%, #9de08e 100%);
    color: #06220f;
    font-weight: 800;
}

.portal-logo-mark {
    padding: 6px;
    background: rgb(255, 255, 255);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95);
}

.portal-logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.login-brand-image {
    width: 130px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.portal-nav {
    display: grid;
    gap: 8px;
}

.portal-nav a {
    padding: 11px 13px;
    border-radius: 13px;
    color: rgba(247, 255, 249, 0.9);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.94rem;
}

.portal-nav a:hover,
.portal-nav a.is-active {
    background: linear-gradient(135deg, rgba(181, 247, 199, 0.28) 0%, rgba(255, 255, 255, 0.18) 100%);
    color: #fffef8;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.portal-sidebar-note {
    margin-top: auto;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.08) 100%);
    font-size: 0.9rem;
}

.portal-sidebar-note span,
.page-kicker,
.login-highlight-label,
.portal-topbar-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.66rem;
    font-weight: 700;
}

.portal-topbar-label {
    letter-spacing: normal;
    font-size: 1.1rem;
    color: #03833a;
}

.portal-sidebar-note strong {
    display: block;
    margin: 6px 0;
}

.portal-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(183, 204, 182, 0.7);
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(12px);
}

.portal-topbar h2,
.portal-topbar h6,
.login-form-header h2 {
    margin: 0;
}

.portal-topbar h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--portal-text-soft);
}

.portal-content {
    padding: 20px 22px 26px;
}

.page-shell,
.form-grid {
    display: grid;
    gap: 16px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.page-header h1 {
    margin: 4px 0;
    font-size: clamp(1.5rem, 1.8vw, 2rem);
}

.page-subtitle {
    margin: 0;
    max-width: 840px;
    line-height: 1.5;
    font-size: 0.94rem;
}

.stats-grid,
.field-grid {
    display: grid;
    gap: 12px;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-card {
    display: grid;
    gap: 4px;
}

.two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.turnstile-host {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 8px 0 14px;
}

.field-span-3 {
    grid-column: 1 / -1;
}

.search-actions-block {
    display: flex;
    align-items: end;
}

.input-action-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.input-action-field {
    flex: 1 1 auto;
}

.tax-code-trigger {
    cursor: pointer;
}

.input-action-row .portal-secondary-action {
    min-width: 118px;
    white-space: nowrap;
}

.lookup-clear-action {
    min-width: 40px;
    width: 40px;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
}

.stat-card,
.workspace-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow);
}

.stat-card {
    padding: 16px 18px;
}

.workspace-card {
    padding: 16px;
}

.stat-label {
    display: block;
    color: var(--portal-text-soft);
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.stat-card strong {
    font-size: 1.55rem;
}

.toolbar-row {
    justify-content: space-between;
    margin-bottom: 12px;
}

.toolbar-search {
    flex: 1 1 420px;
}

.toolbar-search-input {
    min-width: min(560px, 100%);
}

.toolbar-meta {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0 12px;
    min-height: 42px;
    background: var(--portal-surface-soft);
    border: 1px solid var(--portal-border);
    color: var(--portal-text-soft);
}

.order-filter-panel {
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fcfefc 0%, #f4f8f4 100%);
}

.order-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.order-filter-field {
    min-width: 0;
}

.order-filter-field .portal-label {
    margin-bottom: 5px;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
    color: var(--portal-text-soft);
}

.order-filter-input {
    min-height: 36px;
    padding: 0 11px;
    border-radius: 10px;
    font-size: 0.88rem;
}

.order-filter-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
}

.order-filter-button {
    min-height: 36px;
    width: 100%;
    white-space: nowrap;
    padding: 0 16px;
    border-radius: 10px;
}

.pager-label {
    margin: 0 0 0 14px;
    font-size: 0.82rem;
}

.pager-size-select {
    width: 76px;
    min-height: 36px;
    padding-right: 28px;
}

.pager-button {
    min-width: 78px;
    min-height: 36px;
}

.toolbar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--portal-text-soft);
}

.portal-input {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    background: #fbfdfb;
    padding: 0 13px;
    color: var(--portal-text);
    font-size: 0.94rem;
}

.portal-textarea {
    min-height: 100px;
    padding-top: 12px;
    resize: vertical;
}

.portal-input:focus {
    outline: none;
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 4px rgba(30, 140, 79, 0.12);
}

.portal-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 0.9rem;
}

.portal-primary-action,
.portal-secondary-action,
.table-action,
.login-captcha-refresh {
    min-height: 40px;
    border-radius: 12px;
    border: 0;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.92rem;
}

.portal-primary-action:disabled,
.portal-secondary-action:disabled,
.table-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.portal-primary-action {
    background: linear-gradient(135deg, var(--portal-primary) 0%, #4bb56a 100%);
    min-width: max-content; /* Đảm bảo chiều rộng ít nhất bằng nội dung chữ */
    padding: 0 15px; /* Đảm bảo khoảng cách hai bên chữ đẹp mắt */
    color: white;
}

.query-info-button {
    min-height: 46px;
    padding: 0 20px;
    font-size: 0.98rem;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 146, 63, 0.18);
}

@media (max-width: 1200px) {
    .order-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .order-filter-panel {
        padding: 14px;
    }

    .order-filter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .order-filter-actions {
        justify-content: stretch;
    }

    .workspace-footer {
        gap: 10px;
    }

    .footer-summary,
    .footer-pagination {
        width: 100%;
        justify-content: space-between;
    }
}

.portal-secondary-action {
    background: var(--portal-surface-soft);
    border: 1px solid var(--portal-border);
    color: var(--portal-text);
    min-width: max-content; /* Đảm bảo chiều rộng ít nhất bằng nội dung chữ */
    padding: 0 15px; /* Đảm bảo khoảng cách hai bên chữ đẹp mắt */
}

.portal-alert {
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid;
    font-size: 0.92rem;
}

.portal-alert-success {
    background: rgba(45, 178, 103, 0.1);
    border-color: rgba(45, 178, 103, 0.24);
    color: #126238;
}

.portal-alert-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(248, 113, 113, 0.18));
    border-color: rgba(220, 38, 38, 0.26);
    color: #991b1b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.portal-alert-danger {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(248, 113, 113, 0.2));
    border-color: rgba(220, 38, 38, 0.26);
    color: #8f1f24;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.portal-alert-error::before,
.portal-alert-danger::before {
    content: "!";
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.14);
    border: 1px solid rgba(220, 38, 38, 0.28);
    color: #b91c1c;
    font-weight: 800;
    line-height: 1;
    font-size: 0.9rem;
}

.portal-alert-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(253, 224, 71, 0.26));
    border-color: rgba(217, 119, 6, 0.28);
    color: #8a5a00;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.payment-warning {
    padding: 14px 16px;
    font-weight: 600;
    line-height: 1.55;
}

.payment-warning-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.payment-warning-row .payment-warning {
    flex: 1 1 auto;
    margin-top: 0 !important;
}

.payment-warning-action {
    flex: 0 0 auto;
    white-space: nowrap;
}

.payment-warning-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.28);
}

.table-shell {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--portal-border);
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.portal-table th,
.portal-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--portal-border);
    text-align: left;
    vertical-align: middle;
    font-size: 0.9rem;
}

.portal-table th {
    background: #f5faf5;
    color: var(--portal-text-soft);
    font-size: 0.82rem;
}

.text-end {
    text-align: right !important;
}

.text-start {
    text-align: left !important;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-chip.success {
    background: rgba(45, 178, 103, 0.14);
    color: #127242;
}

.status-chip.warning {
    background: rgba(241, 185, 79, 0.18);
    color: #8a6113;
}

.status-chip.danger {
    background: rgba(207, 90, 77, 0.16);
    color: #8d2f25;
}

.status-chip.pending {
    background: rgba(74, 144, 226, 0.16);
    color: #1d5fa8;
}

.status-chip.neutral {
    background: rgba(90, 112, 97, 0.12);
    color: #395141;
}

.order-payment-stack {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.invoice-download-link {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(45, 178, 103, 0.12);
    color: #14693d;
    border: 1px solid rgba(45, 178, 103, 0.2);
    text-decoration: none;
    flex: 0 0 auto;
}

.invoice-download-link:hover {
    background: rgba(45, 178, 103, 0.18);
}

.portal-text-muted {
    color: var(--portal-text-soft);
}

.table-action.success {
    background: rgba(45, 178, 103, 0.14);
    color: #14693d;
}

.table-action.danger {
    background: rgba(207, 90, 77, 0.14);
    color: #8d2f25;
}

.workspace-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    color: var(--portal-text-soft);
    font-size: 0.9rem;
}

.docs-summary-grid {
    margin-bottom: 12px;
}

.docs-company-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.docs-info-card,
.docs-item {
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: #fbfefb;
}

.docs-info-card {
    padding: 12px 14px;
}

.docs-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 14px;
}

.docs-item h2 {
    margin: 0 0 6px;
    font-size: 0.96rem;
    color: var(--portal-primary-dark);
}

.docs-item p {
    margin: 0;
    color: var(--portal-text-soft);
    word-break: break-all;
}

.docs-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.docs-open-btn,
.table-link-btn {
    min-height: 40px;
}

.admin-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.admin-upload-status {
    margin-top: 0;
    max-width: 220px;
    text-align: right;
}

.docs-list {
    display: grid;
    gap: 10px;
}

.company-profile-grid .docs-info-card {
    min-height: 92px;
}

.docs-warning-text {
    color: #8a6113;
    font-weight: 600;
}

.portal-empty-state {
    min-height: 170px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    text-align: center;
    padding: 18px;
}

.portal-empty-state.compact {
    min-height: 140px;
}

.portal-empty-state h1,
.portal-empty-state h2 {
    margin: 0;
}

.login-brandname {
    color: #209244; /* Màu xanh theo yêu cầu */
    font-weight: bold; /* Chữ in đậm (hoặc dùng giá trị 700) */
    text-transform: uppercase; /* Tự động chuyển tất cả các ký tự thành viết hoa */
    /* Bạn có thể thêm các thuộc tính bổ trợ dưới đây nếu cần */
    font-size: 20px; /* Kích thước chữ (tùy chỉnh theo giao diện) */
    letter-spacing: 0.5px; /* Khoảng cách giữa các chữ cái nhìn sẽ thoáng và sang hơn */
    display: inline-block;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 16px;
}

.login-card {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    background: var(--portal-surface);
    border-radius: var(--portal-radius-xl);
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(16, 54, 32, 0.16);
}

.login-aside,
.login-form-panel {
    padding: 28px;
}

.login-aside {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.1) 100%),
        linear-gradient(180deg, #005726 0%, #007333 42%, #00863a 74%, #00913f 100%);
    color: #f2f8f2;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.login-badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.login-title {
    margin: 18px 0 10px;
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
    line-height: 1.12;
}

.login-description,
.login-highlight p,
.login-points li {
    color: rgba(242, 248, 242, 0.82);
    line-height: 1.58;
    font-size: 0.93rem;
}

.login-highlight {
    margin-top: 18px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.login-highlight strong {
    display: block;
    margin: 6px 0;
}

.login-aside-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(3, 131, 58, 0.22), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.login-aside-footer-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
}

.login-aside-footer-copy {
    min-width: 0;
}

.login-aside-footer-copy strong {
    display: block;
    margin: 4px 0 6px;
    font-size: 1rem;
}

.login-aside-footer-copy p {
    margin: 0;
    color: rgba(242, 248, 242, 0.82);
    line-height: 1.5;
    font-size: 0.9rem;
}

.login-points {
    padding-left: 18px;
    margin-top: 18px;
}

.login-form-panel,
.login-form {
    display: grid;
    gap: 14px;
}

.portal-secondary-button {
    border: none;
    cursor: pointer;
    font: inherit;
}

.portal-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 27, 18, 0.48);
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 1000;
}

.portal-modal {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 24px 80px rgba(12, 40, 23, 0.2);
    display: grid;
    gap: 10px;
}

.portal-modal h3,
.portal-modal p {
    margin: 0;
}

.portal-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.portal-modal-actions.tax-lookup-actions .portal-primary-action,
.portal-modal-actions.tax-lookup-actions .portal-secondary-action {
    min-height: 40px;
    height: 40px;
}

.import-check-action-button {
    min-width: 260px;
    min-height: 52px;
    padding: 0 26px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    border-radius: 16px;
    box-shadow: 0 14px 28px rgba(47, 125, 86, 0.18);
}

.import-check-action-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(47, 125, 86, 0.24);
}

.loading-overlay {
    backdrop-filter: blur(2px);
}

.loading-modal {
    width: min(520px, 100%);
    text-align: center;
    gap: 14px;
    padding: 28px 26px;
}

.loading-spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 5px solid rgba(20, 57, 38, 0.12);
    border-top-color: #2f7d56;
    margin: 0 auto;
    animation: loading-spin 0.9s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.register-shell {
    min-height: 100vh;
    padding: 16px;
    background: linear-gradient(180deg, #f2f9f2 0%, #e8f3ea 100%);
}

.register-card {
    width: min(1280px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    background: var(--portal-surface);
    border-radius: var(--portal-radius-xl);
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(16, 54, 32, 0.14);
}

.register-aside,
.register-form-panel {
    padding: 28px;
}

.register-aside {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.1) 100%),
        linear-gradient(180deg, #005726 0%, #007333 42%, #00863a 74%, #00913f 100%);
    color: #f3faf3;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
}

.register-aside h1,
.register-aside p {
    margin: 0;
}

.register-brandline {
    margin-bottom: 6px;
}

.register-side-actions {
    margin-top: 8px;
}

.register-form-panel,
.register-form {
    display: grid;
    gap: 14px;
}

.register-section-card {
    padding: 16px;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fcfefc 0%, #f6fbf6 100%);
}

.register-section-card h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--portal-primary-dark);
}

.field-card.wide {
    grid-column: span 3;
}

.upload-status {
    margin-top: 7px;
    color: var(--portal-text-soft);
    font-size: 0.86rem;
}

.register-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.guide-shell {
    min-height: 100vh;
    padding: 20px 16px 28px;
}

.guide-page {
    width: min(1320px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.guide-hero,
.guide-section {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(16, 54, 32, 0.08);
}

.guide-hero {
    padding: 22px 24px;
    display: grid;
    gap: 14px;
}

.guide-brandline,
.guide-hero-actions,
.guide-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.guide-kicker,
.guide-section-kicker,
.guide-card-tag,
.guide-support-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.guide-kicker,
.guide-section-kicker {
    color: var(--portal-primary-dark);
}

.guide-hero-copy h1,
.guide-card h2 {
    margin: 0;
}

.guide-hero-copy p,
.guide-card p,
.guide-list li,
.guide-support-card strong {
    line-height: 1.65;
}

.guide-hero-copy p {
    margin: 10px 0 0;
    max-width: 760px;
    color: var(--portal-text-soft);
}

.guide-section {
    padding: 18px 16px 16px;
    display: grid;
    gap: 14px;
}

.guide-section-head {
    justify-content: center;
    padding-top: 4px;
}

.guide-process-grid,
.guide-form-grid,
.guide-bottom-grid {
    display: grid;
    gap: 14px;
}

.guide-process-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guide-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-bottom-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.guide-card,
.guide-support-card {
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f6fbf7 100%);
}

.guide-card {
    padding: 16px 18px 18px;
}

.guide-step-card {
    min-height: 172px;
}

.guide-step-number {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--portal-primary);
    color: white;
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.guide-card h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.guide-card p {
    margin: 0;
    color: var(--portal-text-soft);
}

.guide-card-tag,
.guide-support-label {
    padding: 0 10px;
    background: rgba(0, 146, 63, 0.1);
    color: var(--portal-primary);
}

.guide-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--portal-text);
}

.guide-list li + li {
    margin-top: 8px;
}

.guide-list-dense {
    margin-top: 0;
}

.guide-download-button {
    margin-top: 18px;
    align-self: start;
}

.guide-support-grid {
    display: grid;
    gap: 14px;
}

.guide-support-card {
    padding: 14px 16px;
    display: grid;
    gap: 8px;
}

.guide-support-card strong {
    font-size: 0.94rem;
}

.guide-section-compact {
    align-content: start;
}

.login-captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.login-captcha-box {
    min-width: 170px;
    padding: 6px 8px 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid var(--portal-border);
    background: linear-gradient(135deg, #f7fbf7 0%, #edf6ed 100%);
}

.login-captcha-box span {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--portal-primary-dark);
}

.login-captcha-refresh {
    min-width: 42px;
    background: var(--portal-primary);
    color: white;
}

.section-heading p {
    margin: 0 0 12px;
    font-size: 0.9rem;
}

.workflow-grid {
    display: grid;
    /*grid-template-columns: repeat(2, minmax(0, 1fr));*/
    /* Chia tỷ lệ 3/7 cực chuẩn, không lo bị tràn do gap */
    gap: 16px;
    margin-top: 18px;
}

.workflow-card {
    padding: 16px 18px 18px;
    border: 1px solid var(--portal-border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcf8 100%);
    box-shadow: 0 12px 32px rgba(16, 35, 24, 0.06);
}

.workflow-card-overdue {
    background: linear-gradient(180deg, rgba(255, 235, 235, 0.96) 0%, rgba(255, 245, 245, 0.98) 100%);
    border-color: rgba(220, 38, 38, 0.18);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.06);
}

.workflow-card-wide {
    grid-column: 1 / -1;
}

.workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.workflow-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    color: var(--portal-text-soft);
    font-size: 0.92rem;
}

.workflow-payment-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0 14px;
}

.portal-table tbody tr.order-row-completed td {
    background: rgba(34, 197, 94, 0.10);
}

.portal-table tbody tr.order-row-overdue td {
    background: rgba(207, 90, 77, 0.10);
}

.portal-table tbody tr.order-row-pending td {
    background: rgba(245, 158, 11, 0.10);
}

.portal-table tbody tr.order-row-completed:hover td {
    background: rgba(34, 197, 94, 0.14);
}

.portal-table tbody tr.order-row-overdue:hover td {
    background: rgba(207, 90, 77, 0.14);
}

.portal-table tbody tr.order-row-pending:hover td {
    background: rgba(245, 158, 11, 0.15);
}

.workflow-message {
    margin: 0;
    color: var(--portal-text-soft);
    line-height: 1.65;
}

.compact-table {
    margin-top: 12px;
}

.compact-table .portal-table th,
.compact-table .portal-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.query-table-scroll {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: auto;
    background: var(--portal-surface);
}

.query-table-scroll .portal-table {
    min-width: 920px;
}

.compact-fields {
    margin-top: 12px;
}

.no-print {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.payment-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(10, 16, 28, 0.56);
    backdrop-filter: blur(8px);
}

.payment-modal {
    width: min(1040px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.payment-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 0;
}

.payment-modal-header h3 {
    margin: 4px 0 0;
    font-size: 1.35rem;
}

.payment-modal-close {
    border: 0;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.payment-modal-body {
    padding: 24px;
}

.payment-modal-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.payment-qr-card {
    display: grid;
    gap: 12px;
    justify-items: center;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border: 1px solid rgba(74, 144, 226, 0.14);
}

.payment-qr-image {
    width: 240px;
    height: 240px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    padding: 10px;
}

.payment-qr-caption {
    margin: 0;
    color: var(--portal-text-soft);
    text-align: center;
}

.payment-details {
    display: grid;
    gap: 12px;
}

.payment-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
}

.payment-detail-row span {
    color: var(--portal-text-soft);
}

.payment-detail-row strong {
    text-align: right;
    word-break: break-word;
}

.payment-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 24px 24px;
}

.validation-message {
    display: block;
    color: #9f3126;
    margin-top: 4px;
    font-size: 0.82rem;
}

@media (max-width: 1080px) {
    .portal-shell,
    .login-card,
    .register-card,
    .stats-grid,
    .field-grid,
    .docs-company-grid,
    .guide-process-grid,
    .guide-form-grid,
    .guide-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .portal-topbar,
    .portal-content,
    .login-form-panel,
    .login-aside,
    .register-aside,
    .register-form-panel {
        padding: 22px;
    }

    .page-header,
    .workspace-footer,
    .docs-item {
        display: grid;
    }

    .login-captcha-row {
        grid-template-columns: 1fr;
    }

    .portal-table {
        min-width: 760px;
    }

    .field-card.wide {
        grid-column: span 1;
    }

    .workflow-grid {
        grid-template-columns: 1fr;
    }

    .payment-modal-grid {
        grid-template-columns: 1fr;
    }

    .payment-qr-image {
        width: 100%;
        max-width: 240px;
        height: auto;
    }

    .payment-detail-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .payment-detail-row strong {
        text-align: left;
    }

    .payment-warning-row {
        flex-direction: column;
        align-items: stretch;
    }

    .payment-warning-action {
        width: 100%;
    }
}

.support-chat-wrapper {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 5000;
}

@media (max-width: 760px) {
    .support-chat-wrapper {
        right: 0.5rem;
        left: 0.5rem;
        bottom: 0.5rem;
    }

    .support-chat-wrapper deep-chat {
        width: 100%;
    }
}

.upload-inline-label {
    position: relative;
    overflow: hidden;
}

.upload-inline-label .admin-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
}

/* Style chung cho các Badge trạng thái */
.status-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    min-width: 100px;
    border: 1px solid transparent;
}

/* Class Đã thanh toán - Màu Xanh */
.status-paid {
    background-color: #e8f5e9; /* Xanh lá nhạt */
    color: #2e7d32; /* Chữ xanh đậm */
    border-color: #c8e6c9;
}

/* Class Hạn quá ngày - Màu Đỏ */
.status-overdue {
    background-color: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

/* Class Chưa thanh toán - Màu Đỏ */
.status-unpaid {
    background-color: #ffebee; /* Đỏ nhạt */
    color: #c62828; /* Chữ đỏ đậm */
    border-color: #ffcdd2;
}

@media print {
    .no-print {
        display: none !important;
    }

    .page-shell {
        padding: 0;
    }

    .workflow-card,
    .workspace-card {
        box-shadow: none;
    }
}

.custom-file-input {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
}
.btn-select-file {
    /* Quan trọng: inline-block giúp nút chỉ rộng bằng nội dung bên trong */
    display: inline-block;
    /* Độ rộng tự động theo chữ */
    width: auto;
    /* Khoảng cách giữa chữ và viền nút */
    padding: 6px 16px;
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    /* Đảm bảo không bị xuống dòng giữa chừng */
    white-space: nowrap;
    /* Canh giữa chữ nếu bạn có đặt chiều cao cố định */
    text-align: center;
    transition: all 0.2s ease;
}

    .btn-select-file:hover {
        background-color: #e2e6ea;
        border-color: #adb5bd;
    }

/* Container chứa nút cũng nên là inline-flex để không chiếm 100% chiều rộng dòng */
.custom-file-input {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.selected-file-name {
    font-size: 14px;
    color: #007bff;
    font-style: italic;
}

.upload-status {
    margin-top: 4px;
    font-size: 13px;
    color: #007bff; /* Hoặc màu bạn đang dùng */
}

/*Loading ktra hai quan*/
.loading-alert {
    margin-top: 18px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fff5f5, #ffeaea);
    border: 1px solid #ffcccc;
    border-left: 5px solid #e53935;
    border-radius: 14px;
    color: #b42318;
    font-size: 14px;
    line-height: 1.7;
    text-align: left;
    box-shadow: 0 6px 18px rgba(229, 57, 53, 0.12);
}

.loading-alert-label {
    font-weight: 700;
    color: #d92d20;
    margin-right: 4px;
}

.portal-modal-backdrop.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.portal-modal.loading-modal {
    width: 520px;
    max-width: 90%;
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    text-align: center;
    animation: fadeIn 0.2s ease-in-out;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px auto;
    border: 5px solid #e5e7eb;
    border-top: 5px solid #127F42;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-title {
    margin: 0 0 14px 0;
    color: #127F42;
    font-size: 22px;
    font-weight: 700;
}

.loading-description {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.7;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}
/*End loading Hai quan*/
.mst-updated-date {
    font-weight: bold;
    font-style: italic;
}

.portal-alert-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    margin-left:4px;
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #127F42, #18a957);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(18, 127, 66, 0.18);
}

.portal-alert-refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(18, 127, 66, 0.28);
    opacity: 0.96;
}

.portal-alert-refresh-btn:active {
    transform: scale(0.98);
}

.portal-alert-refresh-btn i {
    font-size: 11px;
}
/*Tra cuu thong tin*/
.enhanced-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 220px;
    height: 48px;
    padding: 0 22px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #127F42, #18a957);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px rgba(18, 127, 66, 0.22);
    position: relative;
    overflow: hidden;
}

    .enhanced-action-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 12px 26px rgba(18, 127, 66, 0.32);
    }

    .enhanced-action-btn:active:not(:disabled) {
        transform: scale(0.98);
    }

    .enhanced-action-btn:disabled {
        opacity: 0.85;
        cursor: not-allowed;
    }

    .enhanced-action-btn i {
        font-size: 15px;
    }

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.35);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/*Tao bien nhan thanh toan*/
.enhanced-storage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 0 24px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #127F42, #19b15d);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 10px 24px rgba(18, 127, 66, 0.24);
    position: relative;
    overflow: hidden;
}

.enhanced-storage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(18, 127, 66, 0.34);
}

.enhanced-storage-btn:active {
    transform: scale(0.98);
}

.enhanced-storage-btn i {
    font-size: 20px;
    flex-shrink: 0;
}

.enhanced-storage-btn span {
    text-align: center;
}

/*Gia han*/
.enhanced-extend-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 0 24px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #c2410c, #ea580c);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 10px 24px rgba(194, 65, 12, 0.24);
    position: relative;
    overflow: hidden;
}

.enhanced-extend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(194, 65, 12, 0.34);
}

.enhanced-extend-btn:active {
    transform: scale(0.98);
}

.enhanced-extend-btn i {
    font-size: 20px;
    flex-shrink: 0;
}

.enhanced-extend-btn span {
    text-align: center;
}