/* VPN PANEL — full admin theme (mockup) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html.dark body,
html.dark .fi-body {
    font-family: 'Inter', system-ui, sans-serif !important;
    background: #0b0e14 !important;
}

html.dark .fi-layout {
    background: #0b0e14 !important;
}

/* Sidebar */
html.dark .fi-sidebar {
    background: #0f1419 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html.dark .fi-sidebar-header {
    padding: 1.25rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html.dark .fi-logo {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em !important;
    color: #fff !important;
}

html.dark .fi-sidebar-group-label {
    color: #64748b !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    padding-top: 0.35rem !important;
    padding-bottom: 0.15rem !important;
}

html.dark .fi-sidebar-nav {
    flex: 1 !important;
    overflow-y: auto !important;
    padding-bottom: 0.5rem !important;
}

html.dark .fi-sidebar-nav-groups {
    gap: 0.25rem !important;
}

html.dark .fi-sidebar-item a {
    border-radius: 8px !important;
    margin: 2px 6px !important;
    padding: 0.5rem 0.7rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
    gap: 0.65rem !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

html.dark .fi-sidebar-item:not(.fi-sidebar-item-active) a:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
}

html.dark .fi-sidebar-item-icon {
    width: 1.15rem !important;
    height: 1.15rem !important;
    padding: 0.35rem !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    box-sizing: content-box !important;
    color: #64748b !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

html.dark .fi-sidebar-item:not(.fi-sidebar-item-active) a:hover .fi-sidebar-item-icon {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #93c5fd !important;
}

html.dark .fi-sidebar-footer {
    display: none !important;
}

.vpn-brand-sub {
    margin: -0.15rem 0 0;
    padding: 0 0.25rem 0.65rem;
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.vpn-sidebar-status {
    margin: 0.75rem 0.5rem 1rem;
    padding: 0.85rem;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.vpn-sidebar-status h4 {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin: 0 0 0.5rem;
    font-weight: 700;
}

.vpn-dot--warn { background: #f59e0b !important; }

.vpn-dashboard-page .fi-page > section { padding-top: 0 !important; }

.vpn-dashboard-page .fi-page,
.vpn-dashboard-page .fi-main-ctn {
    max-width: 100% !important;
}

.vpn-dashboard-page .vpn-dash {
    box-sizing: border-box;
}

.vpn-dash-header { margin-bottom: 1.25rem; }
.vpn-dash-title { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 0; }
.vpn-dash-subtitle { font-size: 0.85rem; color: #64748b; margin: 0.25rem 0 0; }

.vpn-stat { display: flex; align-items: center; justify-content: space-between; }
.vpn-stat-body { flex: 1; min-width: 0; padding-right: 0.5rem; }
.vpn-stat--blue { border-left: 3px solid #3b82f6; }
.vpn-stat--green { border-left: 3px solid #22c55e; }
.vpn-stat--cyan { border-left: 3px solid #06b6d4; }
.vpn-stat--gold { border-left: 3px solid #eab308; }
.vpn-stat--purple { border-left: 3px solid #a855f7; }
.vpn-stat--teal { border-left: 3px solid #14b8a6; }
.vpn-stat-icon {
    width: 2.75rem; height: 2.75rem; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 700; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}
.vpn-stat--blue .vpn-stat-icon { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.vpn-stat--green .vpn-stat-icon { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.vpn-stat--cyan .vpn-stat-icon { background: rgba(6, 182, 212, 0.2); color: #67e8f9; }
.vpn-stat--gold .vpn-stat-icon { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.vpn-stat--purple .vpn-stat-icon { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.vpn-stat--teal .vpn-stat-icon { background: rgba(20, 184, 166, 0.2); color: #5eead4; }
.vpn-stat-trend--up { color: #4ade80; }
.vpn-stat-trend span { color: #64748b; }

.vpn-grid-main {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.45fr) minmax(0, 1.15fr);
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
}
.vpn-grid-main > .vpn-card,
.vpn-grid-bottom > .vpn-card {
    min-width: 0;
}
@media (max-width: 1280px) {
    .vpn-grid-main {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .vpn-grid-main .vpn-card--chart {
        grid-column: 1 / -1;
    }
}
@media (max-width: 900px) {
    .vpn-grid-main {
        grid-template-columns: 1fr;
    }
    .vpn-grid-main .vpn-card--chart {
        grid-column: auto;
    }
}

.vpn-card--chart { min-height: 280px; }
.vpn-chart-wrap { height: 220px; position: relative; }
.vpn-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.vpn-card-head .vpn-card-title { margin-bottom: 0; }
.vpn-card-meta { font-size: 0.7rem; color: #64748b; }

.vpn-server-summary {
    display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem;
    padding-top: 0.75rem; border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem; color: #94a3b8;
}
.vpn-server-summary--inline {
    margin: 0;
    padding: 0;
    border: none;
    gap: 0.5rem;
    font-size: 0.68rem;
}
.vpn-server-summary span { display: inline-flex; align-items: center; gap: 0.35rem; }

.vpn-card--servers .vpn-card-head {
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.vpn-card--servers .vpn-table {
    font-size: 0.78rem;
}
.vpn-card--servers .vpn-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
}

.vpn-insights {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 1rem;
    align-items: start;
}
.vpn-insights__chart {
    min-width: 0;
}
.vpn-donut-wrap--compact canvas {
    max-height: 120px;
}
.vpn-insights__resources {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.vpn-insights__resources .vpn-progress-head {
    font-size: 0.72rem;
}
@media (max-width: 1280px) {
    .vpn-insights {
        grid-template-columns: 1fr;
    }
}

.vpn-donut-wrap { display: flex; flex-direction: column; align-items: center; }
.vpn-donut-wrap canvas { max-height: 140px; }
.vpn-donut-legend { font-size: 0.75rem; color: #94a3b8; margin-top: 0.5rem; }
.vpn-legend-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: 0.35rem; vertical-align: middle;
}

.vpn-grid-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}
.vpn-grid-bottom--admin {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 2.2fr) minmax(0, 1.05fr);
}
.vpn-grid-bottom .vpn-card--wide {
    grid-column: span 2;
}
.vpn-grid-bottom--admin .vpn-card--recent {
    grid-column: auto;
}
@media (max-width: 1280px) {
    .vpn-grid-bottom {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .vpn-grid-bottom--admin {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .vpn-grid-bottom .vpn-card--wide,
    .vpn-grid-bottom--admin .vpn-card--recent {
        grid-column: 1 / -1;
    }
}
@media (max-width: 900px) {
    .vpn-grid-bottom,
    .vpn-grid-bottom--admin {
        grid-template-columns: 1fr;
    }
    .vpn-grid-bottom .vpn-card--wide,
    .vpn-grid-bottom--admin .vpn-card--recent {
        grid-column: auto;
    }
}

.vpn-whmcs-status { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.vpn-whmcs-meta { font-size: 0.8rem; color: #64748b; margin: 0 0 0.5rem; }

.vpn-action-plus {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.25rem; height: 1.25rem; margin-right: 0.35rem;
    background: rgba(255, 255, 255, 0.2); border-radius: 4px; font-weight: 700;
}

.vpn-pill--dim { opacity: 0.55; border-color: rgba(239, 68, 68, 0.35) !important; color: #fca5a5 !important; }

.vpn-loc { font-weight: 500; color: #e2e8f0; }

.vpn-stats.vpn-stats--5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
}
@media (max-width: 1100px) {
    .vpn-stats.vpn-stats--5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .vpn-stats.vpn-stats--5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.vpn-stat--orange { border-left: 3px solid #f97316; }
.vpn-stat--orange .vpn-stat-icon { background: rgba(249, 115, 22, 0.2); color: #fdba74; }

.vpn-grid-main--reseller { grid-template-columns: 2fr 1fr; }
.vpn-card--span2 { grid-column: span 1; }
@media (min-width: 1100px) {
    .vpn-grid-main--reseller .vpn-card--chart { grid-column: 1 / -1; }
}

.vpn-grid-bottom--reseller { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 1200px) { .vpn-grid-bottom--reseller { grid-template-columns: 1fr; } }

.vpn-actions--stack { grid-template-columns: 1fr; }
.vpn-action--teal { background: #0d9488; }

.vpn-table-link { color: #60a5fa; font-size: 0.8rem; text-decoration: none; }
.vpn-table-link:hover { text-decoration: underline; }
.vpn-credits-negative { color: #f87171; font-weight: 600; }

html.dark .fi-sidebar-item-active a {
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

html.dark .fi-sidebar-item-active .fi-sidebar-item-icon {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
}

html.dark .fi-sidebar-item-active .fi-sidebar-item-label {
    color: #fff !important;
    font-weight: 600 !important;
}

/* Topbar */
html.dark .fi-topbar {
    background: #0f1419 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    min-height: 4rem !important;
}

html.dark .fi-topbar nav {
    max-width: none !important;
}

html.dark .fi-topbar nav {
    gap: 0.75rem !important;
}

html.dark .fi-topbar nav > .ms-auto {
    flex: 1 1 auto !important;
    margin-inline-start: 0.75rem !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    min-width: 0 !important;
    gap: 0.75rem !important;
    width: 100%;
    max-width: 100%;
}

html.dark .fi-topbar nav > .ms-auto > .fi-global-search {
    flex: 0 1 380px !important;
    min-width: 0 !important;
    order: 1 !important;
}

html.dark .fi-topbar nav > .ms-auto > .fi-user-menu {
    order: 3 !important;
    flex-shrink: 0 !important;
    margin-inline-start: 0.25rem !important;
}

html.dark .fi-global-search-field {
    background: #161b22 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 10px !important;
    min-width: 280px !important;
    max-width: 420px !important;
    flex: 0 1 380px !important;
    margin-inline-end: 0 !important;
}

html.dark .fi-global-search-field .fi-input-wrp {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
}

html.dark .fi-global-search-field input {
    color: #e2e8f0 !important;
    font-size: 0.8125rem !important;
}

html.dark .fi-global-search-field input::placeholder {
    color: #94a3b8 !important;
}

/* Table toolbar search (above filters / list) */
html.dark .fi-ta-search-field {
    min-width: 12rem;
}

html.dark .fi-ta-search-field .fi-input-wrp {
    background: #161b22 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
}

html.dark .fi-ta-search-field input {
    color: #f1f5f9 !important;
    font-size: 0.8125rem !important;
}

html.dark .fi-ta-search-field input::placeholder {
    color: #94a3b8 !important;
}

html.dark .fi-ta-search-field .fi-input-wrp-prefix {
    color: #94a3b8 !important;
}

html.dark .fi-ta-header-toolbar .fi-icon-btn,
html.dark .fi-ta-header-toolbar .fi-dropdown-trigger {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
}

html.dark .fi-ta-header-toolbar .fi-icon-btn:hover,
html.dark .fi-ta-header-toolbar .fi-dropdown-trigger:hover {
    background: #334155 !important;
    color: #fff !important;
}

/* Main content */
html.dark .fi-main {
    background: #0b0e14 !important;
}

html.dark .fi-page,
html.dark .fi-simple-page {
    background: transparent !important;
}

html.dark .fi-header-heading {
    display: none !important;
}

.vpn-dashboard-page .fi-header,
.vpn-dashboard-page header.fi-header {
    display: none !important;
}

.vpn-dashboard-page .fi-page > section {
    padding-top: 0.5rem !important;
}

html.dark .fi-section,
html.dark .fi-ta-ctn,
html.dark .fi-fo-component-ctn {
    background: #161b22 !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25) !important;
}

html.dark .fi-ta-header-cell {
    background: #1a2332 !important;
    color: #94a3b8 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
}

html.dark .fi-ta-cell {
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

html.dark .fi-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
}

/* System status — dashboard widget + topbar button */
.vpn-system-widget {
    margin-bottom: 1rem;
}

.vpn-system-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1100px) {
    .vpn-system-grid { grid-template-columns: repeat(3, 1fr); }
}

.vpn-system-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: #1a2332;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.vpn-system-item span:first-child {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.vpn-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.vpn-ok {
    color: #4ade80;
    font-weight: 600;
    font-size: 0.75rem;
}

.vpn-err {
    color: #f87171;
    font-weight: 600;
    font-size: 0.75rem;
}

.vpn-dot--off {
    background: #ef4444;
}

.vpn-online-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.vpn-online-banner--ok {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
}

.vpn-online-banner--warn {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
}

.vpn-topbar-actions {
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
    position: relative;
}

.vpn-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #161b22;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.vpn-status-btn:hover {
    background: #1e293b;
}

.vpn-status-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    min-width: 220px;
    padding: 0.85rem;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.vpn-status-dropdown h4 {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.vpn-status-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.8rem;
    color: #cbd5e1;
}

.vpn-status-link {
    display: block;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: #60a5fa;
    text-decoration: none;
}

.vpn-topbar-extras {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 1;
    min-width: 0;
    margin-inline-start: auto;
    order: 2;
}

.vpn-topbar-live {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: linear-gradient(90deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.9));
    flex-shrink: 0;
}

.vpn-live-stat {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    line-height: 1.1;
}

.vpn-live-stat strong {
    font-size: 0.7rem;
    font-weight: 700;
    color: #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.vpn-live-stat__label {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #94a3b8;
}

.vpn-live-stat--muted strong {
    color: #cbd5e1;
}

html.dark .fi-topbar nav > .ms-auto > .fi-user-menu,
html.dark .fi-topbar nav > .ms-auto .fi-topbar-database-notifications-btn {
    flex-shrink: 0;
}

.vpn-topbar-pills {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.vpn-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #161b22;
    color: #cbd5e1;
    white-space: nowrap;
}

.vpn-pill-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
}

.vpn-pill-dot--wg { background: #ef4444; }
.vpn-pill-dot--ovpn { background: #f97316; }
.vpn-pill-dot--radius { background: #a855f7; }

.vpn-pill-status {
    color: #22c55e;
    font-weight: 700;
}

.vpn-pill--dim .vpn-pill-status {
    color: #94a3b8;
}

.vpn-pill--wg { border-color: rgba(239, 68, 68, 0.25); }
.vpn-pill--ovpn { border-color: rgba(249, 115, 22, 0.25); }
.vpn-pill--radius { border-color: rgba(168, 85, 247, 0.25); }

.vpn-server-loc,
.vpn-server-loc-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.vpn-flag-img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

html.dark .fi-user-menu .fi-dropdown-trigger {
    border-radius: 10px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.vpn-user-menu-trigger {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.3rem 0.7rem 0.3rem 0.35rem !important;
    border-radius: 10px !important;
    background: #161b22 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    cursor: pointer !important;
    transition: background 0.15s ease, border-color 0.15s ease !important;
}

.vpn-user-menu-trigger:hover {
    background: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.vpn-user-menu-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.2;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .vpn-user-menu-name {
        display: none;
    }

    .vpn-user-menu-trigger {
        padding: 0.25rem !important;
    }
}

@media (max-width: 1280px) {
    .vpn-topbar-pills {
        display: none;
    }
}

@media (max-width: 900px) {
    .vpn-topbar-live {
        gap: 0.35rem;
        padding: 0.22rem 0.45rem;
    }

    .vpn-live-stat__label {
        display: none;
    }

    .vpn-live-stat--muted {
        display: none;
    }
}

/* Dashboard grid */
.vpn-dash {
    color: #e2e8f0;
    padding-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.vpn-dashboard-page .fi-page,
.vpn-dashboard-page .fi-main-ctn {
    overflow-x: clip;
}

.vpn-stat {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    min-width: 0;
}

.vpn-stat-label { font-size: 0.75rem; color: #94a3b8; margin-bottom: 0.35rem; }
.vpn-stat-value { font-size: 1.5rem; font-weight: 700; color: #fff; }
.vpn-stat-trend { font-size: 0.7rem; color: #22c55e; margin-top: 0.25rem; }
a.vpn-stat--link {
    display: flex;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
a.vpn-stat--link:hover {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}
a.vpn-stat--link .vpn-stat-trend { color: #60a5fa; }

.vpn-grid-2 { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 1200px) { .vpn-grid-2 { grid-template-columns: 1fr 1fr; } }

.vpn-card {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.vpn-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.vpn-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 1200px) { .vpn-grid-3 { grid-template-columns: 1fr 1fr; } }

.vpn-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

.vpn-dash .vpn-table-scroll {
    overflow-x: visible;
}

.vpn-table-scroll .vpn-table {
    min-width: 32rem;
}

.vpn-dash .vpn-table-scroll .vpn-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.vpn-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.vpn-table th {
    text-align: left;
    color: #64748b;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.vpn-table td { padding: 0.55rem 0.25rem; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: #cbd5e1; }

.vpn-dash .vpn-table th,
.vpn-dash .vpn-table td {
    padding: 0.45rem 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.vpn-dash .vpn-table .vpn-server-loc {
    min-width: 0;
}

.vpn-dash .vpn-table .vpn-server-loc span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vpn-dash .vpn-table--servers th:nth-child(1),
.vpn-dash .vpn-table--servers td:nth-child(1) { width: 36%; }
.vpn-dash .vpn-table--servers th:nth-child(2),
.vpn-dash .vpn-table--servers td:nth-child(2) { width: 30%; font-family: ui-monospace, monospace; font-size: 0.72rem; }
.vpn-dash .vpn-table--servers th:nth-child(3),
.vpn-dash .vpn-table--servers td:nth-child(3) { width: 12%; text-align: center; }
.vpn-dash .vpn-table--servers th:nth-child(4),
.vpn-dash .vpn-table--servers td:nth-child(4) { width: 22%; text-align: right; }

.vpn-dash .vpn-table--resellers th:nth-child(1),
.vpn-dash .vpn-table--resellers td:nth-child(1) { width: 10%; }
.vpn-dash .vpn-table--resellers th:nth-child(2),
.vpn-dash .vpn-table--resellers td:nth-child(2) { width: 42%; }
.vpn-dash .vpn-table--resellers th:nth-child(3),
.vpn-dash .vpn-table--resellers td:nth-child(3) { width: 18%; }
.vpn-dash .vpn-table--resellers th:nth-child(4),
.vpn-dash .vpn-table--resellers td:nth-child(4) { width: 30%; }

.vpn-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
}
.vpn-badge--online { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.vpn-badge--offline { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.vpn-badge--maint { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.vpn-badge--active { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.vpn-badge--expired { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.vpn-progress { margin-bottom: 0.75rem; }
.vpn-progress-head { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 0.35rem; color: #94a3b8; }
.vpn-progress-bar { height: 6px; background: #1e293b; border-radius: 999px; overflow: hidden; }
.vpn-progress-fill { height: 100%; border-radius: 999px; }

.vpn-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.vpn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s;
}
.vpn-action:hover { opacity: 0.9; color: #fff; }
.vpn-action--blue { background: #2563eb; }
.vpn-action--green { background: #16a34a; }
.vpn-action--orange { background: #ea580c; }
.vpn-action--purple { background: #7c3aed; }

.vpn-whmcs-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.6rem;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    text-decoration: none;
}

.vpn-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vpn-footer a { color: #64748b; text-decoration: none; margin-left: 1rem; }
.vpn-footer a:hover { color: #94a3b8; }

.vpn-credits { color: #22c55e; font-weight: 600; }

/* VPN accounts table — filters, layout, sticky actions */
html.dark .fi-resource-subscriptions .fi-ta-filters-above-content-ctn,
html.dark .fi-resource-vpn-accounts .fi-ta-filters-above-content-ctn {
    padding: 0.75rem 1rem !important;
    margin-bottom: 0 !important;
    background: #1a2332 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html.dark .fi-resource-subscriptions .fi-ta-filters-above-content-ctn .fi-fo-field-wrp-label,
html.dark .fi-resource-vpn-accounts .fi-ta-filters-above-content-ctn .fi-fo-field-wrp-label {
    color: #94a3b8 !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

html.dark .fi-resource-subscriptions .fi-ta-filters-above-content-ctn .fi-select-input,
html.dark .fi-resource-vpn-accounts .fi-ta-filters-above-content-ctn .fi-select-input,
html.dark .fi-resource-subscriptions .fi-ta-filters-above-content-ctn .choices__inner,
html.dark .fi-resource-vpn-accounts .fi-ta-filters-above-content-ctn .choices__inner {
    background: #0f1419 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    min-height: 2.25rem !important;
    color: #e2e8f0 !important;
}

html.dark .fi-resource-subscriptions .fi-ta-header-toolbar .fi-icon-btn,
html.dark .fi-resource-vpn-accounts .fi-ta-header-toolbar .fi-icon-btn,
html.dark .fi-resource-subscriptions .fi-ta-filters-trigger,
html.dark .fi-resource-vpn-accounts .fi-ta-filters-trigger {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
}

html.dark .fi-resource-subscriptions .fi-ta-content,
html.dark .fi-resource-vpn-accounts .fi-ta-content {
    overflow-x: auto !important;
}

html.dark .fi-resource-subscriptions .fi-ta-table,
html.dark .fi-resource-vpn-accounts .fi-ta-table {
    min-width: 100% !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-header-cell,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-header-cell,
html.dark .fi-resource-subscriptions .fi-ta-actions-cell,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell {
    position: sticky !important;
    right: 0 !important;
    z-index: 4 !important;
    background: #161b22 !important;
    box-shadow: -10px 0 16px rgba(0, 0, 0, 0.45) !important;
    min-width: 9.5rem !important;
    white-space: nowrap !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-header-cell,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-header-cell {
    background: #1a2332 !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell {
    padding-inline: 0.35rem !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell .fi-ac-btn-group,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell .fi-ac-btn-group {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 0.2rem !important;
    justify-content: center !important;
}

/* VPN accounts list (SGConnected-style actions) */
html.dark .fi-resource-subscriptions .fi-ta-actions-cell,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell {
    white-space: nowrap;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell .fi-ac-btn-action,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell .fi-ac-btn-action {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 6px;
    margin: 0;
    flex-shrink: 0;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell .fi-btn.fi-color-warning,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell .fi-btn.fi-color-warning {
    background: #eab308 !important;
    color: #1c1917 !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell .fi-btn.fi-color-success,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell .fi-btn.fi-color-success {
    background: #22c55e !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell .fi-btn.fi-color-info,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell .fi-btn.fi-color-info {
    background: #3b82f6 !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell .fi-btn.fi-color-danger,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell .fi-btn.fi-color-danger {
    background: #ef4444 !important;
}

/* Servers list — compact table, no horizontal scroll */
html.dark .fi-resource-servers .fi-ta-ctn {
    overflow-x: clip !important;
    max-width: 100% !important;
}

html.dark .fi-resource-servers .fi-ta-content {
    overflow-x: auto !important;
}

html.dark .fi-resource-servers .fi-ta-table {
    width: 100% !important;
    table-layout: auto !important;
}

html.dark .fi-resource-servers .fi-ta-header-cell,
html.dark .fi-resource-servers .fi-ta-cell {
    padding-inline: 0.5rem !important;
    font-size: 0.8125rem !important;
}

html.dark .fi-resource-servers .fi-ta-actions-header-cell,
html.dark .fi-resource-servers .fi-ta-actions-cell {
    position: sticky !important;
    right: 0 !important;
    z-index: 4 !important;
    background: #161b22 !important;
    box-shadow: -8px 0 14px rgba(0, 0, 0, 0.35) !important;
    min-width: 0 !important;
    width: 1% !important;
    white-space: nowrap !important;
    padding-inline: 0.4rem !important;
}

html.dark .fi-resource-servers .fi-ta-actions-header-cell {
    background: #1a2332 !important;
}

html.dark .fi-resource-servers .fi-ta-actions-cell .fi-ac-btn-group {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.25rem !important;
}

html.dark .fi-resource-servers .fi-ta-actions-cell .fi-ac-btn-action.fi-btn {
    min-height: 1.65rem !important;
    padding: 0.2rem 0.45rem !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

html.dark .fi-resource-servers .fi-ta-actions-cell .fi-ac-btn-action.fi-btn.fi-color-info {
    background: linear-gradient(135deg, #0ea5e9, #3b82f6) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35) !important;
}

html.dark .fi-resource-servers .fi-ta-actions-cell .fi-ac-icon-btn-action {
    width: 1.75rem !important;
    height: 1.75rem !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
}

html.dark .fi-resource-servers .fi-ta-actions-cell .fi-ac-icon-btn-action.fi-color-info {
    background: #1d4ed8 !important;
    color: #fff !important;
    border: 1px solid rgba(147, 197, 253, 0.35) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4) !important;
}

html.dark .fi-resource-servers .fi-ta-actions-cell .fi-ac-icon-btn-action.fi-color-gray {
    background: #334155 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f1f5f9 !important;
}

html.dark .fi-resource-subscriptions .fi-ta-actions-cell .fi-ac-icon-btn-action.fi-color-gray,
html.dark .fi-resource-vpn-accounts .fi-ta-actions-cell .fi-ac-icon-btn-action.fi-color-gray {
    background: #334155 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f1f5f9 !important;
}

html.dark .fi-ta-cell .fi-ta-text-item-description {
    color: #94a3b8 !important;
    font-size: 0.68rem !important;
}

/* Mobile-friendly panel + dashboard */
@media (max-width: 768px) {
    .vpn-dashboard-page .fi-page {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .vpn-dash-header {
        margin-bottom: 1rem;
    }

    .vpn-dash-title {
        font-size: 1.25rem;
    }

    .vpn-dash-subtitle {
        font-size: 0.8rem;
    }

    .vpn-stats.vpn-stats--5 {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.65rem;
    }

    .vpn-stat {
        padding: 0.75rem 0.85rem;
    }

    .vpn-stat-value {
        font-size: 1.25rem;
    }

    .vpn-stat-icon {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        min-height: 2rem;
        font-size: 0.9rem;
    }

    .vpn-grid-2,
    .vpn-grid-3,
    .vpn-grid-main,
    .vpn-grid-main--reseller,
    .vpn-grid-bottom,
    .vpn-grid-bottom--reseller {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    .vpn-grid-main .vpn-card--chart {
        grid-column: auto;
    }

    .vpn-card {
        padding: 0.85rem 1rem;
    }

    .vpn-actions {
        grid-template-columns: 1fr;
    }

    .vpn-chart-wrap {
        height: 200px;
    }

    .vpn-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    html.dark .fi-global-search-field {
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 100% !important;
    }

    html.dark .fi-topbar nav > .ms-auto {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .vpn-stats.vpn-stats--5 {
        grid-template-columns: 1fr !important;
    }

    .vpn-dash .vpn-table-scroll .vpn-table {
        font-size: 0.75rem;
    }

    .vpn-table-scroll .vpn-table {
        min-width: 28rem;
        font-size: 0.75rem;
    }
}

html.dark .fi-sidebar-header .fi-logo {
    gap: 0.65rem !important;
}

html.dark .fi-sidebar-header .fi-logo img {
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25) !important;
}

html.dark .fi-avatar {
    width: 2rem !important;
    height: 2rem !important;
}

