/* =========================================================================
   Modern UI CSS cho EDISystem
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600&display=swap');

:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --dark-color: #2b2d42;
    --light-bg: #f4f7fe;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-width: 260px;
    --header-height: 50px;
}

body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 450;
    background-color: var(--light-bg);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: normal;
}

/* Global input & form elements typography */
input, select, textarea, button, .form-control, .form-select {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 450;
    font-feature-settings: "tnum";
}

/* Validation Feedback & Forms typography fix */
.invalid-feedback,
.valid-feedback,
.form-text {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 450 !important;
    letter-spacing: normal !important;
    font-style: normal !important;
    line-height: 1.4 !important;
    margin-top: 4px !important;
}

/* Detail Tabs & Sub-Buttons Compact Proportions */
#ediDetailTabs,
#declarationDetailTabs {
    margin-bottom: 12px;
}

    #ediDetailTabs .nav-link,
    #declarationDetailTabs .nav-link {
        font-size: 0.785rem !important;
        font-weight: 600 !important;
        padding: 5px 14px !important;
        border-radius: 9999px !important;
        color: #64748b !important;
        background-color: transparent !important;
        border: 1px solid transparent !important;
        transition: all 0.15s ease !important;
        line-height: 1.35 !important;
        display: inline-flex;
        align-items: center;
    }

        #ediDetailTabs .nav-link:hover,
        #declarationDetailTabs .nav-link:hover {
            color: var(--primary-color) !important;
            background-color: rgba(67, 97, 238, 0.08) !important;
        }

        #ediDetailTabs .nav-link.active,
        #declarationDetailTabs .nav-link.active {
            color: #ffffff !important;
            background-color: var(--primary-color) !important;
            box-shadow: 0 1px 4px rgba(67, 97, 238, 0.25) !important;
        }

/* Action Buttons in Table Lists - Perfect Centering & Alignment */
.btn-action-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease-in-out !important;
    line-height: 1 !important;
    cursor: pointer;
}

    /* Fallback spacing for adjacent action buttons */
    .btn-action-icon + .btn-action-icon,
    .btn-action-icon + form,
    form + .btn-action-icon {
        margin-left: 4px !important;
    }

    .btn-action-icon:hover {
        background-color: #f8fafc !important;
        border-color: #94a3b8 !important;
        color: #0f172a !important;
    }

    .btn-action-icon.btn-action-primary:hover {
        color: #2563eb !important;
        background-color: #eff6ff !important;
        border-color: #93c5fd !important;
    }

    .btn-action-icon.btn-action-success:hover {
        color: #16a34a !important;
        background-color: #f0fdf4 !important;
        border-color: #86efac !important;
    }

    .btn-action-icon.btn-action-danger:hover {
        color: #dc2626 !important;
        background-color: #fef2f2 !important;
        border-color: #fca5a5 !important;
    }

    .btn-action-icon:disabled,
    .btn-action-icon[disabled],
    .btn-action-icon.disabled {
        cursor: not-allowed !important;
        opacity: 0.38 !important;
        pointer-events: auto !important;
        background-color: #f8fafc !important;
        border-color: #e2e8f0 !important;
        color: #94a3b8 !important;
        box-shadow: none !important;
        transform: none !important;
    }

        .btn-action-icon:disabled:hover,
        .btn-action-icon[disabled]:hover,
        .btn-action-icon.disabled:hover {
            background-color: #f8fafc !important;
            border-color: #e2e8f0 !important;
            color: #94a3b8 !important;
        }

    .btn-action-icon i,
    .btn-action-icon i.fas,
    .btn-action-icon i.far,
    .btn-action-icon i.fa,
    .btn-action-icon svg {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 13px !important;
        line-height: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        vertical-align: 0 !important;
        transform: none !important;
        height: 13px !important;
        width: 13px !important;
    }

        .btn-action-icon i::before {
            vertical-align: 0 !important;
            line-height: 1 !important;
            display: block !important;
        }

/* Modern Segmented Navigation Tabs */
.nav-tabs-modern {
    display: inline-flex !important;
    align-items: center !important;
    background-color: #f1f5f9 !important;
    padding: 3px !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    gap: 3px !important;
    margin: 0 !important;
    list-style: none !important;
}

    .nav-tabs-modern .nav-item {
        margin: 0 !important;
    }

    .nav-tabs-modern .nav-link {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 6px 16px !important;
        font-size: 0.825rem !important;
        font-weight: 500 !important;
        color: #64748b !important;
        border-radius: 7px !important;
        border: none !important;
        background: transparent !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
        text-decoration: none !important;
        line-height: 1.4 !important;
        white-space: nowrap !important;
    }

        .nav-tabs-modern .nav-link i {
            font-size: 0.85rem !important;
            color: #94a3b8 !important;
            transition: color 0.2s ease !important;
        }

        .nav-tabs-modern .nav-link:hover {
            color: #1e293b !important;
            background-color: rgba(255, 255, 255, 0.65) !important;
        }

            .nav-tabs-modern .nav-link:hover i {
                color: var(--primary-color) !important;
            }

        .nav-tabs-modern .nav-link.active {
            color: var(--primary-color) !important;
            background-color: #ffffff !important;
            font-weight: 600 !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
        }

            .nav-tabs-modern .nav-link.active i {
                color: var(--primary-color) !important;
            }

    .nav-tabs-modern .nav-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 2px 7px !important;
        font-size: 0.7rem !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        border-radius: 9999px !important;
        background-color: #e2e8f0 !important;
        color: #64748b !important;
        transition: all 0.2s ease !important;
    }

    .nav-tabs-modern .nav-link.active .nav-badge {
        background-color: rgba(67, 97, 238, 0.12) !important;
        color: var(--primary-color) !important;
    }

/* Modern Tabs (Underline Tab Style like SysDNUser) */
.modern-tabs {
    border-bottom: 1px solid #e2e8f0 !important;
}

    .modern-tabs .nav-item {
        margin-bottom: -1px !important;
    }

    .modern-tabs .nav-link {
        color: #64748b !important;
        font-weight: 500 !important;
        font-size: 0.85rem !important;
        border: none !important;
        border-bottom: 2px solid transparent !important;
        padding: 0.65rem 1.25rem !important;
        background: transparent !important;
        transition: all 0.2s ease !important;
        border-radius: 0 !important;
    }

        .modern-tabs .nav-link:hover {
            color: #334155 !important;
            border-color: #cbd5e1 !important;
            background: transparent !important;
        }

        .modern-tabs .nav-link.active {
            color: #4f46e5 !important;
            border-color: #4f46e5 !important;
            background: transparent !important;
            font-weight: 600 !important;
        }

        .modern-tabs .nav-link .badge {
            font-size: 0.725rem !important;
            padding: 0.25rem 0.55rem !important;
            transition: all 0.2s ease !important;
        }

        .modern-tabs .nav-link.active .badge {
            background-color: rgba(79, 70, 229, 0.1) !important;
            color: #4f46e5 !important;
            border-color: rgba(79, 70, 229, 0.2) !important;
        }

.tab-content > .tab-pane.show.active {
    display: flex !important;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-main);
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

    .sidebar-logo i {
        font-size: 1.5rem;
        margin-right: 10px;
    }

.sidebar-nav {
    padding: 20px 15px;
    flex-grow: 1;
}

.nav-item-custom {
    margin-bottom: 5px;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 15px;
    color: #334155;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .nav-link-custom > div {
        display: flex;
        align-items: center;
    }

        .nav-link-custom i.nav-icon,
        .nav-link-custom > i:first-child,
        .nav-link-custom > div > i:first-child {
            width: 22px;
            font-size: 1rem;
            margin-right: 10px;
            text-align: center;
        }

.nav-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.nav-link-parent[aria-expanded="true"] .nav-chevron,
.nav-link-parent:not(.collapsed) .nav-chevron {
    transform: rotate(90deg);
}

.nav-link-custom:hover {
    background-color: rgba(67, 97, 238, 0.08);
    color: var(--primary-color);
}

.nav-link-custom.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.nav-link-parent.active-parent {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(67, 97, 238, 0.06);
}

/* Submenu Tree View Styles */
.nav-submenu {
    position: relative;
    margin-left: 26px;
    padding-left: 14px;
    margin-top: 3px;
    margin-bottom: 5px;
}

    .nav-submenu::before {
        content: '';
        position: absolute;
        top: -2px;
        bottom: 16px;
        left: 0;
        width: 0.75px;
        background-color: rgba(203, 213, 225, 0.7);
    }

.nav-link-sub {
    position: relative;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

    .nav-link-sub::before {
        content: '';
        position: absolute;
        left: -14px;
        top: 50%;
        width: 12px;
        height: 0.75px;
        background-color: rgba(203, 213, 225, 0.7);
        transition: all 0.2s ease;
    }

    .nav-link-sub i {
        font-size: 0.82rem;
        width: 18px;
        text-align: center;
        opacity: 0.85;
    }

    .nav-link-sub:hover {
        color: var(--primary-color);
        background-color: rgba(67, 97, 238, 0.05);
    }

        .nav-link-sub:hover::before {
            background-color: var(--primary-color);
            opacity: 0.7;
        }

    .nav-link-sub.active {
        color: var(--primary-color);
        font-weight: 600;
        background-color: rgba(67, 97, 238, 0.09);
    }

        .nav-link-sub.active::before {
            background-color: var(--primary-color);
            opacity: 1;
        }

/* Main Content Wrapper */
.app-wrapper {
    margin-left: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Sidebar Collapsed State */
body.sidebar-collapsed .app-sidebar {
    width: 80px;
}

body.sidebar-collapsed .app-wrapper {
    margin-left: 80px;
}

body.sidebar-collapsed .sidebar-logo span {
    display: none;
}

body.sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding: 0;
}

    body.sidebar-collapsed .sidebar-logo i {
        margin-right: 0;
    }

body.sidebar-collapsed .nav-link-custom span.nav-text,
body.sidebar-collapsed .nav-chevron,
body.sidebar-collapsed .nav-submenu {
    display: none !important;
}

body.sidebar-collapsed .nav-link-custom {
    justify-content: center;
    padding: 12px 0;
}

    body.sidebar-collapsed .nav-link-custom i,
    body.sidebar-collapsed .nav-link-custom > div > i {
        margin-right: 0;
    }

body.sidebar-collapsed .sidebar-nav small {
    display: none;
}

body.sidebar-collapsed .sidebar-nav hr {
    margin: 1rem 0;
}

/* Header */
.app-header {
    height: var(--header-height);
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
    flex-shrink: 0;
}

.user-profile-btn {
    border-radius: 8px;
    padding: 4px 8px !important;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

    .user-profile-btn:hover,
    .user-profile-btn:focus,
    .user-profile-btn[aria-expanded="true"] {
        background-color: #f1f5f9;
    }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(67, 97, 238, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--text-main);
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.user-dropdown-menu .dropdown-item:hover {
    background-color: #fee2e2;
}

/* Main Body */
.app-main {
    padding: 12px 16px 12px 16px;
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

    /* For Index and Full-height Card pages */
    .app-main:has(> .card-table-full),
    .app-main:has(> .edi-detail-wrapper),
    .app-main:has(.card-table-full),
    .app-main:has(.edi-detail-wrapper) {
        overflow: hidden;
        padding: 12px 16px 12px 16px;
    }

.page-header-bar {
    margin-bottom: 12px !important;
}

.card-table-full,
.edi-detail-wrapper {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow: hidden;
}

.template-header-sticky {
    position: sticky;
    top: -10px;
    z-index: 90;
    background-color: var(--light-bg);
    margin: -10px -16px 10px -16px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Cards */
.card-modern {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    background: var(--white);
    display: flex;
    flex-direction: column;
}

    .card-modern .card-body.overflow-y-auto {
        overflow-y: auto !important;
        min-height: 0 !important;
        flex: 1 1 0% !important;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

.card-header-modern {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    font-weight: 600;
    flex-shrink: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-bar {
    flex-shrink: 0;
}

.table-responsive {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

.card-modern .card-footer {
    flex-shrink: 0;
    margin-top: auto;
    background-color: var(--white);
    z-index: 5;
}

/* Checkbox Modern Sizing & Styling */
.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0;
    vertical-align: middle;
    cursor: pointer;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    background-color: var(--white);
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

    .form-check-input:hover:not(:disabled) {
        border-color: var(--primary-color);
    }

    .form-check-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.18);
    }

    .form-check-input:checked {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

    .form-check-input:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

/* Modern Input Group */
.input-group-modern {
    border: 1px solid #d6dde5;
    border-radius: 6px;
    background-color: var(--white);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

    .input-group-modern:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    }

    .input-group-modern .input-group-text {
        background-color: transparent;
        border: none;
        color: var(--text-muted);
    }

    .input-group-modern .form-control {
        background-color: transparent;
        border: none;
        box-shadow: none !important;
    }

    /* Quick search specific styling matching modern-input-sm */
    .input-group-modern:has(.quick-search-grid-input),
    .quick-search-container .input-group-modern {
        border: 1px solid #cad2dd;
        border-radius: 0.375rem;
        box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.08);
        transition: all 0.2s;
    }

        .input-group-modern:has(.quick-search-grid-input):hover,
        .quick-search-container .input-group-modern:hover {
            border-color: #64748b;
            box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.1);
        }

        .input-group-modern:has(.quick-search-grid-input):focus-within,
        .quick-search-container .input-group-modern:focus-within {
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
        }

    .input-group-modern .quick-search-grid-input {
        font-size: 0.8rem;
        font-weight: 500;
        color: #0f172a;
    }

/* Tables: High-density data grid with vertical borders & crisp typography */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background-color: #ffffff;
}

    .table-modern thead {
        position: static;
    }

        .table-modern thead th {
            position: sticky;
            top: 0;
            z-index: 15;
            background: #f1f5f9 !important;
            color: #475569 !important;
            font-weight: 700 !important;
            text-transform: uppercase !important;
            font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
            font-size: 0.725rem !important;
            letter-spacing: 0.05em !important;
            padding: 4px 10px !important;
            height: 38px;
            border-bottom: 1px solid #cbd5e1 !important;
            border-right: 1px solid #e2e8f0 !important;
            vertical-align: middle;
            white-space: nowrap;
        }

            .table-modern thead th:first-child {
            }

            .table-modern thead th:last-child {
                border-right: none !important;
            }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.table-modern tbody tr {
    height: 38px;
}

    .table-modern tbody tr:nth-child(even) td {
        background-color: #f8fafc !important;
    }

.table-modern tbody td {
    padding: 4px 10px !important;
    height: 38px;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    color: #0f172a;
    font-weight: 450 !important;
    line-height: 1.4;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .table-modern tbody td:last-child {
        border-right: none !important;
    }

    .table-modern tbody td,
    .table-modern tbody td *:not(i):not([class*="fa-"]),
    .table-modern tbody td div:not(i):not([class*="fa-"]),
    .table-modern tbody td span:not(i):not([class*="fa-"]),
    .table-modern tbody td a:not(i):not([class*="fa-"]),
    .table-modern tbody td p:not(i):not([class*="fa-"]),
    .table-modern tbody td label:not(i):not([class*="fa-"]),
    .table-modern tbody td .small:not(i):not([class*="fa-"]),
    .table-modern tbody td small:not(i):not([class*="fa-"]) {
        font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 450 !important;
        color: #0f172a;
    }

        .table-modern tbody td a:not(i):not([class*="fa-"]):hover {
            color: #2563eb !important;
            text-decoration: underline !important;
        }

        .table-modern tbody td .btn-action-icon i,
        .table-modern tbody td .btn-action-icon svg {
            font-size: 11px !important;
        }

.badge {
    border-radius: 0.375rem !important;
}

/* Specific Channel (Luồng tờ khai) badge styling */
.badge-channel,
.badge-pluong-green {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.badge-pluong-yellow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
    background-color: #fef9c3 !important;
    color: #a16207 !important;
    border: 1px solid #fef08a !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.badge-pluong-red {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.badge-pluong-gray {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
}

.table-modern tbody td .badge i {
    font-size: 0.7rem !important;
}

.table-modern thead th.action-col-sticky {
    position: sticky !important;
    top: 0 !important;
    right: 0 !important;
    z-index: 25 !important;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    background-color: #f1f5f9 !important;
    border-left: 1px solid #cbd5e1 !important;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.04) !important;
}

.table-modern td.action-col-sticky,
.table-modern tbody td.action-col-sticky {
    position: sticky !important;
    right: 0 !important;
    z-index: 5 !important;
    background-color: #ffffff !important;
    border-left: 1px solid #e2e8f0 !important;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.04) !important;
}

.table-modern tbody tr:hover > td,
.table-modern tbody tr:hover > th {
    background-color: #f1f5f9 !important;
}

    .table-modern tbody tr:hover > td.action-col-sticky,
    .table-hover tbody tr:hover td.action-col-sticky {
        background-color: #f1f5f9 !important;
    }

.table-modern tr.table-warning td.action-col-sticky,
.table-modern tbody tr.table-warning td.action-col-sticky {
    background-color: #fff3cd !important;
}

/* Buttons */
.btn-modern {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.2s;
}

    .btn-modern.btn-sm,
    .btn-sm.btn-modern {
        padding: 5px 14px;
        font-size: 0.85rem;
        border-radius: 6px;
        line-height: 1.5;
    }

.btn-primary-modern {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
}

    .btn-primary-modern:hover {
        background-color: var(--primary-hover);
        border-color: var(--primary-hover);
        color: white;
        box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
    }

.btn-secondary-modern {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
}

    .btn-secondary-modern:hover {
        background-color: #e2e8f0;
        color: var(--text-main);
        border-color: #cbd5e1;
    }

/* Login Page specific - Fullscreen Pro Layout */
.login-page-v2 {
    background: #0b0f19;
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    display: flex;
    overflow: hidden;
    padding: 0;
    margin: 0;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.login-container-v2 {
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    max-width: 100%;
}

.login-brand-col {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    height: 100vh;
    overflow-y: auto;
}

.login-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.15);
}

.role-switch-group .btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 8px;
}

    .role-switch-group .btn.active {
        background-color: #4361ee !important;
        color: white !important;
        border-color: #4361ee !important;
        box-shadow: 0 2px 6px rgba(67, 97, 238, 0.3);
    }

.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

    .login-logo i {
        font-size: 3rem;
        color: var(--primary-color);
        margin-bottom: 10px;
    }

.login-title {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-main);
}

.form-control-modern {
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
}

    .form-control-modern:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
        background-color: var(--white);
    }

.input-group-modern {
    border-radius: 8px;
    overflow: hidden;
}

    .input-group-modern .input-group-text,
    .input-group-modern .form-control {
        border-color: #cbd5e1;
    }

        .input-group-modern .form-control:focus {
            box-shadow: none;
            border-color: var(--primary-color);
        }

/* =========================================================================
   Split Pane & Draggable Gutter Styles
   ========================================================================= */
.split-pane-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    position: relative;
    user-select: auto;
}

    .split-pane-container.is-dragging {
        user-select: none !important;
        cursor: col-resize !important;
    }

        .split-pane-container.is-dragging iframe,
        .split-pane-container.is-dragging textarea,
        .split-pane-container.is-dragging input {
            pointer-events: none !important;
        }

.split-pane-left,
.split-pane-right {
    position: relative;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    transition: none;
}

.split-gutter {
    width: 10px;
    margin: 0 -1px;
    background-color: #f1f5f9;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    cursor: col-resize;
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
}

    .split-gutter:hover,
    .split-gutter.is-active {
        background-color: #e0e7ff;
        border-color: #818cf8;
    }

.split-gutter-handle {
    width: 3px;
    height: 32px;
    background-color: #94a3b8;
    border-radius: 2px;
    transition: background-color 0.15s ease, height 0.15s ease;
}

.split-gutter:hover .split-gutter-handle,
.split-gutter.is-active .split-gutter-handle {
    background-color: #4361ee;
    height: 44px;
}

/* =========================================================================
   Enterprise Selection Modal (Matching TSX Modern Design)
   ========================================================================= */
.modal-enterprise-dialog {
    max-width: 540px;
}

.modal-enterprise-content {
    border-radius: 16px !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.modal-enterprise-header {
    background-color: #ffffff;
    color: #1e293b;
    padding: 20px 24px 14px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.enterprise-search-wrap {
    position: relative;
}

    .enterprise-search-wrap .search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: 0.875rem;
        pointer-events: none;
    }

    .enterprise-search-wrap .form-control {
        padding-left: 38px;
        padding-right: 36px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid #cbd5e1;
        font-size: 0.875rem;
        background-color: #f8fafc;
        transition: all 0.15s ease;
    }

        .enterprise-search-wrap .form-control:focus {
            background-color: #ffffff;
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
        }

    .enterprise-search-wrap .btn-clear-search {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #94a3b8;
        padding: 4px;
        cursor: pointer;
        font-size: 0.875rem;
        display: none;
    }

        .enterprise-search-wrap .btn-clear-search:hover {
            color: #475569;
        }

.enterprise-list-scroll {
    max-height: 270px;
    overflow-y: auto;
}

    .enterprise-list-scroll::-webkit-scrollbar {
        width: 5px;
    }

    .enterprise-list-scroll::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .enterprise-list-scroll::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

        .enterprise-list-scroll::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

.enterprise-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.15s ease-in-out;
    user-select: none;
}

    .enterprise-card-item:hover {
        border-color: #cbd5e1;
        background-color: #f8fafc;
    }

    .enterprise-card-item.selected {
        background-color: #eef2ff !important;
        border-color: #6366f1 !important;
        box-shadow: 0 1px 3px 0 rgba(99, 102, 241, 0.12);
    }

    .enterprise-card-item .card-code-badge {
        font-size: 0.8125rem;
        font-weight: 700;
        color: #4f46e5;
        display: flex;
        align-items: center;
        gap: 6px;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    }

    .enterprise-card-item .card-name {
        font-size: 0.845rem;
        font-weight: 600;
        color: #1e293b;
        margin-top: 2px;
        line-height: 1.35;
    }

    .enterprise-card-item .card-address {
        font-size: 0.725rem;
        color: #94a3b8;
        margin-top: 3px;
        line-height: 1.3;
    }

    .enterprise-card-item .card-check {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 1.5px solid #cbd5e1;
        display: flex;
        align-items: center;
        justify-content: center;
        color: transparent;
        flex-shrink: 0;
        transition: all 0.15s ease;
        margin-left: 12px;
    }

    .enterprise-card-item.selected .card-check {
        background-color: #4f46e5;
        border-color: #4f46e5;
        color: #ffffff;
    }

.modal-enterprise-footer {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* --- GridConfig Modal Styles --- */

.modal-modern .modal-header {
    padding: 0.75rem 1.25rem;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.modal-modern .modal-body {
    padding: 1.25rem;
    background-color: #ffffff;
    color: #1e293b;
}

.modal-modern .modal-footer {
    padding: 0.75rem 1.25rem;
    background-color: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.modal-modern .modal-content {
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.icon-gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.25), 0 2px 4px -2px rgba(59, 130, 246, 0.25);
}

.bento-card {
    background-color: rgba(248, 250, 252, 0.6);
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.875rem;
}

.bento-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    margin-bottom: 0.875rem;
}

.bento-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #2563eb;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.bento-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bento-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
}

.modern-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.25rem;
}

.modern-input {
    display: block;
    width: 100%;
    padding: 0.375rem 0.625rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.08);
    transition: all 0.2s;
}

    .modern-input:hover {
        border-color: #64748b;
        box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.1);
    }

    .modern-input:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
        outline: none;
    }

    .modern-input::placeholder {
        color: #94a3b8;
        font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
        font-weight: 400;
    }

/* Modern Input Group with Addon / Password Toggle (Matching .modern-input height & full focus highlight) */
.modern-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

    .modern-input-group:hover {
        border-color: #64748b;
        box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.1);
    }

    .modern-input-group:focus-within {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    }

    .modern-input-group .form-control,
    .modern-input-group input {
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        background: transparent !important;
        padding: 0.375rem 0.625rem !important;
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        font-weight: 500 !important;
        color: #0f172a !important;
        flex: 1 1 auto;
        width: 1%;
        min-width: 0;
        border-radius: 0 !important;
        margin: 0 !important;
    }

        .modern-input-group .form-control:focus,
        .modern-input-group input:focus {
            border: none !important;
            box-shadow: none !important;
            outline: none !important;
        }

        .modern-input-group .form-control::placeholder,
        .modern-input-group input::placeholder {
            color: #94a3b8;
            font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
            font-weight: 400;
        }

    .modern-input-group .btn-password-toggle {
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
        background: transparent !important;
        color: #64748b !important;
        padding: 0 0.75rem !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.875rem !important;
        cursor: pointer !important;
        transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out !important;
        border-radius: 0 !important;
    }

        .modern-input-group .btn-password-toggle:hover {
            color: #2563eb !important;
            background-color: rgba(37, 99, 235, 0.06) !important;
        }

        .modern-input-group .btn-password-toggle:active {
            background-color: rgba(37, 99, 235, 0.12) !important;
        }

.data-type-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    cursor: pointer;
    width: 100%;
    text-align: left;
}

    .data-type-btn:hover {
        border-color: #cbd5e1;
        color: #0f172a;
    }

    .data-type-btn.active {
        background-color: #2563eb;
        border-color: #2563eb;
        color: #ffffff;
        box-shadow: 0 1px 2px 0 rgba(59, 130, 246, 0.2);
    }

        .data-type-btn.active i {
            color: #ffffff !important;
        }

.align-container {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.align-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #64748b;
    transition: all 0.2s;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
}

    .align-btn:hover {
        color: #1e293b;
    }

    .align-btn.active {
        background-color: #eff6ff;
        color: #1d4ed8;
        font-weight: 600;
        border-color: rgba(191, 219, 254, 0.6);
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    }

.switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    user-select: none;
}

    .switch-card:hover {
        border-color: #cbd5e1;
    }

    .switch-card.active-warning {
        background-color: rgba(254, 252, 232, 0.8);
        border-color: rgba(253, 224, 71, 0.9);
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(250, 204, 21, 0.2);
    }

    .switch-card.active-primary {
        background-color: rgba(239, 246, 255, 0.8);
        border-color: rgba(147, 197, 253, 0.9);
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(96, 165, 250, 0.2);
    }

.icon-box {
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #f1f5f9;
    color: #94a3b8;
    transition: all 0.2s;
}

.switch-card.active-warning .icon-box {
    background-color: #fef3c7;
    color: #b45309;
}

.switch-card.active-primary .icon-box {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.custom-toggle {
    width: 40px;
    height: 20px;
    border-radius: 9999px;
    background-color: #e2e8f0;
    position: relative;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

    .custom-toggle::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 16px;
        height: 16px;
        background-color: white;
        border-radius: 50%;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        transition: transform 0.2s;
    }

    .custom-toggle.active-warning {
        background-color: #f59e0b;
    }

    .custom-toggle.active-primary {
        background-color: #2563eb;
    }

    .custom-toggle.active::after {
        transform: translateX(20px);
    }

.btn-gradient-primary {
    background: linear-gradient(to right, #2563eb, #4f46e5);
    color: white;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

    .btn-gradient-primary:hover {
        background: linear-gradient(to right, #1d4ed8, #4338ca);
        color: white;
    }

.modern-input-sm {
    display: block;
    width: 100%;
    padding: 0.375rem 0.5rem !important;
    background-color: #ffffff;
    border: 1px solid #cad2dd;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #0f172a;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.08);
    transition: all 0.2s;
}

    .modern-input-sm:hover {
        border-color: #64748b;
        box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.1);
    }

    .modern-input-sm:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
        outline: none;
    }

    .modern-input-sm::placeholder {
        color: #94a3b8;
        font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
        font-weight: 400;
    }

/* Enhanced font-weight for all inputs and textareas */
input.modern-input,
textarea.modern-input,
input.modern-input-sm,
textarea.modern-input-sm,
input.form-control,
textarea.form-control,
.declaration-field,
.good-item-col,
.good-item-page-input {
    font-weight: 450 !important;
    color: #0f172a;
}

/* EDI Form Field Labels: Darker than text-muted (#64748b) for clear readability, but lighter than input text (#0f172a) */
.edi-field-label,
.edi-detail-wrapper .form-label:not(.text-warning-emphasis) {
    color: #475569 !important;
    font-weight: 400 !important;
}

#tblGoodItems thead th {
    color: #475569 !important;
}

/* =========================================================================
   Redesigned EDI Goods Items Table (Modern, Clean & High Contrast)
   ========================================================================= */
.edi-goods-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

    .edi-goods-table thead th {
        background-color: #f1f5f9;
        color: #475569 !important;
        font-size: 0.725rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 4px 10px;
        height: 38px;
        border-bottom: 1px solid #cbd5e1;
        border-top: none;
        border-left: none;
        border-right: 1px solid #e2e8f0;
    }

        .edi-goods-table thead th:last-child {
            border-right: none;
        }

    .edi-goods-table tbody tr {
        height: 38px;
    }

        .edi-goods-table tbody tr:nth-child(even) td {
            background-color: #f8fafc;
        }

    .edi-goods-table tbody td {
        padding: 4px 10px;
        height: 38px;
        border-bottom: 1px solid #e2e8f0;
        border-top: none;
        border-left: none;
        border-right: 1px solid #e2e8f0;
        background-color: #ffffff;
        transition: background-color 0.15s ease;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .edi-goods-table tbody tr:hover td {
        background-color: #f8fafc;
    }

    .edi-goods-table .row-stt {
        font-size: 0.75rem;
        font-weight: 500;
        color: #64748b;
    }

    .edi-goods-table thead th.col-stt,
    .edi-goods-table tbody td.col-stt {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        text-align: center;
    }

    .edi-goods-table thead th.col-action,
    .edi-goods-table tbody td.col-action {
        width: 48px;
        min-width: 48px;
        max-width: 48px;
        text-align: center;
        background-color: #ffffff;
    }

    .edi-goods-table tbody tr:hover td.col-action {
        background-color: #f8fafc;
    }

    .edi-goods-table thead th.col-action {
        background-color: #f8fafc;
        border-left: 1px solid #e2e8f0;
        box-shadow: -2px 0 6px rgba(0, 0, 0, 0.03);
    }

    .edi-goods-table tbody td.col-action {
        border-left: 1px solid #f1f5f9;
        box-shadow: -2px 0 6px rgba(0, 0, 0, 0.03);
    }

    .edi-goods-table .btn-delete-row {
        color: #94a3b8;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        transition: all 0.15s ease;
    }

        .edi-goods-table .btn-delete-row:hover {
            color: #ef4444;
            background-color: #fee2e2;
        }

    /* Modern inputs inside table rows */
    .edi-goods-table .modern-input-sm {
        border: 1px solid #94a3b8;
        background-color: #ffffff;
        padding: 4px 8px;
        font-size: 0.8125rem;
        height: 32px;
        border-radius: 6px;
        transition: all 0.15s ease-in-out;
    }

        .edi-goods-table .modern-input-sm:hover {
            border-color: #cbd5e1;
        }

        .edi-goods-table .modern-input-sm:focus {
            border-color: #3b82f6;
            background-color: #ffffff;
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
        }

    .edi-goods-table textarea.modern-input-sm {
        height: 48px;
    }

/* Numeric input formatting styling */
.numeric-input {
    font-variant-numeric: tabular-nums;
}

/* Disabled and Readonly states for modern inputs */
.modern-input:disabled,
.modern-input[readonly],
.modern-input-sm:disabled,
.modern-input-sm[readonly] {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* =========================================================================
   Grid Customizer Column Modal (Modern UI)
   ========================================================================= */
.modal-grid-customizer .modal-content {
    border-radius: 16px !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.grid-config-list-scroll {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    width: 100% !important;
}

.grid-col-custom-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex !important;
    width: 100% !important;
    flex-shrink: 0;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease-in-out;
    cursor: default;
    user-select: none;
    margin-bottom: 2px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

    .grid-col-custom-card:hover {
        background-color: #f8fafc;
        border-color: #93c5fd;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .grid-col-custom-card.is-active {
        background-color: #ffffff;
        border-color: #e2e8f0;
    }

    .grid-col-custom-card.is-required {
        background-color: #fffbeb;
        border-color: #fef3c7;
    }

    .grid-col-custom-card.is-dragging {
        opacity: 0.45;
        background-color: #eff6ff !important;
        border: 2px dashed #3b82f6 !important;
    }

    .grid-col-custom-card.drag-over-top {
        border-top: 3px solid #2563eb !important;
        background-color: #f0fdf4 !important;
    }

    .grid-col-custom-card.drag-over-bottom {
        border-bottom: 3px solid #2563eb !important;
        background-color: #f0fdf4 !important;
    }

    .grid-col-custom-card .drag-handle {
        cursor: grab;
        cursor: -webkit-grab;
        color: #64748b;
        width: 24px;
        height: 26px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        transition: all 0.15s ease;
    }

        .grid-col-custom-card .drag-handle:hover {
            color: #2563eb;
            background-color: #eff6ff;
            border-color: #bfdbfe;
        }

        .grid-col-custom-card .drag-handle:active {
            cursor: grabbing;
            cursor: -webkit-grabbing;
            background-color: #dbeafe;
        }

    .grid-col-custom-card .reorder-btn-group {
        display: inline-flex;
        align-items: center;
        border-radius: 6px;
        overflow: hidden;
        border: 1px solid #cbd5e1;
        background-color: #ffffff;
    }

        .grid-col-custom-card .reorder-btn-group .btn-col-up,
        .grid-col-custom-card .reorder-btn-group .btn-col-down {
            width: 26px;
            height: 24px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #475569;
            background-color: #ffffff;
            border: none;
            border-right: 1px solid #e2e8f0;
            transition: all 0.15s ease;
        }

        .grid-col-custom-card .reorder-btn-group .btn-col-down {
            border-right: none;
        }

            .grid-col-custom-card .reorder-btn-group .btn-col-up:hover:not(:disabled),
            .grid-col-custom-card .reorder-btn-group .btn-col-down:hover:not(:disabled) {
                color: #1d4ed8;
                background-color: #eff6ff;
            }

            .grid-col-custom-card .reorder-btn-group .btn-col-up:active:not(:disabled),
            .grid-col-custom-card .reorder-btn-group .btn-col-down:active:not(:disabled) {
                background-color: #dbeafe;
            }

            .grid-col-custom-card .reorder-btn-group .btn-col-up:disabled,
            .grid-col-custom-card .reorder-btn-group .btn-col-down:disabled {
                opacity: 0.25;
                cursor: not-allowed;
                background-color: #f8fafc;
                color: #94a3b8;
            }

    .grid-col-custom-card .col-order-index {
        font-size: 0.6875rem;
        font-weight: 700;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        color: #64748b;
        background-color: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        padding: 2px 5px;
        min-width: 24px;
        text-align: center;
        display: inline-block;
    }

    .grid-col-custom-card .form-check-input {
        width: 17px;
        height: 17px;
        margin-top: 0;
        margin-right: 10px !important;
        cursor: pointer;
        border-color: #cbd5e1;
    }

        .grid-col-custom-card .form-check-input:checked {
            background-color: #2563eb;
            border-color: #2563eb;
        }

    .grid-col-custom-card .col-label-vi {
        font-size: 0.845rem;
        font-weight: 500;
        color: #1e293b;
        line-height: 1.25;
    }

    .grid-col-custom-card .col-field-key {
        font-size: 0.725rem;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        color: #64748b;
        background-color: #f1f5f9;
        padding: 1px 6px;
        border-radius: 4px;
        border: 1px solid #e2e8f0;
    }

    .grid-col-custom-card .badge-required {
        font-size: 0.7rem;
        padding: 3px 8px;
        border-radius: 5px;
        background-color: #fef3c7;
        color: #b45309;
        border: 1px solid #fde68a;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

/* EDI Detail Tabs Layout & Scrolling */
#ediDetailTabContent {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    position: relative;
}

    #ediDetailTabContent > .tab-pane {
        height: 100% !important;
        min-height: 0 !important;
        width: 100% !important;
    }

        #ediDetailTabContent > .tab-pane:not(.active) {
            display: none !important;
        }

        #ediDetailTabContent > .tab-pane.active {
            display: flex !important;
            flex-direction: column;
        }

#tab-form {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
    min-height: 0 !important;
}

/* =========================================================================
   EDI Default Configuration (EDIConfig) Styles
   ========================================================================= */
.cursor-pointer {
    cursor: pointer !important;
}

.edi-search-box-width {
    min-width: 200px;
    max-width: 250px;
}

.edi-col-stt {
    width: 50px;
}

.edi-desc-truncate {
    max-width: 200px;
    display: inline-block;
}

.edi-modal-content-rounded {
    border-radius: 12px !important;
    overflow: hidden !important;
}

.edi-modal-icon-circle {
    width: 38px;
    height: 38px;
}

.edi-dropzone-box {
    cursor: pointer;
    transition: all 0.2s ease;
}

.edi-dropzone-subtext {
    font-size: 0.75rem;
}

.edi-json-textarea {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
    background-color: #fafbfd !important;
}

.edi-preview-table-scroll {
    max-height: 160px;
}

.edi-btn-circle-back {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.edi-switch-container {
    height: 38px;
}

.edi-switch-toggle {
    width: 2.2em !important;
    height: 1.1em !important;
    cursor: pointer !important;
}

.edi-switch-label {
    cursor: pointer;
}

    .edi-switch-label.is-active {
        color: #16a34a !important;
    }

    .edi-switch-label.is-inactive {
        color: #64748b !important;
    }

.edi-decl-row {
    background-color: rgba(248, 250, 252, 0.6) !important;
}

.edi-goods-row {
    background-color: rgba(240, 249, 255, 0.6) !important;
}

.edi-col-field {
    flex-basis: 50%;
}

.edi-btn-remove-row {
    height: 38px !important;
    width: 38px !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    padding: 0.375rem 0.75rem !important;
    display: flex;
    align-items: center;
    background-color: #ffffff;
}

.select2-container--bootstrap-5 .select2-selection__rendered {
    padding: 8px !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown {
    padding: 0.5rem !important;
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: block !important;
}

.select2-container--bootstrap-5 .select2-search__field {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.625rem !important;
    font-size: 0.875rem !important;
    outline: none !important;
    background-color: #ffffff !important;
    width: 100% !important;
}

    .select2-container--bootstrap-5 .select2-search__field:focus {
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    }

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.875rem !important;
}


/* HORIZONTAL LAYOUT */
body.layout-horizontal .app-wrapper {
    margin-left: 0 !important;
}

body.layout-horizontal .app-sidebar {
    width: 100% !important;
    min-height: auto;
    height: 50px;
    position: fixed;
    top: var(--header-height);
    left: 0;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    z-index: 998;
    padding: 0 30px;
    background-color: var(--white);
}

body.layout-horizontal .sidebar-logo {
    display: none;
}

body.layout-horizontal .sidebar-nav {
    display: flex !important;
    flex-direction: row;
    padding: 0;
    height: 100%;
    align-items: center;
    gap: 5px;
    overflow: visible;
}

    body.layout-horizontal .sidebar-nav hr,
    body.layout-horizontal .sidebar-nav small {
        display: none;
    }

body.layout-horizontal .nav-item-custom {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

body.layout-horizontal .nav-link-custom {
    padding: 0 15px;
    height: 40px;
    border-radius: 6px;
    white-space: nowrap;
}

    body.layout-horizontal .nav-link-custom .nav-text {
        margin-left: 8px;
    }

body.layout-horizontal .nav-link-parent .nav-chevron {
    margin-left: 8px;
    transform: rotate(90deg);
}

body.layout-horizontal .nav-link-parent[aria-expanded="true"] .nav-chevron {
    transform: rotate(270deg);
}

body.layout-horizontal .nav-item-custom:hover .nav-chevron {
    transform: rotate(270deg) !important;
}

body.layout-horizontal .nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 8px;
    /* Override Bootstrap Collapse for hover behavior */
    display: block !important;
    height: auto !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    pointer-events: none;
}

body.layout-horizontal .nav-item-custom:hover .nav-submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

body.layout-horizontal .nav-link-sub {
    padding: 10px 15px;
}

body.layout-horizontal .app-main {
    margin-top: 55px !important; /* Clear the horizontal sidebar */
}

body.layout-horizontal #btnToggleSidebar {
    display: none;
}

.header-logo-horizontal {
    display: none;
}

body.layout-horizontal .header-logo-horizontal {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-right: 20px;
}

body.layout-horizontal .nav-submenu::before {
    display: none !important;
}

body.layout-horizontal .nav-submenu {
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    top: 100% !important;
    left: 0 !important;
}

body.layout-horizontal .nav-link-sub::before {
    display: none !important;
}

/* ==========================================================================
   EDI Schema Catalog Master-Detail Layout & Action Styles
   ========================================================================== */
.schema-catalog-layout {
    display: flex !important;
    gap: 14px !important;
    min-height: 560px !important;
    overflow: hidden !important;
}

@media (max-width: 991.98px) {
    .schema-catalog-layout {
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }
}

/* Left Panel: Schema Hierarchy Tree */
.schema-tree-panel {
    width: 280px !important;
    min-width: 260px !important;
    max-width: 320px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

@media (max-width: 991.98px) {
    .schema-tree-panel {
        width: 100% !important;
        max-width: none !important;
    }
}

.schema-tree-header {
    background: #ffffff !important;
    padding: 10px 14px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.schema-tree-title {
    font-size: 0.785rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #334155 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
}

.schema-tree-body {
    padding: 10px !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
}

.schema-tree-group {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 9px !important;
    padding: 8px !important;
    margin-bottom: 10px !important;
}

.schema-group-title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px 6px 6px 6px !important;
    font-size: 0.8rem !important;
    font-weight: 650 !important;
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
    margin-bottom: 6px !important;
}

.schema-group-badge {
    font-family: var(--bs-font-monospace, monospace) !important;
    font-size: 0.675rem !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
}

.schema-tree-children {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.schema-tree-node {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 7px 10px !important;
    border-radius: 7px !important;
    color: #475569 !important;
    text-decoration: none !important;
    font-size: 0.795rem !important;
    font-weight: 500 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    transition: all 0.15s ease !important;
    line-height: 1.35 !important;
}

    .schema-tree-node:hover {
        color: #0f172a !important;
        background-color: #f1f5f9 !important;
    }

    .schema-tree-node.active {
        color: #1d4ed8 !important;
        background-color: #eff6ff !important;
        border-color: #bfdbfe !important;
        font-weight: 650 !important;
        box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08) !important;
    }

    .schema-tree-node .node-icon {
        font-size: 0.825rem !important;
        color: #94a3b8 !important;
        transition: color 0.15s ease !important;
    }

    .schema-tree-node:hover .node-icon,
    .schema-tree-node.active .node-icon {
        color: #2563eb !important;
    }

    .schema-tree-node .node-badge {
        font-size: 0.7rem !important;
        font-weight: 600 !important;
        padding: 2px 7px !important;
        border-radius: 9999px !important;
        background-color: #e2e8f0 !important;
        color: #475569 !important;
        font-family: Arial, sans-serif !important;
    }

    .schema-tree-node.active .node-badge {
        background-color: #2563eb !important;
        color: #ffffff !important;
    }

.schema-dirty-dot {
    width: 7px !important;
    height: 7px !important;
    background-color: #f59e0b !important;
    border-radius: 50% !important;
    display: inline-block !important;
    animation: pulse 1.8s infinite !important;
}

/* Right Panel: Workspace & Actions */
.schema-workspace {
    flex: 1 !important;
    min-width: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.schema-workspace-header {
    background: #ffffff !important;
    padding: 10px 16px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

.schema-breadcrumb-ctx {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 0.85rem !important;
}

    .schema-breadcrumb-ctx .ctx-schema {
        font-weight: 600 !important;
        color: #1e293b !important;
    }

    .schema-breadcrumb-ctx .ctx-divider {
        color: #94a3b8 !important;
        font-size: 0.75rem !important;
    }

    .schema-breadcrumb-ctx .ctx-section {
        font-weight: 700 !important;
        color: #2563eb !important;
    }

    .schema-breadcrumb-ctx .ctx-file {
        font-family: var(--bs-font-monospace, monospace) !important;
        font-size: 0.7rem !important;
        background-color: #f1f5f9 !important;
        color: #64748b !important;
        padding: 2px 7px !important;
        border-radius: 5px !important;
        border: 1px solid #e2e8f0 !important;
    }

/* Unsaved Changes Banner */
.schema-unsaved-alert {
    background-color: #fffbeb !important;
    border-bottom: 1px solid #fde68a !important;
    color: #92400e !important;
    padding: 8px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 0.8rem !important;
    animation: slideDown 0.2s ease-out !important;
}

/* Toolbar: Search, Filters & Batch Actions */
.schema-toolbar {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 8px 16px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
}

.schema-search-box {
    min-width: 220px !important;
    max-width: 320px !important;
}

.schema-filter-select {
    width: 155px !important;
    font-size: 0.8rem !important;
}

.schema-batch-btn-group .btn {
    font-size: 0.785rem !important;
    padding: 4px 10px !important;
    font-weight: 500 !important;
}

/* Table Column Widths & Styles */
.col-schema-stt {
    width: 45px !important;
    min-width: 45px !important;
    text-align: center !important;
}

.col-schema-key {
    width: 175px !important;
    min-width: 165px !important;
}

.col-schema-label-vi {
    width: 170px !important;
    min-width: 160px !important;
}

.col-schema-label-en {
    width: 140px !important;
    min-width: 130px !important;
}

.col-schema-type {
    width: 85px !important;
    min-width: 80px !important;
    text-align: center !important;
}

.col-schema-len {
    width: 75px !important;
    min-width: 70px !important;
    text-align: center !important;
}

.col-schema-req {
    width: 95px !important;
    min-width: 90px !important;
    text-align: center !important;
}

.col-schema-view {
    width: 140px !important;
    min-width: 135px !important;
    text-align: center !important;
}

.schema-icon-lock {
    font-size: 11px !important;
}

.isview-status-badge {
    display: inline-block !important;
    text-align: center !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    width: 42px !important;
    line-height: 1.2 !important;
}

@keyframes schemaRowPulse {
    0% {
        background-color: rgba(13, 110, 253, 0.18) !important;
    }

    50% {
        background-color: rgba(13, 110, 253, 0.32) !important;
    }

    100% {
        background-color: transparent !important;
    }
}

.schema-row-highlight {
    animation: schemaRowPulse 1.8s ease-in-out !important;
}


/* Toast Styling */
.toast-container {
    z-index: 1090;
    pointer-events: none;
}

.toast {
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    background-clip: padding-box !important;
}

    /* Glassmorphism Toasts */
    .toast.glass-toast {
        backdrop-filter: blur(12px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
        background-clip: padding-box !important;
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08) !important;
    }

    .toast.glass-success {
        background-color: rgba(209, 231, 221, 0.15) !important;
        border: 1px solid rgba(25, 135, 84, 0.15) !important;
        color: #0f5132 !important; /* dark green */
    }

    .toast.glass-danger {
        background-color: rgba(248, 215, 218, 0.15) !important;
        border: 1px solid rgba(220, 53, 69, 0.15) !important;
        color: #842029 !important; /* dark red */
    }

    .toast.glass-warning {
        background-color: rgba(255, 243, 205, 0.15) !important;
        border: 1px solid rgba(255, 193, 7, 0.15) !important;
        color: #664d03 !important; /* dark yellow/brown */
    }

    .toast.glass-primary {
        background-color: rgba(207, 226, 255, 0.15) !important;
        border: 1px solid rgba(13, 110, 253, 0.15) !important;
        color: #084298 !important; /* dark blue */
    }

#globalToastContainer {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important; /* Chỉ cách nhau 4px */
}

    #globalToastContainer > .toast {
        margin-top: 2px !important;
        margin-bottom: 2px !important;
    }

/* =========================================================================
   Unified Modern Pagination UI Component
   ========================================================================= */
.pagination,
.pagination-modern {
    display: inline-flex !important;
    gap: 4px !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

    .pagination .page-item,
    .pagination-modern .page-item {
        margin: 0 !important;
    }

    .pagination .page-link,
    .pagination-modern .page-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 32px !important;
        height: 32px !important;
        padding: 0 9px !important;
        font-size: 0.8125rem !important;
        font-weight: 500 !important;
        color: #475569 !important;
        background-color: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
        line-height: 1 !important;
        user-select: none !important;
    }

        .pagination .page-link:hover,
        .pagination-modern .page-link:hover {
            color: var(--primary-color, #4361ee) !important;
            background-color: #f8fafc !important;
            border-color: #cbd5e1 !important;
            box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08) !important;
            transform: translateY(-1px);
        }

    .pagination .page-item.active .page-link,
    .pagination-modern .page-item.active .page-link {
        color: #ffffff !important;
        background: linear-gradient(135deg, #4361ee 0%, #3a56d4 100%) !important;
        border-color: #3a56d4 !important;
        font-weight: 600 !important;
        box-shadow: 0 2px 6px rgba(67, 97, 238, 0.35) !important;
        transform: none !important;
    }

    .pagination .page-item.disabled .page-link,
    .pagination-modern .page-item.disabled .page-link {
        color: #94a3b8 !important;
        background-color: #f8fafc !important;
        border-color: #e2e8f0 !important;
        cursor: not-allowed !important;
        opacity: 0.55 !important;
        box-shadow: none !important;
        transform: none !important;
    }

        .pagination .page-item.disabled span.ellipsis,
        .pagination .page-item.disabled .page-link.ellipsis,
        .pagination-modern .page-item.disabled span.ellipsis,
        .pagination-modern .page-item.disabled .page-link.ellipsis {
            background-color: transparent !important;
            border-color: transparent !important;
            color: #94a3b8 !important;
            cursor: default !important;
            box-shadow: none !important;
            transform: none !important;
            min-width: 24px !important;
            padding: 0 4px !important;
        }

/* Pagination Info & Page Size Select */
.pagination-info-text {
    font-size: 0.8125rem;
    color: #64748b;
}

    .pagination-info-text strong {
        color: #1e293b;
        font-weight: 600;
    }

.pagination-pagesize-select {
    height: 28px !important;
    width: 72px !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 0 20px 0 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

    .pagination-pagesize-select:hover {
        border-color: #cbd5e1 !important;
    }

    .pagination-pagesize-select:focus {
        border-color: #4361ee !important;
        box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15) !important;
        outline: none !important;
    }

/* User Form Extracted Inline CSS Classes */
.user-page-header {
    margin-bottom: 0 !important;
}

.user-form-container {
    min-height: 0 !important;
}

.user-decoy-input {
    display: none !important;
}

.user-card-gap {
    gap: 16px !important;
}

.user-level-notice {
    font-size: 11px !important;
}

.enterprise-checkbox-list {
    max-height: 320px !important;
}

.enterprise-item-name {
    font-size: 0.8125rem !important;
    line-height: 1.35 !important;
}

.enterprise-code-badge {
    font-size: 0.725rem !important;
    padding: 2px 6px !important;
}

.enterprise-hq-badge {
    font-size: 0.7rem !important;
    padding: 2px 5px !important;
}

.enterprise-address-small {
    max-width: 90% !important;
    font-size: 0.725rem !important;
}

.bento-card-min-0 {
    min-height: 0 !important;
}

.permissions-table-wrapper {
    min-height: 380px !important;
}

.th-func-width {
    min-width: 220px !important;
}

.th-action-width {
    min-width: 80px !important;
}

.action-code-small {
    font-size: 10px !important;
}

.th-select-width {
    width: 70px !important;
}

.func-icon-box {
    width: 30px !important;
    height: 30px !important;
}

.func-icon-size {
    font-size: 13px !important;
}

.func-name-text {
    font-size: 0.85rem !important;
}

.func-group-badge {
    font-size: 10px !important;
}

.task-icon-size {
    font-size: 11px !important;
}
