:root {
    --top-lockup-height: 80px;
    --top-lockup-inner-size: 50px;
    --top-lockup-pad-x: 15px;
    --page-head-pad-x: 21px;
    --mobile-sidebar-height: 74px;
    --mobile-browser-ui-offset: 0px;

    --brand-500: #0b77e4;
    --brand-600: #0969c8;
    --brand-700: #085aaf;
    --theme-icon: rgba(11, 119, 228, 0.62);
    --theme-icon-hover: rgba(11, 119, 228, 0.82);

    --text-primary: #1d1d1f;
    --text-secondary: #4e5660;
    --text-muted: #89919a;

    --surface-0: #fdfdfd;
    --surface-50: #f8f9fb;
    --surface-100: #eef2f6;
    --app-bg: #f4f6f9;
    --sidebar-bg: #f7f7fa;
    --overlay-soft: rgba(244, 246, 249, 0.72);

    --border-soft: #dfe4eb;
    --border-card: #dfe4eb;

    --success: #2ecc71;
    --support-nav-color: #239f57;
    --support-nav-hover-bg: rgba(35, 159, 87, 0.14);
    --support-nav-hover-shadow: rgba(35, 159, 87, 0.45);
    --warning: #b7791f;
    --danger: #ff4757;
    --danger-soft-text: #ad7272;
    --danger-soft-text-hover: #8f6060;
    --danger-soft-bg: rgba(184, 105, 105, 0.12);

    --shadow-soft: 0 1px 2px rgba(17, 24, 39, 0.06), 0 10px 22px -18px rgba(17, 24, 39, 0.25);
    --shadow-card: 0 2px 6px rgba(17, 24, 39, 0.08), 0 18px 30px -18px rgba(17, 24, 39, 0.28);
    --shadow-float: 0 6px 18px -14px rgba(17, 24, 39, 0.24), 0 22px 40px -28px rgba(17, 24, 39, 0.3);
    --ring-focus: 0 0 0 3px rgba(11, 119, 228, 0.24);
    color-scheme: light;
}

html.auth-session-present body::before,
html.auth-session-present body::after {
    content: none;
    display: none;
}

.auth-session-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    background: var(--app-bg);
    color: var(--text-secondary);
}

html.auth-session-present .auth-session-loader {
    display: flex;
}

html:not(.auth-session-present) .auth-session-loader,
html.auth-session-present:has(#appRoot:not(.app-hidden)) .auth-session-loader {
    display: none;
}

.auth-session-loader p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-loader-machine,
.auth-loader-press,
.auth-loader-press-head,
.auth-loader-belt,
.auth-loader-track,
.auth-loader-token,
.auth-loader-shadow {
    display: none;
}

.auth-loader-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid rgba(11, 119, 228, 0.18);
    border-top-color: var(--brand-500);
    box-shadow: 0 12px 28px -20px rgba(11, 119, 228, 0.65);
    animation: authLoaderSpinner 0.75s linear infinite;
}

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

html.theme-dark {
    --brand-500: #4f9dff;
    --brand-600: #3d8ef2;
    --brand-700: #2f7fdd;
    --theme-icon: rgba(79, 157, 255, 0.68);
    --theme-icon-hover: rgba(79, 157, 255, 0.9);

    --text-primary: #e8edf5;
    --text-secondary: #c2cad8;
    --text-muted: #94a0b2;

    --surface-0: #171d28;
    --surface-50: #1e2634;
    --surface-100: #283244;
    --app-bg: #0f141d;
    --sidebar-bg: #121a26;
    --overlay-soft: rgba(15, 20, 29, 0.72);

    --border-soft: #2f3a4c;
    --border-card: #344156;

    --success: #34d179;
    --support-nav-color: #58d98f;
    --support-nav-hover-bg: rgba(88, 217, 143, 0.14);
    --support-nav-hover-shadow: rgba(88, 217, 143, 0.4);
    --warning: #d39b3a;
    --danger: #ff6b78;
    --danger-soft-text: #d7a5aa;
    --danger-soft-text-hover: #f1bec3;
    --danger-soft-bg: rgba(255, 107, 120, 0.16);

    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 24px -18px rgba(0, 0, 0, 0.65);
    --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.35), 0 20px 34px -20px rgba(0, 0, 0, 0.7);
    --shadow-float: 0 8px 22px -16px rgba(0, 0, 0, 0.55), 0 28px 44px -28px rgba(0, 0, 0, 0.72);
    --ring-focus: 0 0 0 3px rgba(79, 157, 255, 0.3);
    color-scheme: dark;
}

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

html,
body {
    height: 100%;
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    background: var(--app-bg);
    color: var(--text-primary);
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

body.mobile-sidebar-open {
    overflow: hidden;
}

.app-hidden {
    display: none;
}

.auth-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: var(--app-bg);
}

.auth-page.auth-page-hidden {
    display: none;
}

.auth-card {
    position: relative;
    width: min(460px, 100%);
    background: var(--surface-0);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow-float);
}

html.auth-preflight .auth-card {
    min-height: 168px;
}

html.auth-preflight .auth-card > * {
    visibility: hidden;
}

html.auth-preflight .auth-card::before {
    content: "Проверяем вход...";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
}

html.auth-session-present .auth-page {
    display: none;
}

html.auth-session-present body::before {
    content: "Открываем личный кабинет...";
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 190px;
    background: var(--app-bg);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
}

html.auth-session-present body::after {
    content: "";
    position: fixed;
    left: 50%;
    top: calc(50% - 92px);
    z-index: 1001;
    width: min(520px, calc(100vw - 34px));
    height: 190px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(11, 119, 228, 0.18), rgba(11, 119, 228, 0.03)) 50% 2px / 112px 58px no-repeat,
        linear-gradient(90deg, transparent 0 38%, rgba(11, 119, 228, 0.28) 38% 62%, transparent 62% 100%) 50% 50px / 134px 24px no-repeat,
        radial-gradient(circle at 50% 48px, rgba(255, 255, 255, 0.96) 0 18px, rgba(11, 119, 228, 0.34) 19px 23px, transparent 24px) 50% 0 / 128px 92px no-repeat,
        url("../img/logo.svg") -42px 114px / 44px 44px repeat-x,
        linear-gradient(90deg, rgba(11, 119, 228, 0), rgba(11, 119, 228, 0.14), rgba(11, 119, 228, 0)) 0 122px / 100% 22px no-repeat,
        repeating-linear-gradient(90deg, rgba(11, 119, 228, 0.15) 0 22px, rgba(11, 119, 228, 0.04) 22px 46px) 0 118px / 100% 38px no-repeat,
        linear-gradient(180deg, rgba(17, 184, 122, 0.16), rgba(11, 119, 228, 0.11)) 0 112px / 100% 50px no-repeat;
    border-radius: 24px;
    filter: drop-shadow(0 22px 32px rgba(11, 119, 228, 0.13));
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 17%, #000 83%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 17%, #000 83%, transparent 100%);
    animation: authConveyorStamp 1.25s linear infinite;
}

@keyframes authConveyorStamp {
    0% {
        background-position:
            50% 2px,
            50% 50px,
            50% 0,
            -42px 114px,
            0 122px,
            0 118px,
            0 112px;
        transform: translate(-50%, -50%) scale(1);
    }
    38% {
        background-position:
            50% 16px,
            50% 64px,
            50% 14px,
            28px 114px,
            0 122px,
            44px 118px,
            0 112px;
        transform: translate(-50%, -50%) scale(0.992);
    }
    52% {
        background-position:
            50% 2px,
            50% 50px,
            50% 0,
            54px 114px,
            0 122px,
            64px 118px,
            0 112px;
        transform: translate(-50%, -50%) scale(1.006);
    }
    100% {
        background-position:
            50% 2px,
            50% 50px,
            50% 0,
            126px 114px,
            0 122px,
            126px 118px,
            0 112px;
        transform: translate(-50%, -50%) scale(1);
    }
}

html.auth-session-present body::before {
    padding-top: 176px;
    font-weight: 800;
    letter-spacing: 0;
}

html.auth-session-present body::after {
    top: calc(50% - 88px);
    width: min(440px, calc(100vw - 36px));
    height: 168px;
    background:
        radial-gradient(circle at 50% 40px, rgba(255, 255, 255, 0.96) 0 17px, rgba(11, 119, 228, 0.28) 18px 22px, transparent 23px) 50% 0 / 120px 92px no-repeat,
        linear-gradient(180deg, rgba(11, 119, 228, 0.18), rgba(11, 119, 228, 0.02)) 50% 0 / 96px 52px no-repeat,
        linear-gradient(90deg, transparent 0 39%, rgba(11, 119, 228, 0.24) 39% 61%, transparent 61% 100%) 50% 45px / 118px 20px no-repeat,
        url("../img/logo.svg") 50% 104px / 38px 38px no-repeat,
        linear-gradient(90deg, rgba(255,255,255,0.92) 0 68px, rgba(255,255,255,0.58) 68px 84px, transparent 84px 104px) -104px 98px / 104px 50px repeat-x,
        linear-gradient(180deg, rgba(17, 184, 122, 0.18), rgba(11, 119, 228, 0.11)) 0 104px / 100% 42px no-repeat,
        linear-gradient(180deg, rgba(11, 119, 228, 0.1), rgba(11, 119, 228, 0)) 50% 132px / 86% 20px no-repeat;
    border-radius: 22px;
    filter: drop-shadow(0 18px 28px rgba(11, 119, 228, 0.12));
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
    animation: authConveyorStamp 1.45s cubic-bezier(0.42, 0, 0.2, 1) infinite;
}

@keyframes authConveyorStamp {
    0% {
        background-position:
            50% 0,
            50% 0,
            50% 45px,
            50% 104px,
            -104px 98px,
            0 104px,
            50% 132px;
        transform: translate(-50%, -50%) scale(1);
    }
    42% {
        background-position:
            50% 13px,
            50% 13px,
            50% 58px,
            50% 107px,
            -28px 98px,
            0 104px,
            50% 132px;
        transform: translate(-50%, -50%) scale(0.996);
    }
    58% {
        background-position:
            50% 0,
            50% 0,
            50% 45px,
            50% 104px,
            12px 98px,
            0 104px,
            50% 132px;
        transform: translate(-50%, -50%) scale(1.004);
    }
    100% {
        background-position:
            50% 0,
            50% 0,
            50% 45px,
            50% 104px,
            104px 98px,
            0 104px,
            50% 132px;
        transform: translate(-50%, -50%) scale(1);
    }
}

.auth-card.auth-layout-telegram {
    display: flex;
    flex-direction: column;
}

.auth-card.auth-layout-telegram .auth-brand {
    order: 1;
}

.auth-card.auth-layout-telegram #telegramUsernameForm,
.auth-card.auth-layout-telegram #telegramCodeForm {
    order: 2;
}

.auth-card.auth-layout-telegram #authHint {
    order: 3;
    margin-top: 12px;
    margin-bottom: 14px;
}

.auth-card.auth-layout-telegram #authAltLogin {
    order: 4;
    margin-top: 0;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-brand-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
}

.auth-brand-icon img {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
    transition: filter 0.24s ease;
}

.auth-brand-text h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
    color: var(--text-primary);
}

.auth-brand-text p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

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

.auth-form-hidden {
    display: none;
}

.auth-alt-login {
    margin-top: 16px;
}

.auth-alt-login.auth-form-hidden {
    display: none;
}

.auth-alt-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.auth-alt-divider span {
    display: block;
    height: 1px;
    background: var(--border-soft);
}

.auth-alt-divider strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.auth-alt-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-alt-btn {
    appearance: none;
    min-height: 52px;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    background: var(--surface-50);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.auth-alt-btn:hover {
    border-color: var(--brand-500);
    background: var(--surface-0);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.auth-alt-btn:focus-visible {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: var(--ring-focus);
}

.auth-alt-btn:disabled {
    opacity: 0.64;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.auth-alt-btn i {
    font-size: 22px;
}

.auth-alt-btn-telegram {
    color: #2aabee;
}

.auth-alt-btn-yandex {
    color: #fc3f1d;
}

.auth-phone-row {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    background: var(--surface-0);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-phone-row:focus-within {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(11, 119, 228, 0.24);
}

.auth-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.auth-input {
    appearance: none;
    width: 100%;
    border: 1px solid var(--border-card);
    border-radius: 14px;
    background: var(--surface-0);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(11, 119, 228, 0.24);
}

#phoneInput::placeholder {
    color: rgba(100, 116, 139, 0.32);
}

#phoneInput {
    font-family: "Roboto", "Segoe UI", sans-serif;
}

.auth-phone-row .auth-input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
}

.auth-phone-row .auth-input:focus {
    border: 0;
    box-shadow: none;
}

.auth-code-input {
    text-align: center;
    letter-spacing: 0.2em;
}

.auth-input.auth-code-input.auth-code-input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.24);
    animation: authCodeShake 0.34s ease-in-out, authCodeErrorGlow 0.62s ease;
}

.auth-input.auth-code-input.auth-code-input-success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.24);
    animation: authCodeSuccessGlow 0.58s ease;
}

@keyframes authCodeShake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

@keyframes authCodeErrorGlow {
    0% { background: var(--surface-0); }
    35% { background: rgba(255, 71, 87, 0.08); }
    100% { background: var(--surface-0); }
}

@keyframes authCodeSuccessGlow {
    0% { background: var(--surface-0); transform: scale(1); }
    35% { background: rgba(46, 204, 113, 0.1); transform: scale(1.012); }
    100% { background: var(--surface-0); transform: scale(1); }
}

.auth-phone-row .auth-send-inline-btn {
    flex: 0 0 50px;
    min-width: 50px;
    width: 50px;
    margin: 4px;
    border-radius: 10px;
    border: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.auth-phone-row .auth-send-inline-btn:hover {
    transform: none;
}

.auth-phone-row .auth-send-inline-btn i {
    font-size: 16px;
}

.auth-code-title {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-code-title strong {
    color: var(--text-primary);
}

.auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.auth-action-btn {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0 14px;
}

.auth-resend-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--surface-50);
    border-color: var(--border-soft);
    color: var(--text-secondary);
}

.auth-resend-btn:hover:not(:disabled) {
    background: #eceef2;
    border-color: var(--border-card);
    color: var(--text-primary);
}

.auth-submit-btn {
    box-shadow: 0 6px 14px -8px rgba(11, 119, 228, 0.34);
}

.auth-resend-timer {
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #d9e1ea;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.auth-resend-timer-hidden {
    display: none !important;
}

.auth-resend-btn:disabled {
    opacity: 0.72;
    cursor: default;
    transform: none;
}

.auth-back-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--brand-700);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 2px 0 0;
}

.auth-back-btn:hover {
    color: var(--text-secondary);
}

.auth-hint {
    margin-top: 14px;
    min-height: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-hint.auth-hint-info {
    color: var(--text-secondary);
}

.auth-hint.auth-hint-success {
    color: var(--success);
}

.auth-hint.auth-hint-error {
    color: var(--danger);
}

.topup-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(2px);
}

.topup-modal-backdrop[hidden] {
    display: none;
}

.topup-modal {
    width: min(460px, 100%);
    border-radius: 20px;
    border: 1px solid var(--border-card);
    background: var(--surface-0);
    box-shadow: var(--shadow-float);
    overflow: hidden;
}

.balance-alert-backdrop {
    position: fixed;
    inset: 0;
    z-index: 182;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(6px);
}

.balance-alert-backdrop[hidden] {
    display: none;
}

.balance-alert-modal {
    width: min(460px, 100%);
    border-radius: 20px;
    border: 1px solid var(--border-card);
    background: var(--surface-0);
    box-shadow: var(--shadow-float);
    overflow: hidden;
}

.balance-alert-body {
    text-align: center;
    align-items: center;
}

.balance-alert-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    background: var(--surface-50);
    color: var(--brand-500);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.balance-alert-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-primary);
    font-weight: 600;
}

.balance-alert-subtext {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.balance-alert-actions {
    width: 100%;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}

.topup-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.topup-modal-head h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
}

.topup-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.topup-modal-close:hover {
    background: rgba(60, 60, 67, 0.08);
    color: var(--text-primary);
}

.topup-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.topup-modal-body[hidden] {
    display: none !important;
}

.topup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topup-field span {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.topup-field input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--surface-0);
}

.topup-field input:focus {
    outline: 2px solid rgba(11, 119, 228, 0.22);
    border-color: var(--brand-500);
}

.topup-pay-btn {
    width: 100%;
}

.topup-hint {
    margin: 0;
    min-height: 18px;
    font-size: 13px;
    color: var(--text-secondary);
}

.topup-payment-box {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-50);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topup-qr-wrap {
    width: 100%;
    min-height: 220px;
    border: 1px dashed var(--border-soft);
    border-radius: 12px;
    background: var(--surface-0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#topupQrImage {
    width: min(220px, 100%);
    height: auto;
    display: block;
    object-fit: contain;
}

.topup-qr-fallback {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.topup-payment-meta {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.topup-payment-meta span {
    color: var(--text-muted);
}

.topup-payment-meta strong,
.topup-payment-meta code {
    color: var(--text-primary);
}

.topup-payment-meta code {
    font-size: 12px;
}

.topup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topup-actions .btn {
    width: auto;
}

.tariff-purchase-backdrop {
    position: fixed;
    inset: 0;
    z-index: 185;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(6px);
}

.tariff-purchase-backdrop[hidden] {
    display: none;
}

.tariff-purchase-modal {
    position: relative;
    width: min(460px, 100%);
    border-radius: 20px;
    border: 1px solid var(--border-card);
    background: var(--surface-0);
    box-shadow: var(--shadow-float);
    overflow: hidden;
}

.tariff-purchase-summary {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-50);
    padding: 12px;
}

.tariff-purchase-summary h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
}

.tariff-purchase-summary p {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
}

.tariff-payment-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tariff-payment-method-btn {
    appearance: none;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    height: 44px;
    background: var(--surface-0);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tariff-payment-method-btn i {
    font-size: 14px;
}

.tariff-payment-method-btn:hover {
    border-color: var(--brand-500);
    color: var(--brand-700);
}

.tariff-payment-method-btn.is-active {
    border-color: var(--brand-500);
    background: rgba(11, 119, 228, 0.08);
    color: var(--brand-700);
    box-shadow: var(--ring-focus);
}

.tariff-payment-method-btn:disabled {
    opacity: 0.66;
    cursor: default;
}

.tariff-purchase-hint {
    margin: 0;
    min-height: 18px;
    font-size: 13px;
    color: var(--text-secondary);
}

.tariff-purchase-success {
    align-items: center;
    text-align: center;
    gap: 14px;
    padding-top: 20px;
    padding-bottom: 24px;
}

.tariff-success-icon {
    width: 92px;
    height: 92px;
    border-radius: 999px;
    border: 2px solid rgba(46, 204, 113, 0.34);
    background: rgba(46, 204, 113, 0.14);
    color: var(--success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tariff-success-icon i {
    font-size: 44px;
    line-height: 1;
}

.tariff-success-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
}

.tariff-success-connect-btn {
    max-width: 260px;
    width: 100%;
}

.tariff-success-connect-btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    box-shadow: none;
}

.tariff-purchase-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--overlay-soft);
    backdrop-filter: blur(7px);
}

.tariff-purchase-loading-overlay[hidden] {
    display: none;
}

.tariff-purchase-loading-overlay p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.tariff-spinner {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid rgba(11, 119, 228, 0.24);
    border-top-color: var(--brand-500);
    animation: tariffSpinnerRotate 0.9s linear infinite;
}

@keyframes tariffSpinnerRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.app {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-soft);
    transition: width 0.25s ease;
    overflow-x: hidden;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: inset -1px 0 0 var(--border-soft), 10px 0 20px -24px rgba(29, 29, 31, 0.4);
}

.sidebar.sidebar-no-transition,
.sidebar.sidebar-no-transition .logo-area,
.sidebar.sidebar-no-transition .logo-text,
.sidebar.sidebar-no-transition .nav-item,
.sidebar.sidebar-no-transition .nav-item span {
    transition: none !important;
}

.sidebar.expanded {
    width: 260px;
}

.sidebar.collapsed {
    width: 80px;
}

.logo-area {
    --brand-lockup-height: var(--top-lockup-inner-size);
    appearance: none;
    border: 0;
    width: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--top-lockup-height);
    min-height: var(--top-lockup-height);
    padding: 0 var(--top-lockup-pad-x);
    border-bottom: 1px solid var(--border-soft);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.26s ease, padding 0.25s ease, gap 0.25s ease;
}

.logo-area:hover {
    background: rgba(60, 60, 67, 0.06);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--brand-lockup-height);
    height: var(--brand-lockup-height);
    min-width: var(--brand-lockup-height);
    text-align: center;
}

.logo-image {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
    transition: filter 0.24s ease;
}

html.theme-dark .logo-image,
html.theme-dark .auth-brand-icon img {
    filter: brightness(0) invert(0.96);
}

.logo-text {
    display: inline-flex;
    align-items: center;
    min-height: var(--brand-lockup-height);
    max-width: 180px;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    transform: translateY(-0.5px);
    transition: opacity 0.2s ease, max-width 0.25s ease;
}

.nav-menu {
    flex: 1;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    appearance: none;
    border: 0;
    width: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 13px;
    border-radius: 16px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    color: var(--text-secondary);
    white-space: nowrap;
    text-align: left;
}

#adminNavItem {
    display: none;
}

#adminNavItem.nav-item-admin-visible {
    display: flex !important;
}

#adminNavItem[hidden],
#adminNavItem.nav-item-admin-hidden {
    display: none !important;
}

.nav-item i {
    font-size: 22px;
    min-width: 28px;
    text-align: center;
}

.theme-toggle-icon {
    width: 23px;
    height: 23px;
    flex: 0 0 28px;
    display: block;
}

.nav-item span {
    display: inline-block;
    max-width: 148px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 600;
    transition: opacity 0.2s ease, max-width 0.25s ease;
}

.nav-item.active {
    background: rgba(11, 119, 228, 0.12);
    border-color: rgba(11, 119, 228, 0.28);
    color: var(--brand-700);
    box-shadow: 0 6px 14px -14px rgba(11, 119, 228, 0.38);
}

.nav-item.active i {
    color: inherit;
}

.nav-item:hover:not(.active) {
    background: rgba(60, 60, 67, 0.08);
    color: var(--text-primary);
    box-shadow: 0 8px 16px -16px rgba(29, 29, 31, 0.45);
}

.nav-item-muted {
    color: var(--support-nav-color);
    opacity: 0.84;
}

.nav-item.nav-item-muted:hover {
    color: var(--support-nav-color);
    background: var(--support-nav-hover-bg);
    box-shadow: 0 8px 16px -16px var(--support-nav-hover-shadow);
}

.nav-item-theme {
    color: var(--theme-icon);
}

.nav-item.nav-item-theme:hover {
    color: var(--theme-icon-hover);
}

.nav-item-theme .theme-toggle-icon {
    color: var(--theme-icon);
    opacity: 1;
    transition: transform 0.24s ease, opacity 0.24s ease, color 0.24s ease;
    transform-origin: center;
}

.nav-item-theme span {
    transition: opacity 0.18s ease, transform 0.18s ease, max-width 0.25s ease;
    transform: translateY(0);
}

.nav-item-theme.theme-label-animating span {
    opacity: 0;
    transform: translateY(-3px);
}

.nav-item-theme:hover .theme-toggle-icon {
    color: var(--theme-icon-hover);
    opacity: 1;
}

.nav-item-theme.theme-icon-animating .theme-toggle-icon {
    transform: rotate(160deg) scale(0.82);
    opacity: 0.35;
}

.nav-item-logout {
    color: var(--danger-soft-text);
}

.nav-item.nav-item-logout:hover {
    background: var(--danger-soft-bg);
    color: var(--danger-soft-text-hover);
}

html.theme-transition body,
html.theme-transition .sidebar,
html.theme-transition .main-content,
html.theme-transition .global-page-head,
html.theme-transition .card,
html.theme-transition .subscriptions-section,
html.theme-transition .sub-item,
html.theme-transition .tariff-card,
html.theme-transition #subDetailCard.card,
html.theme-transition .sub-detail-panel,
html.theme-transition .detail-metric,
html.theme-transition .admin-module-card,
html.theme-transition .admin-mini-stat,
html.theme-transition .topup-modal,
html.theme-transition .balance-alert-modal,
html.theme-transition .tariff-purchase-modal,
html.theme-transition .dashboard-balance-inline,
html.theme-transition .nav-item,
html.theme-transition .btn,
html.theme-transition input,
html.theme-transition textarea,
html.theme-transition select {
    transition: background-color 0.26s ease, color 0.22s ease, border-color 0.26s ease, box-shadow 0.26s ease;
}

@media (prefers-reduced-motion: reduce) {
    .nav-item-theme .theme-toggle-icon,
    .nav-item-theme.theme-icon-animating .theme-toggle-icon {
        transition: none;
        transform: none;
        opacity: 1;
    }

    .nav-item-theme span,
    .nav-item-theme.theme-label-animating span {
        transition: none;
        transform: none;
        opacity: 1;
    }

    .auth-input.auth-code-input.auth-code-input-error,
    .auth-input.auth-code-input.auth-code-input-success {
        animation: none;
        transform: none;
    }

    html.theme-transition body,
    html.theme-transition .sidebar,
    html.theme-transition .main-content,
    html.theme-transition .global-page-head,
    html.theme-transition .card,
    html.theme-transition .subscriptions-section,
    html.theme-transition .sub-item,
    html.theme-transition .tariff-card,
    html.theme-transition #subDetailCard.card,
    html.theme-transition .sub-detail-panel,
    html.theme-transition .detail-metric,
    html.theme-transition .admin-module-card,
    html.theme-transition .admin-mini-stat,
    html.theme-transition .topup-modal,
    html.theme-transition .balance-alert-modal,
    html.theme-transition .tariff-purchase-modal,
    html.theme-transition .dashboard-balance-inline,
    html.theme-transition .nav-item,
    html.theme-transition .btn,
    html.theme-transition input,
    html.theme-transition textarea,
    html.theme-transition select {
        transition: none;
    }
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}

.sidebar.collapsed .nav-item {
    justify-content: flex-start;
    gap: 16px;
    padding: 12px 13px;
}

.sidebar.collapsed .nav-item i {
    min-width: 28px;
    margin: 0;
}

.sidebar.collapsed .logo-area {
    width: 100%;
    height: var(--top-lockup-height);
    min-height: var(--top-lockup-height);
    justify-content: flex-start;
    align-items: center;
    padding: 0 var(--top-lockup-pad-x);
    gap: 0;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0 32px 24px;
    background: var(--app-bg);
    scroll-behavior: smooth;
}

.page {
    display: none;
    animation: fade-in 0.22s ease;
}

.page.active-page {
    display: block;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.2px;
    margin-bottom: 24px;
}

.page-title i {
    color: var(--text-primary);
}

.global-page-head {
    position: sticky;
    top: 0;
    z-index: 40;
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    height: var(--top-lockup-height);
    min-height: var(--top-lockup-height);
    padding: 0 var(--page-head-pad-x);
    background: var(--app-bg);
    box-shadow: none;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
}

.global-page-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: calc(var(--top-lockup-height) - 2px);
}

.global-page-head-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.global-page-head-row .page-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    min-height: var(--top-lockup-inner-size);
    line-height: 1;
    transform: translateY(-0.5px);
}

.mobile-menu-btn {
    display: none;
    appearance: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-card);
    background: var(--surface-0);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-btn:hover {
    background: rgba(60, 60, 67, 0.08);
    border-color: #cfd6df;
}

.mobile-menu-btn i {
    font-size: 16px;
}

.mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 75;
}

.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-topbar .page-title {
    margin-bottom: 0;
}

.dashboard-balance-inline {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-card);
    background: var(--app-bg);
    box-shadow: none;
    white-space: nowrap;
}

.dashboard-balance-meta {
    display: inline-flex;
    align-items: center;
}

.dashboard-balance-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-balance-value {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.dashboard-balance-value.balance-negative {
    color: var(--danger);
}

.dashboard-balance-topup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    min-width: 38px;
    border: 1px solid var(--brand-500);
    border-radius: 12px;
    background: transparent;
    color: var(--brand-700);
    font-size: 12px;
    font-weight: 700;
    padding: 0 11px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dashboard-balance-topup:hover {
    background: rgba(11, 119, 228, 0.08);
    border-color: var(--brand-600);
    transform: translateY(-1px);
}

.dashboard-balance-topup i {
    font-size: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
}

.subscriptions-section {
    border: 1px solid var(--border-card);
    border-radius: 26px;
    padding: 20px;
    background: var(--app-bg);
    box-shadow: none;
}

.subscriptions-title {
    justify-content: center;
    text-align: center;
    margin-bottom: 16px;
}

.subscriptions-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.subscriptions-head .subscriptions-title {
    grid-column: 2;
    justify-self: center;
    margin-bottom: 0;
}

.subscriptions-sort-btn {
    grid-column: 3;
    justify-self: end;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--surface-0);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease, transform 0.18s ease;
}

.subscriptions-sort-btn:hover {
    background: rgba(11, 119, 228, 0.08);
    border-color: rgba(11, 119, 228, 0.35);
    color: var(--brand-700);
    box-shadow: 0 6px 14px -11px rgba(11, 119, 228, 0.4);
}

.subscriptions-sort-btn:active {
    transform: scale(0.97);
}

.subscriptions-sort-btn:focus-visible {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(11, 119, 228, 0.18);
}

.subscriptions-sort-btn[aria-pressed="true"] {
    background: rgba(11, 119, 228, 0.14);
    border-color: rgba(11, 119, 228, 0.38);
    color: var(--brand-700);
}

.subscriptions-sort-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: transform 0.22s ease;
    transform-origin: center;
}

.subscriptions-sort-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.subscriptions-sort-btn.is-reversed .subscriptions-sort-icon {
    transform: rotate(180deg);
}

.tariffs-section .grid-2cols {
    margin-top: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

@media (max-width: 1400px) {
    .tariffs-section .grid-2cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1120px) {
    .tariffs-section .grid-2cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.balance-page-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.balance-page-shell .subscriptions-title {
    margin-bottom: 0;
}

.balance-page-overview {
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}

.balance-page-overview-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.balance-page-overview-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.balance-page-overview-value {
    font-size: 40px;
    line-height: 1;
    color: var(--text-primary);
    font-weight: 700;
}

.balance-page-overview-value.balance-negative {
    color: var(--danger);
}

.balance-page-overview-stats {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.balance-page-stat {
    min-width: 128px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-50);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.balance-page-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.balance-page-stat-value {
    font-size: 15px;
    font-weight: 700;
}

.balance-page-topup-btn {
    width: auto;
    min-width: 150px;
}

.balance-page-transactions {
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 16px 18px;
}

.balance-page-transactions-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.balance-page-transactions-title {
    margin-bottom: 0;
    font-size: 18px;
    line-height: 1.2;
}

.balance-page-transactions-meta {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.balance-transactions-table {
    min-width: 620px;
}

.balance-transactions-pagination {
    margin-top: 12px;
}

.meta-label {
    font-size: 14px;
    color: var(--text-muted);
}

.card {
    background: var(--surface-0);
    border-radius: 24px;
    padding: 20px 24px;
    border: 0;
    box-shadow: var(--shadow-soft);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.balance-card {
    margin-bottom: 32px;
}

.balance-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.balance-amount {
    font-size: 42px;
    font-weight: 700;
    color: var(--brand-700);
}

.balance-icon {
    font-size: 40px;
    color: var(--brand-500);
    opacity: 0.8;
}

.subscription-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.sub-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border: 0;
    border-radius: 20px;
    background: var(--surface-0);
    box-shadow: var(--shadow-soft);
    transition: background-color 0.28s ease, color 0.22s ease, border-color 0.28s ease, box-shadow 0.28s ease, transform 0.22s ease;
}

.sub-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.no-subscriptions-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 186px;
    padding: 24px 20px;
    border: 0;
    border-radius: 20px;
    background: var(--surface-0);
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: background-color 0.28s ease, color 0.22s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.no-subscriptions-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 119, 228, 0.14);
    color: var(--brand-700);
    font-size: 18px;
}

.no-subscriptions-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.no-subscriptions-text {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.sub-info {
    width: 100%;
}

.sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sub-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sub-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sub-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.sub-status-active {
    background: rgba(46, 204, 113, 0.14);
    border-color: rgba(46, 204, 113, 0.32);
    color: var(--success);
}

.sub-status-limited {
    background: rgba(186, 122, 18, 0.14);
    border-color: rgba(186, 122, 18, 0.32);
    color: var(--warning);
}

.sub-status-disabled,
.sub-status-expired {
    background: rgba(255, 71, 87, 0.13);
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--danger);
}

.sub-status-unknown {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.24);
    color: var(--text-secondary);
}

.sub-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-700);
    white-space: nowrap;
}

.sub-details {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.sub-traffic {
    width: 100%;
    margin-top: 12px;
}

.sub-traffic-current {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.sub-traffic .progress-limit {
    margin: 0;
}

.sub-traffic-scale {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.sub-item-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sub-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sub-action-btn {
    height: 38px;
    border: 1px solid var(--border-soft);
    border-radius: 40px;
    background: var(--surface-50);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    min-width: 42px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition: width 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, padding 0.22s ease, gap 0.22s ease;
}

.sub-action-btn .btn-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.sub-action-btn .btn-symbol svg {
    width: 16px;
    height: 16px;
    display: block;
}

.sub-action-btn .btn-text {
    display: inline-block;
    line-height: 1;
}

.sub-action-btn:disabled {
    opacity: 0.56;
    cursor: not-allowed;
    box-shadow: none;
}

.sub-action-btn-renew {
    width: 42px;
    padding: 0;
    gap: 0;
}

.sub-action-btn-renew .btn-text {
    display: none;
}

.sub-action-btn-detail {
    width: 116px;
    background: var(--brand-500);
    border-color: var(--brand-500);
    color: var(--surface-0);
    box-shadow: 0 4px 10px rgba(11, 119, 228, 0.3);
}

.sub-action-btn-detail .btn-symbol {
    display: none;
}

.sub-item-actions.renew-hovered .sub-action-btn-renew {
    width: 116px;
    padding: 0 14px;
    gap: 8px;
    background: var(--brand-500);
    border-color: var(--brand-500);
    color: var(--surface-0);
    box-shadow: 0 4px 10px rgba(11, 119, 228, 0.3);
}

.sub-item-actions.renew-hovered .sub-action-btn-renew .btn-symbol {
    display: none;
}

.sub-item-actions.renew-hovered .sub-action-btn-renew .btn-text {
    display: inline-block;
}

.sub-item-actions.renew-hovered .sub-action-btn-detail {
    width: 42px;
    padding: 0;
    gap: 0;
    background: var(--surface-50);
    border-color: var(--border-soft);
    color: var(--text-secondary);
    box-shadow: none;
}

.sub-item-actions.renew-hovered .sub-action-btn-detail .btn-symbol {
    display: inline-flex;
}

.sub-item-actions.renew-hovered .sub-action-btn-detail .btn-text {
    display: none;
}

.sub-expire {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}

.btn {
    appearance: none;
    border: 1px solid var(--border-soft);
    background: var(--surface-50);
    border-radius: 40px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.btn-primary {
    background: var(--brand-500);
    border-color: var(--brand-600);
    color: var(--surface-0);
    box-shadow: 0 8px 16px -12px rgba(11, 119, 228, 0.38);
}

.btn-primary:hover {
    background: var(--brand-600);
    border-color: #085aaf;
    color: var(--surface-0);
    box-shadow: 0 10px 18px -14px rgba(8, 90, 175, 0.42);
}

.btn-outline {
    background: var(--surface-0);
    border-color: var(--border-soft);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: rgba(11, 119, 228, 0.1);
    border-color: var(--brand-500);
    color: var(--text-primary);
}

html.theme-dark .btn:not(.btn-primary) {
    box-shadow: none;
}

html.theme-dark .btn-outline {
    border-color: var(--border-card);
}

.grid-2cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

.tariff-card {
    background: var(--surface-0);
    border-radius: 20px;
    padding: 18px;
    border: 0;
    box-shadow: var(--shadow-soft);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.tariff-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.tariff-card {
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding: 22px 20px 18px;
    gap: 10px;
}

.tariff-card-empty {
    min-height: 176px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface-0);
}

.tariff-card h3 {
    color: var(--text-primary);
    margin: 0;
}

.tariff-card p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 8px;
}

.tariff-card .btn {
    margin-top: 10px;
}

.tariff-head {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
    text-align: center;
}

.tariff-title {
    min-width: 0;
    text-align: center;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
}

.tariff-price-old {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: line-through;
}

.tariff-price-discount {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
    font-size: 12px;
    font-weight: 900;
}

.tariff-card-accent {
    border: 2px solid var(--tariff-accent-color, var(--brand-500));
    box-shadow: 0 10px 18px -14px rgba(11, 119, 228, 0.28);
}

.tariff-card-standard-plus {
    z-index: 1;
    transform: translateY(-6px) scale(1.025);
    border-color: rgba(255, 255, 255, 0.78);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.44)),
        linear-gradient(155deg, rgba(11, 119, 228, 0.11), rgba(33, 195, 161, 0.13));
    box-shadow:
        0 20px 54px rgba(11, 119, 228, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    animation: tariffStandardPlusGlow 3.8s ease-in-out infinite;
}

.tariff-card-standard-plus:hover {
    transform: translateY(-8px) scale(1.028);
    box-shadow:
        0 24px 62px rgba(11, 119, 228, 0.22),
        0 0 28px rgba(33, 195, 161, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.tariff-card-standard-plus::before {
    content: "";
    position: absolute;
    inset: -26% -26% auto auto;
    width: 74%;
    height: 42%;
    transform: rotate(15deg);
    border-radius: 999px;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.82), rgba(33, 195, 161, 0.18), transparent 72%);
    pointer-events: none;
}

.tariff-card-standard-plus .tariff-accent-badge {
    padding: 5px 14px;
    border-color: rgba(255, 255, 255, 0.85);
    background: linear-gradient(135deg, #fff6d8, #f4c45d);
    color: #153239;
    box-shadow: 0 10px 26px rgba(190, 128, 20, 0.18);
}

.tariff-featured-caption {
    position: relative;
    z-index: 1;
    display: block;
    margin: 8px auto 0;
    color: var(--brand-700);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 900;
    text-align: center;
}

.tariff-action-btn-featured {
    border-color: rgba(255, 255, 255, 0.42);
    background: linear-gradient(135deg, var(--brand-700), var(--brand-500) 58%, #21c3a1);
    box-shadow: 0 14px 30px rgba(11, 119, 228, 0.26);
}

@keyframes tariffStandardPlusGlow {
    0%, 100% {
        box-shadow:
            0 20px 54px rgba(11, 119, 228, 0.16),
            0 0 0 1px rgba(255, 255, 255, 0.45) inset;
    }
    50% {
        box-shadow:
            0 24px 64px rgba(11, 119, 228, 0.22),
            0 0 28px rgba(33, 195, 161, 0.22),
            0 0 0 1px rgba(255, 255, 255, 0.52) inset;
    }
}

html.theme-dark .tariff-card-standard-plus {
    border-color: rgba(255, 255, 255, 0.18);
    background:
        linear-gradient(145deg, rgba(31, 41, 55, 0.9), rgba(15, 23, 42, 0.82)),
        linear-gradient(155deg, rgba(59, 130, 246, 0.17), rgba(45, 212, 191, 0.12));
}

.tariff-accent-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 36px);
    padding: 3px 12px;
    border-radius: 999px;
    border: 2px solid var(--tariff-accent-color, var(--brand-500));
    background: var(--tariff-accent-color, var(--brand-500));
    color: var(--surface-0);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tariff-description {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    min-height: 44px;
    width: 100%;
    text-align: center;
    white-space: pre-line;
}

.tariff-description-wrap {
    width: 100%;
    height: 132px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tariff-description-wrap.is-expanded {
    height: auto;
}

.tariff-description-wrap:not(.is-expanded) .tariff-description {
    flex: 1 1 auto;
    overflow: hidden;
}

.tariff-description-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border-soft);
    background: var(--surface-100);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    padding: 6px 12px;
    min-height: 30px;
    border-radius: 999px;
    cursor: pointer;
    text-align: center;
    align-self: center;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.tariff-description-toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.tariff-description-wrap.is-expanded .tariff-description-toggle::after {
    transform: rotate(-135deg) translateY(-1px);
}

.tariff-description-toggle:hover {
    color: var(--brand-700);
    border-color: rgba(11, 119, 228, 0.3);
    background: rgba(11, 119, 228, 0.08);
}

.tariff-description-toggle:active {
    transform: translateY(1px);
}

.tariff-description p {
    margin: 0 0 6px;
    text-align: center;
}

.tariff-description p:last-child {
    margin-bottom: 0;
}

.tariff-description ul,
.tariff-description ol {
    margin: 0 0 6px;
    padding: 0;
    list-style-position: inside;
    text-align: center;
}

.tariff-description li {
    margin: 0 0 2px;
}

.tariff-description li:last-child {
    margin-bottom: 0;
}

.tariff-description strong,
.tariff-description b {
    font-weight: 700;
}

.tariff-description em,
.tariff-description i {
    font-style: italic;
}

.tariff-description u {
    text-decoration: underline;
}

.tariff-description-empty {
    color: var(--text-muted);
}

.price-tag {
    font-size: 36px;
    font-weight: 700;
    color: var(--brand-700);
    margin: 0;
    white-space: nowrap;
    text-align: center;
    line-height: 1.15;
}

.tariff-action-btn {
    margin: 0 auto;
    min-width: 168px;
    justify-content: center;
    background: var(--brand-500);
    border-color: var(--brand-600);
    color: var(--surface-0);
    box-shadow: 0 8px 16px -12px rgba(11, 119, 228, 0.38);
    font-weight: 700;
}

.tariff-action-btn:hover {
    background: var(--brand-600);
    border-color: #085aaf;
    color: var(--surface-0);
}

.tariff-separator {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(210, 210, 215, 0) 0%, rgba(210, 210, 215, 0.9) 50%, rgba(210, 210, 215, 0) 100%);
}

.tariff-traffic-label {
    margin: 0;
    color: var(--brand-700);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.traffic-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-700);
    flex: 0 0 7px;
}

.tariff-actions-block .tariff-device-limit {
    margin: 0 0 7px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.tariff-device-limit strong {
    font-weight: 800;
}

.tariff-slot-limit {
    margin: 0 0 7px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.tariff-slot-limit strong {
    font-weight: 800;
    color: var(--brand-700);
}

.tariff-actions-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: auto;
}

.tariff-card .tariff-action-btn {
    margin: 0 auto;
}

.tariff-action-btn:disabled {
    background: var(--surface-100);
    border-color: var(--border-soft);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

.tariff-action-btn:disabled:hover {
    background: var(--surface-100);
    border-color: var(--border-soft);
    color: var(--text-muted);
    transform: none;
}

.trial-offer-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 18px 20px;
    margin: 0 0 18px;
    border-radius: 18px;
    border: 1px solid rgba(17, 184, 122, 0.34);
    background:
        linear-gradient(135deg, rgba(17, 184, 122, 0.14), rgba(11, 119, 228, 0.1)),
        var(--surface-0);
    box-shadow: 0 18px 36px -30px rgba(17, 184, 122, 0.58);
}

.trial-offer-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.trial-offer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #11b87a;
    color: #ffffff;
    box-shadow: 0 12px 22px -16px rgba(17, 184, 122, 0.76);
}

.trial-offer-copy {
    min-width: 0;
}

.trial-offer-kicker {
    margin: 0 0 3px;
    color: #0f8c61;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.trial-offer-copy h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
}

.trial-offer-copy p:last-child {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.35;
}

.trial-offer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.trial-offer-close:hover {
    color: var(--text-primary);
    background: var(--surface-100);
    border-color: var(--border-soft);
}

.trial-offer-action {
    flex: 0 0 auto;
    margin-right: 28px;
}

.tariff-card-trial {
    border: 2px solid #11b87a;
    background:
        linear-gradient(180deg, rgba(17, 184, 122, 0.11), rgba(11, 119, 228, 0.05) 62%),
        var(--surface-0);
    box-shadow: 0 16px 28px -24px rgba(17, 184, 122, 0.64);
}

.tariff-card-trial .tariff-accent-badge {
    border-color: #11b87a;
    background: #11b87a;
}

.tariff-card-trial .price-tag,
.tariff-card-trial .tariff-slot-limit strong,
.tariff-card-trial .tariff-traffic-label strong {
    color: #0f8c61;
}

.trial-tariff-action-btn {
    background: #11b87a;
    border-color: #0f9b68;
    box-shadow: 0 8px 16px -12px rgba(17, 184, 122, 0.56);
}

.trial-tariff-action-btn:hover {
    background: #0f9b68;
    border-color: #0b8056;
}

.discount-offer-card {
    border-color: rgba(245, 158, 11, 0.38);
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(14, 165, 233, 0.09)),
        var(--surface-0);
    box-shadow: 0 18px 36px -30px rgba(245, 158, 11, 0.58);
}

.discount-offer-icon {
    background: #f59e0b;
    box-shadow: 0 12px 22px -16px rgba(245, 158, 11, 0.76);
}

.discount-offer-kicker {
    color: #b45309;
}

.discount-offer-action {
    background: #f59e0b;
    border-color: #d97706;
    color: #ffffff;
}

.discount-offer-action:hover {
    background: #d97706;
    border-color: #b45309;
}

.app-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    max-width: min(420px, calc(100vw - 32px));
    padding: 13px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--surface-0);
    color: var(--text-primary);
    box-shadow: 0 18px 46px -24px rgba(0, 0, 0, 0.34);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast-info {
    border-color: rgba(11, 119, 228, 0.26);
}

.app-toast-success {
    border-color: rgba(17, 184, 122, 0.36);
}

.app-toast-error {
    border-color: rgba(224, 49, 49, 0.34);
}

@media (max-width: 640px) {
    .trial-offer-card {
        align-items: stretch;
        flex-direction: column;
        padding: 18px 16px 16px;
    }

    .trial-offer-main {
        align-items: flex-start;
        padding-right: 30px;
    }

    .trial-offer-action {
        width: 100%;
        margin-right: 0;
        justify-content: center;
    }

    .app-toast {
        right: 16px;
        bottom: 16px;
    }
}

.detail-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

#subscription-detail-page .detail-header {
    justify-content: flex-end;
    padding-right: var(--page-head-pad-x);
}

#subscription-detail-page #backToDashboardBtn {
    width: auto;
    background: var(--app-bg);
    border-color: var(--border-card);
    color: var(--text-secondary);
    box-shadow: none;
}

#subscription-detail-page #backToDashboardBtn:hover {
    background: var(--app-bg);
    color: var(--text-primary);
    border-color: var(--border-soft);
}

#subDetailCard.card {
    border: 1px solid var(--border-card);
    border-radius: 26px;
    padding: 20px;
    background: var(--app-bg);
    box-shadow: none;
}

#subDetailCard.card:hover {
    transform: none;
    box-shadow: none;
}

.loading-placeholder {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.sub-detail-shell {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sub-detail-overview-card,
.sub-detail-panel {
    background: var(--surface-0);
    border: 0;
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
}

.sub-detail-title-row {
    margin-bottom: 14px;
}

.sub-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.detail-chip-active {
    background: rgba(46, 204, 113, 0.14);
    border-color: rgba(46, 204, 113, 0.32);
    color: var(--success);
}

.detail-chip-limited {
    background: rgba(186, 122, 18, 0.14);
    border-color: rgba(186, 122, 18, 0.32);
    color: var(--warning);
}

.detail-chip-disabled,
.detail-chip-expired {
    background: rgba(255, 71, 87, 0.13);
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--danger);
}

.detail-chip-unknown {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.24);
    color: var(--text-secondary);
}

.sub-detail-name {
    font-size: 26px;
    color: var(--text-primary);
    margin: 0;
}

.sub-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.sub-detail-meta-card {
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 12px 14px;
}

.sub-detail-meta-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text-primary);
}

.sub-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 16px;
}

.sub-detail-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.sub-detail-caption {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.detail-kv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-kv-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    align-items: start;
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-kv-row span {
    color: var(--text-muted);
}

.detail-kv-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.detail-kv-row code {
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 5px 8px;
    color: var(--text-primary);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.detail-auto-renew-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--surface-50);
}

.detail-auto-renew-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.detail-auto-renew-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-auto-renew-caption {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
}

.detail-auto-renew-switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}

.detail-auto-renew-switch input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.detail-auto-renew-slider {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--surface-100);
    border: 1px solid var(--border-soft);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.detail-auto-renew-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--surface-0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.detail-auto-renew-switch input:checked + .detail-auto-renew-slider {
    background: var(--brand-500);
    border-color: var(--brand-500);
}

.detail-auto-renew-switch input:checked + .detail-auto-renew-slider::before {
    transform: translateX(20px);
}

.detail-auto-renew-switch input:disabled + .detail-auto-renew-slider {
    opacity: 0.55;
}

.detail-profile-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sub-detail-profile-panel {
    position: relative;
    overflow: hidden;
}

.sub-detail-profile-content {
    position: relative;
    z-index: 1;
}

.sub-detail-profile-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: var(--overlay-soft);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.sub-detail-profile-loading[hidden] {
    display: none;
}

.sub-detail-profile-panel.is-loading .sub-detail-profile-content {
    filter: blur(1.4px);
    opacity: 0.72;
    pointer-events: none;
}

.sub-detail-profile-spinner {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 3px solid rgba(11, 119, 228, 0.24);
    border-top-color: var(--brand-500);
    animation: subDetailSpin 0.85s linear infinite;
}

@keyframes subDetailSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.sub-detail-action-hint {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.35;
}

.sub-detail-action-hint.is-info {
    color: var(--text-muted);
}

.sub-detail-action-hint.is-success {
    color: var(--success);
}

.sub-detail-action-hint.is-error {
    color: var(--danger);
}

.detail-metrics-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.detail-metric {
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px 12px;
}

.detail-metric span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.detail-metric strong {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-primary);
}

.detail-key-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.key-chip {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-50);
}

.key-chip span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.key-chip strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
}

.key-chip-enabled {
    border-color: rgba(46, 204, 113, 0.32);
}

.key-chip-hidden {
    border-color: rgba(11, 119, 228, 0.28);
}

.key-chip-disabled {
    border-color: rgba(255, 71, 87, 0.3);
}

.detail-code-block {
    margin-top: 10px;
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.top-nodes-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-node-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 8px 10px;
}

.top-node-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.top-node-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(11, 119, 228, 0.14);
    color: var(--brand-700);
    font-size: 11px;
    font-weight: 700;
}

.top-node-item strong {
    color: var(--text-primary);
    font-size: 13px;
}

.detail-empty {
    font-size: 13px;
    color: var(--text-muted);
}

.sub-detail-panel-wide {
    grid-column: span 2;
}

.sub-detail-devices-panel {
    grid-column: 1 / -1;
}

.detail-metrics-grid-activity {
    margin-top: 0;
}

.hwid-table {
    margin-top: 12px;
    background: var(--surface-50);
    border-radius: 18px;
    border: 1px solid var(--border-soft);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

.hwid-table-head,
.hwid-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.35fr) minmax(120px, 0.8fr) minmax(170px, 1fr) 44px;
    gap: 12px;
    align-items: center;
    min-width: 560px;
}

.hwid-table-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface-100);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.hwid-table-body {
    display: flex;
    flex-direction: column;
}

.hwid-row {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    color: var(--text-secondary);
}

.hwid-row:last-child {
    border-bottom: 0;
}

.hwid-cell {
    min-width: 0;
}

.hwid-cell-device {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hwid-cell-device i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.hwid-cell-device span,
.hwid-cell-os,
.hwid-cell-last {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hwid-head-action {
    text-align: right;
}

.hwid-cell-action {
    display: flex;
    justify-content: flex-end;
}

.hwid-delete-btn {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid var(--border-soft);
    background: var(--surface-0);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.hwid-delete-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.hwid-delete-btn:hover:not(:disabled) {
    border-color: #f2b4ba;
    background: #fff4f5;
    color: var(--danger);
}

.hwid-delete-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hwid-delete-btn.is-loading {
    pointer-events: none;
    opacity: 0.65;
}

.progress-limit {
    background: linear-gradient(180deg, #e7edf5 0%, #dde6f0 100%);
    border-radius: 20px;
    height: 8px;
    width: 100%;
    margin: 12px 0 6px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--brand-500) 0%, var(--brand-600) 100%);
    height: 8px;
    border-radius: 20px;
}

.progress-fill-unlimited {
    background: linear-gradient(90deg, #2e8df0 0%, #0b77e4 100%);
}

.sub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 32px;
}

.sub-actions-detail {
    margin-top: 0;
}

.info-note {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--surface-50);
    padding: 12px;
    border-radius: 20px;
    border: 1px solid var(--border-soft);
}

.info-note code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.support-text {
    color: var(--text-secondary);
    margin: 0;
}

.support-title {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

.support-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--brand-500);
    border-radius: 12px;
    background: rgba(11, 119, 228, 0.08);
    color: var(--brand-700);
    text-decoration: none;
    font-weight: 700;
    word-break: break-all;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.support-link:hover {
    background: rgba(11, 119, 228, 0.14);
    border-color: var(--brand-600);
    color: var(--brand-700);
}

.support-input {
    width: 100%;
    margin: 16px 0;
    padding: 12px;
    border: 1px solid var(--border-card);
    border-radius: 16px;
    background: var(--surface-0);
    color: var(--text-primary);
    resize: vertical;
    min-height: 92px;
}

.support-input:focus {
    outline: 2px solid rgba(11, 119, 228, 0.24);
    border-color: var(--brand-500);
}

.settings-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-card-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-title {
    margin: 0;
}

.settings-status-text {
    font-size: 14px;
    line-height: 1.45;
}

.settings-miniapp-note {
    margin-top: 0;
}

.settings-link-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: var(--surface-50);
}

.settings-link-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-link-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-link-caption {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.settings-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.settings-field span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.settings-input {
    width: 100%;
    max-width: none;
    min-height: 46px;
    font-size: 16px;
}

.settings-code-input {
    letter-spacing: 0.08em;
    font-weight: 700;
}

.settings-action-btn {
    width: auto;
    min-width: 152px;
    min-height: 46px;
    border-radius: 12px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-code-row {
    margin-top: 2px;
}

.settings-merge-note {
    margin-top: 0;
}

.settings-merge-btn {
    align-self: flex-start;
    margin-top: 0;
}

.settings-link-hint {
    margin-top: 2px;
}

.admin-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.admin-module-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-module-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.admin-module-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 18px;
}

.admin-module-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.admin-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-mini-stat {
    background: var(--surface-50);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 10px 12px;
}

.admin-mini-stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-mini-stat-value {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 18px;
}

.admin-tariffs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-tariffs-meta {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.admin-users-toolbar {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.admin-users-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-users-meta {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.admin-users-table {
    min-width: 860px;
}

.admin-users-actions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.admin-table-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface-0);
    color: var(--text-secondary);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-table-icon-btn:hover,
.admin-table-icon-btn.is-active {
    color: var(--brand-700);
    border-color: var(--brand-500);
    background: var(--surface-50);
}

.admin-users-search-row th {
    padding-top: 10px;
    padding-bottom: 12px;
    background: var(--surface-50);
}

.admin-table-filter-input {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface-0);
}

.admin-table-filter-input:focus {
    outline: 2px solid rgba(11, 119, 228, 0.18);
    border-color: var(--brand-500);
}

.admin-users-search-actions {
    display: flex;
    justify-content: flex-end;
}

.admin-transactions-table {
    min-width: 960px;
}

.admin-notifications-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.admin-notifications-table {
    min-width: 980px;
}

.admin-inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    min-height: 40px;
    padding: 0 12px;
    background: var(--surface-50);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.admin-radio-option input[type="radio"] {
    margin: 0;
}

.admin-users-meta.is-success {
    color: var(--success);
}

.admin-users-meta.is-error {
    color: var(--danger);
}

.admin-users-meta.is-info {
    color: var(--text-secondary);
}

.admin-amount-in {
    color: var(--success) !important;
}

.admin-amount-out {
    color: var(--danger) !important;
}

.admin-balance-negative {
    color: var(--danger) !important;
}

.admin-users-pagination {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-users-pagination .btn {
    width: auto;
}

.admin-trial-settings-card,
.admin-discount-settings-card {
    margin-bottom: 16px;
}

.admin-trial-settings-card .admin-form-actions,
.admin-discount-settings-card .admin-form-actions {
    align-items: center;
}

.admin-trial-settings-card .admin-users-meta,
.admin-discount-settings-card .admin-users-meta {
    margin: 0;
}

.admin-users-page-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.admin-user-details-summary {
    margin-bottom: 16px;
}

.admin-user-details-mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.admin-user-details-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.admin-user-details-kv {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-user-kv-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(0, 1.5fr);
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-50);
}

.admin-user-kv-row > span:first-child {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-user-kv-row strong,
.admin-user-kv-row code {
    color: var(--text-primary);
    font-size: 13px;
}

.admin-user-kv-row code {
    overflow-wrap: anywhere;
}

.admin-user-panel-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-user-profile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.admin-user-panel-card {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px;
    background: var(--surface-0);
}

.admin-user-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.admin-user-panel-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.admin-user-subscriptions-table {
    min-width: 860px;
}

.admin-user-devices-table {
    min-width: 940px;
}

.admin-user-transactions-table {
    min-width: 760px;
}

.admin-tariffs-layout {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.5fr);
    gap: 16px;
}

.admin-form-title {
    margin-bottom: 14px;
}

.admin-tariff-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-field span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.admin-field input[type="text"],
.admin-field input[type="number"],
.admin-field select,
.admin-field textarea {
    width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface-0);
}

.admin-field input[type="number"]:disabled,
.admin-field input[type="text"]:disabled,
.admin-field select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.admin-field input[type="text"],
.admin-field input[type="number"],
.admin-field select {
    height: 40px;
}

.admin-field input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 4px;
    background: var(--surface-0);
    cursor: pointer;
}

.admin-field textarea {
    min-height: 82px;
    padding: 10px 12px;
    resize: vertical;
}

.admin-field-hint {
    margin: 2px 0 4px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-tertiary);
}

.admin-field-hint code {
    font-size: 12px;
}

.admin-rich-editor {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-0);
    overflow: hidden;
}

.admin-rich-editor:focus-within {
    outline: 2px solid rgba(11, 119, 228, 0.22);
    border-color: var(--brand-500);
}

.admin-rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface-50);
}

.admin-rich-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface-0);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
}

.admin-rich-btn:hover {
    background: rgba(11, 119, 228, 0.1);
    color: var(--brand-700);
}

.admin-rich-btn.is-active {
    border-color: var(--brand-500);
    background: rgba(11, 119, 228, 0.16);
    color: var(--brand-700);
}

.admin-rich-input {
    min-height: 108px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.45;
    overflow-wrap: anywhere;
    cursor: text;
    user-select: text;
}

.admin-rich-input:focus {
    outline: none;
}

.admin-rich-input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.admin-rich-input p {
    margin: 0 0 6px;
}

.admin-rich-input p:last-child {
    margin-bottom: 0;
}

.admin-rich-input ul,
.admin-rich-input ol {
    margin: 0 0 6px 18px;
    padding: 0;
}

.admin-rich-input li {
    margin: 0 0 2px;
}

.admin-rich-input li:last-child {
    margin-bottom: 0;
}

.admin-rich-input strong,
.admin-rich-input b {
    font-weight: 800;
}

.admin-rich-input em,
.admin-rich-input i {
    font-style: italic;
}

.admin-rich-input u {
    text-decoration: underline;
}

.admin-rich-input s,
.admin-rich-input strike,
.admin-rich-input del {
    text-decoration: line-through;
}

.admin-rich-input code {
    font-family: "Roboto Mono", "Consolas", "Courier New", monospace;
    font-size: 0.94em;
    padding: 0 4px;
    border-radius: 6px;
    border: 1px solid var(--border-soft);
    background: rgba(11, 119, 228, 0.08);
    color: var(--brand-700);
}

.admin-rich-editor-compact .admin-rich-input {
    min-height: 120px;
}

.admin-broadcast-rich-input {
    white-space: pre-wrap;
}

.admin-rich-floating-toolbar {
    position: fixed;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--surface-0);
    box-shadow: 0 10px 30px rgba(21, 27, 40, 0.18);
    pointer-events: auto;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus,
.admin-field input[type="color"]:focus {
    outline: 2px solid rgba(11, 119, 228, 0.22);
    border-color: var(--brand-500);
}

.admin-field-color {
    min-height: 0;
}

.admin-field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

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

.admin-field-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    min-height: 40px;
    padding: 0 12px;
    background: var(--surface-50);
}

.admin-field-checkbox span {
    margin: 0;
}

.admin-squads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
}

.admin-squad-item {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 8px 10px;
    background: var(--surface-50);
}

.admin-squad-item span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-squad-item code {
    font-size: 11px;
    color: var(--text-muted);
}

.admin-empty-state {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-broadcast-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-broadcast-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--surface-50);
    overflow: hidden;
}

.admin-broadcast-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
    transition: width 0.24s ease;
}

.admin-broadcast-progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.admin-broadcast-progress-meta span {
    white-space: nowrap;
}

#adminNotificationsBroadcastStopBtn[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
    text-align: left;
    font-size: 13px;
    color: var(--text-secondary);
}

.admin-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

.admin-table-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s ease;
}

.admin-table-sort-btn i {
    font-size: 12px;
}

.admin-table-sort-btn:hover,
.admin-table-sort-btn.is-active,
.admin-table-sort-btn.is-filtered {
    color: var(--brand-600);
}

.admin-status-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.admin-status-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    min-width: 170px;
    padding: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-0);
    box-shadow: var(--shadow-soft);
}

.admin-status-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 4px;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.admin-table td strong {
    color: var(--text-primary);
    font-size: 14px;
}

.admin-table-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-table-description {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.admin-accent-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--accent-color, var(--brand-500));
    color: var(--accent-color, var(--brand-700));
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 18px 8px;
}

.admin-squads-cell {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-row-actions .btn {
    width: auto;
}

.admin-row-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.admin-row-btn-danger {
    border-color: rgba(184, 105, 105, 0.45);
    color: #8f6060;
}

.admin-row-btn-danger:hover {
    background: rgba(184, 105, 105, 0.12);
}

@media (max-width: 980px) {
    .main-content {
        padding: 0 16px 18px;
    }

    .global-page-head {
        padding-left: 17px;
        padding-right: 17px;
    }

    .balance-amount {
        font-size: 34px;
    }

    .sub-detail-name {
        font-size: 22px;
    }

    .sub-detail-panel-wide {
        grid-column: auto;
    }

    .detail-kv-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .admin-tariffs-layout {
        grid-template-columns: 1fr;
    }

    .admin-notifications-layout {
        grid-template-columns: 1fr;
    }

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

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

    .global-page-head-row {
        gap: 12px;
    }

    .global-page-head-row .page-title {
        font-size: 24px;
    }

    .dashboard-balance-inline {
        min-width: 0;
        width: auto;
        max-width: 100%;
    }

    .balance-page-overview-value {
        font-size: 34px;
    }

    .balance-page-stat {
        min-width: 112px;
    }

    .subscription-list {
        grid-template-columns: 1fr;
    }

    .settings-link-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .settings-action-btn,
    .settings-merge-btn {
        width: 100%;
        min-width: 0;
    }

    .grid-2cols {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }

    .tariffs-section .grid-2cols {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .tariff-card {
        padding: 20px 16px 16px;
    }

    .tariff-card-standard-plus,
    .tariff-card-standard-plus:hover {
        transform: none;
    }

    .price-tag {
        font-size: 34px;
    }

    .sub-detail-grid {
        grid-template-columns: 1fr;
    }

    .sub-detail-overview-card,
    .sub-detail-panel,
    #subDetailCard.card {
        border-radius: 18px;
    }

    .detail-profile-actions .btn {
        width: 100%;
    }
}

@media (max-width: 760px) {
    body {
        overflow: auto;
    }

    .app {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: 100svh;
        overflow: visible;
    }

    .sidebar,
    .sidebar.expanded,
    .sidebar.collapsed {
        position: fixed;
        left: 0;
        right: auto;
        top: 0;
        bottom: 0;
        width: min(82vw, 312px) !important;
        height: 100vh;
        height: 100dvh;
        height: 100svh;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: 100svh;
        border-top: 0;
        border-right: 1px solid var(--border-soft);
        box-shadow: 10px 0 28px -20px rgba(29, 29, 31, 0.55);
        background: var(--sidebar-bg);
        padding: 0 10px calc(10px + env(safe-area-inset-bottom) + var(--mobile-browser-ui-offset));
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        z-index: 80;
        transform: translateX(calc(-100% - 14px));
        transition: transform 0.24s ease;
        will-change: transform;
    }

    .sidebar.mobile-open,
    .sidebar.expanded.mobile-open,
    .sidebar.collapsed.mobile-open {
        transform: translateX(0);
    }

    .logo-area {
        display: flex !important;
        height: 68px;
        min-height: 68px;
        padding: 0 10px;
        margin: 0 -2px;
    }

    .nav-menu {
        padding: 12px 0 0;
        margin: 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .sidebar-footer {
        padding: 12px 0 0;
        margin-top: auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .nav-menu .nav-item,
    .sidebar-footer .nav-item,
    .sidebar .nav-item {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .nav-item {
        min-width: 0;
        min-height: 50px;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 12px;
        text-align: left;
    }

    .sidebar.collapsed .nav-item,
    .sidebar.expanded .nav-item {
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 12px;
    }

    .nav-item i {
        width: 24px;
        min-width: 24px;
        font-size: 19px;
        line-height: 1;
        text-align: center;
        display: block;
    }

    .sidebar.collapsed .nav-item i,
    .sidebar.expanded .nav-item i {
        width: 24px;
        min-width: 24px;
    }

    .nav-item span {
        display: inline-block;
    }

    .sidebar.collapsed .nav-item span,
    .sidebar.expanded .nav-item span {
        display: inline-block;
        opacity: 1;
        max-width: none;
        pointer-events: auto;
    }

    .sidebar.collapsed .logo-text,
    .sidebar.expanded .logo-text {
        opacity: 1;
        max-width: 180px;
        pointer-events: auto;
    }

    .sidebar.collapsed .logo-area,
    .sidebar.expanded .logo-area {
        justify-content: flex-start;
        gap: 12px;
        padding: 0 10px;
    }

    .nav-item.active {
        box-shadow: 0 8px 16px -14px rgba(11, 119, 228, 0.46);
    }

    .main-content {
        padding: 0 12px 18px;
        min-height: 100vh;
        overflow-y: auto;
    }

    .global-page-head {
        position: sticky;
        top: 0;
        z-index: 50;
        margin-bottom: 14px;
        height: auto;
        min-height: 0;
        padding: 8px 12px;
    }

    .global-page-head-row {
        min-height: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .global-page-head-main {
        flex: 1 1 auto;
        min-width: 0;
    }

    .global-page-head-row .page-title {
        font-size: 22px;
        min-height: 0;
        transform: none;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-balance-inline {
        width: auto;
        max-width: 100%;
        flex: 0 0 auto;
        min-height: 42px;
        border-radius: 12px;
        padding: 8px 10px;
    }

    .dashboard-balance-value {
        font-size: 20px;
    }

    .dashboard-balance-topup {
        width: 38px;
        height: 38px;
        padding: 0;
        border-radius: 10px;
    }

    .dashboard-balance-topup-text {
        display: none;
    }

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        border-radius: 18px;
        padding: 16px;
    }

    .auth-brand-text h1 {
        font-size: 22px;
    }

    .auth-brand-text p {
        font-size: 13px;
    }

    .auth-phone-row {
        border-radius: 12px;
    }

    .auth-phone-row .auth-send-inline-btn {
        margin: 3px;
        min-width: 44px;
        width: 44px;
        border-radius: 9px;
    }

    .auth-input {
        font-size: 16px;
        padding: 11px 12px;
    }

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

    .settings-link-block {
        padding: 12px;
        border-radius: 14px;
    }

    .settings-link-title {
        font-size: 14px;
    }

    .settings-link-caption {
        font-size: 12px;
    }

    .settings-action-btn {
        min-height: 44px;
    }

    .settings-code-input {
        letter-spacing: 0.04em;
    }

    .topup-modal-backdrop,
    .balance-alert-backdrop {
        padding: 12px;
    }

    .topup-modal,
    .balance-alert-modal,
    .tariff-purchase-modal {
        width: min(100%, 440px);
        max-height: min(88vh, 640px);
        display: flex;
        flex-direction: column;
    }

    .topup-modal,
    .balance-alert-modal {
        border-radius: 16px;
    }

    .tariff-purchase-backdrop {
        padding: 12px;
    }

    .tariff-purchase-modal {
        border-radius: 16px;
    }

    .topup-modal-body {
        overflow-y: auto;
    }

    .topup-actions {
        flex-direction: column;
    }

    .topup-actions .btn {
        width: 100%;
    }

    .subscriptions-section {
        padding: 14px;
        border-radius: 18px;
    }

    .balance-page-overview {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .balance-page-overview-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .balance-page-topup-btn {
        width: 100%;
    }

    .balance-page-transactions {
        padding: 14px;
    }

    .balance-transactions-table {
        min-width: 540px;
    }

    .sub-item {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 16px;
        padding: 14px;
        gap: 12px;
    }

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

    .sub-item-actions {
        width: 100%;
    }

    .sub-action-btn {
        flex: 1 1 auto;
        min-height: 36px;
    }

    .sub-expire {
        margin-left: 0;
        text-align: left;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .tariff-card {
        border-radius: 16px;
        padding: 16px 14px 14px;
    }

    .price-tag {
        font-size: 30px;
    }

    .tariff-title {
        font-size: 22px;
    }

    .tariff-description {
        font-size: 14px;
    }

    .tariff-description-wrap {
        height: 124px;
    }

    .tariff-device-limit {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .tariff-slot-limit {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .sub-actions {
        width: 100%;
    }

    #subscription-detail-page .detail-header {
        padding-right: 0;
    }

    #subscription-detail-page {
        overflow-x: hidden;
    }

    #subscription-detail-page #backToDashboardBtn {
        width: 100%;
    }

    #subDetailCard.card {
        padding: 14px;
        border-radius: 18px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .sub-detail-overview-card,
    .sub-detail-panel {
        border-radius: 16px;
        padding: 14px;
    }

    .sub-detail-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .sub-detail-title-row .sub-price {
        font-size: 13px;
        line-height: 1.2;
    }

    .sub-detail-name {
        font-size: 22px;
    }

    .sub-detail-chips {
        width: 100%;
        gap: 8px;
    }

    .detail-chip {
        font-size: 11px;
        padding: 5px 8px;
        max-width: 100%;
    }

    .detail-kv-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-kv-row code,
    .detail-kv-row strong,
    .detail-kv-row span {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .detail-auto-renew-row {
        align-items: flex-start;
        gap: 10px;
    }

    .detail-auto-renew-caption {
        max-width: 230px;
    }

    .detail-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hwid-table {
        overflow-x: hidden;
        border-radius: 14px;
    }

    .hwid-table-head,
    .hwid-row {
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr) minmax(0, 0.95fr) 34px;
        gap: 8px;
    }

    .hwid-table-head {
        font-size: 11px;
        padding: 8px 10px;
    }

    .hwid-row {
        font-size: 13px;
        padding: 8px 10px;
    }

    .hwid-cell-device span,
    .hwid-cell-os,
    .hwid-cell-last {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hwid-delete-btn {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .admin-tariffs-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-users-toolbar-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-users-actions-head {
        min-width: 120px;
    }

    .admin-users-search-row th {
        padding-top: 8px;
        padding-bottom: 10px;
    }

    .admin-users-pagination {
        width: 100%;
        justify-content: space-between;
    }

    .admin-user-details-layout {
        grid-template-columns: 1fr;
    }

    .admin-user-kv-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .admin-transactions-table {
        min-width: 880px;
    }

    .admin-notifications-table {
        min-width: 840px;
    }

    .admin-user-subscriptions-table {
        min-width: 760px;
    }

    .admin-user-devices-table {
        min-width: 860px;
    }

    .admin-field-grid {
        grid-template-columns: 1fr;
    }

    .admin-field-grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-form-actions {
        width: 100%;
    }

    .admin-form-actions .btn {
        width: 100%;
    }

    .admin-table {
        min-width: 620px;
    }
}

@media (max-width: 560px) {
    :root {
        --mobile-sidebar-height: 70px;
    }

    .main-content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .global-page-head {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 12px;
    }

    .global-page-head-row .page-title {
        font-size: 20px;
    }

    .dashboard-balance-inline {
        border-radius: 10px;
        padding: 7px 9px;
    }

    .dashboard-balance-value {
        font-size: 18px;
    }

    .balance-page-overview-value {
        font-size: 30px;
    }

    .balance-page-overview-stats {
        grid-template-columns: 1fr;
    }

    .balance-transactions-table {
        min-width: 460px;
    }

    .subscriptions-section {
        padding: 12px;
        border-radius: 16px;
    }

    .subscriptions-head {
        grid-template-columns: 36px minmax(0, 1fr) 36px;
        margin-bottom: 12px;
    }

    .subscriptions-sort-btn {
        width: 34px;
        height: 34px;
        border-radius: 999px;
    }

    .subscriptions-sort-icon {
        width: 17px;
        height: 17px;
    }

    .subscriptions-sort-icon svg {
        width: 17px;
        height: 17px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .sub-name {
        font-size: 16px;
    }

    .sub-price {
        font-size: 13px;
    }

    .sub-traffic-current {
        font-size: 12px;
    }

    .sub-action-btn {
        font-size: 13px;
        border-radius: 12px;
    }

    .sub-detail-name {
        font-size: 20px;
    }

    .sub-detail-panel-title {
        font-size: 15px;
    }

    .detail-metrics-grid {
        grid-template-columns: 1fr;
    }

    .detail-metric {
        padding: 9px 10px;
    }

    .sub-detail-chips {
        gap: 6px;
    }

    .detail-chip {
        width: 100%;
        justify-content: flex-start;
        padding: 6px 8px;
        border-radius: 10px;
    }

    .hwid-table {
        overflow: hidden;
        border-radius: 12px;
    }

    .hwid-table-head {
        display: none;
    }

    .hwid-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
        border-bottom: 1px solid var(--border-soft);
    }

    .hwid-cell-device {
        order: 1;
    }

    .hwid-cell-os {
        order: 2;
        font-size: 12px;
        color: var(--text-muted);
    }

    .hwid-cell-last {
        order: 3;
        font-size: 12px;
        color: var(--text-muted);
    }

    .hwid-cell-os::before {
        content: "ОС: ";
    }

    .hwid-cell-last::before {
        content: "Активность: ";
    }

    .hwid-cell-action {
        order: 4;
        justify-content: flex-start;
        padding-top: 2px;
    }

    .hwid-delete-btn {
        width: 30px;
        height: 30px;
    }

    .tariff-title {
        font-size: 20px;
    }

    .price-tag {
        font-size: 28px;
    }

    .tariff-card-accent {
        min-height: 24px;
        font-size: 12px;
        padding: 3px 10px;
    }

    .tariff-payment-methods {
        grid-template-columns: 1fr;
    }

    .tariff-payment-method-btn {
        height: 42px;
        border-radius: 10px;
    }

    .tariff-success-icon {
        width: 78px;
        height: 78px;
    }

    .tariff-success-icon i {
        font-size: 36px;
    }

    .tariff-success-title {
        font-size: 16px;
    }

    .admin-modules-grid {
        grid-template-columns: 1fr;
    }

    .admin-mini-stats {
        grid-template-columns: 1fr;
    }

    .admin-table th,
    .admin-table td {
        font-size: 12px;
        padding: 8px 6px;
    }

    .admin-row-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .admin-user-transactions-table {
        min-width: 700px;
    }

    .admin-notifications-table {
        min-width: 700px;
    }
}

@media (max-width: 420px) {
    :root {
        --mobile-sidebar-height: 68px;
    }

    .nav-item i {
        font-size: 18px;
    }

    .nav-item {
        min-height: 52px;
    }

    .auth-card {
        border-radius: 14px;
        padding: 12px;
    }

    .auth-brand {
        gap: 10px;
    }

    .auth-brand-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .auth-brand-icon img {
        width: 28px;
        height: 28px;
    }

    .auth-brand-text h1 {
        font-size: 20px;
    }

    .topup-modal-head h2 {
        font-size: 16px;
    }

    .topup-modal-close {
        width: 30px;
        height: 30px;
    }

    .sub-item {
        padding: 12px;
    }

    .tariff-card {
        padding: 14px 12px 12px;
    }
}












.accounting-chart-shell {
    min-height: 220px;
}

.accounting-chart-canvas {
    display: block;
    width: 100%;
    height: 220px;
}

@media (max-width: 760px) {

#admin-accounting-page .section-title {
    font-size: 32px;
    line-height: 1.15;
    margin-bottom: 18px;
}

#admin-accounting-page .accounting-empty-note {
    max-width: 680px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-secondary);
}

#admin-accounting-page .admin-users-meta {
    font-size: 16px;
    line-height: 1.45;
}

#admin-accounting-page .accounting-kpi {
    padding: 18px 20px;
    border-radius: 18px;
}

#admin-accounting-page .accounting-kpi-label {
    font-size: 15px;
    line-height: 1.35;
}

#admin-accounting-page .accounting-kpi-value {
    font-size: 34px;
    line-height: 1.1;
}

.accounting-chart-shell {
    width: min(100%, 680px);
    min-height: 470px;
    margin: 22px auto 0;
    padding: 14px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: var(--surface-50);
}

.accounting-chart-canvas {
    display: block;
    width: 100%;
    height: 470px;
}

#admin-accounting-page .accounting-chart-tooltip {
    font-size: 16px;
    line-height: 1.45;
    padding: 14px 16px;
    min-width: 260px;
}

#admin-accounting-page .accounting-tooltip-date {
    font-size: 18px;
    margin-bottom: 10px;
}

#admin-accounting-page .accounting-tooltip-list {
    gap: 8px;
}

@media (max-width: 760px) {
    #admin-accounting-page .section-title {
        font-size: 24px;
        margin-bottom: 14px;
    }

    #admin-accounting-page .accounting-empty-note {
        max-width: 100%;
        font-size: 14px;
    }

    #admin-accounting-page .admin-users-meta {
        font-size: 14px;
    }

    #admin-accounting-page .accounting-kpi-value {
        font-size: 26px;
    }

    .accounting-chart-shell {
        width: 100%;
        min-height: 240px;
        padding: 10px 12px;
    }

    .accounting-chart-canvas {
        height: 240px;
    }

    #admin-accounting-page .accounting-chart-tooltip {
        font-size: 14px;
        min-width: 220px;
    }

    #admin-accounting-page .accounting-tooltip-date {
        font-size: 16px;
    }
}

.admin-users-hwid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.admin-users-hwid-toolbar-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-users-hwid-toolbar-copy .section-title {
    margin-bottom: 0;
}

.admin-users-hwid-toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-users-hwid-toolbar-form {
    display: grid;
    grid-template-columns: minmax(280px, 1.4fr) minmax(180px, 0.7fr) auto;
    gap: 12px;
    align-items: end;
}

.admin-users-hwid-toolbar-form .btn {
    white-space: nowrap;
}

.admin-user-feature-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    background: var(--surface-50);
}

.admin-user-feature-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-user-feature-grid {
    margin-top: 4px;
}

@media (max-width: 760px) {
    .admin-users-hwid-toolbar {
        align-items: stretch;
    }

    .admin-users-hwid-toolbar-form,
    .admin-users-hwid-toolbar-actions {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .admin-users-hwid-toolbar-form .btn,
    .admin-users-hwid-toolbar-actions .btn {
        flex: 1 1 100%;
    }
}

html.auth-session-present body::before,
html.auth-session-present body::after {
    content: none;
    display: none;
}

html.auth-session-present .auth-session-loader {
    display: flex;
}

html.auth-session-present:has(#appRoot:not(.app-hidden)) .auth-session-loader {
    display: none;
}

.auth-session-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 38%, rgba(11, 119, 228, 0.12), transparent 34%),
        var(--app-bg);
    color: var(--text-secondary);
}

.auth-session-loader p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
}

html.auth-session-present body::before,
html.auth-session-present body::after {
    content: none;
    display: none;
}

html.auth-session-present .auth-session-loader {
    display: flex;
}

.auth-session-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    background: var(--app-bg);
    color: var(--text-secondary);
}

.auth-session-loader p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-loader-machine,
.auth-loader-press,
.auth-loader-press-head,
.auth-loader-belt,
.auth-loader-track,
.auth-loader-token,
.auth-loader-shadow {
    display: none;
}

.auth-loader-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 4px solid rgba(11, 119, 228, 0.18);
    border-top-color: var(--brand-500);
    box-shadow: 0 12px 28px -20px rgba(11, 119, 228, 0.65);
    animation: authLoaderSpinner 0.75s linear infinite;
}

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