/* ==========================================================================
   TuanDuong UI System — Dual-Layout Theme (Horizontal Light + Left Sidebar)
   ========================================================================== */
:root {
    --td-primary: #4454c3;
    --td-primary-hover: #3745a8;
    --td-primary-soft: #eef0fb;
    --td-success: #16a34a;
    --td-warning: #d97706;
    --td-danger: #e11d48;
    --td-info: #0284c7;
    --td-bg: #f5f6fb;
    --td-surface: #ffffff;
    --td-border: #e6eaf5;
    --td-text: #334155;
    --td-heading: #1e293b;
    --td-muted: #64748b;
    --td-header-h: 66px;
    --td-hnav-h: 50px;
    --td-sidebar-w: 254px;
    --td-shadow: 0 2px 12px rgba(18, 38, 63, 0.04);
    --bs-primary: #4454c3;
    --bs-primary-rgb: 68, 84, 195;
    --bs-body-bg: #f5f6fb;
    --bs-body-color: #334155;
}

html[data-bs-theme="dark"] {
    --td-bg: #141724;
    --td-surface: #1d2133;
    --td-border: #2c314a;
    --td-text: #e2e6f3;
    --td-heading: #f8f9fc;
    --td-muted: #94a3b8;
    --td-primary-soft: rgba(68, 84, 195, 0.24);
    --td-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
    --bs-body-bg: #141724;
    --bs-body-color: #e2e6f3;
}

html, body {
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    background-color: var(--td-bg) !important;
    color: var(--td-text) !important;
    overflow-x: hidden;
}

code, pre, .font-monospace {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-container {
    animation: none !important;
}

/* Top Header Bar (.td-header) */
.td-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--td-header-h);
    background: var(--td-surface);
    border-bottom: 1px solid var(--td-border);
    z-index: 1035;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(18, 38, 63, 0.04);
    transition: left 0.25s ease;
}

.td-header-inner {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.td-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.td-brand img {
    height: 34px;
    width: auto;
    border-radius: 6px;
}

.td-brand-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--td-heading);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.td-brand-text span {
    color: var(--td-primary);
}

.td-search-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--td-bg);
    border: 1px solid var(--td-border);
    border-radius: 999px;
    padding: 6px 14px;
    min-width: 240px;
    max-width: 340px;
    color: var(--td-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.td-search-pill:hover {
    border-color: var(--td-primary);
    box-shadow: 0 0 0 3px rgba(68, 84, 195, 0.1);
}

.td-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--td-border);
    background: var(--td-surface);
    color: var(--td-heading);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.td-icon-btn:hover {
    background: var(--td-primary-soft);
    color: var(--td-primary);
    border-color: rgba(68, 84, 195, 0.28);
}

.td-layout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--td-border);
    background: var(--td-bg);
    color: var(--td-heading);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.td-layout-btn:hover {
    background: var(--td-primary-soft);
    color: var(--td-primary);
    border-color: rgba(68, 84, 195, 0.3);
}

.td-wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--td-primary-soft);
    color: var(--td-primary);
    border: 1px solid rgba(68, 84, 195, 0.2);
    font-weight: 700;
    font-size: 0.84rem;
    text-decoration: none;
    white-space: nowrap;
}

.td-wallet-pill:hover {
    background: var(--td-primary);
    color: #fff;
}

/* Horizontal Sub-Navbar (.td-horiz-nav) */
.td-horiz-nav {
    position: fixed;
    top: var(--td-header-h);
    left: 0;
    right: 0;
    height: var(--td-hnav-h);
    background: var(--td-surface);
    border-bottom: 1px solid var(--td-border);
    z-index: 1030;
    box-shadow: 0 4px 14px rgba(18, 38, 63, 0.03);
    display: none;
}

.td-horiz-inner {
    width: 100%;
    max-width: 1360px;
    height: 100%;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.td-hnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 3px;
    width: 100%;
}

.td-hnav-item {
    position: relative;
}

.td-hnav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 7px;
    color: var(--td-text);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.td-hnav-link i {
    font-size: 1.02rem;
    color: var(--td-muted);
}

.td-hnav-link:hover,
.td-hnav-link.active,
.td-hnav-item.show > .td-hnav-link {
    background: var(--td-primary-soft);
    color: var(--td-primary);
}

.td-hnav-link:hover i,
.td-hnav-link.active i,
.td-hnav-item.show > .td-hnav-link i {
    color: var(--td-primary);
}

.td-hnav-item .dropdown-menu {
    border: 1px solid var(--td-border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(18, 38, 63, 0.1);
    padding: 6px;
    min-width: 215px;
    margin-top: 6px !important;
    background: var(--td-surface);
}

.td-hnav-item .dropdown-item {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--td-text);
}

.td-hnav-item .dropdown-item:hover,
.td-hnav-item .dropdown-item.active {
    background: var(--td-primary-soft);
    color: var(--td-primary);
}

/* Left Sidebar (.td-sidebar) */
.td-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--td-sidebar-w);
    background: var(--td-surface);
    border-right: 1px solid var(--td-border);
    z-index: 1055;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(18, 38, 63, 0.06);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.td-sidebar-head {
    height: var(--td-header-h);
    padding: 0 16px;
    border-bottom: 1px solid var(--td-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.td-sidebar-user {
    padding: 14px 16px;
    border-bottom: 1px solid var(--td-border);
    text-align: center;
    background: linear-gradient(180deg, rgba(68, 84, 195, 0.04) 0%, transparent 100%);
    flex-shrink: 0;
}

.td-sidebar-scroll {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 10px 20px;
    scrollbar-width: thin;
}

.td-snav-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--td-muted);
    padding: 10px 12px 4px;
}

.td-snav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--td-text);
    font-size: 0.87rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 2px;
    transition: all 0.16s ease;
}

.td-snav-link i {
    font-size: 1.08rem;
    color: var(--td-muted);
    width: 20px;
    text-align: center;
}

.td-snav-link:hover,
.td-snav-link.active {
    background: var(--td-primary-soft);
    color: var(--td-primary);
    font-weight: 600;
}

.td-snav-link:hover i,
.td-snav-link.active i {
    color: var(--td-primary);
}

.td-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1045;
}

html.td-sidebar-open .td-sidebar {
    transform: translateX(0) !important;
}

html.td-sidebar-open .td-sidebar-backdrop {
    display: block;
}

/* Desktop Dual-Layout Mode Rules (>= 992px) */
@media (min-width: 992px) {
    html[data-td-layout="horizontal"] .td-horiz-nav {
        display: block;
    }
    html[data-td-layout="horizontal"] .td-sidebar-toggle-desktop {
        display: none !important;
    }
    html[data-td-layout="horizontal"] .page-content {
        margin-left: 0 !important;
        padding-top: calc(var(--td-header-h) + var(--td-hnav-h) + 18px) !important;
    }

    html[data-td-layout="sidebar"] .td-horiz-nav {
        display: none !important;
    }
    html[data-td-layout="sidebar"] .td-sidebar {
        transform: translateX(0);
    }
    html[data-td-layout="sidebar"] .td-header {
        left: var(--td-sidebar-w);
    }
    html[data-td-layout="sidebar"] .td-header-brand-wrap {
        display: none;
    }
    html[data-td-layout="sidebar"] .page-content {
        margin-left: var(--td-sidebar-w) !important;
        padding-top: calc(var(--td-header-h) + 18px) !important;
    }
    html[data-td-layout="sidebar"].td-sidebar-collapsed .td-sidebar {
        transform: translateX(-100%);
    }
    html[data-td-layout="sidebar"].td-sidebar-collapsed .td-header {
        left: 0;
    }
    html[data-td-layout="sidebar"].td-sidebar-collapsed .td-header-brand-wrap {
        display: inline-flex;
    }
    html[data-td-layout="sidebar"].td-sidebar-collapsed .page-content {
        margin-left: 0 !important;
    }
}

/* Mobile Layout (< 992px): Strictly Light Left Sidebar Drawer */
@media (max-width: 991.98px) {
    .td-horiz-nav,
    .td-layout-btn,
    .td-search-pill {
        display: none !important;
    }
    .page-content {
        margin-left: 0 !important;
        padding-top: calc(var(--td-header-h) + 14px) !important;
    }
    .td-header-inner {
        padding: 0 12px;
    }
    aside.td-sidebar {
        background: #ffffff !important;
        border-right: 1px solid #e6eaf5 !important;
        color: #334155 !important;
    }
    aside.td-sidebar .td-sidebar-head {
        background: #ffffff !important;
        border-bottom: 1px solid #e6eaf5 !important;
    }
    aside.td-sidebar .td-brand-text {
        color: #1e293b !important;
    }
    aside.td-sidebar .td-sidebar-user {
        background: linear-gradient(180deg, rgba(68, 84, 195, 0.05) 0%, #ffffff 100%) !important;
        border-bottom: 1px solid #e6eaf5 !important;
        color: #1e293b !important;
    }
    aside.td-sidebar .td-snav-title {
        color: #64748b !important;
    }
    aside.td-sidebar .td-snav-link {
        color: #334155 !important;
    }
    aside.td-sidebar .td-snav-link i {
        color: #64748b !important;
    }
    aside.td-sidebar .td-snav-link:hover,
    aside.td-sidebar .td-snav-link.active {
        background: #eef0fb !important;
        color: #4454c3 !important;
    }
    aside.td-sidebar .td-snav-link:hover i,
    aside.td-sidebar .td-snav-link.active i {
        color: #4454c3 !important;
    }
}

/* Unified Page Container & Cards */
.page-content {
    flex: 1 0 auto;
    padding-bottom: 40px;
    transition: margin-left 0.25s ease;
}

.page-content > .page-container,
.page-content > .container-fluid {
    width: 100%;
    max-width: 1360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
}

.card {
    background: var(--td-surface);
    border: 1px solid var(--td-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--td-shadow) !important;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--td-border);
    padding: 14px 18px;
}

.page-title-head {
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 16px 0 !important;
    padding: 14px 18px !important;
    background: var(--td-surface);
    border: 1px solid var(--td-border);
    border-radius: 12px;
    box-shadow: var(--td-shadow);
}

.page-title-head h1,
.page-title-head .td-page-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--td-heading);
    margin: 0;
}

.btn-primary {
    background-color: var(--td-primary) !important;
    border-color: var(--td-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--td-primary-hover) !important;
    border-color: var(--td-primary-hover) !important;
}

.btn-outline-primary {
    color: var(--td-primary) !important;
    border-color: var(--td-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--td-primary) !important;
    color: #fff !important;
}

.text-primary {
    color: var(--td-primary) !important;
}

.bg-primary {
    background-color: var(--td-primary) !important;
}

.bg-soft-primary {
    background-color: var(--td-primary-soft) !important;
    color: var(--td-primary) !important;
}

/* KPI Cards */
.td-kpi-card {
    border: 1px solid var(--td-border);
    border-radius: 12px;
    background: var(--td-surface);
    padding: 18px;
    box-shadow: var(--td-shadow);
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.td-kpi-card .d-flex {
    gap: 8px;
}

.td-kpi-card .d-flex > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.td-kpi-card .fs-3,
.td-kpi-card .fs-22 {
    font-size: clamp(1rem, 1.35vw, 1.36rem) !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.td-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.td-kpi-bar {
    height: 5px;
    border-radius: 999px;
    background: var(--td-bg);
    overflow: hidden;
    margin-top: 12px;
}

.td-kpi-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

/* Redesigned TuanDuong FAQ Section (Kills Bootstrap Baby-Blue Active Bar) */
.td-faq-card {
    background: var(--td-surface);
    border: 1px solid var(--td-border);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--td-shadow);
    margin-bottom: 24px;
}

.td-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--td-primary-soft);
    color: var(--td-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.td-faq-accordion .accordion-item {
    background: var(--td-surface);
    border: 1px solid var(--td-border) !important;
    border-radius: 10px !important;
    margin-bottom: 10px;
    overflow: hidden;
}

.td-faq-accordion .accordion-item:last-child {
    margin-bottom: 0;
}

.td-faq-accordion .accordion-button {
    background: var(--td-surface) !important;
    color: var(--td-heading) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 15px 18px;
    box-shadow: none !important;
}

.td-faq-accordion .accordion-button:not(.collapsed) {
    background: #f4f5fd !important;
    color: #4454c3 !important;
    border-bottom: 1px solid #e6eaf5;
}

html[data-bs-theme="dark"] .td-faq-accordion .accordion-button:not(.collapsed) {
    background: rgba(68, 84, 195, 0.2) !important;
    color: #c7d2fe !important;
    border-bottom-color: var(--td-border);
}

.td-faq-accordion .accordion-body {
    padding: 15px 18px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--td-text);
}

/* Redesigned TuanDuong Ecosystem Cards */
.td-eco-card {
    background: var(--td-surface);
    border: 1px solid var(--td-border);
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.td-eco-card:hover {
    transform: translateY(-2px);
    border-color: #c7cef2;
    box-shadow: 0 8px 24px rgba(68, 84, 195, 0.08);
}

.td-eco-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 12px;
    flex-shrink: 0;
}

/* Redesigned TuanDuong 3-Column Footer */
.td-footer {
    position: relative;
    background: var(--td-surface);
    border-top: 1px solid var(--td-border);
    padding: 36px 0 24px;
    color: var(--td-muted);
    font-size: 0.85rem;
}

.td-footer .page-container {
    max-width: 1360px !important;
    margin: 0 auto !important;
    padding: 0 18px !important;
}

.td-footer-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--td-heading);
    margin-bottom: 12px;
}

.td-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 7px;
}

.td-footer-links a {
    color: var(--td-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.td-footer-links a:hover {
    color: var(--td-primary);
}

.td-footer-bottom {
    margin-top: 24px;
    padding-top: 16px;
    padding-right: 78px;
    border-top: 1px solid var(--td-border);
}

/* TuanDuong AI Chat Widget */
.td-chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4454c3 0%, #6366f1 100%);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 20px rgba(68, 84, 195, 0.35);
    cursor: pointer;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.td-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(68, 84, 195, 0.42);
}

.td-chat-box {
    display: none;
    position: fixed;
    bottom: 86px;
    right: 20px;
    width: 350px;
    height: 440px;
    background: var(--td-surface);
    color: var(--td-text);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(18, 38, 63, 0.18);
    z-index: 1040;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--td-border);
    transform: scale(0.92);
    transform-origin: bottom right;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.td-chat-box.show {
    transform: scale(1);
    opacity: 1;
}

/* Suppress legacy animations */
.animate__animated,
.animate__bounceInUp,
.animate__fadeInDown,
.animate__fadeInLeft,
.animate__fadeInRight,
.animate__zoomIn,
.animate__tada {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Dark/Light Legacy Bootstrap Harmonization */
html[data-bs-theme="dark"] .bg-white,
html[data-bs-theme="dark"] .bg-light {
    background-color: var(--td-surface) !important;
    color: var(--td-text) !important;
    border-color: var(--td-border) !important;
}

html[data-bs-theme="dark"] .text-dark {
    color: var(--td-heading) !important;
}

html[data-bs-theme="dark"] .table-light,
html[data-bs-theme="dark"] .table-light th {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--td-heading) !important;
    border-color: var(--td-border) !important;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: #161928 !important;
    border-color: var(--td-border) !important;
    color: var(--td-text) !important;
}

/* Tables, DataTables, Modals */
.table {
    --bs-table-bg: transparent;
    color: var(--td-text);
    border-color: var(--td-border);
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--td-muted);
    background-color: var(--td-bg);
    border-bottom: 1px solid var(--td-border);
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--td-border);
    border-radius: 8px;
    padding: 4px 10px;
    background: var(--td-surface);
    color: var(--td-text);
}

.modal-content {
    background: var(--td-surface);
    color: var(--td-text);
    border: 1px solid var(--td-border) !important;
    border-radius: 14px !important;
}

/* TuanDuong Light Centered Auth & Status Card */
.td-auth-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f6fb 0%, #eef1fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.td-auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid #e6eaf5;
    border-top: 4px solid #4454c3;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(68, 84, 195, 0.08);
    padding: 32px 28px;
}

.td-auth-card.td-auth-wide {
    max-width: 520px;
}

.td-auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 18px;
}

.td-auth-brand img {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.td-auth-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 6px;
}

.td-auth-sub {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 22px;
}

.td-auth-card .form-label {
    font-weight: 600;
    font-size: 0.84rem;
    color: #334155;
}

.td-auth-card .form-control {
    border: 1px solid #dce2f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

.td-auth-card .form-control:focus {
    border-color: #4454c3;
    box-shadow: 0 0 0 3px rgba(68, 84, 195, 0.14);
}

.td-auth-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #edf0f7;
    font-size: 0.8rem;
    color: #64748b;
}

@media (max-width: 575.98px) {
    .page-content > .page-container,
    .page-content > .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .page-title-head {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .page-title-head .text-end {
        text-align: left !important;
    }
    .td-header-inner {
        padding: 0 10px !important;
        gap: 6px !important;
    }
    .td-header-inner > div {
        gap: 5px !important;
    }
    .td-brand {
        gap: 6px !important;
    }
    .td-brand img {
        height: 28px !important;
    }
    .td-brand-text {
        font-size: 0.88rem !important;
    }
    .td-icon-btn {
        width: 32px !important;
        height: 32px !important;
    }
    .td-wallet-pill {
        padding: 0 8px !important;
        height: 30px !important;
        font-size: 0.74rem !important;
        gap: 4px !important;
    }
    .td-kpi-card {
        padding: 12px !important;
    }
    .td-kpi-card .d-flex {
        gap: 6px !important;
    }
    .td-kpi-card .fs-3,
    .td-kpi-card .fs-22 {
        font-size: 0.9rem !important;
    }
    .td-kpi-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }
    .td-faq-card {
        padding: 18px 14px;
    }
    .td-footer-bottom {
        padding-right: 0;
        padding-bottom: 52px;
    }
    #chat-box {
        width: calc(100vw - 24px) !important;
        right: 12px !important;
        height: 390px !important;
    }
}

/* WCAG AA Contrast Polish */
:root { --td-muted: #475569; }
html[data-bs-theme="light"] .text-success, :root:not([data-bs-theme="dark"]) .text-success { color: #047857 !important; }
html[data-bs-theme="light"] .text-muted, :root:not([data-bs-theme="dark"]) .text-muted { color: #475569 !important; }
#notificationModal .notification-content a { text-decoration: underline !important; color: #1d4ed8 !important; }
#notificationModal .notification-content strong[style*="#2ed573"] { color: #047857 !important; }
#notificationModal .notification-content strong[style*="#1e90ff"] { color: #0369a1 !important; }
#notificationModal .notification-content strong[style*="#ffa502"] { color: #b45309 !important; }
#notificationModal .notification-content strong[style*="#ff4757"] { color: #b91c1c !important; }

/* Single-line Select Polish & Picker Icon Fix */
select.form-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding-top: 0.42rem !important;
  padding-bottom: 0.42rem !important;
  padding-right: 2.25rem !important;
  line-height: 1.45 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
select.form-select.form-select-sm {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding-top: 0.28rem !important;
  padding-bottom: 0.28rem !important;
}
select.form-select::picker-icon { display: none !important; }
