/**
 * VIP ProxyGuard — premium dark SaaS overlay (works with dgs-theme + app.min.css)
 */

html:not([data-theme]) {
    --dgs-p-bg: #0b0e14;
    --dgs-p-surface: #151921;
    --dgs-p-surface-2: #10141c;
    --dgs-p-border: rgba(71, 85, 105, 0.35);
    --dgs-p-text: #f1f5f9;
    --dgs-p-muted: #8b95a8;
    --dgs-accent: #3b82f6;
    --dgs-accent-hover: #2563eb;
    --dgs-accent-dim: rgba(59, 130, 246, 0.18);
    --dgs-accent-border: rgba(59, 130, 246, 0.42);
    --dgs-sidebar-gradient: linear-gradient(180deg, #070a10 0%, #0d1017 55%, #111827 100%);
    --dgs-topbar-bg: rgba(13, 16, 23, 0.96);
    --dgs-main-gradient: linear-gradient(165deg, #0d1017 0%, #0b0e14 48%, #0a0e14 100%);
    --dgs-topnav-bg: linear-gradient(90deg, rgba(21, 25, 33, 0.98), rgba(15, 20, 28, 0.98));
}

body.dgs-premium {
    --dgs-p-accent: var(--dgs-accent, #3b82f6);
    --dgs-p-accent-2: #a855f7;
    --dgs-p-danger: #f43f5e;
    --dgs-p-warning: #f59e0b;
    --dgs-p-success: #10b981;
}

body.dgs-premium[data-sidebar="dark"],
body.dgs-premium[data-topbar="dark"] {
    background: var(--dgs-p-bg);
}

#layout-wrapper.dgs-app .dgs-topnav {
    background: var(--dgs-topnav-bg, linear-gradient(90deg, rgba(18, 24, 38, 0.99), rgba(15, 20, 32, 0.99)));
    border-bottom: 1px solid var(--dgs-p-border);
    padding: 0 0.5rem;
    margin: 0;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 1001;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 992px) {
    #layout-wrapper.dgs-app .dgs-topnav {
        left: 250px;
    }

    body.vertical-collpsed #layout-wrapper.dgs-app .dgs-topnav {
        left: 70px;
    }
}

body.dgs-premium #layout-wrapper.dgs-app .main-content .page-content {
    padding-top: calc(1.25rem + var(--dgs-topbar-h, 70px) + var(--dgs-topnav-h, 52px)) !important;
}

.dgs-topnav-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.2rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.4rem 0.25rem 0.55rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.dgs-topnav-inner::-webkit-scrollbar {
    height: 4px;
}

.dgs-topnav-inner::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 4px;
}

.dgs-topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dgs-p-muted);
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    flex: 0 0 auto;
    white-space: nowrap;
}

button.dgs-topnav-link {
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.dgs-topnav-link i {
    font-size: 1rem;
    opacity: 0.9;
}

.dgs-topnav-link:hover {
    color: var(--dgs-accent, var(--dgs-p-text));
    background: var(--dgs-accent-dim, rgba(6, 182, 212, 0.08));
}

.dgs-topnav-link.active {
    color: #fff;
    background: var(--dgs-accent-dim, rgba(6, 182, 212, 0.18));
    border-color: var(--dgs-accent-border, rgba(6, 182, 212, 0.35));
}

.dgs-topnav-link--action {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.dgs-topnav-link--action:hover {
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.1);
}

.dgs-premium-card {
    background: var(--dgs-p-surface) !important;
    border: 1px solid var(--dgs-p-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}

body.dgs-premium .card-title {
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .text-muted {
    color: var(--dgs-p-muted) !important;
}

/* Dashboard legacy stat cards — ensure counts / RAM values stay readable */
body.dgs-premium .dash-legacy-count {
    color: var(--dgs-p-text) !important;
}

/* Bootstrap .text-body = #212529 — invisible on dark legacy cards */
body.dgs-premium .card a.text-body,
body.dgs-premium .card a.text-body p,
body.dgs-premium .card a.text-body h5,
body.dgs-premium .dash-legacy-details p,
body.dgs-premium .dash-legacy-details span {
    color: var(--dgs-p-text) !important;
}

body.dgs-premium #dashLegacyMemTotal,
body.dgs-premium #dashLegacyMemUsed,
body.dgs-premium #dashLegacyMemAvail,
body.dgs-premium #dashLegacyDiskFree,
body.dgs-premium #dashLegacyDiskUsed,
body.dgs-premium #dashLegacyCpuLoad {
    color: var(--dgs-p-text) !important;
    font-weight: 600;
}

body.dgs-premium .dash-legacy-summary {
    color: var(--dgs-p-muted) !important;
}

body.dgs-premium .dash-legacy-summary strong {
    color: var(--dgs-p-text) !important;
}

body.dgs-premium #dashLegacyRecentLogs td,
body.dgs-premium #dashLegacyRecentLogs th,
body.dgs-premium #dashLegacyTopIps td,
body.dgs-premium #dashLegacyTopIps th,
body.dgs-premium #dashLegacyRecentLogs h5,
body.dgs-premium #dashLegacyTopIps h5 {
    color: var(--dgs-p-text) !important;
}

body.dgs-premium #inputd,
body.dgs-premium #outputd,
body.dgs-premium #esd,
body.dgs-premium #tod,
body.dgs-premium #ramlive,
body.dgs-premium #cpulive,
body.dgs-premium #disklive {
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .dash-bans-panel .card-header a {
    color: var(--dgs-p-text) !important;
}

/* Recent IP Bans card on dashboard only — do not apply to 9-col bans modal */
body.dgs-premium .dash-bans-panel .dash-bans-table {
    width: 100%;
    table-layout: fixed;
}

body.dgs-premium .dash-bans-panel .dash-bans-table th,
body.dgs-premium .dash-bans-panel .dash-bans-table td {
    vertical-align: middle;
}

body.dgs-premium .dash-bans-panel .dash-bans-table th:nth-child(1),
body.dgs-premium .dash-bans-panel .dash-bans-table td:nth-child(1) {
    width: 28%;
}

body.dgs-premium .dash-bans-panel .dash-bans-table th:nth-child(2),
body.dgs-premium .dash-bans-panel .dash-bans-table td:nth-child(2) {
    width: 32%;
}

body.dgs-premium .dash-bans-panel .dash-bans-table th:nth-child(3),
body.dgs-premium .dash-bans-panel .dash-bans-table td:nth-child(3) {
    width: 18%;
}

body.dgs-premium .dash-bans-panel .dash-bans-table th:nth-child(4),
body.dgs-premium .dash-bans-panel .dash-bans-table td:nth-child(4) {
    width: 22%;
}

body.dgs-premium .dash-main-stats-divider {
    margin: 0.75rem 0 1rem;
    opacity: 0.35;
}

body.dgs-premium .dash-main-stats-group-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dgs-p-muted) !important;
    margin-bottom: 0.5rem;
}

body.dgs-premium .dash-main-stat-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.7rem 0.55rem;
    min-height: 4.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

body.dgs-premium .dash-main-stat-label {
    font-size: 0.74rem;
    line-height: 1.35;
    color: var(--dgs-p-muted) !important;
}

body.dgs-premium .dash-main-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .dash-data-table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--dgs-p-muted) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

body.dgs-premium .dash-data-table tbody td {
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--dgs-p-text) !important;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    vertical-align: middle;
}

body.dgs-premium .dash-bans-panel .dash-bans-ip {
    word-break: break-all;
    white-space: normal;
    line-height: 1.35;
    font-size: 0.86rem;
}

body.dgs-premium .dash-bans-panel .dash-bans-trigger {
    word-break: break-word;
    white-space: normal;
    line-height: 1.4;
    font-size: 0.88rem;
}

body.dgs-premium .dash-bans-panel .dash-bans-geo {
    white-space: normal;
    line-height: 1.35;
    font-size: 0.86rem;
}

body.dgs-premium .dash-bans-panel .dash-bans-row--inactive {
    opacity: 0.72;
}

body.dgs-premium .dash-bans-panel .dash-bans-row--inactive td {
    color: var(--dgs-p-muted) !important;
}

body.dgs-premium .dash-bans-panel .dash-bans-status {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

body.dgs-premium .dash-bans-panel .dash-bans-when {
    font-size: 0.68rem;
    line-height: 1.3;
    margin-top: 0.15rem;
}

body.dgs-premium .dash-upstream-table tbody td.font-monospace {
    font-size: 0.82rem;
}

body.dgs-premium .dash-upstream-table td:nth-child(3) {
    color: #9be7b0 !important;
    font-weight: 500;
}

body.dgs-premium .dash-main-server-card .card-body {
    min-height: 100%;
}

body.dgs-premium .dash-http-legend {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dgs-premium .dash-http-legend-search {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--dgs-p-text) !important;
    font-size: 0.8rem;
}

body.dgs-premium .dash-http-legend-search::placeholder {
    color: var(--dgs-p-muted) !important;
    opacity: 0.85;
}

body.dgs-premium .dash-http-legend-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

body.dgs-premium .dash-http-badge {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

body.dgs-premium .dash-http-badge--ok {
    background: rgba(40, 167, 69, 0.2);
    color: #9be7b0 !important;
    border-color: rgba(40, 167, 69, 0.35);
}

body.dgs-premium .dash-http-badge--redirect {
    background: rgba(23, 162, 184, 0.18);
    color: #8ad4e8 !important;
    border-color: rgba(23, 162, 184, 0.35);
}

body.dgs-premium .dash-http-badge--4xx {
    background: rgba(255, 193, 7, 0.16);
    color: #ffe08a !important;
    border-color: rgba(255, 193, 7, 0.35);
}

body.dgs-premium .dash-http-badge--5xx {
    background: rgba(220, 53, 69, 0.18);
    color: #f5a5ad !important;
    border-color: rgba(220, 53, 69, 0.35);
}

body.dgs-premium .dash-http-legend-hint {
    font-size: 0.72rem;
    line-height: 1.35;
}

body.dgs-premium .dash-http-legend-list {
    flex: 1 1 auto;
    min-height: 7.5rem;
    max-height: 13.5rem;
    overflow-y: auto;
    padding-right: 0.2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

body.dgs-premium .dash-http-legend-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left-width: 3px;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.55rem;
    margin-bottom: 0.45rem;
}

body.dgs-premium .dash-http-legend-item--ok {
    border-left-color: #28a745;
}

body.dgs-premium .dash-http-legend-item--redirect {
    border-left-color: #17a2b8;
}

body.dgs-premium .dash-http-legend-item--nok-client {
    border-left-color: #ffc107;
}

body.dgs-premium .dash-http-legend-item--nok-server {
    border-left-color: #dc3545;
}

body.dgs-premium .dash-http-legend-item-head {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin-bottom: 0.2rem;
}

body.dgs-premium .dash-http-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--dgs-p-text) !important;
    min-width: 2.4rem;
}

body.dgs-premium .dash-http-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .dash-http-desc {
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--dgs-p-muted) !important;
}

/* Dashboard — main column left + utilities rail (HTTP legend) on the right */
body.dgs-premium #layout-wrapper .container-fluid.dgs-page--dashboard {
    max-width: none;
    width: 100%;
}

body.dgs-premium .dgs-dash-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(340px, 30vw);
    gap: 1rem 1.25rem;
    align-items: start;
}

body.dgs-premium .dgs-dash-main {
    min-width: 0;
}

body.dgs-premium .dgs-dash-rail {
    min-width: 0;
}

body.dgs-premium .dgs-dash-rail-inner {
    position: sticky;
    top: calc(var(--dgs-topbar-h, 70px) + var(--dgs-topnav-h, 52px) + 0.85rem);
}

body.dgs-has-live-strip body.dgs-premium .dgs-dash-rail-inner,
body.dgs-premium.dgs-has-live-strip .dgs-dash-rail-inner,
html.dgs-has-live-strip body.dgs-premium .dgs-dash-rail-inner {
    top: calc(var(--dgs-topbar-h, 70px) + var(--dgs-strip-h, 52px) + var(--dgs-topnav-h, 52px) + 0.85rem);
}

body.dgs-premium .dgs-dash-rail .dash-nxt-mask {
    margin-bottom: 0.85rem;
    padding: 1rem 1rem 0.85rem;
    border: 1px solid var(--dgs-p-border);
    border-radius: 12px;
    background: var(--dgs-p-surface);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

body.dgs-premium .dgs-dash-rail .dash-nxt-mask-hint {
    font-size: 0.78rem;
    line-height: 1.35;
}

body.dgs-premium .dgs-dash-rail .dash-nxt-mask-list {
    max-height: 11rem;
    overflow-y: auto;
    margin-bottom: 0.65rem;
    padding-right: 0.15rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

body.dgs-premium .dash-nxt-mask-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    padding: 0.35rem 0.4rem;
    margin-bottom: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
}

body.dgs-premium .dash-nxt-mask-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    color: #fff !important;
}

body.dgs-premium .dash-nxt-mask-val {
    font-size: 0.78rem;
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .dash-nxt-mask-name {
    font-size: 0.72rem;
    flex: 1 1 auto;
    min-width: 0;
}

body.dgs-premium .dash-nxt-mask-rm {
    margin-left: auto;
    padding: 0 0.25rem;
    line-height: 1;
    text-decoration: none !important;
}

body.dgs-premium .dgs-dash-rail .dash-nxt-mask .form-control-sm {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--dgs-p-text) !important;
    font-size: 0.8rem;
}

body.dgs-premium .dgs-dash-rail .dash-nxt-mask-meta {
    font-size: 0.72rem;
}

body.dgs-premium .dgs-dash-rail .dash-http-legend {
    margin-top: 0;
    padding: 1rem 1rem 0.85rem;
    border: 1px solid var(--dgs-p-border);
    border-radius: 12px;
    background: var(--dgs-p-surface);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    border-top: 1px solid var(--dgs-p-border);
}

body.dgs-premium .dgs-dash-rail .dash-main-stats-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.dgs-premium .dgs-dash-rail .dash-http-legend-search {
    font-size: 0.85rem;
    padding: 0.4rem 0.55rem;
}

body.dgs-premium .dgs-dash-rail .dash-http-legend-badges {
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

body.dgs-premium .dgs-dash-rail .dash-http-badge {
    font-size: 0.78rem;
    padding: 0.35em 0.65em;
}

body.dgs-premium .dgs-dash-rail .dash-http-legend-hint {
    font-size: 0.8rem;
}

body.dgs-premium .dgs-dash-rail .dash-http-legend-list {
    min-height: 10rem;
    max-height: calc(100vh - 11rem);
}

body.dgs-premium .dgs-dash-rail .dash-http-legend-item {
    padding: 0.65rem 0.7rem;
    margin-bottom: 0.55rem;
}

body.dgs-premium .dgs-dash-rail .dash-http-code {
    font-size: 0.95rem;
    min-width: 2.75rem;
}

body.dgs-premium .dgs-dash-rail .dash-http-title {
    font-size: 0.9rem;
}

body.dgs-premium .dgs-dash-rail .dash-http-desc {
    font-size: 0.82rem;
    line-height: 1.45;
}

@media (max-width: 1399.98px) {
    body.dgs-premium .dgs-dash-layout {
        grid-template-columns: minmax(0, 1fr) min(300px, 32vw);
    }
}

@media (max-width: 1199.98px) {
    body.dgs-premium .dgs-dash-layout {
        grid-template-columns: 1fr;
    }

    body.dgs-premium .dgs-dash-rail-inner {
        position: static;
    }

    body.dgs-premium .dgs-dash-rail .dash-http-legend-list {
        max-height: 18rem;
    }
}

body.dgs-premium .dgs-lang-switch {
    gap: 0.25rem;
    padding: 0.15rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.2);
}

body.dgs-premium .dgs-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 1.65rem;
    border-radius: 0.35rem;
    text-decoration: none;
    opacity: 0.72;
    transition: opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

body.dgs-premium .dgs-lang-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

body.dgs-premium .dgs-lang-btn.is-active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

body.dgs-premium .dgs-lang-flag {
    border-radius: 2px;
    object-fit: cover;
}

body.dgs-premium .dgs-lang-fallback-text {
    display: none;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--dgs-p-text) !important;
    letter-spacing: 0.04em;
}

body.dgs-premium .dgs-lang-btn.dgs-lang-fallback .dgs-lang-fallback-text,
body.dgs-premium .dgs-lang-btn:not(:has(.dgs-lang-flag)) .dgs-lang-fallback-text {
    display: inline;
}

body.dgs-premium .dash-geo-flag {
    border-radius: 2px;
    object-fit: cover;
}

body.dgs-premium .dash-table-flag {
    flex-shrink: 0;
    vertical-align: middle;
}

body.dgs-premium .dash-table-flag-local {
    font-size: 0.65rem;
    padding: 0.15em 0.35em;
}

body.dgs-premium #dash-top-ips-table .dash-geo-country {
    color: var(--dgs-p-text);
}

body.dgs-premium .card.border-primary .card-header {
    background: var(--dgs-p-surface-2) !important;
    border-color: var(--dgs-p-border) !important;
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .card.border-primary .card-header a {
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .card.border-primary .table td,
body.dgs-premium .card.border-primary .table th {
    color: var(--dgs-p-text) !important;
}

.dgs-metric {
    border-radius: 12px !important;
    border: 1px solid var(--dgs-p-border) !important;
    padding: 0.85rem 1rem !important;
    background: var(--dgs-p-surface-2) !important;
}

.dgs-metric-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dgs-p-muted);
    margin-bottom: 0.35rem;
}

.dgs-metric-value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--dgs-p-text);
}

.dgs-metric--danger .dgs-metric-value { color: #fb7185; }
.dgs-metric--warning .dgs-metric-value { color: #fbbf24; }
.dgs-metric--success .dgs-metric-value { color: #34d399; }
.dgs-metric--info .dgs-metric-value { color: #60a5fa; }
.dgs-metric--purple .dgs-metric-value { color: #c084fc; }
.dgs-metric--orange .dgs-metric-value { color: #fb923c; }

.dgs-progress-thin {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.dgs-domain-pill {
    font-weight: 500;
    padding: 0.4em 0.75em;
}

body.dgs-premium #layout-wrapper .main-content {
    background:
        var(--dgs-main-glow-a, radial-gradient(1200px 600px at 10% -10%, rgba(59, 130, 246, 0.08), transparent 55%)),
        var(--dgs-main-glow-b, radial-gradient(900px 500px at 90% 0%, rgba(168, 85, 247, 0.06), transparent 50%)),
        var(--dgs-main-gradient, var(--dgs-p-bg)) !important;
}

body.dgs-premium .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--dgs-p-text);
    --bs-table-striped-bg: var(--dgs-table-stripe-odd, rgba(22, 29, 46, 0.85));
    --bs-table-striped-color: var(--dgs-p-text);
    --bs-table-hover-bg: var(--dgs-table-hover, rgba(59, 130, 246, 0.12));
    --bs-table-hover-color: var(--dgs-p-text);
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .table thead th {
    border-color: var(--dgs-p-border) !important;
    color: var(--dgs-p-muted) !important;
    background: var(--dgs-p-surface-2) !important;
}

body.dgs-premium .table td,
body.dgs-premium .table th {
    border-color: var(--dgs-p-border) !important;
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: var(--bs-table-striped-bg);
    color: var(--bs-table-striped-color) !important;
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

body.dgs-premium .table-striped > tbody > tr:nth-of-type(even) > * {
    --bs-table-accent-bg: var(--dgs-table-stripe-even, rgba(18, 24, 38, 0.45));
    box-shadow: inset 0 0 0 9999px var(--bs-table-accent-bg);
}

body.dgs-premium .table tbody tr:hover > * {
    --bs-table-accent-bg: var(--bs-table-hover-bg);
    color: var(--bs-table-hover-color) !important;
}

body.dgs-premium .table code {
    color: var(--dgs-table-code-fg, #93c5fd) !important;
    background: var(--dgs-table-code-bg, rgba(59, 130, 246, 0.12));
    padding: 0.12em 0.35em;
    border-radius: 4px;
}

body.dgs-premium .table a:not(.btn) {
    color: var(--dgs-table-link, #34d399) !important;
}

body.dgs-premium .card:not(.dgs-dash-quick-card) {
    background: var(--dgs-p-surface) !important;
    border-color: var(--dgs-p-border) !important;
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .card .card-body,
body.dgs-premium .card strong {
    color: var(--dgs-p-text);
}

body.dgs-premium .form-control,
body.dgs-premium .form-select,
body.dgs-premium select.form-control {
    background: var(--dgs-p-surface-2) !important;
    color: var(--dgs-p-text) !important;
    border-color: var(--dgs-p-border) !important;
}

body.dgs-premium .form-control::placeholder {
    color: var(--dgs-p-muted) !important;
    opacity: 1;
}

body.dgs-premium .form-label {
    color: var(--dgs-p-muted) !important;
}

body.dgs-premium .pagination .page-link {
    background: var(--dgs-p-surface-2) !important;
    border-color: var(--dgs-p-border) !important;
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .pagination .page-item.active .page-link {
    background: var(--dgs-p-accent) !important;
    border-color: var(--dgs-p-accent) !important;
    color: #fff !important;
}

/* Dashboard — hero + quick actions */
body.dgs-premium .dgs-dash-hero .dgs-page-header {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

body.dgs-premium .dgs-dash-hero .dgs-page-header h4 {
    color: var(--dgs-p-text) !important;
}

body.dgs-premium .dgs-dash-hero .dgs-page-header .text-muted {
    color: var(--dgs-p-muted) !important;
}

/* Dashboard — prominent quick actions (bans / host traffic) — light cards on dark shell */
.dgs-dash-quick-actions {
    position: relative;
    z-index: 2;
    margin-top: 0.25rem;
}

.dgs-dash-quick-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.05rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--dgs-quick-card-border, #e2e8f0);
    background: var(--dgs-quick-card-bg, #ffffff) !important;
    color: var(--dgs-quick-card-fg, #0f172a) !important;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dgs-dash-quick-card:focus {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 2px;
}

.dgs-dash-quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.dgs-dash-quick-card--danger {
    border-left: 4px solid #e11d48;
}

.dgs-dash-quick-card--danger:hover {
    border-color: #fda4af;
    box-shadow: 0 10px 28px rgba(225, 29, 72, 0.22);
}

.dgs-dash-quick-card--info {
    border-left: 4px solid #2563eb;
}

.dgs-dash-quick-card--info:hover {
    border-color: #93c5fd;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.22);
}

.dgs-dash-quick-icon {
    font-size: 1.75rem;
    line-height: 1;
    opacity: 1;
    color: #334155;
}

.dgs-dash-quick-card--danger .dgs-dash-quick-icon {
    color: #e11d48;
}

.dgs-dash-quick-card--info .dgs-dash-quick-icon {
    color: #2563eb;
}

.dgs-dash-quick-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dgs-dash-quick-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--dgs-quick-card-fg, #0f172a) !important;
}

.dgs-dash-quick-desc {
    font-size: 0.82rem;
    color: var(--dgs-quick-card-muted, #475569) !important;
    line-height: 1.4;
    opacity: 1;
}

.dgs-dash-quick-stat {
    font-size: 1.25rem;
    font-weight: 800;
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #0f172a;
}

.dgs-dash-quick-card--danger .dgs-dash-quick-stat {
    color: #be123c;
    background: #ffe4e6;
}

.dgs-dash-quick-card--info .dgs-dash-quick-stat {
    color: #1d4ed8;
    background: #dbeafe;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Dashboard modals — dark readable panels (body direct child, high specificity) */
.modal.dgs-modal-dark {
    z-index: 1065 !important;
}

body.modal-open .modal-backdrop {
    z-index: 1060 !important;
}

.modal.dgs-modal-dark .modal-content {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55) !important;
}

.modal.dgs-modal-dark .modal-header {
    background: #0f172a !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.modal.dgs-modal-dark .modal-body {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

.modal.dgs-modal-dark .modal-title {
    color: #f8fafc !important;
}

.modal.dgs-modal-dark .form-control {
    background: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
}

.modal.dgs-modal-dark .form-control::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

.modal.dgs-modal-dark .form-label,
.modal.dgs-modal-dark .text-muted,
.modal.dgs-modal-dark small.text-muted,
.modal.dgs-modal-dark p.small {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

.modal.dgs-modal-dark .dash-modal-table {
    --bs-table-bg: transparent;
    --bs-table-color: #f1f5f9;
    --bs-table-striped-bg: rgba(15, 23, 42, 0.65);
    --bs-table-striped-color: #f1f5f9;
    --bs-table-hover-bg: rgba(59, 130, 246, 0.14);
    --bs-table-hover-color: #fff;
    color: #f1f5f9 !important;
}

.modal.dgs-modal-dark .dash-modal-table {
    table-layout: auto;
}

.modal.dgs-modal-dark .dash-modal-table thead th {
    color: #94a3b8 !important;
    background: #0f172a !important;
    border-color: #334155 !important;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}

.modal.dgs-modal-dark .dash-modal-table td,
.modal.dgs-modal-dark .dash-modal-table th {
    border-color: #334155 !important;
    color: #f1f5f9 !important;
    vertical-align: middle;
    font-size: 0.9rem;
    line-height: 1.4;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.modal.dgs-modal-dark .dash-modal-table .font-monospace {
    color: #e2e8f0 !important;
}

.modal.dgs-modal-dark .dash-modal-table .text-danger {
    color: #fca5a5 !important;
}

.modal.dgs-modal-dark .badge {
    color: #f1f5f9 !important;
}

.modal.dgs-modal-dark code {
    color: #7dd3fc !important;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.modal.dgs-modal-dark .btn-outline-secondary {
    color: #e2e8f0 !important;
    border-color: #64748b !important;
}

.modal.dgs-modal-dark .btn-outline-danger {
    color: #fecaca !important;
    border-color: #f87171 !important;
}

/* Bans modal — extra-wide for UA + geo flag */
.dgs-bans-modal-dialog {
    max-width: min(98vw, 1820px);
    width: 98vw;
    margin-left: auto;
    margin-right: auto;
}

.modal.dgs-modal-dark .dash-bans-table .dash-bans-col-ua {
    min-width: 200px;
    width: 22%;
}

.modal.dgs-modal-dark .dash-bans-table .dash-bans-col-ip {
    min-width: 140px;
}

.modal.dgs-modal-dark .dash-bans-table .dash-bans-col-geo {
    min-width: 220px;
    width: 16%;
}

.modal.dgs-modal-dark .dash-bans-table th:nth-child(5),
.modal.dgs-modal-dark .dash-bans-table td:nth-child(5) {
    min-width: 220px;
}

.modal.dgs-modal-dark .dash-ua-cell {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    color: #bae6fd !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.35;
}

.modal.dgs-modal-dark .dash-ban-geo-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.modal.dgs-modal-dark .dash-ban-flag {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.2rem;
    min-width: 2.5rem;
}

.modal.dgs-modal-dark .dash-ban-cc {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #94a3b8 !important;
    line-height: 1;
}

.modal.dgs-modal-dark .dash-ban-flag-img {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.modal.dgs-modal-dark .dash-ban-loc {
    font-size: 0.86rem;
    color: #cbd5e1 !important;
    line-height: 1.4;
    min-width: 0;
}

.modal.dgs-modal-dark .dash-bans-table .font-monospace {
    font-size: 0.88rem;
}

.modal.dgs-modal-dark .dash-modal-table .small {
    font-size: 0.88rem;
}

@media (max-width: 1400px) {
    .dgs-bans-modal-dialog {
        max-width: 99vw;
        width: 99vw;
    }
}

.modal.dgs-modal-dark .dgs-bans-quick-access {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.55);
}

.modal.dgs-modal-dark .dgs-bans-quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.55rem 0.65rem;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(30, 41, 59, 0.75);
    color: #e2e8f0 !important;
    text-decoration: none !important;
    min-height: 4.5rem;
    transition: border-color 0.15s, background 0.15s;
}

.modal.dgs-modal-dark .dgs-bans-quick-card:hover {
    border-color: rgba(96, 165, 250, 0.55);
    background: rgba(30, 58, 95, 0.55);
}

.modal.dgs-modal-dark .dgs-bans-quick-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.modal.dgs-modal-dark .dgs-bans-quick-title {
    font-size: 0.82rem;
    font-weight: 700;
}

.modal.dgs-modal-dark .dgs-bans-quick-count {
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #f8fafc !important;
}

.modal.dgs-modal-dark .dgs-bans-quick-hint {
    font-size: 0.68rem;
    color: #94a3b8 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Country bans — search + scroll list with flags (no Select2) */
.dgs-country-bans-page .dgs-country-picker-wrap #dgs-country-search {
    background: #0f172a;
    color: #f8fafc;
    border-color: #475569;
}

.dgs-country-bans-page .dgs-country-picker-wrap #dgs-country-search::placeholder {
    color: #94a3b8;
}

.dgs-country-bans-page .dgs-country-scroll-list {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #475569;
    border-radius: 6px;
    background: #1e293b;
    padding: 0.25rem 0;
}

.dgs-country-bans-page .dgs-country-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(71, 85, 105, 0.35);
}

.dgs-country-bans-page .dgs-country-row:last-child {
    border-bottom: none;
}

.dgs-country-bans-page .dgs-country-row:hover {
    background: rgba(37, 99, 235, 0.18);
}

.dgs-country-bans-page .dgs-country-row--banned {
    opacity: 0.72;
}

.dgs-country-bans-page .dgs-country-row--banned .dgs-country-row-name {
    color: #94a3b8;
}

.dgs-country-bans-page .dgs-country-row-check {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.dgs-country-bans-page .dgs-country-row-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dgs-country-bans-page .dgs-country-row-badge {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f87171;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(248, 113, 113, 0.12);
}

.dgs-country-bans-page .dgs-country-row-flag {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 2px;
    object-fit: cover;
    margin-left: 0.35rem;
}

.dgs-country-bans-page .dgs-country-unban-cb {
    cursor: pointer;
}

.dgs-country-bans-page .country-flag-img {
    border-radius: 2px;
    object-fit: cover;
}
