* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    font-weight: 400;
    background: linear-gradient(145deg, #f0f9ff 0%, #e6f0fa 100%);
    color: #0f172a;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .page-title h1, .stat-number, .card-head h3, .btn-primary-modern {
    font-weight: 600;
}

.field-input, .field-select, .nav-item, .btn-outline-modern {
    font-family: inherit;
    font-weight: 500;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #dbeafe;
    --primary-glow: rgba(37, 99, 235, 0.2);
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar-modern {
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(2px);
    border-right: 1px solid rgba(37, 99, 235, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 20;
    transition: all 0.2s;
}

.logo-area {
    padding: 22px 20px 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logo-area-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo-area-lang {
    width: 100%;
}

.logo-area-lang .hp-lang-switch {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px !important;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -8px rgba(37, 99, 235, 0.4);
}

.logo-icon i {
    font-size: 22px;
    color: white;
}

.logo-text h2 {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e40af, #0891b2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-text span {
    font-size: 0.65rem;
    color: var(--gray-500);
}

.nav-modern {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.92rem;
}

.nav-item i {
    width: 24px;
    font-size: 1.2rem;
    color: var(--gray-500);
    transition: 0.2s;
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-item.active i {
    color: var(--primary);
}

.nav-item:hover:not(.active) {
    background: var(--gray-100);
}

.nav-item span:first-of-type {
    flex: 1;
}

.nav-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-item.active .nav-badge {
    background: var(--primary);
    color: #fff;
}

.user-card-side {
    margin: 20px 16px 24px;
    background: var(--gray-100);
    border-radius: 20px;
    padding: 14px;
    border: 1px solid var(--gray-200);
}

.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-badge {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 6px 12px -6px var(--primary-glow);
}

.user-info p {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 0.88rem;
}

.user-info small {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 600;
}

.logout-link:hover {
    color: var(--primary);
}

.main-modern {
    flex: 1;
    margin-left: 0;
    padding: var(--portal-nav-h, 58px) 36px 28px;
    min-width: 0;
}

.portal-shell {
    flex: 1;
    min-width: 0;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.portal-navbar {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    z-index: 100;
    margin: 0;
    padding: 0 36px;
    min-height: var(--portal-nav-h, 58px);
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.portal-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: var(--portal-nav-h, 58px);
}

.portal-navbar-title {
    flex: 1;
    min-width: 0;
}

.portal-navbar-title h1 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f2b40;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-navbar-title p {
    color: var(--gray-500);
    font-size: 0.72rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-navbar .action-buttons {
    width: auto;
    justify-content: flex-end;
    margin-left: auto;
    flex-shrink: 0;
}

.topbar-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    max-width: 220px;
}

.topbar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.topbar-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.topbar-user-meta strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user-meta small {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: capitalize;
}

.user-card-side-compact {
    padding: 12px 16px 20px;
}

.user-card-side-compact .logout-link {
    justify-content: center;
}

html[data-theme="dark"] .topbar-user-chip {
    background: #334155;
    border-color: #475569;
}

html[data-theme="dark"] .topbar-user-meta strong {
    color: #ffffff;
}

html[data-theme="dark"] .topbar-user-meta small {
    color: #93c5fd;
}

.topbar-modern {
    display: none;
}

.nex-topbar-source {
    display: none !important;
}

.page-title {
    flex: 1;
    min-width: 200px;
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.page-title h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f2b40;
    letter-spacing: -0.02em;
}

.page-title p {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 4px;
}

.live-badge {
    background: white;
    padding: 6px 18px;
    border-radius: 60px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #059669;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 1.2s infinite;
}

.live-badge.offline .live-dot {
    background: #ef4444;
    animation: none;
}

.live-badge.offline {
    color: #b91c1c;
}

@keyframes pulse {
    0% {
        opacity: 0.4;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    align-items: stretch;
}

.nex-dash-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.nex-dash-row {
    display: grid;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

.nex-dash-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nex-dash-row--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    min-height: 100%;
}

.stat-card-link .card-stat {
    flex: 1;
    width: 100%;
    height: 100%;
}

.nx-period-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    align-items: center;
}

.nx-period-bar-label {
    font-weight: 700;
    color: var(--gray-600, #475569);
    margin-right: 4px;
    font-size: 0.85rem;
}

.nx-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--gray-200, #e2e8f0);
    background: var(--card, #fff);
    color: var(--gray-600, #475569);
    text-decoration: none;
    transition: 0.15s;
}

.nx-chip:hover {
    border-color: var(--primary, #2563eb);
    color: var(--primary, #2563eb);
}

.nx-chip.active {
    background: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
    color: #fff;
}

.card-stat {
    background: white;
    border-radius: 28px;
    padding: 22px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-soft);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-top: 6px;
}

.stat-sub {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 6px;
}

.two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 32px;
}

.modern-card {
    background: white;
    border-radius: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.2s;
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
}

.card-head {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-head h3 {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-link {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
}

.tx-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-50);
}

.tx-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ecfdf5;
    color: #059669;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-pending {
    background: #fffbeb;
    color: #d97706;
}

.status-other {
    background: #f1f5f9;
    color: #64748b;
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    padding: 20px;
}

.btn-primary-modern {
    background: linear-gradient(95deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    font-family: inherit;
    font-size: 0.88rem;
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-modern {
    background: transparent;
    border: 1.5px solid var(--gray-200);
    padding: 11px 26px;
    border-radius: 40px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    font-size: 0.88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline-modern:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.deposit-form-card {
    max-width: 720px;
    background: white;
    border-radius: 16px;
    padding: 18px 20px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 24px 0;
}

.method-item {
    border: 1.5px solid var(--gray-200);
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    cursor: default;
    transition: all 0.2s;
}

.method-item.active {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.method-item i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 6px;
}

.fee-preview {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 10px 0;
}

.field-label {
    font-weight: 600;
    font-size: 0.88rem;
    display: block;
    margin-bottom: 8px;
}

.field-input,
.field-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    margin: 4px 0 12px;
    font-size: 0.95rem;
    font-family: inherit;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.qr-box {
    text-align: center;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 24px;
    margin: 16px 0;
}

.qr-box img {
    max-width: 260px;
    border-radius: 16px;
}

/* ── API docs / code panels ── */
.nex-api-intro {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--gray-700);
}

.nex-api-endpoint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 14px 0 8px;
}

.nex-api-method {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border-radius: 8px;
    text-transform: uppercase;
}

.nex-api-method--get {
    background: #dbeafe;
    color: #1e40af;
}

.nex-api-method--post {
    background: #dcfce7;
    color: #166534;
}

.nex-api-path {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-900);
    word-break: break-all;
}

.nex-apidoc-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nex-apidoc-ep-card {
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 0 0 18px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.nex-apidoc-ep-head {
    padding: 14px 18px 10px;
    background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
    border-bottom: 1px solid var(--gray-100);
}

.nex-apidoc-ep-head .nex-api-endpoint {
    margin: 0;
}

.nex-apidoc-ep-card .nex-apidoc-desc,
.nex-apidoc-ep-card .nex-apidoc-meta,
.nex-apidoc-ep-card .nex-apidoc-usage,
.nex-apidoc-ep-card .nex-apidoc-section-title,
.nex-apidoc-ep-card .nex-apidoc-table-wrap,
.nex-apidoc-ep-card .nex-apidoc-no-params,
.nex-apidoc-ep-card .nex-apidoc-details,
.nex-apidoc-ep-card .nex-apidoc-curl {
    margin-left: 18px;
    margin-right: 18px;
}

.nex-apidoc-ep-card .nex-apidoc-desc {
    margin-top: 12px;
}

.nex-apidoc-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 16px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nex-apidoc-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.nex-apidoc-table-wrap .nx-ptable {
    margin: 0;
    min-width: 480px;
}

.nex-apidoc-table-wrap .nx-ptable th {
    background: var(--gray-50);
    white-space: nowrap;
}

.nex-apidoc-table-wrap .nx-ptable tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.85);
}

.nex-apidoc-table-wrap code {
    font-size: 0.76rem;
    word-break: break-word;
}

.nex-apidoc-details {
    margin-top: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.nex-apidoc-details summary {
    cursor: pointer;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--gray-50);
    list-style: none;
}

.nex-apidoc-details summary::-webkit-details-marker {
    display: none;
}

.nex-apidoc-details-body {
    padding: 0 0 12px;
}

.nex-apidoc-details-body .nex-apidoc-table-wrap {
    margin: 12px 14px 0;
}

.nex-apidoc-curl {
    margin-top: 16px;
    padding-top: 4px;
    border-top: 1px dashed var(--gray-200);
}

.nex-apidoc-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
}

.nex-apidoc-jump-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nex-apidoc-jump a {
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-800);
    text-decoration: none;
    font-weight: 600;
}

.nex-apidoc-jump a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Full API doc page (apidoc_render) */
.nex-apidoc-full .nx-apidoc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .nex-apidoc-full .nx-apidoc-grid {
        grid-template-columns: 1fr;
    }
}

.nex-apidoc-full .nx-apidoc-card {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    font-size: 0.8rem;
    line-height: 1.55;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.nex-apidoc-full .nx-apidoc-card h3 {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 800;
}

.nex-apidoc-full .nx-ep {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.nex-apidoc-full .nx-ep-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(180deg, var(--gray-50), #fff);
    cursor: pointer;
    user-select: none;
    font-size: 0.84rem;
}

.nex-apidoc-full .nx-ep-head:hover {
    background: var(--gray-50);
}

.nex-apidoc-full .nx-ep-body {
    display: none;
    padding: 14px 16px 18px;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
}

.nex-apidoc-full .nx-ep-body.open {
    display: block;
}

.nex-apidoc-full .nx-ep .m-get {
    background: #dbeafe;
    color: #1e40af;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.nex-apidoc-full .nx-ep .m-post {
    background: #dcfce7;
    color: #15803d;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

.nex-apidoc-full .nx-ptable {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 14px;
}

.nex-apidoc-full .nx-ptable th,
.nex-apidoc-full .nx-ptable td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.nex-apidoc-full .nx-ptable th {
    font-size: 0.68rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.nex-apidoc-full .nx-code {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px 16px;
    border-radius: 10px;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.55;
    overflow: auto;
    max-height: 280px;
    margin: 8px 0 0;
}

.nex-apidoc-full .nx-ep-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.75rem;
}

.nex-apidoc-full .nx-ep-meta span {
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: 8px;
    color: #334155;
}

.nex-apidoc-full .nx-mig-ok {
    color: #15803d;
}

.nex-apidoc-full .nx-mig-fail {
    color: #b91c1c;
}

.nex-apidoc-full .nx-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 18px;
}

.nex-apidoc-full .nx-toc a {
    font-size: 0.72rem;
    padding: 5px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    background: #fafafa;
}

.nex-apidoc-full .nx-toc a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.nex-apidoc-desc {
    margin: 0 0 10px;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--gray-700);
}

.nex-apidoc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.nex-apidoc-tag {
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
}

.nex-apidoc-usage {
    font-size: 0.8rem;
    line-height: 1.6;
    padding: 10px 12px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    margin-bottom: 8px;
}

.nex-apidoc-ep-card .nx-ptable {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0 12px;
    font-size: 0.78rem;
}

.nex-apidoc-ep-card .nx-ptable th,
.nex-apidoc-ep-card .nx-ptable td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.nex-apidoc-ep-card .nx-ptable th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.nex-req {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
}

.nx-req.req {
    background: #fee2e2;
    color: #b91c1c;
}

.nx-req.opt {
    background: #ecfdf5;
    color: #047857;
}

/* ── API settings page (credentials only) ── */
.nex-api-settings-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff 0%, #fdf2f8 55%, #fff 100%);
    border: 1px solid var(--gray-200);
}

.nex-api-settings-hero h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gray-900);
}

.nex-api-settings-hero p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--gray-600);
    max-width: 520px;
}

.nex-api-cred-body {
    padding: 20px;
}

/* API settings — unified grid layout */
.nex-api-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.nex-api-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.nex-api-card-body {
    padding: 20px 22px 22px;
    flex: 1;
}

.nex-api-card--full {
    grid-column: 1 / -1;
}

.nex-api-mono {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

.nex-api-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.nex-api-actions form {
    display: inline-flex;
    margin: 0;
}

.nex-api-ip-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 14px;
    max-width: 100%;
}

.nex-api-ip-rows--wide {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.nex-api-ip-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 1200px) {
    .nex-dash-row--5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .nex-dash-row--3,
    .nex-dash-row--5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

    .nex-api-card--full {
        grid-column: auto;
    }

    .nex-api-ip-rows--wide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .nex-api-ip-row {
        grid-template-columns: 1fr;
    }
}

.nex-api-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--gray-200);
}

@media (max-width: 640px) {
    .nex-api-kv-grid {
        grid-template-columns: 1fr;
    }
}

.nex-api-kv-val {
    display: block;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--gray-50);
    font-size: 0.78rem;
    word-break: break-all;
}

.nex-api-webhook-url {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    font-size: 0.82rem;
    word-break: break-all;
    font-family: ui-monospace, monospace;
}

.nex-api-btn-warn {
    border-color: #b45309 !important;
    color: #b45309 !important;
}

.nex-api-lang-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px;
    background: var(--gray-100);
    border-radius: 14px;
    border: 1px solid var(--gray-200);
}

.nex-api-lang-tabs .api-lang-tab {
    border-radius: 10px !important;
    min-width: 88px;
}

.nex-api-lang-tabs .api-lang-tab.nex-nav-active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.nex-code-panel {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    margin: 8px 0 18px;
    box-shadow: var(--shadow-sm);
}

.nex-code-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(90deg, #0f172a, #1e293b);
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
}

.nex-code-panel-head span {
    color: #e2e8f0;
}

.nex-code-panel .code-block {
    margin: 0;
    border: none;
    border-radius: 0;
    max-height: 340px;
    font-size: 0.74rem;
    line-height: 1.55;
    tab-size: 2;
}

.nex-code-panel-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nex-code-panel-lang {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b !important;
}

.nex-code-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nex-code-copy-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: #94a3b8;
    color: #fff;
}

.nex-api-samples-wrap {
    padding: 18px 20px 22px;
}

.nex-api-sample-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nex-api-sample-card {
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    padding: 16px 18px 18px;
    background: var(--card-bg, #fff);
    box-shadow: var(--shadow-sm);
}

.nex-api-sample-card-title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}

.nex-api-sample-card .nex-api-endpoint {
    margin-top: 8px;
    margin-bottom: 0;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px solid var(--gray-100);
}

.nex-api-sample-hint {
    margin: 10px 0 0 !important;
    line-height: 1.55;
}

.nex-api-sample-card .nex-code-panel {
    margin-top: 14px;
    margin-bottom: 0;
}

.nex-code-panel--sample .nex-code-panel-head {
    justify-content: space-between;
}

.nex-code-panel-lang-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #e2e8f0 !important;
    letter-spacing: 0.04em;
}

.nex-code-panel--sample .code-block {
    max-height: 320px;
}

/* ── Withdraw page: line queue ── */
.nex-withdraw-layout.two-col-grid {
    align-items: start;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
}

.nex-withdraw-layout--single-main {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 1.05fr);
}

.nex-withdraw-main {
    min-width: 0;
}

.nex-wd-queue-col {
    min-width: 0;
}

.nex-wd-queue-wrap {
    padding: 8px 16px 18px;
}

.nex-wd-queue-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 72vh;
    overflow-y: auto;
}

.nex-wd-queue-item {
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 14px 16px;
    background: var(--card-bg, #fff);
    box-shadow: var(--shadow-sm);
}

.nex-wd-queue-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.nex-wd-queue-ref {
    display: block;
    font-size: 0.72rem;
    word-break: break-all;
    margin-bottom: 4px;
}

.nex-wd-queue-amt {
    margin: 0 0 10px;
    font-size: 0.88rem;
}

.nex-wd-pay-card {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    margin-bottom: 10px;
}

.nex-wd-pay-bank {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.nex-wd-pay-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.nex-wd-pay-num {
    font-family: ui-monospace, monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1d4ed8;
    letter-spacing: 0.05em;
}

.nex-wd-queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

html[data-theme="dark"] .nex-wd-queue-item {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .nex-wd-pay-card {
    background: #1e293b;
    border-color: #475569;
}

.nex-api-secret-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.nex-api-secret-row .field-input {
    flex: 1;
    min-width: 200px;
}

.code-block {
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    background: var(--gray-50);
    padding: 12px 14px;
    border-radius: 12px;
    word-break: break-all;
    margin: 8px 0;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 30;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.text-amber {
    color: #d97706;
}

@media (max-width: 880px) {
    .sidebar-modern {
        width: 80px;
        padding: 0 6px;
    }

    .sidebar-modern .logo-text,
    .sidebar-modern .nav-item span,
    .sidebar-modern .user-info,
    .sidebar-modern .logout-link span {
        display: none;
    }

    .main-modern {
        margin-left: 0;
        padding: var(--portal-nav-h, 58px) 20px 20px;
    }

    .portal-shell {
        margin-left: 80px;
    }

    .portal-navbar {
        left: 80px;
    }

    .two-col-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .nex-dash-row--3,
    .nex-dash-row--5 {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 600px) {
    .sidebar-modern {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar-modern.open {
        transform: translateX(0);
    }

    .sidebar-modern.open .logo-text,
    .sidebar-modern.open .nav-item span,
    .sidebar-modern.open .user-info,
    .sidebar-modern.open .logout-link span {
        display: inline;
    }

    .main-modern {
        margin-left: 0;
        padding-top: var(--portal-nav-h, 58px);
    }

    .portal-shell {
        margin-left: 0;
    }

    .portal-navbar {
        left: 0;
        padding: 0 16px;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Login */
body.bridge-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.bridge-login-wrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.bridge-login-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.bridge-login-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.bridge-login-card .sub {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.bridge-alert {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    margin-bottom: 16px;
}

.bridge-alert.danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.bridge-alert.warn {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.bridge-alert.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
}

.nex-nav-active,
.btn-outline-modern.nex-nav-active {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: var(--primary-soft);
}

.nex-nav-loader {
    display: none;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    background-size: 200% 100%;
    animation: nexLoader 1s linear infinite;
    border-radius: 2px;
    margin-bottom: 8px;
}

.nex-nav-loader.is-active {
    display: block;
}

.nex-page-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.95) 0, rgba(255, 255, 255, 0.72) 34%, rgba(226, 240, 255, 0.72) 100%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(6, 182, 212, 0.12));
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.nex-page-loader.is-active {
    opacity: 1;
    pointer-events: auto;
}

.nex-page-loader-card {
    width: min(320px, 100%);
    padding: 30px 26px 26px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    text-align: center;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.22s ease;
}

.nex-page-loader.is-active .nex-page-loader-card {
    transform: translateY(0) scale(1);
}

.nex-orbit-loader {
    position: relative;
    width: 92px;
    height: 92px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
}

.nex-orbit-loader::before,
.nex-orbit-loader::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.nex-orbit-loader::before {
    border: 5px solid rgba(37, 99, 235, 0.12);
    border-top-color: var(--primary);
    border-right-color: var(--accent);
    animation: nexSpin 0.92s linear infinite;
    box-shadow: 0 0 26px rgba(37, 99, 235, 0.16);
}

.nex-orbit-loader::after {
    inset: 13px;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
}

.nex-orbit-loader i {
    position: relative;
    z-index: 2;
    font-size: 1.35rem;
    filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.25));
}

.nex-orbit-loader span {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.55);
    animation: nexDotPulse 1.2s ease-in-out infinite;
}

.nex-orbit-loader span:nth-child(1) { top: 2px; left: 50%; transform: translateX(-50%); }
.nex-orbit-loader span:nth-child(2) { right: 7px; bottom: 18px; animation-delay: 0.16s; }
.nex-orbit-loader span:nth-child(3) { left: 7px; bottom: 18px; animation-delay: 0.32s; }

.nex-loader-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.nex-loader-sub {
    margin-top: 5px;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.55;
}

@keyframes nexSpin {
    to { transform: rotate(360deg); }
}

@keyframes nexDotPulse {
    0%, 100% { opacity: 0.35; transform: scale(0.82); }
    50% { opacity: 1; transform: scale(1.18); }
}

@keyframes nexLoader {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#dynamicPanel.nex-panel-pending {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.bridge-panel-hidden {
    display: none !important;
}

.nex-bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 2px;
}

.nex-bank-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-size: .72rem;
    text-align: left;
    font-family: inherit;
    color: var(--gray-700);
}

.nex-bank-opt.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    font-weight: 700;
}

.nex-perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.nex-perm-item {
    font-size: .78rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
}

.nex-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.nex-modal:not(.bridge-panel-hidden) {
    display: flex;
}

.nex-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.nex-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

.nex-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.nex-modal-head h3 {
    margin: 0;
    font-size: 1rem;
}

.nex-modal-x {
    border: none;
    background: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--gray-500);
}

.nex-modal-body {
    padding: 20px;
}

/* ── โหมดมืด (สลับจากปุ่ม topbar) ── */
html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: linear-gradient(145deg, #0b1220 0%, #1a2332 100%);
    color: #f8fafc;
}

html[data-theme="dark"] .sidebar-modern,
html[data-theme="dark"] body.nex-theme-easyslip .sidebar-modern,
html[data-theme="dark"] body.nex-theme-valentine .sidebar-modern,
html[data-theme="dark"] body.nex-theme-paywave .sidebar-modern {
    background: linear-gradient(180deg, #4b5563 0%, #374151 100%) !important;
    border-right-color: #6b7280 !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .logo-area {
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] .logo-text h2 {
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .logo-text span {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .logout-link {
    color: #f9fafb !important;
}

html[data-theme="dark"] .logout-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .nav-item {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .nav-item i {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .nav-item.active,
html[data-theme="dark"] body.nex-theme-valentine .nav-item.active,
html[data-theme="dark"] body.nex-theme-easyslip .nav-item.active,
html[data-theme="dark"] body.nex-theme-paywave .nav-item.active {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 var(--primary);
}

html[data-theme="dark"] .nav-item.active i,
html[data-theme="dark"] body.nex-theme-valentine .nav-item.active i {
    color: #ffffff !important;
}

html[data-theme="dark"] .nav-item:hover:not(.active),
html[data-theme="dark"] body.nex-theme-valentine .nav-item:hover:not(.active),
html[data-theme="dark"] body.nex-theme-easyslip .nav-item:hover:not(.active),
html[data-theme="dark"] body.nex-theme-paywave .nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .nav-item:hover:not(.active) i {
    color: #ffffff !important;
}

html[data-theme="dark"] .nav-item.active:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .user-card-side {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .user-info p {
    color: #f1f5f9;
}

html[data-theme="dark"] .main-modern {
    background: transparent;
}

html[data-theme="dark"] .portal-navbar-title h1 {
    color: #ffffff;
}

html[data-theme="dark"] .portal-navbar-title p {
    color: #e2e8f0;
}

html[data-theme="dark"] .portal-navbar {
    background: rgba(15, 23, 42, 0.94);
    border-color: #334155;
}

html[data-theme="dark"] .topbar-modern,
html[data-theme="dark"] .modern-card,
html[data-theme="dark"] .card-stat,
html[data-theme="dark"] .bridge-login-card {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

html[data-theme="dark"] .page-title h1,
html[data-theme="dark"] .card-header h3,
html[data-theme="dark"] .stat-amount,
html[data-theme="dark"] .field-label,
html[data-theme="dark"] .logo-text span {
    color: #ffffff;
}

html[data-theme="dark"] .page-title p,
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .stat-label {
    color: #e2e8f0;
}

html[data-theme="dark"] .live-badge,
html[data-theme="dark"] .user-info small {
    color: #e2e8f0;
}

html[data-theme="dark"] .field-input,
html[data-theme="dark"] .field-select,
html[data-theme="dark"] .code-block {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

html[data-theme="dark"] .btn-outline-modern {
    background: #334155;
    border-color: #64748b;
    color: #ffffff;
}

html[data-theme="dark"] .btn-outline-modern:hover {
    background: #475569;
    color: #ffffff;
}

html[data-theme="dark"] .btn-outline-modern.nex-nav-active {
    border-color: var(--primary);
    color: #ffffff;
}

html[data-theme="dark"] .tx-table th {
    background: #334155;
    color: #ffffff;
}

html[data-theme="dark"] .tx-table td {
    border-color: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .tx-table td code,
html[data-theme="dark"] .mini-link {
    color: #93c5fd;
}

html[data-theme="dark"] .tx-table tbody tr:nth-child(even) {
    background: #0f172a;
}

html[data-theme="dark"] .bridge-alert {
    background: #422006 !important;
    border-color: #b45309 !important;
    color: #fef3c7 !important;
}

html[data-theme="dark"] .bridge-alert.warn {
    color: #fde68a !important;
}

html[data-theme="dark"] body.nex-theme-easyslip,
html[data-theme="dark"] body.nex-theme-valentine,
html[data-theme="dark"] body.nex-theme-paywave,
html[data-theme="dark"] body.hp-theme-easyslip,
html[data-theme="dark"] body.hp-theme-valentine,
html[data-theme="dark"] body.hp-theme-paywave {
    background: linear-gradient(165deg, #070b12 0%, #0f172a 45%, #0a1018 100%) !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .card-stat,
html[data-theme="dark"] .deposit-form-card {
    background: #1a2332;
    border-color: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .stat-number {
    color: #ffffff !important;
}

html[data-theme="dark"] .stat-sub,
html[data-theme="dark"] .stat-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .card-head {
    border-bottom-color: #334155;
    background: rgba(15, 23, 42, 0.55);
}

html[data-theme="dark"] .card-head h3 {
    color: #ffffff;
}

html[data-theme="dark"] .card-head h3 i {
    color: var(--primary-soft);
    filter: brightness(1.2);
}

html[data-theme="dark"] .deposit-form-card h2,
html[data-theme="dark"] .modern-card h2 {
    color: #ffffff !important;
}

html[data-theme="dark"] .field-input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .field-input:focus,
html[data-theme="dark"] .field-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
}

html[data-theme="dark"] .nex-bank-opt {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

html[data-theme="dark"] .nex-bank-opt.selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 22%, #1e293b);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent);
}

html[data-theme="dark"] .qr-box {
    background: #0f172a;
    border: 1px solid #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .fee-preview {
    color: #e2e8f0;
}

html[data-theme="dark"] .nex-modal-panel {
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
}

html[data-theme="dark"] .nex-modal-head {
    border-bottom-color: #334155;
}

html[data-theme="dark"] .nex-modal-head h3 {
    color: #fff;
}

html[data-theme="dark"] .live-badge {
    background: #1e293b;
    border-color: #475569;
    color: #86efac;
}

html[data-theme="dark"] a.mini-link,
html[data-theme="dark"] .nex-api-intro {
    color: #cbd5e1;
}

html[data-theme="dark"] .nex-api-path {
    color: #e2e8f0;
}

html[data-theme="dark"] .nex-api-method--get {
    background: #1e3a8a;
    color: #bfdbfe;
}

html[data-theme="dark"] .nex-api-method--post {
    background: #14532d;
    color: #bbf7d0;
}

html[data-theme="dark"] .nex-api-sample-card {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .nex-api-sample-card-title {
    color: #f1f5f9;
}

html[data-theme="dark"] .nex-api-sample-card .nex-api-endpoint {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .nex-api-lang-tabs {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .code-block,
html[data-theme="dark"] .nex-code-panel .code-block {
    background: #0a0f18;
    color: #e2e8f0;
    border-color: #334155;
}

html[data-theme="dark"] .status-badge {
    filter: none;
}

html[data-theme="dark"] .btn-primary-modern {
    box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 45%, transparent);
}

html[data-theme="dark"] .topbar-user-chip {
    background: #1e293b;
    border-color: #475569;
}
