/* NY2 dark color scheme. Loaded with the main theme stylesheet on every page. */
:root[data-color-theme="dark"] {
    color-scheme: dark;
    --ny-bg-page: #0b1220;
    --ny-bg-card: #111b2e;
    --ny-bg-soft: #172338;
    --ny-bg-table: #172338;
    --ny-bg-primary-soft: #172b4d;
    --ny-primary: #60a5fa;
    --ny-primary-dark: #3b82f6;
    --ny-success: #4ade80;
    --ny-warning: #fbbf24;
    --ny-danger: #f87171;
    --ny-text-1: #e5edf8;
    --ny-text-2: #bdc9da;
    --ny-text-3: #91a1b8;
    --ny-border: #27364d;
    --ny-border-deep: #33445c;
    --ny-scrollbar-track: rgba(30, 41, 59, .72);
    --ny-scrollbar-thumb: rgba(71, 85, 105, .82);
    --ny-scrollbar-thumb-hover: rgba(100, 116, 139, .92);
    --ny-shadow: 0 10px 30px rgba(0, 0, 0, .24);
    --ny-shadow-soft: 0 1px 3px rgba(0, 0, 0, .2);
}

html[data-color-theme="dark"] body {
    color: #e5edf8;
    background-color: #0b1220;
}

html[data-color-theme="dark"] .ny-topbar,
html[data-color-theme="dark"] #page-topbar.ny-topbar {
    color: var(--ny-text-1);
    background: rgba(15, 23, 42, .98) !important;
    border-bottom-color: var(--ny-border-deep) !important;
}

html[data-color-theme="dark"] .ny-layout-enterprise {
    background-color: var(--ny-bg-page);
}

html[data-color-theme="dark"] .ny-sidebar {
    color: var(--ny-text-1);
    background: #111b2e;
    border-color: var(--ny-border-deep);
}

html[data-color-theme="dark"] .ny-menu-link:hover,
html[data-color-theme="dark"] .ny-menu-link.active {
    background-color: var(--ny-bg-primary-soft);
}

html[data-color-theme="dark"] .ny-menu-link.active {
    color: #bfdbfe;
}

html[data-color-theme="dark"] .ny-topbar-brand-text,
html[data-color-theme="dark"] .ny-topbar-link,
html[data-color-theme="dark"] .ny-topbar-icon-link,
html[data-color-theme="dark"] .ny-topbar-dropdown-trigger,
html[data-color-theme="dark"] .ny-topbar-user,
html[data-color-theme="dark"] .ny-topbar-icon a {
    color: var(--ny-text-2);
}

html[data-color-theme="dark"] .ny-topbar-link:hover,
html[data-color-theme="dark"] .ny-topbar-icon-link:hover {
    color: var(--ny-primary);
    background: var(--ny-bg-primary-soft);
}

html[data-color-theme="dark"] .ny-topbar-dropdown-trigger:hover,
html[data-color-theme="dark"] .ny-topbar-user:hover,
html[data-color-theme="dark"] .ny-menu-toggle:hover {
    color: var(--ny-primary);
    background: var(--ny-bg-primary-soft);
}

html[data-color-theme="dark"] .ny-topbar-search-input,
html[data-color-theme="dark"] .ny-topbar-search-input:focus,
html[data-color-theme="dark"] .ny-topbar-search-dropdown,
html[data-color-theme="dark"] .ny-topbar-dropdown-menu,
html[data-color-theme="dark"] .ny-menu-sub {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-card);
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] .ny-search-tags a,
html[data-color-theme="dark"] .ny-search-link-item,
html[data-color-theme="dark"] .ny-search-quick-item,
html[data-color-theme="dark"] .ny-search-product-item {
    color: var(--ny-text-2);
    background: var(--ny-bg-soft);
}

.ny-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    color: #55657a;
    background: transparent;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.ny-theme-toggle:hover {
    color: var(--ny-primary, #2563eb);
    background: var(--ny-bg-primary-soft, #eef5ff);
    border-color: var(--ny-border-deep, #d8e1ec);
}

html[data-color-theme="dark"] .ny-theme-toggle {
    color: var(--ny-text-2);
    background: var(--ny-bg-soft);
    border-color: var(--ny-border-deep);
    outline-color: var(--ny-primary);
}

html[data-color-theme="dark"] .ny-theme-toggle:hover {
    color: #bfdbfe;
    background: var(--ny-bg-primary-soft);
}

html[data-color-theme="dark"] .ny-theme-toggle i {
    font-size: 16px;
}

html[data-color-theme="dark"] .ny-theme-toggle-label {
    display: inline;
}

/* Shared Bootstrap and legacy page surfaces. */
html[data-color-theme="dark"] :where(.card, .card-header, .card-footer, .modal-content, .modal-header, .modal-footer, .dropdown-menu, .popover, .list-group-item, .accordion-item, .accordion-button, .page-title-box, .breadcrumb, .table, .table th, .table td, .form-control, .custom-select, .input-group-text, .input-group-addon, select.form-control, textarea, .pagination .page-link) {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-card);
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] :where(.form-control, .custom-select, textarea, select.form-control) {
    color-scheme: dark;
}

html[data-color-theme="dark"] :where(.form-control, .custom-select, textarea, select.form-control)::placeholder {
    color: var(--ny-text-3);
}

html[data-color-theme="dark"] :where(.card, .modal-content, .dropdown-menu, .popover, .list-group-item, .accordion-item) {
    box-shadow: var(--ny-shadow-soft);
}

html[data-color-theme="dark"] :where(.table-striped tbody tr:nth-of-type(odd), .table-hover tbody tr:hover, .list-group-item-action:hover, .dropdown-item:hover, .dropdown-item:focus, .page-link:hover) {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-soft);
}

html[data-color-theme="dark"] :where(.text-dark, .text-body, .text-muted, label, .control-label, .card-title, .modal-title, .dropdown-item, .list-group-item, .page-title-box h4, .breadcrumb-item) {
    color: var(--ny-text-2) !important;
}

html[data-color-theme="dark"] :where(.alert-info, .alert-secondary, .bg-light, .bg-white, .jumbotron) {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-soft) !important;
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] :where(.ny-card, .ny-global-pageheader, .ny-dashboard-pagehead) {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-card);
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] .ny-dashboard > :where(.ny-card, .ny-dashboard-panel, .ny-dashboard-block, .ny-dashboard-section),
html[data-color-theme="dark"] .ny-dashboard [class*="ny-card"] {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-card);
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] .ny-dashboard [class*="ny-card"] :where(p, span, strong, small, label) {
    color: var(--ny-text-2);
}

html[data-color-theme="dark"] .ny-dashboard [class*="ny-card"] :where(i) {
    color: inherit;
}

html[data-color-theme="dark"] .ny-verify-pill {
    color: var(--ny-text-2);
    background: var(--ny-bg-soft);
}

html[data-color-theme="dark"] .ny-verify-pill.is-verified {
    color: var(--ny-success);
    background: rgba(74, 222, 128, .12);
    border-color: rgba(74, 222, 128, .25);
}

/* Auth screens use standalone stylesheets rather than the client-area layout. */
html[data-color-theme="dark"] body.login,
html[data-color-theme="dark"] .login-page-container {
    background-color: #0b1220 !important;
}

html[data-color-theme="dark"] .sz-login-card,
html[data-color-theme="dark"] .register-card,
html[data-color-theme="dark"] .pwreset-card,
html[data-color-theme="dark"] .layui-card {
    color: var(--ny-text-1);
    background: var(--ny-bg-card);
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] :where(.sz-tab, .sz-label, .sz-register-link, .sz-form-label, .form-title, .login-header, .login-body .layui-card-header) {
    color: var(--ny-text-1);
}

html[data-color-theme="dark"] :where(.sz-input, .sz-select, .login input.form-control, .register input.form-control, .pwreset input.form-control, .layui-input, .layui-select, .layui-textarea) {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-soft);
    border-color: var(--ny-border-deep);
}

html[data-color-theme="dark"] .sz-motto {
    color: var(--ny-text-2);
    background: var(--ny-bg-soft);
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] .sz-qr-text,
html[data-color-theme="dark"] .sz-tab.active,
html[data-color-theme="dark"] .sz-register-link a {
    color: #93c5fd;
}

html[data-color-theme="dark"] .ny-hero-qrcode-area,
html[data-color-theme="dark"] .ny-hero-qrcode-real-img {
    background: var(--ny-bg-soft) !important;
}

html[data-color-theme="dark"] .ny-hero-qrcode-text {
    color: #93c5fd !important;
}

html[data-color-theme="dark"] :where(.ny-dashboard, .ny-dashboard-enterprise, .ny-content-loading, .ny-content-loaded) {
    color: var(--ny-text-1);
}

html[data-color-theme="dark"] .ny-dashboard-home-card,
html[data-color-theme="dark"] .ny-dashboard-side,
html[data-color-theme="dark"] .ny-stat-card,
html[data-color-theme="dark"] .ny-hero-card,
html[data-color-theme="dark"] .ny-service-card,
html[data-color-theme="dark"] .ny-list-card,
html[data-color-theme="dark"] .ny-table-card,
html[data-color-theme="dark"] .ny-side-summary,
html[data-color-theme="dark"] .ny-balance-card,
html[data-color-theme="dark"] .ny-security-panel,
html[data-color-theme="dark"] .ny-product-panel,
html[data-color-theme="dark"] .ny-affiliate-banner,
html[data-color-theme="dark"] .ny-side-status,
html[data-color-theme="dark"] .ny-side-news {
    color: var(--ny-text-1);
    background-color: var(--ny-bg-card);
    border-color: var(--ny-border);
}

html[data-color-theme="dark"] :where(.ny-dashboard-home-card, .ny-service-card, .ny-list-card) a:hover {
    background-color: var(--ny-bg-primary-soft);
}

html[data-color-theme="dark"] :where(.ny-progress-track, .ny-list-empty, .ny-data-empty) {
    background-color: var(--ny-bg-soft);
}

html[data-color-theme="dark"] :where(.ny-dashboard-home-card [style*="background"], .ny-service-card [style*="background"], .ny-list-card [style*="background"]) {
    background-color: var(--ny-bg-soft) !important;
}

html[data-color-theme="dark"] :where(.ny-dashboard-home-card [style*="color"], .ny-service-card [style*="color"], .ny-list-card [style*="color"]) {
    color: var(--ny-text-2) !important;
}

html[data-color-theme="dark"] .ny-sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--ny-scrollbar-thumb);
}

html[data-color-theme="dark"] hr,
html[data-color-theme="dark"] .dropdown-divider {
    border-color: var(--ny-border);
}

@media (max-width: 768px) {
    html[data-color-theme="dark"] .ny-theme-toggle {
        width: 34px;
        min-width: 34px;
        padding: 0;
    }

    .ny-theme-toggle-label {
        display: none;
    }
}
