/* User dash + shared portal nav (docs + profile) */
.dash-root,
.portal-topbar {
    --dash-bg: #0c0e1c;
    --dash-bg2: rgba(20, 22, 40, 0.92);
    --dash-border: rgba(255, 255, 255, 0.08);
    --dash-accent: #5865f2;
    --dash-accent-h: #4752c4;
    --dash-text: #dcddde;
    --dash-muted: #72767d;
    --dash-green: #57f287;
    --dash-yellow: #fee75c;
    --dash-red: #ed4245;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.dash-root {
    margin: 0;
    min-height: 100vh;
    background: var(--dash-bg);
    color: var(--dash-text);
}

.portal-topbar {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--dash-border);
    background: rgba(12, 14, 28, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-topbar-left,
.portal-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.portal-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: min(280px, 48vw);
    padding: 3px 10px 3px 3px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    min-width: 0;
}

.portal-user-chip .portal-avatar {
    width: 26px;
    height: 26px;
    margin-right: 8px;
    flex-shrink: 0;
}

.portal-user-paid,
.portal-user-badge {
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.portal-user-badge--paid,
.portal-user-paid {
    background: rgba(87, 242, 135, 0.16);
    color: var(--dash-green);
}

.portal-user-badge--free {
    background: rgba(255, 255, 255, 0.06);
    color: var(--dash-muted);
}

.portal-user-badge--admin {
    background: rgba(237, 66, 69, 0.18);
    color: #fca5a5;
}

.portal-user-badge--tester {
    background: rgba(254, 231, 92, 0.14);
    color: var(--dash-yellow);
}

.portal-brand {
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
}

.portal-nav {
    display: flex;
    gap: 6px;
}

.portal-nav-link {
    color: var(--dash-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}

.portal-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.portal-nav-link.active {
    color: #fff;
    background: rgba(88, 101, 242, 0.22);
}

.portal-logout {
    color: var(--dash-accent);
}

.portal-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
/* Аватар с буквой-фолбэком: если фото VK не загрузилось (протухшая ссылка),
   <img> удаляется через onerror и остаётся кружок с инициалом. */
.portal-avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #5865f2, #eb459e);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    text-transform: uppercase;
    object-fit: cover;
}
.portal-avatar-wrap::before { content: attr(data-letter); }
.portal-avatar-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.portal-user-name {
    font-size: 13px;
    color: var(--dash-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.dash-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dash-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--dash-bg2);
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.dash-auth-badge {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dash-auth-badge-docs {
    background: rgba(109, 124, 255, 0.14);
    color: #aeb4ff;
}

.dash-auth-badge-premium {
    background: rgba(87, 242, 135, 0.12);
    color: var(--dash-green);
}

.dash-auth-card h1,
.dash-denied-title {
    color: #fff;
    font-size: 22px;
    margin: 0 0 12px;
}

.dash-auth-card p {
    color: var(--dash-muted);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 14px;
}

.dash-auth-hint a:not(.dash-btn),
.dash-auth-card a:not(.dash-btn) {
    color: var(--dash-accent);
}

.dash-auth-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.dash-auth-card a.dash-btn-primary {
    color: #fff;
}

.dash-auth-card a.dash-btn-soft,
.dash-auth-card a.dash-btn-ghost {
    color: var(--dash-text);
}

.dash-auth-error {
    color: var(--dash-red);
}

.dash-auth-actions,
.dash-auth-card .dash-btn {
    margin-top: 10px;
}

.dash-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .1s;
}

.dash-btn-primary {
    width: 100%;
    background: var(--dash-accent);
    color: #fff;
}

.dash-btn-primary:hover {
    background: var(--dash-accent-h);
}

.dash-btn-ghost {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--dash-text);
    border: 1px solid var(--dash-border);
    margin-top: 10px;
}

.dash-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dash-btn-soft {
    width: auto;
    margin-top: 0;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--dash-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--dash-text);
    font-size: 12px;
    font-weight: 600;
}

.dash-btn-soft:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(109, 124, 255, 0.28);
    color: #fff;
}

.dash-btn-soft:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dash-btn-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.dash-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.dash-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--dash-bg2);
    border: 1px solid var(--dash-border);
    border-radius: 16px;
}

.dash-hero-main {
    display: flex;
    gap: 16px;
    align-items: center;
    min-width: 0;
}

.dash-hero-text {
    min-width: 0;
    flex: 1;
}

.dash-hero-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.dash-hero-title h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.dash-hero-title .portal-user-badge,
.dash-hero-title .portal-user-paid {
    margin-left: 0;
    font-size: 11px;
    padding: 3px 9px;
}

.dash-hero-title .dash-badge {
    font-size: 11px;
    padding: 3px 9px;
}

.dash-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
}

.dash-hero-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 101, 242, 0.25);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
}

.dash-hero h1 {
    margin: 0 0 4px;
    font-size: 26px;
    color: #fff;
}

.dash-hero-sub {
    margin: 0;
    color: var(--dash-muted);
    font-size: 13px;
    line-height: 1.4;
}

.dash-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.dash-badge-paid {
    background: rgba(87, 242, 135, 0.12);
    color: var(--dash-green);
}

.dash-badge-premium {
    background: rgba(87, 242, 135, 0.1);
    color: #86efac;
}

.dash-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px 10px 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 4px;
}

.dash-user-chip h1 {
    margin: 0;
    font-size: 26px;
    color: #fff;
    line-height: 1.1;
}

.dash-user-chip .portal-user-badge,
.dash-user-chip .portal-user-paid {
    margin-left: 8px;
    font-size: 11px;
    padding: 3px 8px;
}

.dash-badge-status {
    background: rgba(88, 101, 242, 0.18);
    color: #aeb4ff;
}

.dash-badge-employee {
    background: rgba(254, 231, 92, 0.12);
    color: var(--dash-yellow);
}

.dash-badge-ok {
    background: rgba(87, 242, 135, 0.1);
    color: var(--dash-green);
}

.dash-badge-ban {
    background: rgba(237, 66, 69, 0.12);
    color: var(--dash-red);
}

.hwid-code-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.hwid-code-full {
    flex: 1;
    min-width: 0;
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--dash-border);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #b9bbfe;
    word-break: break-all;
}

.hwid-change-bar {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hwid-change-bar input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--dash-border);
    background: rgba(0, 0, 0, 0.22);
    color: var(--dash-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
}

.hwid-change-bar input:focus {
    outline: none;
    border-color: rgba(88, 101, 242, 0.45);
}

.hwid-form-msg {
    margin: 10px 0 0;
    font-size: 13px;
}

.hwid-form-err {
    color: var(--dash-red);
}

@media (max-width: 640px) {
    .hwid-code-row {
        flex-direction: column;
    }

    .hwid-change-bar {
        flex-direction: column;
    }

    .hwid-change-bar .dash-btn-inline {
        width: 100%;
    }
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dash-card {
    background: var(--dash-bg2);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    padding: 20px;
}

.dash-card-wide {
    grid-column: 1 / -1;
}

.dash-card h2 {
    margin: 0 0 14px;
    font-size: 15px;
    color: #fff;
}

.dash-dl {
    margin: 0;
}

.dash-dl > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dash-dl > div:last-child {
    border-bottom: none;
}

.dash-dl dt {
    color: var(--dash-muted);
    font-size: 13px;
}

.dash-dl dd {
    margin: 0;
    text-align: right;
    font-size: 13px;
    color: #fff;
    word-break: break-word;
}

.dash-dl a {
    color: var(--dash-accent);
}

.dash-dl-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.dash-dl-grid > div {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-dl-grid dt {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-dl-grid dd {
    text-align: left;
    margin-left: 0;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
}

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

@media (max-width: 640px) {
    .dash-dl-grid {
        grid-template-columns: 1fr;
    }
}

.dash-scroll,
.dash-feed {
    scrollbar-width: thin;
    scrollbar-color: rgba(109, 124, 255, 0.28) transparent;
}

.dash-scroll::-webkit-scrollbar,
.dash-feed::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.dash-scroll::-webkit-scrollbar-track,
.dash-feed::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.dash-scroll::-webkit-scrollbar-thumb,
.dash-feed::-webkit-scrollbar-thumb {
    background: rgba(109, 124, 255, 0.28);
    border-radius: 999px;
}

.dash-scroll::-webkit-scrollbar-thumb:hover,
.dash-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(109, 124, 255, 0.45);
}

.dash-muted {
    color: var(--dash-muted);
    font-weight: 400;
}

.dash-hwid-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-hwid-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.dash-hwid-item code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #aeb4ff;
}

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

.dash-section {
    margin-top: 20px;
}

/* ── HWID journal (bans + API feeds) ── */
.dash-journal {
    padding: 16px 18px;
}

.dash-journal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

.dash-journal-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.dash-journal-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.12);
}

.dash-journal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dash-journal-grid:not(.dash-journal-grid-single) .dash-journal-block + .dash-journal-block {
    padding-left: 14px;
    border-left: none;
}

.dash-journal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
    min-height: 24px;
}

.dash-journal-toolbar {
    height: 82px;
    min-height: 82px;
    max-height: 82px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.dash-journal-head h2 {
    margin: 0;
    font-size: 14px;
    color: #fff;
}

.dash-journal-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--dash-muted);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

.dash-hwid-hint,
.dash-journal-desc {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--dash-muted);
}

.dash-journal-desc {
    margin: 0;
    min-height: 34px;
    max-height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dash-feed-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.dash-feed-filter-btn {
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--dash-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dash-feed-filter-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.dash-feed-filter-btn.active {
    color: #fff;
    background: rgba(109, 124, 255, 0.2);
    border-color: rgba(109, 124, 255, 0.35);
}

.dash-feed-reason {
    color: #e8eaed;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 2px;
}

.dash-feed {
    list-style: none;
    margin: 0;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1 1 auto;
    min-height: 320px;
    height: min(360px, 38vh);
    max-height: min(360px, 38vh);
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.18);
}

.dash-feed-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 12px;
    align-items: start;
    min-height: 52px;
}

.dash-feed-row-neutral .dash-feed-marker {
    background: rgba(109, 124, 255, 0.75);
    box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.12);
}

.dash-feed-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    background: var(--dash-muted);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.dash-feed-row-ban .dash-feed-marker {
    background: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.dash-feed-row-ok .dash-feed-marker {
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.dash-feed-main {
    min-width: 0;
}

.dash-feed-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.dash-feed-dot-sep {
    color: rgba(255, 255, 255, 0.18);
    font-size: 12px;
    user-select: none;
}

.dash-feed-line strong,
.dash-feed-line .dash-feed-status {
    font-size: 13px;
    color: #fff;
    font-weight: 600;
}

.dash-feed-line .dash-feed-status-confirmed,
.dash-feed-line .dash-feed-status-ok,
.dash-feed-line .dash-feed-status-success {
    color: #6ee7b7;
}

.dash-feed-line .dash-feed-status-refused,
.dash-feed-line .dash-feed-status-denied,
.dash-feed-line .dash-feed-status-error,
.dash-feed-line .dash-feed-status-fail {
    color: #fca5a5;
}

.dash-feed-muted {
    color: var(--dash-muted);
    font-size: 12px;
    white-space: nowrap;
}

.dash-feed-time {
    font-variant-numeric: tabular-nums;
}

.dash-feed-row + .dash-feed-row {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.dash-feed-sub {
    margin-top: 4px;
    min-height: 16px;
    font-size: 12px;
    color: var(--dash-muted);
    line-height: 1.45;
    word-break: break-word;
}

.dash-feed-sep {
    margin: 0 6px;
    color: var(--dash-muted);
}

.dash-feed-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--dash-muted);
}

.dash-feed-tags span {
    font-size: 11px;
}

.dash-feed-tags .dash-mono {
    color: #c4b5fd;
}

.dash-feed-status {
    font-size: 12px;
    font-weight: 600;
}

.dash-feed-status-confirmed,
.dash-feed-status-ok,
.dash-feed-status-success {
    color: #6ee7b7;
}

.dash-feed-status-refused,
.dash-feed-status-denied,
.dash-feed-status-error,
.dash-feed-status-fail {
    color: #fca5a5;
}

.dash-feed-status-unknown,
.dash-feed-status-pending {
    color: var(--dash-muted);
}

.dash-feed-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.dash-feed-pill-confirmed,
.dash-feed-pill-ok,
.dash-feed-pill-success {
    background: rgba(52, 211, 153, 0.14);
    color: #6ee7b7;
}

.dash-feed-pill-refused,
.dash-feed-pill-denied,
.dash-feed-pill-error,
.dash-feed-pill-fail {
    background: rgba(248, 113, 113, 0.14);
    color: #fca5a5;
}

.dash-feed-pill-unknown,
.dash-feed-pill-pending {
    background: rgba(255, 255, 255, 0.08);
    color: var(--dash-muted);
}

.dash-feed-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--dash-muted);
    font-size: 13px;
}

.dash-feed-line-compact {
    font-size: 12px;
    line-height: 1.45;
}

.dash-feed-line-compact .dash-mono {
    font-size: 11px;
}

.dash-feed-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    min-height: 38px;
}

.dash-feed-pager[hidden] {
    display: none !important;
}

.dash-feed-page-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--dash-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dash-feed-page-nav {
    min-width: auto;
    padding: 0 10px;
    font-size: 11px;
}

.dash-feed-page-info {
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--dash-muted);
    white-space: nowrap;
}

.portal-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--dash-muted);
}

.portal-refresh-btn:hover {
    color: #fff;
}

.portal-refresh-btn svg {
    display: block;
}

.dash-feed-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.dash-feed-page-btn.active {
    background: rgba(109, 124, 255, 0.2);
    border-color: rgba(109, 124, 255, 0.35);
    color: #fff;
}

.dash-feed-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.dash-feed-row[hidden] {
    display: none;
}

.dash-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.dash-section-head h2 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.dash-section-desc {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--dash-muted);
    width: 100%;
}

.dash-section-tools {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-btn-inline {
    width: auto;
    margin-top: 0;
    padding: 8px 14px;
    font-size: 12px;
}

.dash-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--dash-border);
}

.dash-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.dash-data-table th,
.dash-data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-data-table th {
    color: var(--dash-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-table-empty {
    text-align: center;
    color: var(--dash-muted);
    padding: 24px !important;
}

/* ── Profile stats hub (Онлайн | KPD tabs) ── */
.dash-stats-hub {
    padding: 18px 20px 20px;
}

.dash-stats-head {
    margin-bottom: 16px;
}

.dash-stats-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
}

.dash-stats-tab {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--dash-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 11px 16px;
    border-radius: 9px;
    cursor: pointer;
    text-align: center;
    transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dash-stats-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.dash-stats-tab.active {
    color: #fff;
    background: rgba(109, 124, 255, 0.22);
    box-shadow: inset 0 0 0 1px rgba(109, 124, 255, 0.28);
}

.dash-stats-panel {
    display: none;
}

.dash-stats-panel.active {
    display: block;
}

.dash-stats-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash-stats-subbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

/* ── Profile analytics (legacy aliases) ── */
.dash-analytics {
    padding: 18px 20px;
}

.dash-analytics-head {
    margin-bottom: 14px;
}

.dash-analytics-head h2 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.dash-analytics-desc {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--dash-muted);
}

.dash-analytics-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dash-muted);
    margin-bottom: 6px;
}

.dash-analytics-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    align-items: flex-end;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-analytics-toolbar-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-analytics-subbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 12px;
}

.dash-analytics-subbar-kpd {
    align-items: flex-start;
}

.dash-analytics-subbar-kpd .dash-analytics-label {
    margin: 8px 0 0;
    flex-shrink: 0;
}

#hubKpd .kpd-date-bar {
    margin-bottom: 0;
    padding: 4px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.kpd-hub-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.kpd-export-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.kpd-export-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kpd-export-label {
    font-size: 11px;
    color: var(--dash-muted);
    white-space: nowrap;
}

.kpd-role-bar {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.kpd-role-btn {
    min-height: 32px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--dash-muted);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.kpd-role-btn:hover {
    color: var(--dash-text);
}

.kpd-role-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dash-text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.kpd-export-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1;
}

.kpd-export-actions .dash-btn-inline {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
}

.dash-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(15, 16, 30, 0.96);
    border: 1px solid rgba(167, 139, 250, 0.35);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    transition: opacity 0.2s, transform 0.2s;
}

.dash-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.kpd-file-stub {
    position: fixed;
    left: 50%;
    bottom: 72px;
    transform: translateX(-50%);
    z-index: 1200;
    display: flex;
    align-items: stretch;
    max-width: min(92vw, 420px);
    border-radius: 14px;
    background: rgba(18, 18, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    animation: kpdStubIn 0.2s ease;
}

.kpd-file-stub--done {
    border-color: rgba(87, 242, 135, 0.35);
}

.kpd-file-stub--draggable {
    cursor: grab;
    border-color: rgba(88, 101, 242, 0.45);
    user-select: none;
}

.kpd-file-stub--draggable:active {
    cursor: grabbing;
}

.kpd-file-stub-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.kpd-file-stub--error {
    border-color: rgba(237, 66, 69, 0.35);
}

@keyframes kpdStubIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.kpd-file-stub-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    flex: 1;
    min-width: 0;
}

.kpd-file-stub-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--dash-accent, #5865f2);
    border-radius: 50%;
    flex-shrink: 0;
    animation: kpdStubSpin 0.7s linear infinite;
}

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

.kpd-file-stub-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kpd-file-stub-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--dash-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpd-file-stub-hint {
    font-size: 11px;
    color: var(--dash-muted);
}

#hubKpd .kpd-live-detail {
    margin-top: 0;
}

.dash-analytics-table {
    min-height: 200px;
}

/* Online chart (profile) */
.online-metric-bar,
.online-period-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.online-metric-btn,
.online-period-btn {
    border: none;
    background: transparent;
    color: var(--dash-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 11px;
    border-radius: 7px;
    cursor: pointer;
}

.online-metric-btn:hover,
.online-period-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.online-metric-btn.active {
    background: rgba(52, 211, 153, 0.16);
    color: #34d399;
}

.online-period-btn.active {
    background: rgba(167, 139, 250, 0.18);
    color: #e9d5ff;
}

.online-view-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin: 0;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: fit-content;
    flex-shrink: 0;
}

.online-view-tab {
    border: none;
    background: transparent;
    color: var(--dash-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 7px;
    cursor: pointer;
}

.online-view-tab.active {
    background: rgba(167, 139, 250, 0.18);
    color: #e9d5ff;
}

.online-view-panel { display: none; }
.online-view-panel.active { display: block; margin-top: 4px; }

.online-chart-meta {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--dash-muted);
    text-align: right;
    flex: 1;
    min-width: 180px;
}

.online-chart-meta strong { color: #c4b5fd; font-weight: 600; }
.online-chart-meta span { color: #fff; font-weight: 600; }

.online-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.online-summary-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 58px;
}

.online-summary-skeleton .value {
    color: var(--dash-muted);
    opacity: 0.5;
}

.online-summary-item .label {
    font-size: 10px;
    color: var(--dash-muted);
    text-transform: uppercase;
}

.online-summary-item .value {
    font-size: 16px;
    font-weight: 700;
    margin-top: 4px;
}

.online-chart-wrap {
    position: relative;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    min-height: 240px;
}

.online-chart-wrap svg {
    display: block;
    width: 100%;
    height: 220px;
    pointer-events: none;
}

.online-chart-tooltip {
    position: absolute;
    display: none;
    pointer-events: none;
    z-index: 5;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 16, 30, 0.96);
    border: 1px solid rgba(167, 139, 250, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    font-size: 12px;
}

.online-chart-tip-date { color: var(--dash-muted); margin-bottom: 4px; }
.online-chart-tip-val { display: flex; align-items: center; gap: 8px; }
.online-chart-tip-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #a78bfa;
}

.online-chart-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dash-muted);
    font-size: 13px;
}

.online-sessions-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.online-sessions-toolbar input[type="date"] {
    flex: 1 1 180px;
    min-width: 0;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--dash-border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--dash-text);
    font-size: 12px;
    color-scheme: dark;
}

.online-sessions-toolbar input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.72;
}

.online-sessions-toolbar .dash-btn {
    flex: 0 0 auto;
    min-height: 40px;
}

/* KPD */
.kpd-date-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0;
    min-height: 0;
    align-items: center;
}

.kpd-date-bar:empty::after {
    content: 'Нет live-отчётов от мода';
    color: var(--dash-muted);
    font-size: 12px;
    padding: 6px 8px;
}

.kpd-date-btn {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: var(--dash-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-variant-numeric: tabular-nums;
}

.kpd-date-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.kpd-date-btn.active {
    color: #fff;
    border-color: rgba(167, 139, 250, 0.4);
    background: rgba(167, 139, 250, 0.18);
}

.kpd-live-detail {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    padding: 16px 18px;
    min-height: 0;
}

.kpd-detail-empty {
    color: var(--dash-muted);
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}

.kpd-detail-empty-compact {
    padding: 14px 12px;
    font-size: 12px;
}

.kpd-detail-empty-hint {
    display: block;
    margin-top: 6px;
    opacity: 0.75;
    font-size: 12px;
}

.player-kpd-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.player-kpd-head-text {
    min-width: 0;
}

.kpd-detail-report-label {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.kpd-detail-report-meta {
    font-size: 11px;
    color: var(--dash-muted);
    margin-top: 4px;
    line-height: 1.45;
}

.player-kpd-score-wrap {
    text-align: right;
    flex-shrink: 0;
}

.player-kpd-score-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--dash-muted);
    margin-bottom: 2px;
}

.player-kpd-score {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #e9d5ff, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}

.kpd-detail-section {
    margin-top: 14px;
}

.kpd-detail-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dash-muted);
    margin: 0 0 8px;
}

.kpd-live-lines {
    max-height: 220px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.12);
}

.kpd-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    font-size: 12px;
}

.kpd-action-row:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }

.kpd-action-row-own {
    background: rgba(109, 124, 255, 0.08);
    box-shadow: inset 2px 0 0 rgba(109, 124, 255, 0.55);
}

.kpd-action-row-own:nth-child(odd) {
    background: rgba(109, 124, 255, 0.08);
}

.kpd-action-nick {
    font-weight: 600;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.kpd-action-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kpd-action-count {
    font-size: 11px;
    font-weight: 800;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.12);
    padding: 2px 7px;
    border-radius: 999px;
}

.kpd-field-chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.kpd-field-chip.cat-spec,
.kpd-live-field.cat-spec { --fc: #a78bfa; }
.kpd-field-chip.cat-pve,
.kpd-live-field.cat-pve { --fc: #22d3ee; }
.kpd-field-chip.cat-pvp,
.kpd-live-field.cat-pvp { --fc: #38bdf8; }
.kpd-field-chip.cat-freeze,
.kpd-live-field.cat-freeze { --fc: #67e8f9; }
.kpd-field-chip.cat-revise,
.kpd-live-field.cat-revise { --fc: #fb923c; }
.kpd-field-chip.cat-heavy,
.kpd-live-field.cat-heavy { --fc: #f87171; }
.kpd-field-chip.cat-clear,
.kpd-live-field.cat-clear { --fc: #4ade80; }
.kpd-field-chip.cat-warn,
.kpd-live-field.cat-warn { --fc: #fbbf24; }
.kpd-field-chip.cat-ban,
.kpd-live-field.cat-ban { --fc: #ef4444; }
.kpd-field-chip.cat-neutral,
.kpd-live-field.cat-neutral { --fc: #94a3b8; }

.kpd-field-chip[class*="cat-"] { color: var(--fc, #c4b5fd); }

.kpd-live-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.kpd-live-field {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid color-mix(in srgb, var(--fc, #a78bfa) 18%, rgba(255, 255, 255, 0.07));
}

.kpd-live-field-name {
    font-size: 10px;
    color: var(--dash-muted);
    min-height: 24px;
    line-height: 1.25;
}

.kpd-live-field-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--fc, #c4b5fd);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.kpd-live-field-pts {
    font-size: 10px;
    color: rgba(196, 181, 253, 0.85);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.dash-hero-compact {
    margin-bottom: 20px;
}

.dash-hero-hwid {
    margin-bottom: 20px;
}

.dash-hero-hwid .dash-hero-sub {
    margin: 0;
}

.dash-hero-profile {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

.dash-hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-metric {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 0;
}

.dash-metric-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dash-muted);
    margin-bottom: 6px;
}

.dash-metric-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-overview h2 {
    margin: 0 0 14px;
    font-size: 15px;
    color: #fff;
}

.dash-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.dash-overview-col {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-overview-col h3 {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.42);
}

.dash-overview-dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dash-overview-dl > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dash-overview-dl dt {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.46);
}

.dash-overview-dl dd {
    margin: 0;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.35;
    word-break: break-word;
}

.dash-overview-dl a {
    color: var(--pv-accent, #8b9bff);
    text-decoration: none;
}

.dash-overview-dl a:hover {
    text-decoration: underline;
}

.dash-hero-compact .dash-hero-actions {
    display: none;
}

.dash-hwid-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-hwid-card {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--dash-border);
}

.dash-hwid-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dash-hwid-full {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #aeb4ff;
    word-break: break-all;
}

.dash-copy-btn {
    flex-shrink: 0;
}

.dash-copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dash-dl-compact > div {
    padding: 6px 0;
}

.dash-hwid-change-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-hwid-change-label {
    display: block;
    font-size: 12px;
    color: var(--dash-muted, #94a3b8);
    margin-bottom: 8px;
}

.dash-hwid-change-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-hwid-change-input {
    flex: 1;
    min-width: 180px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.dash-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.dash-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
}

.dash-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dash-hwid-change-msg {
    margin: 8px 0 0;
    font-size: 12px;
}

.dash-hwid-change-ok {
    color: #34d399;
}

.dash-hwid-change-err {
    color: #f87171;
}

.dash-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

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

    .dash-hero-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-overview-grid {
        grid-template-columns: 1fr;
    }

    .dash-overview-dl {
        grid-template-columns: 1fr;
    }

    .dash-stats-tab {
        font-size: 12px;
        padding: 10px 8px;
    }

    .dash-journal-grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .online-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dash-analytics-subbar {
        flex-direction: column;
        align-items: stretch;
    }

    .online-chart-meta {
        text-align: left;
    }
}

@media (max-width: 560px) {
    .online-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-analytics-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 760px) {
    .portal-topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }

    .portal-nav {
        order: 3;
        width: 100%;
    }

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

    .dash-hero {
        flex-direction: column;
    }

    .dash-hero-actions,
    .dash-hero-actions .dash-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .dash-card,
    .dash-section.dash-card,
    .dash-hero,
    .dash-journal,
    .dash-stats-hub {
        padding: 14px;
        border-radius: 12px;
    }

    .dash-hero-main {
        align-items: flex-start;
        gap: 12px;
    }

    .dash-hero-title {
        gap: 6px;
        margin-bottom: 6px;
    }

    .dash-hero-title h1 {
        width: 100%;
        font-size: 22px;
        line-height: 1.05;
    }

    .dash-hero-title .portal-user-badge,
    .dash-hero-title .portal-user-paid,
    .dash-hero-title .dash-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .dash-hero-sub {
        font-size: 12px;
        line-height: 1.45;
    }

    .dash-hero-metrics {
        grid-template-columns: 1fr;
        gap: 8px;
        padding-top: 12px;
    }

    .dash-metric {
        padding: 10px 12px;
    }

    .dash-metric-value {
        white-space: normal;
    }

    .dash-overview-col {
        padding: 12px;
    }

    .dash-overview-dl > div {
        padding: 9px 10px;
    }

    .dash-stats-head {
        margin-bottom: 12px;
    }

    .dash-stats-tab {
        font-size: 11px;
        padding: 10px 6px;
    }

    .dash-stats-toolbar,
    .dash-stats-subbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .online-view-tabs,
    .kpd-date-bar,
    .dash-feed-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .online-view-tabs::-webkit-scrollbar,
    .kpd-date-bar::-webkit-scrollbar,
    .dash-feed-filter::-webkit-scrollbar {
        display: none;
    }

    .online-view-tab,
    .kpd-date-btn,
    .dash-feed-filter-btn {
        flex-shrink: 0;
    }

    .online-chart-meta {
        min-width: 0;
        text-align: left;
    }

    .online-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .online-summary-item {
        min-height: 54px;
    }

    .kpd-export-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .kpd-export-actions {
        justify-content: stretch;
    }

    .kpd-export-actions .dash-btn-inline {
        flex: 1 1 100%;
    }

    .online-chart-wrap {
        min-height: 200px;
    }

    .online-chart-wrap svg {
        height: 190px;
    }

    .online-sessions-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .online-sessions-toolbar .dash-muted {
        display: none;
    }

    .online-sessions-toolbar input[type="date"],
    .online-sessions-toolbar .dash-btn {
        width: 100%;
    }

    .player-kpd-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .player-kpd-score-wrap {
        text-align: left;
    }

    .player-kpd-score {
        font-size: 24px;
    }

    .kpd-live-detail {
        padding: 14px;
    }

    .kpd-live-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kpd-action-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .kpd-action-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .dash-journal-block {
        padding: 12px;
    }

    .dash-journal-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .dash-journal-toolbar {
        height: auto;
        min-height: 0;
        max-height: none;
        align-items: stretch;
        overflow: visible;
    }

    .dash-journal-desc {
        min-height: 0;
        max-height: none;
        display: block;
        -webkit-line-clamp: unset;
    }

    .dash-feed {
        min-height: 260px;
        height: min(420px, 55vh);
        max-height: min(420px, 55vh);
    }

    .dash-feed-row {
        padding: 9px 10px;
        gap: 8px;
    }

    .hwid-code-row,
    .hwid-change-bar {
        gap: 8px;
    }
}

@media (max-width: 420px) {
    .dash-hero-title h1 {
        font-size: 20px;
    }

    .dash-hero-avatar {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .online-summary-grid,
    .kpd-live-fields {
        grid-template-columns: 1fr;
    }

    .dash-stats-tab {
        font-size: 10px;
        padding: 10px 4px;
    }

    .dash-data-table th,
    .dash-data-table td {
        padding: 9px 10px;
    }
}

/* ============================================================
   Панель прав мода (Discord-style) — /perms
   ============================================================ */
.perms-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}
.perms-sidebar {
    background: var(--dash-bg2);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 220px);
    position: sticky;
    top: 88px;
}
.perms-sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.perms-sidebar-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dash-muted); }
.perms-add { display: flex; gap: 6px; }
.perms-input {
    flex: 1; min-width: 0;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--dash-border);
    border-radius: 8px;
    padding: 9px 11px;
    color: var(--dash-text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.12s ease;
}
.perms-input:focus { border-color: var(--dash-accent); }
.perms-btn {
    border: 1px solid var(--dash-border);
    background: rgba(255,255,255,0.05);
    color: var(--dash-text);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.perms-btn:hover { background: rgba(255,255,255,0.09); }
.perms-btn-primary { background: var(--dash-accent); border-color: var(--dash-accent); color: #fff; min-width: 38px; }
.perms-btn-primary:hover { background: var(--dash-accent-h); }
.perms-btn-ghost { background: transparent; color: var(--dash-red); border-color: rgba(237,66,69,0.4); }
.perms-btn-ghost:hover { background: rgba(237,66,69,0.12); }

.perms-members { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding-right: 2px; }
.perms-member {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; text-align: left;
    background: transparent; border: 1px solid transparent;
    border-radius: 9px; padding: 8px 10px; cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.perms-member:hover { background: rgba(255,255,255,0.05); }
.perms-member.active { background: rgba(88,101,242,0.16); border-color: rgba(88,101,242,0.5); }
.perms-member-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perms-member-name { font-size: 13.5px; font-weight: 600; color: var(--dash-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perms-member-sub { font-size: 11px; color: var(--dash-muted); }

.perms-content {
    background: var(--dash-bg2);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
}
.perms-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--dash-border); padding: 10px 14px 0; }
.perms-tab {
    background: transparent; border: none; cursor: pointer;
    color: var(--dash-muted); font-size: 14px; font-weight: 600;
    padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.perms-tab:hover { color: var(--dash-text); }
.perms-tab.active { color: #fff; border-bottom-color: var(--dash-accent); }
.perms-tabpane { display: none; padding: 18px; }
.perms-tabpane.active { display: block; }

.perms-rights-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--dash-border); }
.perms-rights-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.perms-rights-name { font-size: 17px; font-weight: 700; color: #fff; }
.perms-rights-vk { font-size: 12px; color: var(--dash-accent); text-decoration: none; }
.perms-rights-vk:hover { text-decoration: underline; }
.perms-rights-note { font-size: 13px; color: var(--dash-yellow); }

.perms-group { margin-bottom: 18px; }
.perms-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dash-muted); margin-bottom: 6px; }
.perms-row {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 12px 2px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.perms-row:last-child { border-bottom: none; }
.perms-row-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.perms-row-label { font-size: 14px; font-weight: 600; color: var(--dash-text); }
.perms-row-desc { font-size: 12px; color: var(--dash-muted); }

.perms-switch {
    flex-shrink: 0; width: 42px; height: 24px; border-radius: 999px;
    background: rgba(255,255,255,0.14); position: relative; cursor: pointer;
    transition: background 0.15s ease;
}
.perms-switch::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%; background: #fff;
    transition: transform 0.15s ease;
}
.perms-switch.on { background: var(--dash-green); }
.perms-switch.on::after { transform: translateX(18px); }
.perms-switch.disabled { opacity: 0.55; cursor: not-allowed; }
.perms-row.locked .perms-row-label { color: var(--dash-muted); }

.perms-empty { color: var(--dash-muted); font-size: 13px; text-align: center; padding: 24px 8px; }
.perms-hint { color: var(--dash-muted); font-size: 12.5px; margin: 4px 0 12px; }
.perms-manage h3 { color: #fff; font-size: 16px; margin: 0 0 4px; }
.perms-admins { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.perms-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--dash-border); border-radius: 9px; font-size: 13.5px; color: var(--dash-text); }
.perms-admin-row em { color: var(--dash-muted); font-style: normal; font-size: 12px; }

/* Бейджи статуса */
.perms-badge { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; flex-shrink: 0; }
.perms-badge--free { background: rgba(255,255,255,0.08); color: var(--dash-muted); }
.perms-badge--paid { background: rgba(87,242,135,0.16); color: var(--dash-green); }
.perms-badge--tester { background: rgba(254,231,92,0.14); color: var(--dash-yellow); }
.perms-badge--admin { background: rgba(237,66,69,0.18); color: #fca5a5; }

.perms-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    background: #1f2235; border: 1px solid var(--dash-border); color: var(--dash-text);
    padding: 11px 18px; border-radius: 10px; font-size: 13.5px; z-index: 60;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.perms-toast.err { border-color: rgba(237,66,69,0.5); color: #fca5a5; }

@media (max-width: 820px) {
    .perms-shell { grid-template-columns: 1fr; }
    .perms-sidebar { position: static; max-height: 320px; }
}

/* Ранги */
.perms-rank-user { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.perms-rank-card { background: rgba(255,255,255,0.04); border: 1px solid var(--dash-border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.perms-rank-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.perms-rank-title { font-size: 15px; font-weight: 700; color: var(--dash-text); }
.perms-rank-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.perms-inline { display: inline-flex; gap: 6px; align-items: center; }
.perms-input-sm { max-width: 130px; padding: 7px 10px; font-size: 13px; }
