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

    --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.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 {
    width: min(460px, 100%);
    background: var(--surface-0);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow-float);
}

.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-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;
}

.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;
}

.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 .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 .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-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;
}

.tariffs-section .grid-2cols {
    margin-top: 0;
}

.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-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-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 8px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    min-height: 44px;
    width: 100%;
    text-align: left;
    white-space: pre-line;
}

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

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

.tariff-description ul,
.tariff-description ol {
    margin: 0 0 6px 18px;
    padding: 0;
}

.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-actions-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

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

.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-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;
}

.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: hidden;
}

.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;
}

.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-muted);
    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: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);
}

.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;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-users-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.admin-users-search input {
    flex: 1 1 280px;
    min-width: 180px;
    height: 40px;
    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-users-search input:focus {
    outline: 2px solid rgba(11, 119, 228, 0.22);
    border-color: var(--brand-500);
}

.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: 720px;
}

.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-users-page-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.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 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="text"],
.admin-field input[type="number"] {
    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-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-field input:focus,
.admin-field textarea: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-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 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-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%;
    }

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

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

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

    .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;
        overflow: visible;
    }

    .sidebar,
    .sidebar.expanded,
    .sidebar.collapsed {
        position: fixed;
        left: 0;
        right: auto;
        top: 0;
        bottom: 0;
        width: min(82vw, 312px) !important;
        height: 100vh;
        min-height: 100vh;
        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));
        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;
    }

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

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

    .topup-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;
    }

    .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-device-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-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-search {
        width: 100%;
    }

    .admin-users-search input {
        min-width: 0;
        flex: 1 1 100%;
    }

    .admin-users-search .btn {
        flex: 1 1 calc(50% - 5px);
        width: auto;
    }

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

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

    .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;
    }

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

    .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;
    }
}

@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;
    }
}










