/* ── Base ─────────────────────────────────────────────────────────────────── */
:root {
    --bg-body:     #0e0b1a;
    --bg-sidebar:  #110e20;
    --bg-card:     #1a1630;
    --bg-card2:    #1f1b38;
    --border:      rgba(255,255,255,0.07);
    --purple:      #7c3aed;
    --purple-light:#9d5cf6;
    --red-dark:    #7f1d1d;
    --text-muted:  #8b85a1;
    --text-main:   #e2e0ef;
    --cyan:        #22d3ee;
    --green:       #10b981;
    --yellow:      #f59e0b;
    --pink:        #ec4899;
}

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

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

/* ── Login Page ───────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a0a3e 0%, #2d0a1e 50%, #0a0a1e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(26,22,48,0.9);
    border: 1px solid rgba(124,58,237,0.3);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 80px rgba(124,58,237,0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo svg { width: 56px; height: 56px; fill: var(--purple-light); }

.login-logo h1 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 12px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-label { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }

.form-control-dragon {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-main);
    padding: 12px 16px;
    width: 100%;
    font-size: 14px;
    transition: border-color .2s;
    outline: none;
}

.form-control-dragon:focus {
    border-color: var(--purple);
    background: rgba(124,58,237,0.08);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.form-control-dragon::placeholder { color: rgba(255,255,255,0.25); }

.btn-dragon {
    background: linear-gradient(135deg, var(--purple), #6d28d9);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    width: 100%;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    letter-spacing: .3px;
}

.btn-dragon:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(124,58,237,0.45);
}

.btn-dragon:active { transform: translateY(0); }

.btn-dragon-sm {
    padding: 7px 16px;
    width: auto;
    font-size: 13px;
}

.btn-dragon-outline {
    background: transparent;
    border: 1px solid var(--purple);
    color: var(--purple-light);
}

.btn-dragon-outline:hover { background: rgba(124,58,237,0.15); }

.alert-dragon {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    color: #fca5a5;
    padding: 10px 14px;
    font-size: 13px;
}

.alert-success-dragon {
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.3);
    color: #6ee7b7;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.layout { min-height: 100vh; width: 100%; overflow-x: hidden; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: 250px;
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .25s;
}

.sidebar-brand {
    padding: 20px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand svg { width: 32px; height: 32px; fill: var(--purple-light); flex-shrink: 0; }

.sidebar-brand span {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.sidebar-user {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--purple), #ec4899);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-credits { font-size: 12px; color: var(--yellow); font-weight: 600; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 12px 20px 4px;
}

.nav-link-dragon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #9d99b8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .15s;
}

.nav-link-dragon svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }

.nav-link-dragon:hover {
    color: var(--text-main);
    background: rgba(124,58,237,0.1);
    border-left-color: rgba(124,58,237,0.5);
}

.nav-link-dragon.active {
    color: #fff;
    background: rgba(124,58,237,0.18);
    border-left-color: var(--purple-light);
    font-weight: 600;
}

.nav-sub { padding: 4px 0 8px 46px; display: none; }
.nav-sub.open { display: block; }
.nav-sub a {
    display: block;
    color: #8f89aa;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 7px 0 0 7px;
}
.nav-sub a:hover {
    color: #fff;
    background: rgba(124,58,237,0.12);
}
.nav-link-dragon.has-sub::after { content: '›'; margin-left: auto; font-size: 16px; transition: transform .2s; }
.nav-link-dragon.has-sub.open::after { transform: rotate(90deg); }

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main {
    margin-left: 250px;
    width: calc(100vw - 250px);
    max-width: calc(100vw - 250px);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-body);
    overflow-x: hidden;
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
    background: rgba(17,14,32,0.8);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 50;
}

.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }

.topbar-search-form {
    display: flex;
    align-items: center;
    min-width: 280px;
    max-width: 380px;
    width: 32vw;
    margin-left: 10px;
}

.topbar-search {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px 0 0 8px;
    color: var(--text-main);
    padding: 7px 14px;
    font-size: 13px;
    width: 100%;
    outline: none;
}

.topbar-search:focus { border-color: var(--purple); }

.topbar-search-btn {
    height: 33px;
    width: 38px;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: rgba(255,255,255,0.07);
    color: var(--text-muted);
    cursor: pointer;
}

.topbar-search-btn:hover {
    color: #fff;
    background: rgba(124,58,237,0.22);
}

.topbar-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background .15s;
    white-space: nowrap;
}

.topbar-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.topbar-btn.purple { background: rgba(124,58,237,0.25); border-color: rgba(124,58,237,0.4); color: #c084fc; }
.topbar-btn.purple:hover { background: rgba(124,58,237,0.4); }
.topbar-btn.green { background: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }

.language-trigger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 7px 10px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}

.language-trigger:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
}

.language-trigger-icon {
    font-size: 18px;
    line-height: 1;
}

.account-menu {
    position: relative;
    margin-left: 4px;
}

.account-trigger {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: transparent;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.account-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #4b1f8d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}

.account-online {
    position: absolute;
    right: 0;
    bottom: 1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #00b7ff;
    border: 2px solid #4b1f73;
}

.account-dropdown {
    display: none;
    position: absolute;
    top: 56px;
    right: 0;
    width: 230px;
    background: #4b1f73;
    border: 1px solid rgba(185,132,255,0.24);
    border-radius: 7px;
    box-shadow: 0 22px 55px rgba(0,0,0,0.45);
    overflow: visible;
    z-index: 700;
}

.account-menu.open .account-dropdown {
    display: block;
}

.account-dropdown-arrow {
    position: absolute;
    top: -10px;
    right: 22px;
    width: 20px;
    height: 20px;
    background: #4b1f73;
    border-left: 1px solid rgba(185,132,255,0.24);
    border-top: 1px solid rgba(185,132,255,0.24);
    transform: rotate(45deg);
}

.account-dropdown-head {
    position: relative;
    padding: 19px 18px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.account-dropdown-name {
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 6px;
}

.account-dropdown-balance {
    color: #cdb8e8;
    font-size: 13px;
    font-weight: 700;
}

.account-dropdown-item {
    min-height: 54px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 24px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.account-dropdown-item:last-child {
    border-bottom: none;
}

.account-dropdown-item:hover {
    background: rgba(255,255,255,0.07);
}

.account-dropdown-icon {
    width: 18px;
    height: 18px;
    border: 2px solid #d4c7e8;
    border-radius: 50%;
    color: #d4c7e8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    flex-shrink: 0;
}

/* ── Page Content ─────────────────────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; width: 100%; max-width: 100%; overflow-x: hidden; }

/* ── Stat Cards ───────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; width: 100%; }

@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: .1;
    transform: translate(20px, -20px);
}

.stat-card.cyan::before  { background: var(--cyan); }
.stat-card.green::before { background: var(--green); }
.stat-card.purple::before{ background: var(--purple); }
.stat-card.yellow::before{ background: var(--yellow); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.stat-icon.cyan   { background: rgba(34,211,238,0.15); color: var(--cyan); }
.stat-icon.green  { background: rgba(16,185,129,0.15); color: var(--green); }
.stat-icon.purple { background: rgba(124,58,237,0.15); color: var(--purple-light); }
.stat-icon.yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }

.stat-icon svg { width: 22px; height: 22px; }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; margin-top: 4px; color: #fff; }
.stat-mini { margin-top: 6px; height: 32px; }

/* ── Charts Grid ─────────────────────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 260px); gap: 16px; margin-bottom: 24px; width: 100%; }
@media (max-width: 1000px) { .charts-grid { grid-template-columns: 1fr; } }

.card-dragon {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    min-width: 0;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Bottom Grid ─────────────────────────────────────────────────────────── */
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .bottom-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .bottom-grid { grid-template-columns: 1fr; } }

/* ── Activity Feed ─────────────────────────────────────────────────────────*/
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-dot.green  { background: var(--green); }
.activity-dot.purple { background: var(--purple-light); }
.activity-dot.cyan   { background: var(--cyan); }

.activity-text { font-size: 12.5px; color: var(--text-main); line-height: 1.4; }
.activity-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-dragon {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-dragon th {
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table-dragon td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-main);
    vertical-align: middle;
}

.table-dragon tr:hover td { background: rgba(255,255,255,0.03); }

.badge-dragon {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-dragon.green  { background: rgba(16,185,129,0.2);  color: #6ee7b7; }
.badge-dragon.red    { background: rgba(239,68,68,0.2);   color: #fca5a5; }
.badge-dragon.yellow { background: rgba(245,158,11,0.2);  color: #fcd34d; }
.badge-dragon.blue   { background: rgba(59,130,246,0.2);  color: #93c5fd; }
.badge-dragon.purple { background: rgba(124,58,237,0.2);  color: #c084fc; }
.badge-dragon.gray   { background: rgba(255,255,255,0.08);color: #9ca3af; }

/* ── Profile Overview ───────────────────────────────────────────────────── */
.profile-page {
    margin: -24px;
    min-height: calc(100vh - 60px);
    background: linear-gradient(120deg, #160d32 0%, #4a1430 48%, #b94735 100%);
}

.profile-hero {
    height: 150px;
    background:
        radial-gradient(circle at 50% 20%, rgba(124,58,237,0.42), transparent 34%),
        linear-gradient(105deg, #080720 0%, #1b1643 52%, #090823 100%);
    position: relative;
    overflow: hidden;
}

.profile-network span {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.75);
    box-shadow: 0 0 30px rgba(168,85,247,0.65);
}

.profile-network span:nth-child(1) { left: 28%; top: 54%; }
.profile-network span:nth-child(2) { left: 36%; top: 36%; }
.profile-network span:nth-child(3) { left: 46%; top: 60%; }
.profile-network span:nth-child(4) { left: 58%; top: 30%; }
.profile-network span:nth-child(5) { left: 68%; top: 52%; }

.profile-network::before,
.profile-network::after {
    content: '';
    position: absolute;
    left: 25%;
    top: 52%;
    width: 48%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    transform: rotate(-10deg);
}

.profile-network::after {
    top: 42%;
    transform: rotate(12deg);
}

.profile-strip {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 26px;
    background: rgba(75,31,84,0.5);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.profile-logo {
    width: 62px;
    height: 62px;
    margin-top: -32px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.9);
    background: linear-gradient(135deg, #5b21b6, #22d3ee);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    font-weight: 900;
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}

.profile-name {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 7px;
}

.profile-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 700;
    margin-top: 3px;
}

.profile-dashboard-grid {
    display: grid;
    grid-template-columns: 390px minmax(420px, 1fr) 360px;
    gap: 18px;
    padding: 18px 10px 34px;
}

.profile-left,
.profile-right,
.profile-main {
    min-width: 0;
}

.profile-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-mini-stats {
    background: rgba(26,22,48,0.72);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-mini-stat {
    color: #fff;
    min-height: 42px;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 9px;
    align-items: center;
    text-decoration: none;
    font-weight: 700;
}

.profile-mini-stat::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: block;
}

.profile-mini-stat.purple::before { background: #8b5cf6; }
.profile-mini-stat.cyan::before { background: #06b6d4; }
.profile-mini-stat.red::before { background: #f43f5e; }
.profile-mini-stat.yellow::before { background: #fbbf24; }
.profile-mini-stat.green::before { background: #10b981; }

.profile-mini-stat span {
    color: rgba(255,255,255,0.66);
    display: block;
    font-size: 11px;
    line-height: 1.1;
}

.profile-mini-stat strong {
    display: block;
    color: #fff;
    font-size: 18px;
    line-height: 1.1;
}

.profile-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 12px;
    color: #fff;
}

.profile-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.profile-api-row {
    display: flex;
    gap: 0;
}

.profile-api-row .form-control-dragon {
    border-radius: 6px 0 0 6px;
    font-size: 11px;
}

.profile-eye {
    width: 42px;
    border: 1px solid rgba(255,255,255,0.1);
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: rgba(124,58,237,0.45);
    color: #fff;
    cursor: pointer;
}

.profile-api-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.profile-password-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-table-search {
    max-width: 320px;
    padding: 8px 12px;
}

@media (max-width: 1400px) {
    .profile-dashboard-grid { grid-template-columns: 320px 1fr; }
    .profile-right { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .profile-page { margin: -24px; }
    .profile-dashboard-grid { grid-template-columns: 1fr; padding: 16px; }
    .profile-hero { height: 120px; }
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--purple-light);
    text-transform: uppercase;
    letter-spacing: .6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.form-select-dragon {
    background: rgba(255,255,255,0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239d99b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-main);
    padding: 10px 36px 10px 14px;
    width: 100%;
    appearance: none;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
}

.form-select-dragon:focus { border-color: var(--purple); }
.form-select-dragon option { background: #1a1630; }

/* ── Bouquet Checkboxes ───────────────────────────────────────────────────── */
.bouquet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 700px) { .bouquet-grid { grid-template-columns: repeat(2, 1fr); } }

.bouquet-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.bouquet-item:hover { border-color: rgba(124,58,237,0.5); background: rgba(124,58,237,0.08); }
.bouquet-item input { accent-color: var(--purple-light); cursor: pointer; width: 14px; height: 14px; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,58,237,0.5); }

/* ── Misc ─────────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted-dragon { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* Sparkline mini charts */
canvas.sparkline { display: block; }

/* Pagination */
.pagination-dragon { display: flex; gap: 4px; justify-content: flex-end; margin-top: 16px; }
.pagination-dragon a, .pagination-dragon span {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
}
.pagination-dragon a:hover { background: rgba(124,58,237,0.2); color: #fff; }
.pagination-dragon span.current { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ── Aliases & Utilities ─────────────────────────────────────────────────── */
.dragon-card         { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.dragon-card-header  { padding: 14px 20px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); display: flex; justify-content: space-between; align-items: center; }
.dragon-card-body    { padding: 20px; }
.dragon-table        { width: 100%; border-collapse: collapse; font-size: 13px; }
.dragon-table th     { padding: 10px 14px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); font-weight: 700; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.2); }
.dragon-table td     { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.dragon-table tr:last-child td { border-bottom: none; }
.dragon-table tr:hover td { background: rgba(255,255,255,0.03); }
.table-wrapper       { overflow-x: auto; }
.mono, .font-mono    { font-family: 'Consolas', 'JetBrains Mono', monospace; font-size: 12px; }
.text-muted          { color: var(--text-muted) !important; }
.badge-dragon.purple { background: rgba(124,58,237,0.25); color: #c084fc; }
.badge-dragon.blue   { background: rgba(59,130,246,0.25); color: #93c5fd; }

/* ── Collapsible Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    transition: width .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    width: 250px;
}
.main {
    transition: margin-left .25s cubic-bezier(.4,0,.2,1);
}

/* Collapsed state */
.sidebar.collapsed {
    width: 68px;
}
.layout.sb-collapsed .main {
    margin-left: 68px;
    width: calc(100vw - 68px);
    max-width: calc(100vw - 68px);
}

/* Hide text elements when collapsed */
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-link-dragon span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity .15s, width .15s;
}
.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 20px 0;
}
.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 16px 0;
}
.sidebar.collapsed .nav-link-dragon {
    justify-content: center;
    padding: 11px 0;
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar.collapsed .nav-link-dragon svg {
    opacity: 1;
    width: 20px;
    height: 20px;
}
/* Tooltip on hover in collapsed mode */
.sidebar.collapsed .nav-link-dragon::after {
    display: none !important;
}
.sidebar.collapsed .nav-link-dragon[data-tip] {
    position: relative;
}
.sidebar.collapsed .nav-link-dragon[data-tip]:hover::before {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e1830;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid var(--border);
    z-index: 200;
    pointer-events: none;
}

/* Hamburger toggle button */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: color .15s;
    flex-shrink: 0;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.07); }
.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all .25s;
}

/* Mobile overlay */
@media (max-width: 768px) {
    .sidebar { position: fixed; z-index: 200; transform: translateX(-100%); width: 250px !important; }
    .sidebar.mobile-open { transform: translateX(0); }
    .main { margin-left: 0 !important; width: 100vw !important; max-width: 100vw !important; }
    .sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; }
    .sb-overlay.show { display: block; }
}

/* ── Quick Action Strip ──────────────────────────────────────────────────── */
.quick-strip {
    background: rgba(17,14,32,0.6);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.qbtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
}
.qbtn:hover  { opacity: .85; transform: translateY(-1px); }
.qbtn:active { transform: translateY(0); }
.qbtn.pink   { background: #e91e8c; color: #fff; }
.qbtn.green  { background: #00c875; color: #fff; }
.qbtn.dark   { background: #2d2640; color: #c9c3e0; border: 1px solid var(--border); }
.qbtn.orange { background: #f59e0b; color: #1a1020; }
.qbtn.blue   { background: #2563eb; color: #fff; }
.qbtn.cyan   { background: #05c3fb; color: #fff; }
.qbtn.purple { background: #7c3aed; color: #fff; }
.qbtn.teal   { background: #0d9488; color: #fff; }
.qbtn.red    { background: #e11d48; color: #fff; }

.tvplus-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.tvplus-scroll {
    max-height: 410px;
    overflow: auto;
    padding-right: 4px;
}

.top-country-map {
    height: 170px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 22% 42%, rgba(124,58,237,0.85) 0 5px, transparent 6px),
        radial-gradient(circle at 48% 35%, rgba(34,211,238,0.85) 0 5px, transparent 6px),
        radial-gradient(circle at 68% 48%, rgba(236,72,153,0.85) 0 5px, transparent 6px),
        linear-gradient(140deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.top-country-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.news-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    align-items: start;
}

.news-thumb {
    height: 92px;
    border-radius: 7px;
    background:
        radial-gradient(circle at 30% 35%, rgba(255,255,255,0.85), transparent 11px),
        linear-gradient(135deg, #f59e0b, #ec4899 52%, #7c3aed);
}

.news-card h4 {
    margin: 8px 0 6px;
    color: #fff;
    font-size: 14px;
}

.news-card p {
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.tvplus-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.tvplus-tabs > input {
    display: none;
}

.tvplus-tabs > label {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    border-bottom: 2px solid transparent;
}

.tvplus-tabs > input:checked + label {
    color: #fff;
    border-bottom-color: var(--purple-light);
}

.tvplus-tab-panel {
    display: none;
    width: 100%;
    overflow-x: auto;
    padding-top: 14px;
}

#tab-sub:checked ~ .tab-sub-panel,
#tab-trans:checked ~ .tab-trans-panel,
#tab-actions:checked ~ .tab-actions-panel,
#tab-refund:checked ~ .tab-refund-panel,
#tab-expire:checked ~ .tab-expire-panel {
    display: block;
}

@media (max-width: 1100px) {
    .tvplus-grid-3 { grid-template-columns: 1fr; }
    .topbar-search-form { display: none; }
}

.tvplus-user-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 354px));
    justify-content: center;
    gap: 18px;
    margin-bottom: 24px;
}

.tvplus-user-card {
    min-height: 96px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: grid;
    grid-template-columns: 88px 1fr;
    align-items: center;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.tvplus-user-card::after {
    content: '';
    position: absolute;
    right: -24px;
    top: -24px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    opacity: .13;
}

.tvplus-user-card.primary::after { background: #6c5ffc; }
.tvplus-user-card.success::after { background: #10b981; }
.tvplus-user-card.danger::after { background: #ef4444; }

.tvplus-user-icon {
    width: 70px;
    height: 70px;
    border-radius: 14px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tvplus-user-card.primary .tvplus-user-icon { background: #6c5ffc; }
.tvplus-user-card.success .tvplus-user-icon { background: #10b981; }
.tvplus-user-card.danger .tvplus-user-icon { background: #ef4444; }

.tvplus-summary-user-svg {
    width: 54px;
    height: 54px;
    fill: none;
    stroke: rgba(255,255,255,.96);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,.16));
}

.tvplus-user-card h2 {
    color: #fff;
    font-size: 30px;
    line-height: 1;
    margin: 0 0 8px;
}

.tvplus-user-card h5 {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.tvplus-users-card {
    margin-bottom: 24px;
    border-radius: 6px;
    padding: 0;
    overflow: visible;
    width: 100%;
}

.tvplus-users-card > .card-title {
    padding: 20px 24px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}

.tvplus-users-card > .tvplus-user-filters {
    padding: 22px 24px 0;
}

.tvplus-user-filters {
    display: grid;
    grid-template-columns: 96px minmax(190px, 220px) minmax(190px, 220px) minmax(190px, 220px) minmax(220px, 1fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 22px;
}

.tvplus-user-filters label {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}

.tvplus-search-label {
    justify-self: end;
    width: min(100%, 360px);
}

.tvplus-users-table-wrap {
    min-height: 500px;
    overflow-x: visible;
    display: block;
    width: 100%;
    padding: 0 12px 150px;
}

.tvplus-users-table {
    min-width: 0;
    width: 100%;
    white-space: normal;
    table-layout: fixed;
}

.tvplus-users-table th,
.tvplus-users-table td {
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 700;
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    line-height: 1.25;
    vertical-align: middle;
    overflow-wrap: normal;
    word-break: normal;
}

.tvplus-users-table th {
    color: #fff;
    font-size: 11.5px;
    white-space: normal;
}

.tvplus-users-table th:nth-child(1),
.tvplus-users-table td:nth-child(1) { width: 6.5%; }
.tvplus-users-table th:nth-child(2),
.tvplus-users-table td:nth-child(2) { width: 8%; }
.tvplus-users-table th:nth-child(3),
.tvplus-users-table td:nth-child(3) { width: 8.5%; }
.tvplus-users-table th:nth-child(4),
.tvplus-users-table td:nth-child(4) { width: 7%; }
.tvplus-users-table th:nth-child(5),
.tvplus-users-table td:nth-child(5) { width: 7%; }
.tvplus-users-table th:nth-child(6),
.tvplus-users-table td:nth-child(6) { width: 5.5%; }
.tvplus-users-table th:nth-child(7),
.tvplus-users-table td:nth-child(7) { width: 8%; }
.tvplus-users-table th:nth-child(8),
.tvplus-users-table td:nth-child(8) { width: 8%; }
.tvplus-users-table th:nth-child(9),
.tvplus-users-table td:nth-child(9) { width: 7%; }
.tvplus-users-table th:nth-child(10),
.tvplus-users-table td:nth-child(10) { width: 18%; }
.tvplus-users-table th:nth-child(11),
.tvplus-users-table td:nth-child(11) {
    width: 9%;
    text-align: center;
}
.tvplus-users-table th:nth-child(12),
.tvplus-users-table td:nth-child(12) {
    width: 5.5%;
    min-width: 54px;
    text-align: center;
}

.tvplus-users-table td:nth-child(10) {
    text-align: center;
    overflow-wrap: anywhere;
}

.tvplus-users-table td:nth-child(2),
.tvplus-users-table td:nth-child(3),
.tvplus-users-table td:nth-child(8) {
    overflow-wrap: anywhere;
}

.tvplus-users-table .badge-dragon,
.tvplus-users-table .tvplus-link-btn,
.tvplus-users-table .tvplus-package-btn,
.tvplus-users-table .tvplus-action-trigger {
    white-space: nowrap;
}

.tvplus-users-table tbody tr.tvplus-row-open,
.tvplus-users-table tbody tr:hover {
    background: rgba(91,77,224,0.18);
}

.tvplus-link-btn,
.tvplus-package-btn {
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    padding: 8px 9px;
    line-height: 1;
    max-width: 100%;
}

.tvplus-link-btn {
    background: #0d8bf2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 54px;
}

.tvplus-link-btn span {
    font-size: 10px;
    line-height: 1;
}

.tvplus-link-wrap {
    display: inline-flex;
    position: relative;
}

.tvplus-link-menu {
    display: none;
    position: fixed;
    width: 190px;
    background: #4a2385;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.36);
    z-index: 910;
    overflow: hidden;
    text-align: left;
}

.tvplus-link-menu.open {
    display: block;
}

.tvplus-link-choice {
    width: 100%;
    min-height: 48px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: transparent;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 24px;
    text-align: left;
}

.tvplus-link-choice:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.tvplus-link-choice.my-host {
    color: #facc15;
}

.tvplus-link-choice.xtream-app {
    color: #67e8f9;
}

.tvplus-package-btn {
    background: #4a2385;
}

.tvplus-url-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(8, 7, 32, 0.55);
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.tvplus-url-modal.open {
    display: flex;
}

.tvplus-url-dialog {
    width: min(500px, 100%);
    background: #4a2385;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
    color: #fff;
}

.tvplus-url-title {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    font-size: 15px;
    font-weight: 800;
}

.tvplus-url-icon {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.tvplus-url-body {
    display: grid;
    gap: 10px;
    padding: 26px 20px;
}

.tvplus-url-body label {
    margin-top: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.tvplus-url-body .form-select-dragon,
.tvplus-url-body .form-control-dragon {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.14);
    color: #fff;
}

.tvplus-xtream-copy {
    min-height: 92px;
    resize: vertical;
    line-height: 1.6;
}

.tvplus-url-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 18px 20px;
    background: rgba(0,0,0,0.12);
}

.tvplus-url-footer .qbtn {
    min-width: 82px;
    justify-content: center;
}

.tvplus-package-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(8, 7, 32, 0.62);
    align-items: flex-start;
    justify-content: center;
    padding: 18px;
    overflow-y: auto;
}

.tvplus-package-modal.open {
    display: flex;
}

.tvplus-package-dialog {
    width: min(500px, 100%);
    background: #4a2385;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
    color: #fff;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
}

.tvplus-package-title {
    min-height: 56px;
    display: flex;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    font-size: 15px;
    font-weight: 800;
}

.tvplus-package-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 18px 16px 0;
}

.tvplus-package-tabs button {
    min-height: 46px;
    border: 1px solid rgba(255,255,255,0.12);
    border-bottom-color: rgba(255,255,255,0.18);
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    padding: 12px 18px;
}

.tvplus-package-tabs button.active {
    background: rgba(255,255,255,0.05);
    border-bottom-color: transparent;
}

.tvplus-package-save {
    margin: 14px 16px 22px;
    min-height: 64px;
    background: rgba(36, 119, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.55);
}

.tvplus-package-panel {
    display: none;
    margin: 0 16px 18px;
    background: rgba(25, 15, 45, 0.38);
    border-radius: 6px;
    overflow: hidden;
}

.tvplus-package-panel.active {
    display: block;
}

.tvplus-package-section-head {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}

.tvplus-package-section-title {
    padding: 18px 24px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.tvplus-package-section-head .tvplus-package-section-title {
    padding: 0;
}

.tvplus-package-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.tvplus-package-section-actions .qbtn {
    min-width: 96px;
    justify-content: center;
}

.tvplus-package-list {
    margin: 0 24px 24px;
    border: 1px solid rgba(255,255,255,0.12);
}

.tvplus-package-row {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.84);
    font-size: 13px;
    font-weight: 700;
    padding: 10px 12px;
}

.tvplus-package-row:last-child {
    border-bottom: none;
}

.tvplus-package-row.dragging {
    opacity: .55;
    background: rgba(13, 139, 242, 0.18);
}

.tvplus-package-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    width: 100%;
}

.tvplus-package-row input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.tvplus-package-row input[type="checkbox"]:checked {
    background: #14b8a6;
    border-color: #14b8a6;
}

.tvplus-package-row input[type="checkbox"]:checked::before {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

.tvplus-package-drag {
    width: 20px;
    color: rgba(255,255,255,0.78);
    cursor: grab;
    text-align: center;
}

.tvplus-package-screen {
    width: 15px;
    height: 11px;
    border: 2px solid #facc15;
    border-radius: 1px;
    flex-shrink: 0;
    position: relative;
}

.tvplus-package-screen::after {
    content: '';
    position: absolute;
    left: 4px;
    bottom: -5px;
    width: 5px;
    height: 2px;
    background: #facc15;
}

.tvplus-package-empty {
    padding: 24px;
    color: rgba(255,255,255,0.65);
    text-align: center;
    font-weight: 700;
}

.tvplus-package-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 16px 18px;
}

.tvplus-info-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1210;
    background: rgba(8, 7, 32, 0.58);
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.tvplus-info-modal.open {
    display: flex;
}

.tvplus-info-dialog {
    width: min(375px, 100%);
    background: #4a2385;
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    box-shadow: 0 24px 60px rgba(0,0,0,0.46);
}

.tvplus-info-title {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    font-size: 12px;
    font-weight: 800;
}

.tvplus-info-online {
    margin: 12px;
    min-height: 38px;
    display: flex;
    align-items: center;
    border-radius: 3px;
    background: rgba(34, 211, 238, 0.22);
    color: #14b8a6;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 14px;
}

.tvplus-info-online.offline {
    background: rgba(239,68,68,0.18);
    color: #f43f5e;
}

.tvplus-info-rows {
    border-top: 1px solid rgba(255,255,255,0.10);
}

.tvplus-info-rows > div {
    min-height: 36px;
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.3;
}

.tvplus-info-rows strong {
    color: #fff;
    font-weight: 800;
}

.tvplus-info-rows span {
    color: #fff;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tvplus-info-flag {
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
    border-radius: 2px;
}

.tvplus-country-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    font-weight: 800;
}

.tvplus-country-cell .tvplus-info-flag {
    margin-right: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}

.tvplus-info-meter {
    position: relative;
    display: block;
    height: 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.16);
    overflow: hidden;
}

.tvplus-info-meter i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #67e8f9);
}

.tvplus-info-meter em {
    position: relative;
    display: block;
    z-index: 1;
    color: #fff;
    font-size: 8px;
    font-style: normal;
    font-weight: 900;
    line-height: 12px;
    text-align: center;
}

.tvplus-info-footer {
    min-height: 68px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px;
}

.tvplus-action-cell {
    width: 58px;
    text-align: center;
    overflow: visible !important;
}

.tvplus-action-wrap {
    position: relative;
    display: inline-flex;
}

.tvplus-action-trigger {
    min-width: 42px;
    height: 30px;
    border: 1px solid rgba(124,58,237,0.55);
    border-radius: 4px;
    background: #4a2385;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.tvplus-action-trigger svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.tvplus-action-trigger span {
    font-size: 10px;
    line-height: 1;
}

.tvplus-action-menu {
    display: none;
    position: fixed;
    width: 192px;
    background: #4a2385;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.36);
    z-index: 900;
    overflow: hidden;
    text-align: left;
}

.tvplus-action-menu.open {
    display: block;
}

.tvplus-action-form {
    margin: 0;
}

.tvplus-action-item {
    width: 100%;
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 16px;
    text-decoration: none;
}

.tvplus-action-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.tvplus-menu-icon {
    width: 15px;
    height: 15px;
    color: rgba(255,255,255,0.72);
    flex-shrink: 0;
}

.tvplus-action-item.with-divider {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 5px;
}

.tvplus-action-item.danger {
    color: #ff4d78;
}

.tvplus-action-item.danger .tvplus-menu-icon {
    color: #ff4d78;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 18px;
    align-items: start;
}

.settings-card {
    border-radius: 6px;
}

.settings-form {
    display: grid;
    gap: 12px;
}

.settings-help {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.settings-save {
    width: auto;
    justify-self: start;
    padding-inline: 24px;
}

.settings-preview {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.settings-preview span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-preview strong {
    color: #fff;
    font-size: 16px;
}

.settings-preview-link {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 12px;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.pass-hide {
    color: var(--text-muted);
    cursor: pointer;
    font-family: monospace;
}

@media (max-width: 1100px) {
    .tvplus-user-summary { grid-template-columns: 1fr; }
    .tvplus-user-filters { grid-template-columns: 1fr 1fr; }
    .tvplus-search-label { justify-self: stretch; width: 100%; }
}

@media (max-width: 620px) {
    .tvplus-user-filters { grid-template-columns: 1fr; }
}

.tvplus-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    margin: -8px 0 18px;
}

.tvplus-breadcrumb strong {
    color: var(--text-main);
}

.tvplus-add-page {
    width: 100%;
    max-width: 100%;
}

.tvplus-add-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.tvplus-add-info,
.tvplus-add-side,
.tvplus-add-bouquets > .card-dragon,
.tvplus-submit-card {
    border-radius: 6px;
}

.tvplus-add-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.tvplus-add-fields label,
.tvplus-template-label {
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.tvplus-readonly-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.tvplus-readonly-row .qbtn {
    border: none;
    cursor: pointer;
}

.tvplus-switch-row {
    min-height: 34px;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px !important;
    padding: 8px 0;
}

.material-switch {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.material-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.material-switch span {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 20px;
    transition: .18s;
}

.material-switch span::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    transition: .18s;
}

.material-switch input:checked + span {
    background: #10b981;
    border-color: #10b981;
}

.material-switch input:checked + span::before {
    transform: translateX(22px);
}

.tvplus-notes textarea {
    resize: vertical;
    min-height: 104px;
}

.tvplus-sort-block {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.tvplus-sort-block .qbtn,
.tvplus-list-title .qbtn {
    border: none;
    cursor: pointer;
}

.tvplus-add-side {
    padding: 18px;
}

.tvplus-side-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 13px;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.025);
}

.tvplus-side-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: #fff;
    background: rgba(108,95,252,0.35);
    font-size: 14px;
    font-weight: 800;
}

.tvplus-side-stat strong {
    display: block;
    color: #fff;
    font-size: 15px;
    line-height: 1.2;
}

.tvplus-side-stat small {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

.tvplus-confirm {
    margin-top: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
}

.text-success {
    color: #10b981 !important;
}

.tvplus-submit-card {
    margin-bottom: 16px;
    border-left: 4px solid #ef4444;
}

.card-alert {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 8px;
}

.card-alert:last-child {
    margin-bottom: 0;
}

.alert-danger {
    background: rgba(239,68,68,0.14);
    color: #fecaca;
    border: 1px solid rgba(239,68,68,0.28);
}

.tvplus-add-bouquets {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(250px, 1fr) minmax(300px, 2fr);
    gap: 18px;
    align-items: start;
}

.sort-package-bouquet-layout {
    grid-template-columns: minmax(280px, 380px) minmax(280px, 380px);
    justify-content: start;
}

.sort-package-bouquet-layout .card-dragon {
    min-width: 0;
}

.tvplus-add-bouquets .package_select {
    min-height: 160px;
}

.vod_select.wide {
    grid-column: span 2;
}

.tvplus-list-title {
    gap: 10px;
    align-items: center;
}

.tvplus-list-title > span:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tvplus-dd-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 560px;
    overflow: auto;
}

.tvplus-dd-item {
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.025);
    margin-bottom: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.tvplus-dd-item.pkg-bouquet {
    border-color: rgba(124,58,237,0.35);
    background: rgba(124,58,237,0.07);
}

.drag-handle {
    flex-shrink: 0;
    padding: 8px 6px 8px 10px;
    cursor: grab;
    color: rgba(255,255,255,0.3);
    font-size: 16px;
    line-height: 1;
    user-select: none;
}
.drag-handle:active { cursor: grabbing; }

.drag-ghost {
    opacity: 0.4;
    background: rgba(124,58,237,0.3) !important;
}

.tvplus-dd-item label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px 9px 4px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 12.5px;
    line-height: 1.35;
    flex: 1;
}

.tvplus-dd-item input {
    accent-color: #06b6d4;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.tvplus-empty-list {
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px 4px;
}

@media (max-width: 1180px) {
    .tvplus-add-top,
    .tvplus-add-bouquets {
        grid-template-columns: 1fr;
    }
    .sort-package-bouquet-layout {
        grid-template-columns: 1fr;
    }
    .vod_select.wide {
        grid-column: auto;
    }
}

@media (max-width: 620px) {
    .tvplus-readonly-row {
        grid-template-columns: 1fr;
    }
    .tvplus-list-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 500;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #1a1630;
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: modal-in .2s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: scale(.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
}
.modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: #fff; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.language-modal {
    width: 620px;
    background: #4b1f73;
    border: 1px solid rgba(185,132,255,0.24);
    border-radius: 2px;
    box-shadow: 0 28px 70px rgba(0,0,0,0.45);
}

.language-modal .modal-body {
    background: #4b1f73;
    padding: 34px 24px 36px;
}

.language-modal-header {
    background: #4b1f73;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 700;
}

.language-modal-header .modal-close {
    color: rgba(255,255,255,0.42);
    font-size: 28px;
    font-weight: 700;
}

.language-modal-header .modal-close:hover {
    color: #fff;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 30px;
    align-items: stretch;
}

.language-option {
    min-height: 62px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: background .15s, border-color .15s, transform .12s;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    width: 100%;
}

.language-option:hover,
.language-option.active {
    background: rgba(255,255,255,0.06);
    border-color: rgba(185,132,255,0.55);
}

.language-option:hover {
    transform: translateY(-1px);
}

.language-flag {
    width: 34px;
    height: 24px;
    display: inline-block;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.16);
}

.flag-gb {
    background:
        linear-gradient(33deg, transparent 42%, #fff 42%, #fff 48%, #c8102e 48%, #c8102e 54%, #fff 54%, #fff 60%, transparent 60%),
        linear-gradient(-33deg, transparent 42%, #fff 42%, #fff 48%, #c8102e 48%, #c8102e 54%, #fff 54%, #fff 60%, transparent 60%),
        linear-gradient(90deg, transparent 42%, #fff 42%, #fff 58%, transparent 58%),
        linear-gradient(0deg, transparent 36%, #fff 36%, #fff 64%, transparent 64%),
        linear-gradient(90deg, transparent 46%, #c8102e 46%, #c8102e 54%, transparent 54%),
        linear-gradient(0deg, transparent 42%, #c8102e 42%, #c8102e 58%, transparent 58%),
        #012169;
}

.flag-sa {
    background:
        linear-gradient(#0a8f3c, #0a8f3c);
    position: relative;
}

.flag-sa::before {
    content: '';
    position: absolute;
    left: 9px;
    right: 8px;
    bottom: 6px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.flag-sa::after {
    content: '';
    position: absolute;
    left: 11px;
    right: 11px;
    top: 8px;
    height: 4px;
    border-top: 2px solid #fff;
    border-bottom: 2px solid #fff;
    opacity: .95;
}

.flag-fr {
    background: linear-gradient(90deg, #0055a4 0 33.33%, #fff 33.33% 66.66%, #ef4135 66.66%);
}

.flag-es {
    background: linear-gradient(#aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%);
}

.flag-pt {
    background: linear-gradient(90deg, #006600 0 40%, #ff0000 40%);
    position: relative;
}

.flag-pt::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffcc00;
}

@media (max-width: 620px) {
    .language-grid { grid-template-columns: 1fr; }
    .language-trigger [data-language-label] { display: none; }
}

/* ── Stats page charts ───────────────────────────────────────────────────── */
.stats-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 900px) { .stats-chart-grid { grid-template-columns: 1fr; } }

/* ── Page Header Row (title + quick actions side by side) ─────────────────── */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}
.page-header-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    white-space: nowrap;
}
.quick-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* Upload TV modal */
.uptv-dialog { max-width: 480px; width: 100%; }
.uptv-apps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 20px 24px 10px;
}
.uptv-app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .12s;
    background: var(--card2);
    text-align: center;
}
.uptv-app-card:hover {
    border-color: var(--purple-light);
    background: rgba(139,92,246,.08);
    transform: translateY(-2px);
}
.uptv-app-card.is-pending {
    opacity: .62;
}
.uptv-app-card.is-pending:hover {
    border-color: var(--border-color);
    background: var(--card2);
    transform: none;
}
.uptv-app-card.selected {
    border-color: var(--purple);
    background: rgba(139,92,246,.18);
}
.uptv-app-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.uptv-app-name { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.uptv-app-sub  { font-size: 10px; color: var(--text-muted); }
#uptv-next-btn:not(:disabled) { opacity: 1 !important; cursor: pointer !important; }

/* Upload TV — Step 2 form modal */
.uptv-form-dialog { max-width: 400px; width: 100%; }
.uptv-form-body { padding: 0 24px 8px; }
.uptv-form-logo {
    display: flex;
    justify-content: center;
    margin: 16px 0 12px;
}
.uptv-form-logo svg { border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.uptv-form-steps {
    padding-left: 20px;
    margin: 0 0 16px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.7;
}
.uptv-form-steps strong { color: var(--purple-light); }
.uptv-form-field { margin-bottom: 12px; }
.uptv-form-field .form-label-dragon { margin-bottom: 5px; display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* App picker card — real image logos */
.uptv-app-icon img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; display: block; }
.uptv-app-icon { background: none; box-shadow: none; width: auto; height: auto; padding: 4px; }

/* ── Dashboard TVPLUS visual sizing ─────────────────────────────────────── */
.page-content:has(#subChart) {
    margin: -24px;
    padding: 30px;
    min-height: calc(100vh - 60px);
}

.page-content:has(#subChart) .page-header-row {
    margin-bottom: 28px;
}

.page-content:has(#subChart) .page-header-title {
    font-size: 24px;
    color: #fff;
}

.page-content:has(#subChart) .quick-actions {
    gap: 4px;
}

.page-content:has(#subChart) .qbtn {
    min-height: 33px;
    padding: 8px 11px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none;
}

.page-content:has(#subChart) .stats-grid {
    gap: 26px;
    margin-bottom: 26px;
}

.page-content:has(#subChart) .stat-card,
.page-content:has(#subChart) .stat-card {
    min-height: 132px;
    padding: 28px 26px;
    justify-content: space-between;
}

.page-content:has(#subChart) .stat-card::before {
    display: none;
}

.page-content:has(#subChart) .stat-info {
    order: 1;
}

.page-content:has(#subChart) .stat-icon {
    order: 2;
    width: 96px;
    height: 58px;
    border-radius: 0;
    background: transparent;
    opacity: .95;
}

.page-content:has(#subChart) .stat-icon svg {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 8px currentColor);
}

.page-content:has(#subChart) .stat-label {
    color: #fff;
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 700;
}

.page-content:has(#subChart) .stat-value {
    margin-top: 8px;
    font-size: 32px;
    line-height: 1;
}

.page-content:has(#subChart) .charts-grid {
    grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr);
    gap: 26px;
    margin-bottom: 28px;
}

.page-content:has(#subChart) .charts-grid > .card-dragon {
    min-height: 420px;
    padding: 0;
    overflow: hidden;
}

.page-content:has(#subChart) .card-title {
    min-height: 64px;
    margin: 0;
    padding: 20px 26px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 18px;
    color: #fff;
}

.page-content:has(#subChart) .charts-grid canvas {
    width: 100% !important;
    height: 335px !important;
    padding: 20px 26px 24px;
}

.page-content:has(#subChart) #vendorChart {
    height: 335px !important;
    padding: 22px 26px 30px;
}

.vendor-pie-wrap {
    height: 290px;
    padding: 18px 24px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vendor-pie {
    width: min(100%, 290px);
    height: auto;
    display: block;
    overflow: visible;
}

.vendor-pie path,
.vendor-pie circle {
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.vendor-pie text {
    fill: #fff;
    font-size: 14px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
    paint-order: stroke;
    stroke: rgba(0,0,0,.55);
    stroke-width: 3px;
}

.vendor-pie-legend {
    display: grid;
    gap: 8px;
    padding: 0 24px 22px;
}

.vendor-pie-legend-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    color: var(--text-main);
    font-size: 12px;
}

.vendor-pie-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255,255,255,.08);
}

.vendor-pie-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.vendor-pie-value {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.page-content:has(#subChart) .bottom-grid,
.page-content:has(#subChart) .tvplus-grid-3 {
    gap: 26px;
}

.page-content:has(#subChart) .tvplus-grid-3 {
    margin-top: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.page-content:has(#subChart) .tvplus-grid-3 > .card-dragon {
    min-height: 336px;
    padding: 0;
    overflow: hidden;
}

.page-content:has(#subChart) .tvplus-grid-3 > .card-dragon > :not(.card-title) {
    margin: 22px 26px;
}

.page-content:has(#subChart) .tvplus-scroll {
    max-height: 255px;
}

.page-content:has(#subChart) .activity-item {
    padding: 13px 0;
    border-bottom: 0;
}

.page-content:has(#subChart) .activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-top: 5px;
}

.page-content:has(#subChart) .activity-text {
    font-size: 15px;
    font-weight: 700;
}

.page-content:has(#subChart) .activity-meta {
    font-size: 14px;
    color: rgba(255,255,255,.68);
}

.page-content:has(#subChart) .top-country-map {
    height: 218px;
    border: 0;
    border-radius: 0;
    background: transparent;
    opacity: 1;
    overflow: hidden;
}

.page-content:has(#subChart) .top-country-map .jvm-container {
    background: transparent !important;
}

.page-content:has(#subChart) .top-country-map svg {
    max-width: 100%;
    height: 100%;
}

.jvm-tooltip {
    background: rgba(25,31,38,.95);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    padding: 5px 8px;
}

.page-content:has(#subChart) .top-country-tabs {
    margin: 18px 0;
}

.page-content:has(#subChart) .top-country-tabs .qbtn {
    min-height: 41px;
    padding: 10px 17px;
}

.page-content:has(#subChart) .news-card {
    grid-template-columns: 120px 1fr;
    align-items: center;
}

.page-content:has(#subChart) .news-thumb {
    height: 104px;
}

.page-content:has(#subChart) .news-card h4 {
    font-size: 20px;
    line-height: 1.1;
}

.page-content:has(#subChart) .news-card p {
    font-size: 15px;
    color: rgba(255,255,255,.7);
}

.page-content:has(#subChart) .dashboard-log-news-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 26px;
    align-items: stretch;
    margin-top: 28px;
}

.page-content:has(#subChart) .dashboard-channel-country-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    align-items: stretch;
    margin-top: 28px;
}

.page-content:has(#subChart) .dashboard-channel-country-row > .card-dragon {
    min-height: 360px;
    padding: 0;
    overflow: hidden;
}

.page-content:has(#subChart) .dashboard-channel-country-row .top-channels-card {
    padding: 0 26px 32px !important;
}

.page-content:has(#subChart) .dashboard-activity-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
    margin-top: 28px;
}

.page-content:has(#subChart) .dashboard-activity-row > .card-dragon {
    min-height: 336px;
    padding: 0;
    overflow: hidden;
}

.page-content:has(#subChart) .dashboard-activity-row > .card-dragon > :not(.card-title) {
    margin: 22px 26px;
}

.page-content:has(#subChart) .top-channels-card {
    margin-top: 0 !important;
    padding: 0 26px 32px !important;
}

.page-content:has(#subChart) .top-channels-card .top-channel-filter {
    height: 34px;
    margin: 18px 0 0;
    padding: 7px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 3px;
    color: #14212c;
    font-size: 15px;
}

.page-content:has(#subChart) .top-channel-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,.9);
    color: #122232;
    font-size: 14px;
}

.page-content:has(#subChart) .top-channel-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(15,23,42,.08);
    vertical-align: middle;
}

.page-content:has(#subChart) .top-channel-table td:first-child {
    overflow-wrap: anywhere;
}

.page-content:has(#subChart) .top-channel-table td:last-child {
    width: 70px;
    text-align: center;
    font-weight: 700;
}

.page-content:has(#subChart) .dashboard-log-news-row #news-feed {
    min-height: 320px;
    padding: 0;
    overflow: hidden;
}

.page-content:has(#subChart) .dashboard-log-news-row #news-feed .news-card {
    margin: 26px 32px;
}

.page-content:has(#subChart) .tvplus-tabs {
    justify-content: flex-end;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.page-content:has(#subChart) .tvplus-tabs > label {
    padding: 16px 22px;
    color: #fff;
    border-bottom: 0;
    background: transparent;
    font-size: 16px;
}

.page-content:has(#subChart) .tvplus-tabs > input:checked + label {
    background: rgba(0,0,0,.22);
    border-bottom: 0;
}

.page-content:has(#subChart) .table-dragon {
    margin-top: 26px;
    border: 1px solid rgba(255,255,255,.1);
}

.page-content:has(#subChart) .table-dragon th,
.page-content:has(#subChart) .table-dragon td {
    padding: 14px;
    border-color: rgba(255,255,255,.08);
}

@media (max-width: 1180px) {
    .page-content:has(#subChart) .charts-grid,
    .page-content:has(#subChart) .tvplus-grid-3,
    .page-content:has(#subChart) .dashboard-log-news-row,
    .page-content:has(#subChart) .dashboard-channel-country-row,
    .page-content:has(#subChart) .dashboard-activity-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-content:has(#subChart) {
        margin: -16px;
        padding: 18px;
    }

    .page-content:has(#subChart) .stats-grid {
        gap: 14px;
    }

    .page-content:has(#subChart) .stat-card {
        min-height: 112px;
        padding: 20px;
    }

    .page-content:has(#subChart) .charts-grid > .card-dragon {
        min-height: 340px;
    }

    .page-content:has(#subChart) .charts-grid canvas,
    .page-content:has(#subChart) #vendorChart {
        height: 260px !important;
    }
}

/* Dashboard channel/country cards */
.dashboard-channel-country-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
}
