@import url("/assets/css/fonts.css");
@import url("/assets/css/style-kit.css");

:root {
    color-scheme: dark;
    --d-bg: #030303;
    --d-surface: #080808;
    --d-raised: #0c0c0c;
    --d-border: rgba(255, 255, 255, 0.09);
    --ui-workspace-bg: #030303;
    --ui-bg: var(--d-bg);
    --ui-surface: var(--d-raised);
    --ui-surface-elevated: #121212;
    --ui-panel: rgba(8, 8, 8, 0.97);
    --ui-text: #f4f4f8;
    --ui-muted: #8b8b9a;
    --bg: var(--d-bg);
    --panel: var(--d-surface);
    --text: var(--ui-text);
    --muted: var(--ui-muted);
    --accent: var(--ui-accent);
    --danger: var(--ui-danger);
    --ok: var(--ui-ok);
    --border: var(--d-border);
    --scrollbar-thumb: rgba(255, 255, 255, 0.2);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.32);
    --scrollbar-track: rgba(255, 255, 255, 0.04);
    --nav-accent-rgb: 244, 63, 94;
    --accent-rgb: 244, 63, 94;
}

[data-accent="blue"] {
    --nav-accent-rgb: 59, 130, 246;
    --accent-rgb: 59, 130, 246;
    --ui-accent: #3b82f6;
    --ui-btn-primary-bg: linear-gradient(180deg, rgba(59, 130, 255, 0.98) 0%, rgba(22, 78, 190, 0.98) 100%);
    --ui-btn-primary-border: rgba(126, 185, 255, 0.95);
    --ui-focus-ring: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

[data-accent="violet"] {
    --nav-accent-rgb: 139, 92, 246;
    --accent-rgb: 139, 92, 246;
    --ui-accent: #a78bfa;
    --ui-btn-primary-bg: linear-gradient(180deg, rgba(139, 92, 246, 0.98) 0%, rgba(91, 33, 182, 0.98) 100%);
    --ui-btn-primary-border: rgba(196, 181, 253, 0.95);
    --ui-focus-ring: 0 0 0 2px rgba(139, 92, 246, 0.22);
}

[data-accent="emerald"] {
    --nav-accent-rgb: 16, 185, 129;
    --accent-rgb: 16, 185, 129;
    --ui-accent: #34d399;
    --ui-btn-primary-bg: linear-gradient(180deg, rgba(16, 185, 129, 0.98) 0%, rgba(5, 122, 85, 0.98) 100%);
    --ui-btn-primary-border: rgba(110, 231, 183, 0.95);
    --ui-focus-ring: 0 0 0 2px rgba(16, 185, 129, 0.22);
}

[data-accent="rose"] {
    --nav-accent-rgb: 244, 63, 94;
    --accent-rgb: 244, 63, 94;
    --ui-accent: #fb7185;
    --ui-btn-primary-bg: linear-gradient(180deg, rgba(244, 63, 94, 0.98) 0%, rgba(190, 18, 60, 0.98) 100%);
    --ui-btn-primary-border: rgba(253, 164, 175, 0.95);
    --ui-focus-ring: 0 0 0 2px rgba(244, 63, 94, 0.22);
}

[data-accent="amber"] {
    --nav-accent-rgb: 245, 158, 11;
    --accent-rgb: 245, 158, 11;
    --ui-accent: #fbbf24;
    --ui-btn-primary-bg: linear-gradient(180deg, rgba(245, 158, 11, 0.98) 0%, rgba(180, 83, 9, 0.98) 100%);
    --ui-btn-primary-border: rgba(253, 224, 71, 0.95);
    --ui-focus-ring: 0 0 0 2px rgba(245, 158, 11, 0.22);
}

[data-theme="light"] {
    color-scheme: light;
    --d-bg: #cfd6df;
    --d-surface: #dde3eb;
    --d-raised: #d8dee8;
    --d-border: rgba(15, 23, 42, 0.11);
    --ui-text: #1e293b;
    --ui-muted: #5c6b7d;
    --ui-workspace-bg: #c8d0db;
    --ui-surface: #dde3eb;
    --ui-surface-elevated: #d3dae5;
    --ui-panel: rgba(221, 227, 235, 0.97);
    --bg: var(--d-bg);
    --panel: var(--d-surface);
    --text: var(--ui-text);
    --muted: var(--ui-muted);
    --scrollbar-thumb: rgba(15, 23, 42, 0.28);
    --scrollbar-thumb-hover: rgba(15, 23, 42, 0.42);
    --scrollbar-track: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] body {
    background: var(--d-bg);
    color: var(--text);
}

[data-theme="light"] .login-card {
    background: var(--d-surface);
    border-color: var(--d-border);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .topbar-user {
    border-color: rgba(15, 23, 42, 0.1);
    background: var(--ui-surface);
}

[data-theme="light"] .sidebar {
    background: var(--d-raised);
    border-right-color: rgba(15, 23, 42, 0.1);
    color: #1e293b;
}

[data-theme="light"] .brand {
    color: #0f172a;
}

[data-theme="light"] .sidebar-nav-cat {
    color: #64748b;
}

[data-theme="light"] .nav-btn {
    color: #334155;
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .nav-btn:hover:not(.nav-btn--locked) {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.07);
}

[data-theme="light"] .nav-btn--locked {
    color: #94a3b8;
    opacity: 0.75;
}

[data-theme="light"] .nav-btn.active:not(.nav-btn--locked) {
    color: #0f172a;
    background: rgba(var(--nav-accent-rgb), 0.12);
    border-color: rgba(var(--nav-accent-rgb), 0.35);
}

[data-theme="light"] .online-chip {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.12);
    color: #166534;
}

[data-theme="light"] h2 {
    color: #0f172a;
}

[data-theme="light"] .card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
    color: #0f172a;
}

[data-theme="light"] table thead th {
    background: rgba(241, 245, 249, 1);
    color: #334155;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

[data-theme="light"] table tbody td {
    color: #1e293b;
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] tbody tr:nth-child(odd) td {
    background: #ffffff;
}

[data-theme="light"] tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, 1);
}

[data-theme="light"] tbody tr:hover td {
    background: rgba(var(--nav-accent-rgb), 0.08);
}

[data-theme="light"] .field-label,
[data-theme="light"] .card .row label {
    color: #475569;
}

[data-theme="light"] #app input:not([type="checkbox"]):not([type="radio"]):not(.hidden),
[data-theme="light"] #app select:not(.hidden),
[data-theme="light"] #app textarea {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.18);
    color: #0f172a;
    box-shadow: none;
}

[data-theme="light"] #app textarea:focus,
[data-theme="light"] #app input:focus,
[data-theme="light"] #app select:not(.hidden):focus {
    border-color: rgba(var(--nav-accent-rgb), 0.55);
    box-shadow: var(--ui-focus-ring);
}

[data-theme="light"] #tab-manage textarea.keygen-result-area,
[data-theme="light"] #tab-manage #importPayload {
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fafafa;
}

[data-theme="light"] .stat-label {
    color: #64748b;
}

[data-theme="light"] .stat-value {
    color: #0f172a;
}

[data-theme="light"] .topbar-name {
    color: #0f172a;
}

[data-theme="light"] .topbar-role {
    color: #64748b;
}

[data-theme="light"] #tab-profile .card {
    background: #eef1f6;
    border-color: rgba(15, 23, 42, 0.09);
    color: #1e293b;
}

[data-theme="light"] .profile-card-hint,
[data-theme="light"] .profile-field-row label,
[data-theme="light"] .profile-confirm-row label {
    color: #64748b;
}

[data-theme="light"] .profile-email-confirm-label {
    color: #475569;
}

[data-theme="light"] .profile-email-hint-box {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.12);
    color: #475569;
}

[data-theme="light"] .profile-email-hint-box.is-verified {
    color: #166534;
}

[data-theme="light"] .profile-email-hint-box.muted {
    color: #64748b;
}

[data-theme="light"] .input-readonly {
    background: rgba(15, 23, 42, 0.06) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
}

[data-theme="light"] #tab-profile .profile-field-row input:not(.input-readonly),
[data-theme="light"] #tab-profile .profile-password-stack input,
[data-theme="light"] #profileDisplayName,
[data-theme="light"] #profileEmailInput,
[data-theme="light"] #profileEmailCode {
    border: 1px solid rgba(15, 23, 42, 0.22) !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] #tab-profile .profile-section-head h2 {
    color: #0f172a;
}

[data-theme="light"] .user-menu {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .btn-secondary-lite {
    background: rgba(15, 23, 42, 0.06) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    color: #334155 !important;
}

[data-theme="light"] .chat-messages {
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: #0f172a;
}

[data-theme="light"] .chat-bubble {
    background: rgba(var(--nav-accent-rgb), 0.1);
    border: 1px solid rgba(var(--nav-accent-rgb), 0.28);
    backdrop-filter: none;
}

[data-theme="light"] .chat-bubble .meta {
    color: #475569;
}

[data-theme="light"] .chat-bubble .text {
    color: #0f172a;
}

[data-theme="light"] .chat-message--own .chat-bubble {
    background: rgba(var(--nav-accent-rgb), 0.22);
    border-color: rgba(var(--nav-accent-rgb), 0.42);
}

[data-theme="light"] .chat-message--own .chat-bubble .meta {
    color: #334155;
}

[data-theme="light"] .chat-message--own .chat-bubble .text {
    color: #0f172a;
}

[data-theme="light"] .chat-composer textarea {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

[data-theme="light"] .chat-counter {
    color: #64748b;
}

[data-theme="light"] .login-card .field-wrap label,
[data-theme="light"] .login-title {
    color: #0f172a;
}

[data-theme="light"] .login-subtitle {
    color: #64748b;
}

[data-theme="light"] .login-remember-text {
    color: #475569;
}

[data-theme="light"] .login-footer {
    color: #64748b;
}

* { box-sizing: border-box; }

html {
    font-family: var(--font-sans);
}

body * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body::-webkit-scrollbar,
body *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body::-webkit-scrollbar-track,
body *::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 100px;
}

body::-webkit-scrollbar-thumb,
body *::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 100px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

body::-webkit-scrollbar-thumb:hover,
body *::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    border: 2px solid transparent;
    background-clip: padding-box;
}

body::-webkit-scrollbar-corner,
body *::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--d-bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
    overflow-x: hidden;
}

.page-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: rgba(3, 3, 3, 0.98);
    color: #e2e8f0;
    transition: opacity 0.38s ease, visibility 0.38s ease;
}

.page-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-preloader-spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(var(--nav-accent-rgb), 0.95);
    border-right-color: rgba(var(--nav-accent-rgb), 0.55);
    animation: la-spin 1.05s cubic-bezier(.4,.01,.22,1) infinite;
    box-shadow: 0 0 26px rgba(var(--nav-accent-rgb), 0.24);
}

.page-preloader-progress {
    width: min(380px, calc(100vw - 44px));
    height: 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.page-preloader-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(var(--nav-accent-rgb), 0.62), rgba(var(--nav-accent-rgb), 0.96));
    transition: width .28s ease;
}

.page-preloader-text {
    font-size: 13px;
    color: #aab4c8;
    letter-spacing: .02em;
}

#ownerVerificationPending {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#ownerVerificationPending.hidden {
    display: none;
}

.owner-pending-card {
    width: min(560px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(10, 10, 10, 0.96);
    box-shadow: 0 20px 64px rgba(0, 0, 0, 0.62);
    padding: 22px 20px;
    color: #eef2ff;
    text-align: center;
}

.owner-pending-card h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.login-freeze-notice {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(180deg, rgba(127, 0, 0, 0.5) 0%, rgba(59, 8, 8, 0.72) 38%, rgba(7, 10, 16, 0.9) 100%);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-freeze-notice.hidden {
    display: none !important;
}

.login-freeze-card {
    max-width: 560px;
    width: 100%;
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    text-align: center;
}

.login-freeze-title {
    margin: 0 0 10px;
    color: #fca5a5;
}

.login-freeze-avatar {
    width: 78px;
    height: 78px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
}

.login-freeze-avatar svg {
    width: 34px;
    height: 34px;
}

.login-freeze-line {
    margin: 0 0 8px;
}

.login-freeze-line:last-child {
    margin-bottom: 0;
}

.login-freeze-period {
    margin: 12px auto 14px;
    max-width: 360px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.login-freeze-period-line {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
}

.login-freeze-period-line + .login-freeze-period-line {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.login-freeze-logout-link {
    margin: 6px auto 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    color: #f43f5e;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-align: center;
}

.login-freeze-logout-link:hover {
    color: #fb7185;
    background: transparent;
    border: none;
    box-shadow: none;
    text-decoration: underline;
}

.moderation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
    align-items: start;
}

.moderation-ban-side {
    position: sticky;
    top: 12px;
    width: 100%;
    min-width: 0;
    align-self: start;
    box-sizing: border-box;
}

.moderation-ban-side .field-label {
    margin-top: 10px;
    margin-bottom: 6px;
    line-height: 1.35;
}

.moderation-ban-side input[type="text"],
.moderation-ban-side input[type="datetime-local"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.moderation-ban-side .login-remember {
    margin-top: 10px;
}

.moderation-ban-preview {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    min-height: 70px;
}

.moderation-preview-user {
    font-weight: 700;
    color: #e9f1ff;
    margin-bottom: 4px;
}

.moderation-preview-line {
    font-size: 12px;
    line-height: 1.45;
}

.moderation-preview-status.is-active {
    color: #86efac;
}

.moderation-preview-status.is-blocked {
    color: #fca5a5;
}

.moderation-preview-reason {
    color: #a7b2c8;
}

.moderation-preview-reason span {
    color: #e4eaf5;
}

.moderation-preview-unban {
    color: #93c5fd;
}

.moderation-preview-unban span {
    color: #d6e6ff;
}

.moderation-ban-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.moderation-ban-actions .btn-save,
.moderation-ban-actions .btn-cancel {
    width: 100%;
    min-width: 0;
    white-space: nowrap;
}

.ticket-filters {
    display: grid;
    grid-template-columns: 150px 170px minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 10px 0 12px;
}

.ticket-filters > .picker {
    min-width: 170px;
}

.ticket-thread-card textarea {
    min-height: 92px;
}

.ticket-message-wrap {
    position: relative;
}

.ticket-message-wrap textarea {
    padding-right: 48px;
}

.ticket-attach-icon-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(217, 70, 110, 0.62);
    background: rgba(56, 11, 25, 0.92);
    color: #ffd6e2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, transform .16s ease;
}

.ticket-attach-icon-btn:hover {
    border-color: rgba(244, 114, 182, 0.85);
    color: #ffe7ef;
    transform: translateY(-1px);
}

.ticket-attach-icon-btn svg {
    display: block;
    width: 16px;
    height: 16px;
}

.modal-card--ticket-thread {
    width: min(1120px, calc(100vw - 20px));
    margin: min(4vh, 36px) auto 14px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.modal-card--ticket-thread .keygen-modal-body {
    overflow: auto;
}

#ticketThread {
    max-height: 52vh;
    overflow: auto;
    min-height: 120px;
}

.ticket-thread-msg {
    display: flex;
    margin-bottom: 10px;
    gap: 10px;
    align-items: flex-start;
}

.ticket-thread-msg.is-left {
    justify-content: flex-start;
}

.ticket-thread-msg.is-right {
    justify-content: flex-end;
}

.ticket-thread-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #11161f;
    flex-shrink: 0;
}

.ticket-thread-msg.is-right .ticket-thread-msg-avatar {
    order: 2;
}

.ticket-thread-msg-bubble {
    width: min(100%, 86%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(10, 10, 10, 0.58);
}

.ticket-thread-msg.role-developer .ticket-thread-msg-bubble {
    border-color: rgba(168, 85, 247, 0.52);
    background: rgba(88, 28, 135, 0.2);
}

.ticket-thread-msg.role-admin .ticket-thread-msg-bubble {
    border-color: rgba(244, 63, 94, 0.52);
    background: rgba(127, 29, 29, 0.2);
}

.ticket-thread-msg.role-staff .ticket-thread-msg-bubble {
    border-color: rgba(245, 158, 11, 0.48);
    background: rgba(120, 53, 15, 0.2);
}

.ticket-thread-msg.is-right .ticket-thread-msg-bubble {
    border-color: rgba(var(--nav-accent-rgb), 0.38);
    background: rgba(var(--nav-accent-rgb), 0.12);
}

.ticket-thread-msg-head {
    font-size: 14px;
}

.ticket-thread-msg-time {
    font-size: 11px;
    margin-top: 2px;
}

.ticket-thread-msg-text {
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.45;
}

.ticket-thread-msg-attach {
    margin-top: 8px;
}

.ticket-thread-msg-attach img {
    max-width: min(260px, 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ticket-thread-actions-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

#ticketThreadModal .ticket-thread-attach-row {
    align-items: center;
}

#ticketThreadModal .ticket-thread-attach-row .btn-cancel,
#ticketThreadModal .ticket-thread-actions-row > .btn-save,
#ticketThreadModal #ticketSaveStatusBtn {
    min-height: 42px;
    border-radius: 999px;
    padding-left: 18px;
    padding-right: 18px;
}

#ticketStatusControls {
    display: grid;
    grid-template-columns: minmax(180px, 240px) auto;
    align-items: center;
    gap: 10px !important;
}

#ticketStatusSelect {
    min-height: 42px;
    border-radius: 12px;
}

.ticket-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ticket-status-badge--open {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.14);
}

.ticket-status-badge--progress {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.14);
}

.ticket-status-badge--closed {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.14);
}

.ticket-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ticket-live-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.ticket-live-badge--active {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.14);
}

.ticket-live-badge--paused {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(148, 163, 184, 0.12);
}

@media (max-width: 980px) {
    .moderation-grid {
        grid-template-columns: 1fr;
    }
    .moderation-ban-side {
        position: static;
        top: auto;
    }
    .moderation-ban-actions {
        grid-template-columns: 1fr;
    }
    .ticket-filters {
        grid-template-columns: 1fr;
    }
}

@keyframes la-spin {
    to { transform: rotate(360deg); }
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 14px;
    background: radial-gradient(1200px 620px at 50% -120px, rgba(76, 83, 118, 0.16), transparent 58%);
}

.login-card {
    width: min(520px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(13, 15, 24, 0.96) 0%, rgba(12, 14, 22, 0.98) 100%);
    box-shadow: 0 22px 52px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 28px 26px 22px;
    border-radius: 10px;
}

.login-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-align: center;
}

.login-subtitle {
    margin: 8px 0 24px;
    color: #c6d0e6;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.4;
    text-align: center;
}

.field-wrap {
    margin-bottom: 16px;
}

.field-wrap label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #d9e5ff;
}

.field-wrap input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(17, 20, 30, 0.82);
    color: #f3f6ff;
    padding: 0 14px;
    box-shadow: none;
}

.field-wrap select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(17, 20, 30, 0.82);
    color: #f3f6ff;
    padding: 0 14px;
    box-shadow: none;
}

.captcha-inline-row {
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.captcha-refresh-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    border: 1px solid rgba(var(--nav-accent-rgb), 0.45);
    background: rgba(var(--nav-accent-rgb), 0.12);
    color: var(--ui-accent);
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.captcha-refresh-btn:hover {
    transform: rotate(-28deg);
    background: rgba(var(--nav-accent-rgb), 0.18);
    border-color: rgba(var(--nav-accent-rgb), 0.7);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 0;
    cursor: pointer;
    font-size: 14px;
    color: #c5d4ef;
    user-select: none;
}
.login-remember input.login-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.login-remember--custom {
    position: relative;
    align-items: flex-start;
    gap: 12px;
    padding-left: 2px;
}

.login-checkbox-ui {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 6px;
    border: 2px solid rgba(148, 163, 184, 0.5);
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.login-remember--custom:focus-within .login-checkbox-ui {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.login-checkbox-input:checked + .login-checkbox-ui {
    border-color: rgba(96, 165, 250, 0.95);
    background: rgba(59, 130, 246, 0.22);
}

.login-checkbox-input:checked + .login-checkbox-ui::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #e8f4ff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.login-remember-text {
    line-height: 1.45;
    display: block;
}

.login-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 0;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 8px;
    background: #ffffff;
    color: #0b1020;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.login-btn:hover {
    border-color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.45);
}

.login-register-link.btn-cancel {
    margin: 14px 0 0;
    min-height: 44px;
    width: 120px;
    border-radius: 999px;
    border: 1px solid rgba(244, 63, 94, 0.62);
    background: rgba(244, 63, 94, 0.08);
    color: #ff6b84;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-register-link.btn-cancel:hover {
    color: #ff9ab0;
    background: rgba(244, 63, 94, 0.14);
    border-color: rgba(244, 63, 94, 0.82);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.26);
    text-decoration: none;
}

.login-register-link--plain {
    margin: 14px 0 0;
    padding: 0;
    min-height: 0;
    width: auto;
    border: none;
    background: transparent;
    box-shadow: none;
    color: #f43f5e;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    display: inline;
    text-align: left;
}

.login-register-link--plain:hover {
    color: #fb7185;
    text-decoration: underline;
    background: transparent;
    border: none;
    box-shadow: none;
}

.login-msg {
    margin-top: 12px;
    text-align: center;
    color: #99b8f8;
    min-height: 20px;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    color: #93a6cf;
    font-size: 13px;
}

#registerAccountTypePicker .picker-btn {
    min-height: 44px;
    border-radius: 10px;
    border-color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(12, 12, 12, 0.98));
    color: #f3f4f6;
    font-size: 14px;
    padding-top: 8px;
    padding-bottom: 8px;
}

#registerAccountTypePicker .picker-btn:hover {
    border-color: rgba(255, 255, 255, 0.38);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

#registerAccountTypePicker .picker-menu {
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(14, 14, 14, 0.99), rgba(8, 8, 8, 0.99));
}

#registerAccountTypePicker .picker-search {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(10, 10, 10, 0.96);
    color: #f3f4f6;
}

#registerAccountTypePicker .picker-item {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #f3f4f6;
}

#registerAccountTypePicker .picker-item:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.layout {
    display: grid;
    grid-template-columns: minmax(210px, 248px) 1fr;
    min-height: 100vh;
    align-items: stretch;
}

.layout-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.sidebar {
    padding: 10px 12px 20px;
    border-right: 1px solid var(--d-border);
    background: var(--d-surface);
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 4px;
    padding: 10px 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 4px 6px 6px;
    margin: 0;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.brand-block:hover {
    background: rgba(255, 255, 255, 0.04);
}

.brand {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.brand-wrap { display: flex; align-items: center; gap: 10px; }

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.88;
}

.online-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(74, 222, 128, 0.28);
    background: rgba(22, 101, 52, 0.2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #bbf7d0;
    text-transform: uppercase;
}
.online-chip .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
    align-self: center;
}
.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 0 8px;
}

.sidebar-chat-slot {
    flex-shrink: 0;
    margin-top: auto;
    padding: 10px 0 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-chat-btn {
    width: 100%;
    justify-content: flex-start;
}

.sidebar-chat-btn .nav-btn-main {
    width: 100%;
}

.sidebar-nav-block {
    border: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav-block + .sidebar-nav-block {
    margin-top: 6px;
}

.sidebar-nav-cat {
    list-style: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 8px 6px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-nav-cat::-webkit-details-marker {
    display: none;
}

.sidebar-nav-cat::marker,
.sidebar-nav-cat::-moz-list-bullet {
    display: none;
    content: "";
}

.sidebar-nav-cat::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.22);
    transition: transform 0.18s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.sidebar-nav-block:not([open]) .sidebar-nav-cat::after {
    transform: rotate(-90deg);
}

.sidebar-nav-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 0 6px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    margin-bottom: 0;
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
    font-weight: 500;
    font-size: 13px;
}

.nav-btn-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nav-btn-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn-lock-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.nav-btn--locked {
    opacity: 0.52;
    cursor: not-allowed;
    color: #8b92a3;
}

.nav-btn--locked .nav-btn-lock-icon {
    opacity: 1;
    color: rgba(251, 191, 36, 0.75);
}

.nav-btn--locked:hover {
    color: #8b92a3;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover:not(.nav-btn--locked) {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    transform: none;
    box-shadow: none;
}

.nav-btn.active:not(.nav-btn--locked) {
    color: #fff;
    background: rgba(var(--nav-accent-rgb), 0.14);
    border-color: rgba(var(--nav-accent-rgb), 0.28);
    box-shadow: inset 2px 0 0 0 rgba(var(--nav-accent-rgb), 0.85);
    transform: none;
}

.content {
    padding: 24px 28px;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
    background: var(--ui-workspace-bg);
}

.mobile-menu-btn {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 4200;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(180deg, rgba(40, 40, 40, 0.96), rgba(22, 22, 22, 0.98));
    color: #eceff5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 20px;
    line-height: 1;
}

.mobile-menu-btn svg {
    width: 19px;
    height: 19px;
}

.mobile-menu-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: linear-gradient(180deg, rgba(52, 52, 52, 0.98), rgba(26, 26, 26, 0.98));
}

.mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 4050;
}

.card {
    background: var(--d-raised);
    border: 1px solid var(--d-border);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    transform: none;
}

h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }

.row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stats-grid--in-card {
    margin-bottom: 0;
}

.stats-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid--dash {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

@media (max-width: 1100px) {
    .stats-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .stats-grid--four {
        grid-template-columns: 1fr;
    }
}

.dashboard-map-card {
    margin-top: 16px;
}

.dashboard-map-card h3 {
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: 0 0 6px;
    color: #f8fafc;
}

.dashboard-map-lead {
    font-size: 12px;
    margin: 0 auto 16px;
    max-width: 42rem;
    text-align: center;
    line-height: 1.45;
    color: rgba(148, 163, 184, 0.95);
}

.dashboard-world-map {
    width: 100%;
    height: clamp(300px, 48vh, 580px);
    min-height: 300px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
}

.dashboard-map-tooltip {
    position: absolute;
    z-index: 6;
    max-width: min(260px, calc(100% - 16px));
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(5, 7, 12, 0.92);
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-line;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: opacity 0.12s ease;
}

[data-theme="light"] .dashboard-map-card h3 {
    color: #0f172a;
}

[data-theme="light"] .dashboard-map-lead {
    color: #64748b;
}

[data-theme="light"] .dashboard-world-map {
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .dashboard-map-tooltip {
    border-color: rgba(15, 23, 42, 0.18);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
}

.loader-api-settings {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px 24px;
    align-items: end;
    max-width: 920px;
}

.loader-api-title {
    font-size: 16px;
    margin: 0 0 4px;
    grid-column: 1 / -1;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.loader-api-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.loader-api-field .field-label {
    font-size: 12px;
    color: var(--muted);
}

.loader-api-input {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-bottom: 0;
    padding: 10px 12px;
    border-radius: 8px;
}

.loader-api-settings .btn-save {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 4px;
    min-height: 38px;
    padding: 8px 20px;
    border-radius: 10px;
}

.security-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

    .security-form-row--bans {
        grid-template-columns: 1fr;
    }
}

.security-form-row {
    align-items: center;
}

.security-form-row--bans {
    display: grid;
    grid-template-columns: minmax(120px, 150px) minmax(190px, 1fr) minmax(170px, 1fr) auto minmax(210px, 240px) auto;
    gap: 10px;
    align-items: center;
}

.security-form-row--bans .picker,
.security-form-row--bans .security-input,
.security-form-row--bans button {
    margin: 0;
}

.security-form-row--bans .security-check {
    margin: 0;
    white-space: nowrap;
}

.security-filters {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.security-filters select.pretty-select {
    min-width: min(240px, 100%);
    flex: 0 1 auto;
}

[data-theme="dark"] #app .security-input[type="date"],
[data-theme="dark"] #app .security-input[type="datetime-local"] {
    color-scheme: dark;
}

[data-theme="light"] #app .security-input[type="date"],
[data-theme="light"] #app .security-input[type="datetime-local"] {
    color-scheme: light;
}

.security-input {
    min-width: 120px;
    flex: 1;
}

.security-input--short {
    max-width: 72px;
    flex: 0 0 auto;
}

.security-col-blocked-countries h3 {
    margin-bottom: 10px;
}

.blocked-countries-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.blocked-countries-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.blocked-countries-input-code {
    flex: 0 0 76px;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.blocked-countries-input-note {
    flex: 1 1 140px;
    min-width: 0;
}

#tab-security .blocked-countries-add-btn.btn-save {
    border-radius: 10px;
    min-height: 42px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    flex: 1 1 140px;
    box-shadow: 0 0 18px rgba(var(--nav-accent-rgb), 0.14);
}

.table-scroll--blocked-countries {
    margin-top: 0;
}

.table-scroll--blocked-countries table.blocked-countries-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.blocked-countries-table .blocked-countries-col-actions {
    width: 48px;
    max-width: 48px;
    text-align: center;
}

.blocked-countries-table .mono-cell {
    width: 64px;
    max-width: 72px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.blocked-countries-table td:nth-child(2) {
    word-break: break-word;
}

.blocked-countries-actions {
    text-align: center;
    vertical-align: middle;
    padding-left: 6px;
    padding-right: 6px;
}

.blocked-countries-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.blocked-countries-actions button:hover {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.55);
    color: #fecaca;
}

.blocked-countries-empty {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 18px 12px !important;
    border-bottom: none !important;
    background: transparent !important;
}

[data-theme="light"] .blocked-countries-panel {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(248, 250, 252, 0.85);
    box-shadow: none;
}

[data-theme="light"] .blocked-countries-actions button {
    border-color: rgba(190, 18, 60, 0.25);
    background: rgba(254, 226, 226, 0.5);
    color: #9f1239;
}

[data-theme="light"] .blocked-countries-actions button:hover {
    background: rgba(254, 226, 226, 0.85);
    border-color: rgba(190, 18, 60, 0.4);
}

.security-events-table {
    font-size: 12px;
}

.security-events-table .mono-cell {
    font-family: var(--font-mono);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-inline-danger {
    padding: 0 6px;
    margin-left: 6px;
    font-size: 12px;
}

.product-versions-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    font-size: 13px;
}

.product-version-add {
    align-items: center;
    gap: 10px;
}

.product-version-add > input:not([type="checkbox"]) {
    flex: 1 1 130px;
    min-width: 0;
}

.pv-latest-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    white-space: nowrap;
}

#productModal .product-version-add button.btn-save.product-version-add-btn {
    border-radius: 10px;
    min-height: 42px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.01em;
    box-shadow: 0 0 20px rgba(var(--nav-accent-rgb), 0.16);
}

[data-theme="light"] .pv-latest-label {
    color: #64748b;
}

.keygen-one-time-row {
    margin-top: 8px;
}

.keygen-one-time-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.stat-card {
    background: var(--ui-surface-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 16px;
    box-shadow: none;
}

.stat-label {
    font-size: 13px;
    color: #a9bce6;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

.stats-grid--online-compact {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.stats-grid--online-compact .stat-card {
    padding: 10px 12px;
    border-radius: 8px;
}

.stats-grid--online-compact .stat-label {
    font-size: 11px;
    margin-bottom: 4px;
}

.stats-grid--online-compact .stat-value {
    font-size: 24px;
}

.online-refresh-btn {
    margin: 0;
}

.online-ip-mask {
    display: inline-block;
    min-width: 78px;
    letter-spacing: 0.02em;
    cursor: help;
}

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

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    border-radius: var(--ui-radius-md);
    border: 1px solid var(--ui-border-soft);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    color: var(--text);
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

/* Native <select> list: OS popup follows theme; option colors where supported */
[data-theme="dark"] #app select:not(.hidden) {
    color-scheme: dark;
}

[data-theme="light"] #app select:not(.hidden) {
    color-scheme: light;
}

[data-theme="dark"] #app select:not(.hidden) option,
[data-theme="dark"] #app select:not(.hidden) optgroup {
    background-color: #16181f;
    color: #e8eaef;
}

[data-theme="light"] #app select:not(.hidden) option,
[data-theme="light"] #app select:not(.hidden) optgroup {
    background-color: #ffffff;
    color: #0f172a;
}

#app select.pretty-select,
select.select-role-native {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-height: 42px;
    padding: 9px 38px 9px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(22, 24, 32, 0.96);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%),
        linear-gradient(45deg, transparent 50%, rgba(var(--nav-accent-rgb), 0.78) 50%),
        linear-gradient(135deg, rgba(var(--nav-accent-rgb), 0.78) 50%, transparent 50%);
    background-position:
        0 0,
        calc(100% - 17px) calc(50% - 2.5px),
        calc(100% - 11px) calc(50% - 2.5px);
    background-size: auto, 5px 5px, 5px 5px;
    background-repeat: no-repeat, no-repeat, no-repeat;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

select.select-role-native {
    min-width: 180px;
    max-width: 100%;
    font-size: 14px;
}

[data-theme="light"] #app select.pretty-select,
[data-theme="light"] select.select-role-native {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background-color: #ffffff;
    background-image:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%),
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

#app select.pretty-select:hover,
select.select-role-native:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.48);
}

#app select.pretty-select:focus,
select.select-role-native:focus {
    outline: none;
    border-color: rgba(var(--nav-accent-rgb), 0.62);
    box-shadow: var(--ui-focus-ring), 0 2px 14px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] #app select.pretty-select:focus,
[data-theme="light"] select.select-role-native:focus {
    box-shadow: var(--ui-focus-ring), 0 1px 3px rgba(15, 23, 42, 0.08);
}

#app select.pretty-select:disabled,
select.select-role-native:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    min-width: 170px;
}
input[type="checkbox"],
input[type="radio"] {
    min-width: 0;
}
textarea {
    width: 100%;
    min-height: 120px;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(145, 201, 255, 0.9);
    box-shadow: var(--ui-focus-ring);
}

button:not(.footer-seg-btn):not(.picker-btn):not(.la-pag-btn):not(.prod-active-option):not(.topbar-menu-btn):not(.btn-cancel-icon):not(.chat-fab):not(.mobile-menu-btn):not(.nav-btn):not(.brand-block):not(.resources-doc-btn):not(.key-copy-btn):not(.login-btn):not(.danger):not(.warn):not(.btn-copy):not(.keygen-preset-btn):not(.keygen-step-btn):not(.keygen-quick-btn):not(.admin-login-plain):not(.modal-icon-close):not(.btn-inline-danger):not(.loader-btn):not(.key-modal-btn):not(.footer-accent-trigger):not(.footer-accent-option) {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, filter 0.15s ease;
    border-radius: 999px;
    border: 1px solid rgba(var(--nav-accent-rgb), 0.5);
    background: rgba(var(--nav-accent-rgb), 0.14);
    color: var(--ui-accent);
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 0 18px rgba(var(--nav-accent-rgb), 0.12);
    letter-spacing: 0.01em;
}
button:not(.footer-seg-btn):not(.picker-btn):not(.la-pag-btn):not(.prod-active-option):not(.topbar-menu-btn):not(.btn-cancel-icon):not(.chat-fab):not(.mobile-menu-btn):not(.nav-btn):not(.brand-block):not(.resources-doc-btn):not(.key-copy-btn):not(.login-btn):not(.danger):not(.warn):not(.btn-copy):not(.keygen-preset-btn):not(.keygen-step-btn):not(.keygen-quick-btn):not(.admin-login-plain):not(.modal-icon-close):not(.btn-inline-danger):not(.loader-btn):not(.key-modal-btn):not(.footer-accent-trigger):not(.footer-accent-option):hover {
    border-color: rgba(var(--nav-accent-rgb), 0.72);
    background: rgba(var(--nav-accent-rgb), 0.22);
    filter: brightness(1.04);
    transform: none;
    box-shadow: 0 0 22px rgba(var(--nav-accent-rgb), 0.2);
}
button:not(.footer-seg-btn):not(.picker-btn):not(.la-pag-btn):not(.prod-active-option):not(.topbar-menu-btn):not(.btn-cancel-icon):not(.chat-fab):not(.mobile-menu-btn):not(.nav-btn):not(.brand-block):not(.resources-doc-btn):not(.key-copy-btn):not(.login-btn):not(.danger):not(.warn):not(.btn-copy):not(.keygen-preset-btn):not(.keygen-step-btn):not(.keygen-quick-btn):not(.admin-login-plain):not(.modal-icon-close):not(.btn-inline-danger):not(.loader-btn):not(.key-modal-btn):not(.footer-accent-trigger):not(.footer-accent-option):active {
    transform: none;
    filter: brightness(0.96);
}
button.danger,
.danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    min-height: 44px;
    box-sizing: border-box;
    line-height: 1.25;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    background: var(--ui-btn-danger-bg);
    border: 1px solid var(--ui-btn-danger-border);
    color: #ffe5ec;
    box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}
button.danger:hover,
.danger:hover {
    border-color: rgba(255, 170, 190, 0.95);
    box-shadow: 0 0 18px rgba(255, 77, 122, 0.25);
    transform: none;
    filter: brightness(1.04);
}
button.warn,
.warn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    min-height: 38px;
    box-sizing: border-box;
    line-height: 1.25;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid var(--ui-btn-warn-border);
    background: var(--ui-btn-warn-bg);
    color: #20160a;
}
button.warn:hover,
.warn:hover {
    border-color: #f3d78f;
    box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

button.btn-save,
.btn-profile.btn-save,
button.btn-profile-primary {
    background: rgba(var(--nav-accent-rgb), 0.2);
    border: 1px solid rgba(var(--nav-accent-rgb), 0.58);
    color: var(--ui-accent);
    box-shadow: 0 0 20px rgba(var(--nav-accent-rgb), 0.16);
}

button.btn-save:hover,
.btn-profile.btn-save:hover,
button.btn-profile-primary:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.75);
    background: rgba(var(--nav-accent-rgb), 0.28);
    filter: brightness(1.05);
    box-shadow: 0 0 26px rgba(var(--nav-accent-rgb), 0.22);
}

button.btn-cancel,
button.resources-menu-close.btn-cancel-icon {
    background: transparent;
    border: 1px solid var(--ui-btn-cancel-border);
    color: var(--ui-btn-cancel-color);
    box-shadow: none;
    font-weight: 600;
}

button.btn-cancel:hover,
button.resources-menu-close.btn-cancel-icon:hover {
    background: var(--ui-btn-cancel-bg-hover);
    border-color: rgba(248, 113, 113, 0.55);
    color: #fecaca;
    filter: none;
    transform: none;
}

.modal-actions button.btn-cancel {
    min-width: 96px;
}

.modal-actions button.btn-save {
    min-width: 112px;
}

.admin-action-logs-table .admin-log-ip {
    display: inline-block;
    max-width: 100%;
    filter: blur(6px);
    transition: filter 0.2s ease, opacity 0.2s ease;
    user-select: none;
    cursor: pointer;
    opacity: 0.85;
}
.admin-action-logs-table .admin-log-ip:hover {
    filter: blur(0);
    user-select: text;
    cursor: text;
    opacity: 1;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
th { color: var(--muted); cursor: pointer; }
tbody tr:nth-child(odd) td {
    background: rgba(255,255,255,0.015);
}
tbody tr:hover td {
    background: rgba(var(--nav-accent-rgb), 0.1);
}

.admin-action-logs-table .admin-log-nick {
    font-weight: 600;
}

.admin-action-logs-table .admin-log-nick--dev {
    color: #c4b5fd;
}

.admin-action-logs-table .admin-log-nick--admin {
    color: #fb7185;
}

.admin-action-logs-table .admin-log-nick--user {
    color: #94a3b8;
}

[data-theme="light"] .admin-action-logs-table .admin-log-nick--dev {
    color: #5b21b6;
}

[data-theme="light"] .admin-action-logs-table .admin-log-nick--admin {
    color: #be123c;
}

[data-theme="light"] .admin-action-logs-table .admin-log-nick--user {
    color: #475569;
}

.table-scroll {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--d-border);
    border-radius: 6px;
    background: var(--d-surface);
}

.table-scroll table {
    min-width: 920px;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 12;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(10px);
}

.table-scroll-lg {
    min-height: 420px;
    max-height: 520px;
}
.table-scroll-sm {
    min-height: 160px;
    max-height: 280px;
}

.table-scroll-admin-logs {
    max-height: min(460px, 52vh);
    min-height: 0;
}

.table-scroll table.keys-table {
    table-layout: fixed;
    min-width: 760px;
}

.keys-table th.col-key-check,
.keys-table td.cell-key-check {
    width: 40px;
    max-width: 48px;
    text-align: center;
    vertical-align: middle;
    padding-left: 8px;
    padding-right: 8px;
}

.keys-table th.col-key-check {
    cursor: default;
}

.keys-table th.col-key-check .key-check-all,
.keys-table td.cell-key-check .key-row-check {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.security-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.security-check input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

input.panel-checkbox,
.security-check input.panel-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.28);
    background: rgba(14, 16, 22, 0.95);
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    vertical-align: middle;
    box-sizing: border-box;
    accent-color: rgb(var(--nav-accent-rgb));
}

input.panel-checkbox:hover,
.security-check input.panel-checkbox:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.45);
}

input.panel-checkbox:checked,
.security-check input.panel-checkbox:checked {
    background: rgba(var(--nav-accent-rgb), 0.45);
    border-color: rgba(var(--nav-accent-rgb), 0.88);
    box-shadow: 0 0 0 1px rgba(var(--nav-accent-rgb), 0.22);
}

input.panel-checkbox:checked::after,
.security-check input.panel-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    box-sizing: border-box;
}

input.panel-checkbox:focus-visible,
.security-check input.panel-checkbox:focus-visible {
    outline: none;
    box-shadow: var(--ui-focus-ring);
}

[data-theme="light"] input.panel-checkbox,
[data-theme="light"] .security-check input.panel-checkbox {
    border-color: rgba(15, 23, 42, 0.22);
    background: #ffffff;
}

[data-theme="light"] input.panel-checkbox:checked,
[data-theme="light"] .security-check input.panel-checkbox:checked {
    background: rgba(var(--nav-accent-rgb), 0.85);
    border-color: rgba(var(--nav-accent-rgb), 0.95);
}

/* Модалка «Создать ключ»: одноразовый ключ — заметный контроль под тёмную панель */
#keyGenModal .keygen-one-time-label input.panel-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 6px;
    border-width: 2px;
    background: linear-gradient(180deg, rgba(26, 28, 36, 0.98), rgba(12, 13, 18, 0.99));
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#keyGenModal .keygen-one-time-label input.panel-checkbox:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(var(--nav-accent-rgb), 0.12);
}

#keyGenModal .keygen-one-time-label input.panel-checkbox:checked {
    background: linear-gradient(155deg, rgba(var(--nav-accent-rgb), 0.5), rgba(var(--nav-accent-rgb), 0.92));
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow:
        0 0 16px rgba(var(--nav-accent-rgb), 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#keyGenModal .keygen-one-time-label input.panel-checkbox:checked::after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border-width: 0 2.5px 2.5px 0;
}

[data-theme="light"] #keyGenModal .keygen-one-time-label input.panel-checkbox {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    border-color: rgba(15, 23, 42, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] #keyGenModal .keygen-one-time-label input.panel-checkbox:checked {
    background: linear-gradient(155deg, rgba(var(--nav-accent-rgb), 0.75), rgba(var(--nav-accent-rgb), 0.95));
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: 0 0 12px rgba(var(--nav-accent-rgb), 0.25);
}

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

.keys-table th.col-key-near-product,
.keys-table td.cell-key-near-product {
    width: 260px;
    max-width: 300px;
}

.keys-table td.cell-key-near-product {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 28px;
    vertical-align: middle;
}

.keys-table .key-code-inline {
    font-size: 12px;
}

.keys-table .key-copy-btn {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    box-shadow: none;
    font: inherit;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #b8d4ff;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    transform: none;
}

.keys-table .key-copy-btn:hover {
    color: #e8f2ff;
    filter: brightness(1.08);
    transform: none;
}

.keys-table td.cell-product-near-key {
    width: 9%;
    white-space: nowrap;
    padding-left: 20px;
    vertical-align: middle;
}

.keys-table th.col-key-actions,
.keys-table td.cell-key-actions {
    width: 118px;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.keys-table td.cell-key-actions button {
    margin: 0;
}

.products-admin-table .product-actions-cell {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    vertical-align: middle;
    white-space: nowrap;
    text-align: center;
}

.product-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    min-width: 0;
}

/* ID + path бьёт глобальный button:not(.warn):not(.danger) — единая форма и тени для Edit / Regen / Delete */
#tab-products .product-actions button.product-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 12px;
    min-height: 34px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    border-radius: 999px;
    white-space: nowrap;
    box-sizing: border-box;
    transform: none;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.product-install-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.product-install-indicator::before {
    content: "⬇";
    font-size: 12px;
    opacity: 0.9;
}

.product-install-indicator.is-installed {
    border-color: rgba(70, 226, 159, 0.6);
    background: rgba(70, 226, 159, 0.12);
    color: #bfffe4;
}

.product-install-indicator.is-empty {
    border-color: rgba(148, 163, 184, 0.42);
    background: rgba(71, 85, 105, 0.2);
    color: #cbd5e1;
}

#tab-products .product-actions button.product-action-btn:not(.warn):not(.danger) {
    border: 1px solid rgba(var(--nav-accent-rgb), 0.45);
    background: rgba(var(--nav-accent-rgb), 0.12);
    color: var(--ui-accent);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

#tab-products .product-actions button.product-action-btn.warn {
    border: 1px solid var(--ui-btn-warn-border);
    background: var(--ui-btn-warn-bg);
    color: #20160a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

#tab-products .product-actions button.product-action-btn.danger {
    padding: 8px 14px;
    min-height: 34px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid var(--ui-btn-danger-border);
    background: var(--ui-btn-danger-bg);
    color: #ffe5ec;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

#tab-products .product-actions button.product-action-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

#tab-products .product-actions button.product-action-btn.warn:hover {
    border-color: #f3d78f;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

#tab-products .product-actions button.product-action-btn.danger:hover {
    border-color: rgba(255, 170, 190, 0.95);
    box-shadow: 0 2px 6px rgba(255, 77, 122, 0.2);
}

[data-theme="light"] #tab-products .product-actions button.product-action-btn:not(.warn):not(.danger) {
    background: rgba(var(--nav-accent-rgb), 0.1);
    border-color: rgba(var(--nav-accent-rgb), 0.38);
    color: var(--ui-accent);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] #tab-products .product-actions button.product-action-btn:not(.warn):not(.danger):hover {
    background: rgba(var(--nav-accent-rgb), 0.16);
    border-color: rgba(var(--nav-accent-rgb), 0.5);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] #tab-products .product-actions button.product-action-btn.warn {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #92400e;
    box-shadow: none;
}

[data-theme="light"] #tab-products .product-actions button.product-action-btn.warn:hover {
    background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%);
    border-color: rgba(217, 119, 6, 0.55);
    box-shadow: 0 1px 3px rgba(180, 83, 9, 0.1);
    filter: none;
}

[data-theme="light"] #tab-products .product-actions button.product-action-btn.danger {
    background: linear-gradient(180deg, #ffe4e6 0%, #fecdd3 100%);
    border: 1px solid rgba(244, 63, 94, 0.45);
    color: #9f1239;
    box-shadow: none;
}

[data-theme="light"] #tab-products .product-actions button.product-action-btn.danger:hover {
    background: linear-gradient(180deg, #fecdd3 0%, #fda4af 100%);
    border-color: rgba(225, 29, 72, 0.55);
    box-shadow: 0 1px 3px rgba(190, 18, 60, 0.12);
    filter: none;
}

#tab-products .row {
    align-items: center;
}

.card-products {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.008)),
        radial-gradient(120% 90% at 20% 0%, rgba(var(--nav-accent-rgb), 0.12), rgba(0, 0, 0, 0) 55%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 36px rgba(0, 0, 0, 0.22);
}

.owner-product-settings {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
        radial-gradient(120% 120% at 10% 0%, rgba(var(--nav-accent-rgb),0.12), rgba(0,0,0,0) 52%);
}

.owner-product-settings h3 {
    margin: 0 0 12px;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.owner-product-settings-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.owner-product-settings-actions .btn-cancel,
.owner-product-settings-actions .btn-save {
    width: 100%;
    min-height: 38px;
    justify-content: center;
}

#ownerProductSettings .row {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

#ownerProductSettings .security-form-row--bans {
    grid-template-columns: minmax(130px, 170px) minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: stretch;
}

#ownerProductSettings .security-form-row--bans .security-check {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

#ownerProductSettings .security-form-row--bans button {
    width: 100%;
}

#tab-products .product-actions .product-action-btn {
    min-width: 108px;
}

.verify-action-btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}

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

.verify-action-btn--approve {
    color: #e8fff4;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.94), rgba(5, 150, 105, 0.92));
    border-color: rgba(16, 185, 129, 0.85);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.28);
}

.verify-action-btn--approve:hover {
    filter: brightness(1.04);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35);
}

.verify-action-btn--reject {
    color: #ffeef2;
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.94), rgba(190, 18, 60, 0.92));
    border-color: rgba(244, 63, 94, 0.85);
    box-shadow: 0 6px 18px rgba(244, 63, 94, 0.28);
}

.verify-action-btn--reject:hover {
    filter: brightness(1.04);
    box-shadow: 0 8px 22px rgba(244, 63, 94, 0.35);
}

.verify-action-btn--view {
    color: #dbeafe;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.2));
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.2);
}

.verify-action-btn--view:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.3);
}

.verification-request-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.products-subtabs {
    margin: 0 0 10px;
    gap: 8px;
}

.products-subtabs .products-subtab-btn {
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
}

#tab-moderation .products-subtabs .products-subtab-btn:nth-child(1) {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

#tab-moderation .products-subtabs .products-subtab-btn:nth-child(2) {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}

#tab-moderation .products-subtabs .products-subtab-btn:nth-child(3) {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
}

#tab-moderation .products-subtabs .products-subtab-btn:nth-child(4) {
    border-color: rgba(20, 184, 166, 0.55);
    background: rgba(20, 184, 166, 0.14);
    color: #99f6e4;
}

#tab-moderation .products-subtabs .products-subtab-btn.active {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
    filter: brightness(1.08);
}

#productsSubtabSettings {
    padding-top: 2px;
}

.modal-card--admin-edit .modal-actions .btn-save {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-color: rgba(96, 165, 250, 0.72);
    color: #eef6ff;
}

.modal-card--admin-edit .modal-actions .btn-save:hover {
    border-color: rgba(147, 197, 253, 0.9);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

#tab-products .row .prod-active {
    align-self: center;
}

.products-actions-row {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 12px;
}

.products-add-btn {
    min-width: 180px;
}

.owner-product-checklist {
    margin: 0 0 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.22);
}

.owner-product-checklist-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #d7e0f1;
}

.owner-product-checklist-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.owner-product-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
}

.owner-product-check.is-ok {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.owner-product-check.is-bad {
    border-color: rgba(244, 63, 94, 0.55);
    background: rgba(244, 63, 94, 0.12);
    color: #fecdd3;
}

.owner-product-checklist-hint {
    margin-top: 9px;
    font-size: 12px;
}

.owner-product-checklist-hint.is-ok { color: #86efac; }
.owner-product-checklist-hint.is-bad { color: #fca5a5; }

#productModal.product-modal--create #productVersionsWrap {
    display: none;
}

.empty-row td {
    text-align: center;
    color: #9eb0d9;
    padding: 72px 12px;
    height: 150px;
    vertical-align: middle;
    font-style: italic;
    border-bottom: none;
    background: transparent !important;
}

.status { padding: 4px 8px; border-radius: 10px; font-size: 12px; }
.ok { background: rgba(70,226,159,0.15); color: var(--ok); }
.bad { background: rgba(255,77,122,0.15); color: var(--danger); }
.status.warn { background: rgba(246, 201, 93, 0.16); color: #ffd77a; }

[data-theme="light"] .ok {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.25);
}

[data-theme="light"] .bad {
    background: rgba(244, 63, 94, 0.1);
    color: #9f1239;
    border: 1px solid rgba(190, 18, 60, 0.22);
}

[data-theme="light"] .status.warn {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.28);
}

.hidden { display: none; }
.muted { color: var(--muted); }
.divider { border-color: rgba(255,255,255,0.1); margin: 14px 0; }

.toast-root {
    position: fixed;
    top: max(16px, env(safe-area-inset-top, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    left: auto;
    bottom: auto;
    z-index: 8600;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    max-width: calc(100vw - 28px);
    pointer-events: none;
}

.toast {
    --toast-accent: rgba(52, 211, 153, 0.95);
    --toast-accent-soft: rgba(52, 211, 153, 0.22);
    --toast-border: rgba(255, 255, 255, 0.12);
    --toast-bg: rgba(12, 14, 22, 0.55);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: min(300px, calc(100vw - 28px));
    max-width: min(420px, calc(100vw - 28px));
    padding: 14px 16px 14px 14px;
    border-radius: 14px;
    border: 1px solid var(--toast-border);
    background: var(--toast-bg);
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 40px -8px var(--toast-accent-soft);
    animation: toastIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast--out {
    opacity: 0;
    transform: translateX(12px) scale(0.98);
}

.toast-strip {
    flex-shrink: 0;
    width: 4px;
    align-self: stretch;
    min-height: 2.75rem;
    margin: 0;
    border-radius: 4px;
    background: var(--toast-accent);
    box-shadow: 0 0 14px var(--toast-accent-soft);
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    color: var(--toast-accent);
    opacity: 0.95;
}

.toast-icon svg {
    display: block;
    vertical-align: middle;
}

.toast-body {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    color: rgba(248, 250, 252, 0.94);
    padding: 1px 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.toast--rich {
    align-items: flex-start;
    max-width: min(560px, calc(100vw - 28px));
}

.toast--rich .toast-icon {
    margin-top: 3px;
}

.toast-body--rich {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.toast-secret-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.35;
}

.toast-secret-code {
    display: block;
    margin: 0;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    word-break: break-all;
    overflow-wrap: anywhere;
    color: inherit;
    opacity: 0.92;
}

.toast--success {
    --toast-accent: rgba(52, 211, 153, 0.98);
    --toast-accent-soft: rgba(52, 211, 153, 0.2);
}

.toast--error {
    --toast-accent: rgba(251, 113, 133, 0.98);
    --toast-accent-soft: rgba(251, 113, 133, 0.28);
}

.toast--info {
    --toast-accent: rgba(96, 165, 250, 0.98);
    --toast-accent-soft: rgba(96, 165, 250, 0.25);
}

.toast--warn {
    --toast-accent: rgba(251, 191, 36, 0.98);
    --toast-accent-soft: rgba(251, 191, 36, 0.22);
}

/* Совместимость со старым классом loader / вызовами .error */
.toast.error {
    --toast-accent: rgba(251, 113, 133, 0.98);
    --toast-accent-soft: rgba(251, 113, 133, 0.28);
}

[data-theme="light"] .toast {
    --toast-bg: rgba(255, 255, 255, 0.72);
    --toast-border: rgba(15, 23, 42, 0.1);
    box-shadow:
        0 8px 32px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset,
        0 0 36px -10px var(--toast-accent-soft);
}

[data-theme="light"] .toast-body {
    color: rgba(15, 23, 42, 0.9);
}

[data-theme="light"] .toast-secret-code {
    color: rgba(15, 23, 42, 0.85);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-10px) translateX(8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
}

.chat-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.chat-card-head h2 {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.chat-panel .chat-panel-close {
    flex-shrink: 0;
}

.avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(93, 211, 255, 0.35);
    box-shadow: 0 0 14px rgba(93, 211, 255, 0.18);
}

.avatar-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 88px;
    flex-shrink: 0;
}

.avatar-url span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #a9bce6;
}

.avatar-url input {
    width: 100%;
}

.profile-fields {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: none;
}

.profile-card-hint {
    margin: -2px 0 14px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
}

.profile-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    width: 100%;
}

.profile-field-block label {
    display: block;
    font-size: 13px;
    color: #a9bce6;
    margin: 0 0 6px;
}

.profile-field-span2 {
    grid-column: 1 / -1;
}

.profile-fields-grid input {
    width: 100%;
    min-width: 0;
}

.profile-fields input[readonly] {
    opacity: 0.95;
    border-color: rgba(120, 200, 255, 0.22);
}

@media (max-width: 720px) {
    .profile-fields-grid {
        grid-template-columns: 1fr;
    }
    .profile-field-span2 {
        grid-column: 1;
    }
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 16px;
}
.profile-info-card,
.profile-password-card {
    margin-bottom: 0;
}
.profile-info-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-start;
}

.profile-logins-table .profile-login-ip {
    display: inline-block;
    filter: blur(5px);
    transition: filter 0.2s ease, opacity 0.2s ease;
    user-select: none;
    cursor: pointer;
    opacity: 0.88;
}

.profile-logins-table .profile-login-ip:hover {
    filter: none;
    user-select: text;
    cursor: text;
    opacity: 1;
}

.login-status--ok {
    color: var(--ok);
    font-weight: 600;
}

.login-status--fail {
    color: var(--danger);
    font-weight: 600;
}
.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}
.btn-profile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--ui-radius-sm);
    min-height: 34px;
    flex: 0 1 auto;
    white-space: nowrap;
}
.btn-profile-primary {
    font-weight: 700;
}
.profile-password-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
}
.profile-password-grid input {
    width: 100%;
    min-width: 0;
}
.profile-password-grid .btn-profile {
    align-self: flex-start;
    margin-top: 4px;
}

.danger-zone {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.danger-zone .danger {
    width: 100%;
    align-self: stretch;
}

.card-products {
    padding-bottom: 0;
    overflow: visible;
}

.products-form-row {
    padding: 0 0 16px;
    margin-bottom: 0;
}

.products-table-shell {
    margin: 12px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--d-surface);
}

.products-table-shell .products-admin-table {
    margin: 0;
    min-width: 1120px;
}

.products-table-shell tbody tr:last-child td {
    border-bottom: none;
}

.analytics-chart-wrap {
    padding: 14px;
}

.analytics-chart-bars {
    display: grid;
    gap: 8px;
    align-items: end;
    min-height: 210px;
    width: 100%;
}

.analytics-chart-col {
    min-width: 0;
    display: flex;
    align-items: end;
    justify-content: center;
}

.analytics-chart-bar {
    width: min(100%, 28px);
    border-radius: 8px 8px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.analytics-chart-labels {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    color: #ffffff;
    font-size: 11px;
    width: 100%;
}

.analytics-chart-label {
    min-width: 0;
    white-space: nowrap;
    text-align: center;
    transform: none;
    opacity: 0.92;
}

.analytics-chart-empty {
    width: 100%;
    text-align: center;
    padding: 26px 0;
}

@media (max-width: 900px) {
    .products-table-shell {
        margin: 10px 0 0;
        border-radius: 10px;
    }
    .owner-product-checklist-items {
        grid-template-columns: 1fr;
    }
    .modal-card--ticket-thread {
        width: min(100vw - 16px, 1120px);
        max-height: 94vh;
    }
    #ownerProductSettings .security-form-row--bans {
        grid-template-columns: 1fr;
    }
}

.table-scroll-admins {
    margin-top: 8px;
}

.admins-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 12px;
}

.admins-card-head h2 {
    margin: 0;
}

.modal-card--admin-create {
    max-width: 520px;
    width: min(520px, calc(100% - 28px));
}

.admin-create-pass-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
}

.admin-create-pass-row input {
    flex: 1 1 160px;
    min-width: 0;
}

.admin-create-pass-row .key-modal-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.admins-table td.admin-list-usercell {
    vertical-align: middle;
}

.admin-list-usercell {
    min-width: 0;
}

.admin-list-usercell-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.admin-list-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    flex-shrink: 0;
}

.admin-list-names {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.admin-list-login {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
}

.admin-list-nick {
    font-size: 11px;
    line-height: 1.25;
}

button.admin-login-plain {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: #e2e8f0;
    cursor: pointer;
    text-align: left;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

button.admin-login-plain:hover {
    color: #f8fafc;
    text-decoration: underline;
    text-underline-offset: 3px;
    filter: none;
}

[data-theme="light"] button.admin-login-plain {
    color: #0f172a;
}

[data-theme="light"] button.admin-login-plain:hover {
    color: #0f172a;
    text-decoration-color: rgba(15, 23, 42, 0.45);
}

.modal-card--keygen {
    max-width: 600px;
    width: min(600px, calc(100% - 28px));
}

.keygen-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.keygen-modal-head h2 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 16px;
    flex: 1;
}

button.modal-icon-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(248, 250, 252, 0.88);
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button.modal-icon-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(var(--nav-accent-rgb), 0.45);
    color: #fff;
}

button.modal-icon-close svg {
    display: block;
}

[data-theme="light"] button.modal-icon-close {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
}

[data-theme="light"] button.modal-icon-close:hover {
    background: #fff;
    border-color: rgba(var(--nav-accent-rgb), 0.4);
    color: #0f172a;
}

.keygen-modal-body.stack-fields {
    gap: 16px;
}

.keygen-field .field-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.keygen-stepper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.keygen-step-btn {
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--ui-surface-elevated);
    color: #e2e8f0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.keygen-step-btn:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.keygen-step-input {
    flex: 1 1 80px;
    min-width: 72px;
    max-width: 140px;
    height: 36px;
    text-align: center;
    border-radius: 6px;
}

.keygen-quick-btn {
    padding: 0 12px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.keygen-quick-btn:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.09);
    color: #e2e8f0;
}

.keygen-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.keygen-preset-btn {
    padding: 0 8px;
    min-width: 34px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
}

.keygen-preset-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.keygen-preset-btn--wide {
    padding: 0 10px;
    min-width: auto;
}

.keygen-note-input {
    width: 100%;
    box-sizing: border-box;
}

.keygen-submit-wide {
    width: 100%;
    margin-top: 8px;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.keygen-card-lead {
    margin-bottom: 10px;
}

.keygen-open-btn {
    margin-bottom: 12px;
}

.keygen-result-area {
    min-height: 120px;
    width: 100%;
    margin-top: 4px;
    box-sizing: border-box;
}

.modal-card--admin-actions {
    max-width: min(960px, calc(100% - 24px));
    width: min(960px, calc(100% - 24px));
}

.table-scroll.table-scroll-admin-actions {
    overflow: visible;
    max-height: none;
    margin-top: 8px;
}

.table-scroll-admin-actions table.admin-actions-mini-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.admin-actions-mini-table {
    width: 100%;
    font-size: 12px;
}

.admin-actions-mini-table th,
.admin-actions-mini-table td {
    padding: 8px 10px;
    vertical-align: top;
    word-break: break-word;
}

.admin-actions-mini-table th:nth-child(1),
.admin-actions-mini-table td:nth-child(1) {
    width: 22%;
}

.admin-actions-mini-table th:nth-child(2),
.admin-actions-mini-table td:nth-child(2) {
    width: 26%;
}

.admin-actions-mini-table th:nth-child(3),
.admin-actions-mini-table td:nth-child(3) {
    width: 52%;
}

.admins-table .btn-compact.btn-save {
    min-width: 96px;
    padding: 6px 12px;
    font-size: 12px;
    align-self: center;
}

.modal-card--admin-edit {
    max-width: 520px;
}

.admin-edit-hint {
    font-size: 13px;
    margin: 0 0 16px;
    line-height: 1.45;
}

.admin-edit-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.admin-edit-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.admin-edit-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-edit-email-block {
    margin-bottom: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-edit-email-block > .field-label:first-child {
    margin-bottom: 14px;
}

.admin-edit-email-block .profile-email-hint-box {
    margin-bottom: 14px;
}

.admin-edit-email-row {
    align-items: center;
    margin-bottom: 8px !important;
}

.admin-edit-email-input {
    flex: 1;
    min-width: 140px;
}

.admin-edit-code-input {
    flex: 1;
    min-width: 120px;
    max-width: 220px;
}

@media (max-width: 560px) {
    .admin-edit-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .admin-edit-fields {
        width: 100%;
    }
}

.login-otp-actions {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    margin-top: 16px;
    align-items: stretch;
}

.login-otp-back {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.login-otp-submit {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

#loginStepOtp .login-otp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

#loginStepOtp .login-otp-submit {
    width: 100%;
}

#loginStepOtp .login-otp-back {
    min-height: 32px;
    width: auto;
    align-self: center;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    color: #f43f5e;
    font-size: 13px;
    font-weight: 600;
}

#loginStepOtp .login-otp-back:hover {
    color: #fb7185;
    text-decoration: underline;
    background: transparent;
    border: none;
    box-shadow: none;
}

.register-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.register-actions .login-otp-submit {
    width: 100%;
}

.register-back-link {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0 auto;
    color: #f43f5e;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.register-back-link:hover {
    color: #fb7185;
    text-decoration: underline;
}

@media (max-width: 460px) {
    .login-otp-actions {
        grid-template-columns: 1fr;
    }
}

.profile-page-top {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    margin-bottom: 14px;
}

.profile-page-top > .card.profile-card-identity,
.profile-page-top > .card.profile-card-email,
.profile-page-top > .card.profile-card-password {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.profile-card-fill {
    flex: 1 1 auto;
    min-height: 8px;
    margin-top: 4px;
}

.profile-section-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-section-head--compact {
    align-items: center;
    margin-bottom: 12px;
}

.profile-section-head--compact h2 {
    margin: 0;
}

.profile-section-head h2 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.profile-section-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--ui-accent);
    margin-top: 2px;
}

.profile-section-head--compact .profile-section-icon {
    margin-top: 0;
}

.profile-section-icon--warn {
    color: var(--ui-danger);
}

.danger-zone .profile-section-head h2 {
    color: var(--text);
}

.profile-card-identity .profile-card-hint,
.profile-card-email .profile-card-hint,
.profile-card-password .profile-card-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #8a8d91;
}

#tab-profile .card {
    background: var(--d-surface);
    border-color: var(--d-border);
    border-radius: 12px;
    padding: 18px 20px 20px;
}

.profile-email-confirm-label {
    font-size: 12px;
    font-weight: 600;
    color: #a0a5b1;
    letter-spacing: 0.03em;
    margin-top: 24px;
    margin-bottom: 10px;
}

.profile-card-email .profile-card-hint + .profile-email-confirm-label {
    margin-top: 20px;
}

.profile-email-hint-box {
    border: 1px solid rgba(120, 140, 180, 0.22);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
    color: #9ca3af;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.2);
}

.profile-email-hint-box.is-verified {
    border-color: rgba(74, 222, 128, 0.35);
    color: #b6e4c5;
}

.profile-email-hint-box.muted {
    color: #8b92a3;
}

#tab-profile .profile-card-email .profile-email-actions .btn-send-code,
.admin-edit-email-block .row .btn-send-code {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border: 1px solid rgba(21, 128, 61, 0.95);
    color: #f0fdf4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

#tab-profile .profile-card-email .profile-email-actions .btn-send-code:hover,
.admin-edit-email-block .row .btn-send-code:hover {
    filter: brightness(1.05);
    border-color: rgba(20, 83, 45, 0.95);
}

[data-theme="light"] #tab-profile .profile-card-email .profile-email-actions .btn-send-code,
[data-theme="light"] .admin-edit-email-block .row .btn-send-code {
    color: #fff;
    border-color: #15803d;
}

.profile-identity-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.profile-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 100px;
}

.btn-secondary-lite {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
    box-shadow: none !important;
}

.profile-fields-modern {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.profile-field-row label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-field-row input,
.profile-password-stack input {
    width: 100%;
    min-width: 0;
}

#tab-profile .profile-field-row input:not(.input-readonly),
#tab-profile .profile-password-stack input {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
}

.input-readonly {
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.profile-actions--inline {
    margin-top: 4px;
}

.profile-email-status {
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.profile-email-status.is-verified {
    background: rgba(22, 101, 52, 0.15);
    border-color: rgba(74, 222, 128, 0.25);
    color: #bbf7d0;
}

.profile-email-actions {
    margin: 10px 0 14px;
}

.profile-confirm-row label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    display: block;
    margin-bottom: 6px;
}

.profile-confirm-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.profile-confirm-inline input {
    flex: 1 1 140px;
    min-width: 120px;
}

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

.profile-password-stack .btn-profile {
    align-self: flex-start;
    margin-top: 4px;
}

.profile-danger-hint {
    margin: 0 0 12px;
    font-size: 13px;
}

.profile-card-history h2 {
    margin: 0;
}

.chat-messages {
    max-height: 520px;
    min-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    background: var(--d-surface);
    border: 1px solid var(--d-border);
    border-radius: 14px;
}

.chat-typing {
    padding: 8px 4px 0;
}

.chat-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-input-wrap textarea {
    min-height: 40px;
    max-height: 86px;
    resize: none;
    line-height: 1.35;
}

.chat-counter {
    font-size: 12px;
    text-align: left;
}

.chat-counter.over {
    color: var(--danger);
}

.pager {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pager button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.la-pagination {
    margin-top: 10px;
    margin-bottom: 4px;
}

.row > .la-pagination {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    align-self: center;
}

.la-pagination--profile {
    margin-top: 4px;
    margin-bottom: 10px;
}

.la-pagination--chat {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.la-pagination-inner {
    display: inline-flex;
    align-items: stretch;
    flex-wrap: wrap;
    border-radius: 10px;
    border: 1px solid rgba(var(--nav-accent-rgb), 0.35);
    background: rgba(6, 10, 18, 0.92);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    overflow: hidden;
}

.la-pag-btn {
    margin: 0;
    padding: 10px 14px;
    min-width: 42px;
    border: none;
    border-right: 1px solid rgba(var(--nav-accent-rgb), 0.22);
    background: transparent;
    color: rgba(230, 236, 255, 0.92);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.la-pag-btn:last-child {
    border-right: none;
}

.la-pag-nav {
    min-width: auto;
    padding-left: 16px;
    padding-right: 16px;
}

.la-pag-btn:hover:not(:disabled):not(.is-active) {
    background: rgba(var(--nav-accent-rgb), 0.12);
}

.la-pag-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.la-pag-btn.is-active {
    background: rgba(var(--nav-accent-rgb), 0.35);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(var(--nav-accent-rgb), 0.4);
}

.la-pag-num {
    font-variant-numeric: tabular-nums;
}

.la-pag-sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-right: 1px solid rgba(var(--nav-accent-rgb), 0.22);
    color: rgba(160, 185, 220, 0.55);
    font-size: 14px;
    user-select: none;
}

[data-theme="light"] .la-pagination-inner {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: none;
}

[data-theme="light"] .la-pag-btn {
    color: #334155;
    border-right-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .la-pag-btn:hover:not(:disabled):not(.is-active) {
    background: rgba(var(--nav-accent-rgb), 0.1);
}

[data-theme="light"] .la-pag-btn.is-active {
    color: #0f172a;
    background: rgba(var(--nav-accent-rgb), 0.22);
    box-shadow: none;
}

[data-theme="light"] .la-pag-sep {
    border-right-color: rgba(15, 23, 42, 0.08);
    color: #94a3b8;
}

.field-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 170px;
}

.btn-compact {
    width: auto;
    min-width: 120px;
    align-self: flex-end;
}

.field-label {
    font-size: 12px;
    color: #a9bce6;
    margin-left: 2px;
}

code {
    word-break: break-all;
}

button.btn-copy {
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    box-sizing: border-box;
    line-height: 0;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(100, 116, 139, 0.22);
    color: #94a3b8;
    box-shadow: none;
    font-size: 0;
    letter-spacing: 0;
}

button.btn-copy:hover {
    border-color: rgba(148, 163, 184, 0.65);
    background: rgba(100, 116, 139, 0.32);
    color: #cbd5e1;
    filter: none;
    transform: none;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

button.btn-copy .btn-copy-icon {
    width: 17px;
    height: 17px;
    display: block;
    flex-shrink: 0;
}

[data-theme="light"] button.btn-copy {
    border-color: rgba(100, 116, 139, 0.4);
    background: rgba(148, 163, 184, 0.2);
    color: #64748b;
}

.products-admin-table th:nth-child(7),
.products-admin-table td.secret-cell {
    width: 1%;
    max-width: 300px;
    white-space: nowrap;
    vertical-align: middle;
}

#productsBody .secret-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    max-width: 100%;
    vertical-align: middle;
}

#productsBody .secret-value {
    display: inline-block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(200px, 42vw);
    transition: filter .15s ease, opacity .15s ease;
    filter: blur(5px);
    opacity: 0.55;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
}

#productsBody .secret-value:hover {
    filter: blur(0);
    opacity: 1;
}

#productsBody .secret-cell .btn-copy {
    flex: 0 0 auto;
    margin-left: 0;
    align-self: center;
}

.picker {
    position: relative;
    min-width: 220px;
    box-sizing: border-box;
}

.picker.picker--like-role {
    min-width: 220px;
    max-width: 100%;
}

.picker-btn {
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    border-radius: 12px;
    border: 1px solid rgba(120, 120, 120, 0.38);
    background-color: rgba(15, 15, 15, 0.98);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    color: var(--text);
    padding: 10px 14px;
    min-height: 42px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.picker-btn:hover {
    border-color: rgba(165, 165, 165, 0.62);
    background-color: rgba(22, 22, 22, 0.98);
}

[data-theme="light"] .picker-btn {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background-color: #ffffff;
    background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .picker-btn:hover {
    border-color: rgba(120, 120, 120, 0.55);
}

#tab-manage .card:first-of-type {
    position: relative;
    z-index: 3;
}

#tab-manage .card:last-of-type {
    position: relative;
    z-index: 1;
}

.picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    z-index: 8500;
    border-radius: 14px;
    padding: 10px;
    border: 1px solid rgba(110, 110, 110, 0.34);
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.985) 0%, rgba(8, 8, 8, 0.99) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    max-height: 280px;
    overflow: auto;
    isolation: isolate;
}

[data-theme="light"] .picker-menu {
    background: linear-gradient(180deg, #ffffff 0%, #f4f6f9 100%);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.picker--security {
    min-width: min(220px, 100%);
    flex: 0 1 220px;
}

.picker-search {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid rgba(110, 110, 110, 0.35);
    background: rgba(9, 9, 9, 0.95);
    color: var(--text);
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
}

.picker-search:focus {
    border-color: rgba(165, 165, 165, 0.62);
    box-shadow: 0 0 0 2px rgba(145, 145, 145, 0.18);
}

[data-theme="light"] .picker-search {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
    .prod-active-slider {
        transition: none;
    }
}

.picker-item {
    width: 100%;
    text-align: left;
    margin: 0 0 4px;
    border-radius: 10px;
    border: 1px solid rgba(115, 115, 115, 0.36);
    background: rgba(75, 75, 75, 0.18);
    padding: 10px 12px;
    color: var(--text);
    font-size: 13px;
}
.picker-item.multi {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.picker-item.multi .picker-main {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}
.picker-item.multi .picker-sub {
    font-size: 12px;
    color: #bdbdbd;
}
.picker-item.multi.selected {
    border-color: rgba(180, 180, 180, 0.72);
    background: rgba(120, 120, 120, 0.24);
    box-shadow: 0 0 0 1px rgba(160, 160, 160, 0.28), 0 0 12px rgba(0, 0, 0, 0.22);
}
.picker-item--disabled,
.picker-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.picker-item:hover {
    border-color: rgba(185, 185, 185, 0.68);
    background: rgba(95, 95, 95, 0.28);
    box-shadow: 0 0 0 1px rgba(140, 140, 140, 0.24);
}

.picker-item:last-child {
    margin-bottom: 0;
}

[data-theme="light"] .picker-item {
    border-color: rgba(15, 23, 42, 0.1);
    background: #f8fafc;
    color: #0f172a;
}

[data-theme="light"] .picker-item.multi .picker-sub {
    color: #64748b;
}

[data-theme="light"] .picker-item:hover {
    background: rgba(120, 120, 120, 0.13);
    border-color: rgba(120, 120, 120, 0.5);
    box-shadow: 0 0 0 1px rgba(120, 120, 120, 0.2);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid rgba(93, 211, 255, 0.35);
}
.status-pill.undetected { border-color: rgba(70,226,159,0.8); color: #bfffe4; background: rgba(70,226,159,0.08); }
.status-pill.detected { border-color: rgba(255,77,122,0.9); color: #ffe0e9; background: rgba(255,77,122,0.10); }
.status-pill.risk { border-color: rgba(93, 211, 255, 0.85); color: #d7f4ff; background: rgba(93, 211, 255, 0.10); }

[data-theme="light"] .status-pill.undetected {
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(4, 120, 87, 0.45);
}

[data-theme="light"] .status-pill.detected {
    color: #9f1239;
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(190, 18, 60, 0.45);
}

[data-theme="light"] .status-pill.risk {
    color: #0c4a6e;
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(3, 105, 161, 0.4);
}

.prod-active {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}
.prod-active input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.prod-active-track {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    min-width: 132px;
    padding: 4px;
    border-radius: 999px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.35);
}

.prod-active-slider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 6px);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(var(--nav-accent-rgb), 0.42), rgba(var(--nav-accent-rgb), 0.22));
    border: 1px solid rgba(var(--nav-accent-rgb), 0.5);
    box-shadow: 0 2px 14px rgba(var(--nav-accent-rgb), 0.32);
    z-index: 0;
    transition: left 0.22s ease, box-shadow 0.2s ease;
    pointer-events: none;
}

.prod-active-track.is-no .prod-active-slider {
    left: calc(50% + 2px);
}

.prod-active-option {
    position: relative;
    z-index: 1;
    flex: 1 1 50%;
    min-width: 0;
    margin: 0;
    padding: 8px 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #8b9bb8;
    cursor: pointer;
    transition: color 0.18s ease;
}

.prod-active-option:hover {
    color: #c5d4eb;
}

.prod-active-option.is-active {
    color: var(--ui-accent);
    text-shadow: 0 0 18px rgba(var(--nav-accent-rgb), 0.35);
}

.chat-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

.chat-message--own {
    flex-direction: row-reverse;
    align-self: stretch;
}

.chat-message--own .chat-bubble {
    background: rgba(var(--nav-accent-rgb), 0.3);
    border-color: rgba(var(--nav-accent-rgb), 0.5);
}

.chat-message--own .chat-bubble .meta {
    color: rgba(248, 250, 252, 0.88);
}

.chat-message .avatar {
    flex-shrink: 0;
    width: clamp(30px, 2.1vw, 40px);
    height: clamp(30px, 2.1vw, 40px);
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(93, 211, 255, 0.35);
}

.chat-bubble {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(var(--nav-accent-rgb), 0.14);
    border: 1px solid rgba(var(--nav-accent-rgb), 0.28);
    backdrop-filter: blur(14px);
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chat-bubble .meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
}

.chat-bubble .meta .chat-author {
    font-weight: 600;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-bubble .meta .chat-meta-sep {
    flex-shrink: 0;
    color: var(--muted);
    padding: 0 0.28em;
}

.chat-bubble .meta .chat-meta-time {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--muted);
}

.chat-bubble .chat-author--developer {
    color: #c4b5fd;
}

.chat-bubble .chat-author--admin {
    color: #fb7185;
}

.chat-bubble .chat-author--user {
    color: #93c5fd;
}

.chat-message--own .chat-bubble .meta .chat-meta-sep,
.chat-message--own .chat-bubble .meta .chat-meta-time {
    color: rgba(248, 250, 252, 0.78);
}

.chat-message--own .chat-bubble .meta .chat-author--developer {
    color: #f3e8ff;
}

.chat-message--own .chat-bubble .meta .chat-author--admin {
    color: #ffe4e6;
}

.chat-message--own .chat-bubble .meta .chat-author--user {
    color: #dbeafe;
}

[data-theme="light"] .chat-bubble .chat-author--developer {
    color: #5b21b6;
}

[data-theme="light"] .chat-bubble .chat-author--admin {
    color: #be123c;
}

[data-theme="light"] .chat-bubble .chat-author--user {
    color: #475569;
}

[data-theme="light"] .chat-message--own .chat-bubble .meta .chat-meta-sep,
[data-theme="light"] .chat-message--own .chat-bubble .meta .chat-meta-time {
    color: #64748b;
}

[data-theme="light"] .chat-message--own .chat-bubble .meta .chat-author--developer {
    color: #6d28d9;
}

[data-theme="light"] .chat-message--own .chat-bubble .meta .chat-author--admin {
    color: #9f1239;
}

[data-theme="light"] .chat-message--own .chat-bubble .meta .chat-author--user {
    color: #1d4ed8;
}

.chat-bubble .text {
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.chat-composer {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: flex-end;
}

.chat-composer input,
.chat-composer textarea {
    flex: 1;
    min-width: 0;
}
.chat-composer > button {
    min-width: 88px;
    height: 40px;
    padding: 8px 12px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 2500;
    margin: -24px -28px 20px -28px;
    padding: 12px 28px 10px;
    background: var(--ui-workspace-bg);
    box-shadow: 0 1px 0 var(--d-border);
}

.topbar-spacer {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-settings {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.topbar-setting {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    margin: 0;
    cursor: default;
}

.topbar-setting-label {
    white-space: nowrap;
}

.topbar-setting-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 0;
    max-width: 148px;
    padding: 6px 30px 6px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(22, 24, 32, 0.96);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%),
        linear-gradient(45deg, transparent 50%, rgba(var(--nav-accent-rgb), 0.75) 50%),
        linear-gradient(135deg, rgba(var(--nav-accent-rgb), 0.75) 50%, transparent 50%);
    background-position:
        0 0,
        calc(100% - 12px) calc(50% - 2px),
        calc(100% - 7px) calc(50% - 2px);
    background-size: auto, 4px 4px, 4px 4px;
    background-repeat: no-repeat, no-repeat, no-repeat;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] .topbar-setting-select {
    border: 1px solid rgba(15, 23, 42, 0.14);
    background-color: #ffffff;
    background-image:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%),
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--ui-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    flex-shrink: 0;
}

.topbar-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.topbar-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.topbar-name--dev { color: #c084fc; }
.topbar-name--admin { color: #60a5fa; }
.topbar-name--mod { color: #f59e0b; }
.topbar-name--support { color: #22c55e; }
.topbar-name--owner { color: #fb7185; }
.topbar-name--member { color: #2dd4bf; }
.topbar-name--user { color: #cbd5e1; }

.topbar-role {
    display: flex;
    align-items: center;
    font-size: 11px;
    line-height: 1;
    color: #9eb0d9;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    border: 1px solid transparent;
    background: rgba(0,0,0,0.22);
}
.role-badge.staff,
.role-badge.developer {
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(99, 102, 241, 0.14);
}
.role-badge.admin {
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(59, 130, 246, 0.14);
}
.role-badge.moderator {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.58);
    background: rgba(245, 158, 11, 0.15);
}
.role-badge.support {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.58);
    background: rgba(34, 197, 94, 0.14);
}
.role-badge.customer {
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.58);
    background: rgba(244, 63, 94, 0.14);
}
.role-badge.member {
    color: #99f6e4;
    border-color: rgba(20, 184, 166, 0.58);
    background: rgba(20, 184, 166, 0.14);
}
.role-badge.user {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.1);
}

.topbar .role-badge {
    margin: 0;
    min-height: 20px;
    line-height: 1.2;
    box-sizing: border-box;
}

.topbar-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.04);
    font-size: 15px;
    line-height: 1;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    padding: 6px;
    border-radius: 10px;
    background: rgba(9, 11, 14, 0.96);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5000;
    min-width: 148px;
}
.user-menu.hidden { display: none; }

.user-menu button {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 999px;
    box-shadow: 0 0 16px rgba(var(--nav-accent-rgb), 0.14);
    background: rgba(var(--nav-accent-rgb), 0.16);
    border: 1px solid rgba(var(--nav-accent-rgb), 0.52);
    color: var(--ui-accent);
}

.user-menu button:hover {
    box-shadow: 0 0 22px rgba(var(--nav-accent-rgb), 0.22);
    filter: brightness(1.05);
    background: rgba(var(--nav-accent-rgb), 0.24);
}

.user-menu button.danger {
    padding: 6px 10px;
    font-size: 12px;
    background: var(--ui-btn-danger-bg);
    border: 1px solid var(--ui-btn-danger-border);
    color: #ffe5ec;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.user-menu button.danger:hover {
    box-shadow: 0 2px 8px rgba(255, 77, 122, 0.22);
    filter: brightness(1.05);
}

.user-menu button.user-menu-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 999px;
}

.user-menu-logout .user-menu-logout-icon {
    flex-shrink: 0;
    opacity: 0.95;
}

.panel-footer {
    flex: 0 0 auto;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(3, 3, 3, 0.96);
    padding: 0;
}

.panel-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px 28px;
    padding: 18px 28px 14px;
    max-width: 1400px;
    margin: 0 auto;
}

.panel-footer-brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.panel-footer-tagline {
    margin: 6px 0 0;
    font-size: 13px;
    color: #8b92a3;
    max-width: 280px;
    line-height: 1.45;
}

.panel-footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-footer-contacts-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #e2e8f0;
}

.panel-footer-socials {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.panel-footer-social:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.panel-footer-social-icon {
    width: 20px;
    height: 20px;
}

.panel-footer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 22px;
    position: relative;
    z-index: 2;
}

.footer-control {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    min-height: 68px;
}

.footer-control-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b92a3;
}

.footer-seg {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    gap: 0;
    min-height: 48px;
    box-sizing: border-box;
}

.footer-seg--theme,
.footer-seg--lang {
    min-width: 0;
}

.footer-seg--lang {
    cursor: pointer;
    user-select: none;
}

.footer-seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 50%;
    min-width: 44px;
    min-height: 40px;
    padding: 0 10px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.footer-seg-btn:hover {
    color: #e2e8f0;
}

.footer-seg-btn.is-active {
    color: #f8fafc;
    background: rgba(var(--nav-accent-rgb), 0.35);
    box-shadow: 0 0 0 1px rgba(var(--nav-accent-rgb), 0.45);
}

.footer-seg-btn:not(.is-active) .footer-seg-icon {
    opacity: 0.42;
}

.footer-seg-btn.is-active .footer-seg-icon {
    opacity: 1;
}

.footer-seg-btn .footer-seg-icon,
.footer-seg-btn .footer-flag {
    pointer-events: none;
}

.footer-seg-icon {
    width: 18px;
    height: 18px;
}

.footer-seg--lang .footer-seg-btn--flag {
    min-width: 52px;
    padding: 6px 12px;
}

.footer-flag {
    width: 26px;
    height: 17px;
    border-radius: 3px;
    display: block;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.footer-accent-dropdown {
    position: relative;
    min-width: 168px;
}

.footer-accent-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 168px;
    min-height: 48px;
    padding: 0 12px 0 14px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(30, 32, 40, 0.98), rgba(16, 17, 22, 0.99));
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: none;
    cursor: pointer;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.footer-accent-trigger:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.45);
    box-shadow:
        0 2px 18px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(var(--nav-accent-rgb), 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.footer-accent-trigger:focus-visible {
    outline: none;
    border-color: rgba(var(--nav-accent-rgb), 0.55);
    box-shadow: var(--ui-focus-ring);
}

.footer-accent-trigger-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.footer-accent-trigger-text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-accent-chevron {
    flex-shrink: 0;
    color: rgba(var(--nav-accent-rgb), 0.85);
    opacity: 0.95;
    transition: transform 0.18s ease;
}

.footer-accent-trigger[aria-expanded="true"] .footer-accent-chevron {
    transform: rotate(180deg);
}

.footer-accent-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 100%;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(28, 30, 38, 0.98), rgba(14, 15, 20, 0.99));
    box-shadow:
        0 -12px 40px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 80;
}

.footer-accent-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    text-shadow: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.12s ease;
}

.footer-accent-option:hover {
    background: rgba(255, 255, 255, 0.07);
}

.footer-accent-option.is-active {
    background: rgba(var(--nav-accent-rgb), 0.14);
    box-shadow: inset 0 0 0 1px rgba(var(--nav-accent-rgb), 0.28);
}

.footer-accent-option-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.footer-accent-option-label {
    flex: 1 1 auto;
    min-width: 0;
}

.panel-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 28px 16px;
}

.panel-footer-copy {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
}

.panel-footer-contacts--with-copy {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.panel-footer-contacts--with-copy .panel-footer-contacts-title {
    line-height: 1;
}

[data-theme="light"] .panel-footer {
    background: var(--d-surface);
    border-top-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .panel-footer-brand-name {
    color: #0f172a;
}

[data-theme="light"] .panel-footer-tagline,
[data-theme="light"] .panel-footer-copy {
    color: #64748b;
}

[data-theme="light"] .footer-seg {
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .footer-seg-btn:not(.is-active) {
    color: #475569;
}

[data-theme="light"] .footer-seg-btn.is-active {
    color: #0f172a;
}

[data-theme="light"] .footer-accent-trigger {
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.14);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .footer-accent-trigger:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.4);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .footer-accent-menu {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .footer-accent-option:hover {
    background: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .footer-accent-option.is-active {
    background: rgba(var(--nav-accent-rgb), 0.12);
    box-shadow: inset 0 0 0 1px rgba(var(--nav-accent-rgb), 0.22);
}

[data-theme="light"] .panel-footer-social {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #475569;
}

.avatar-upload span {
    display: none;
}
.avatar-clickable {
    cursor: pointer;
}
.avatar-upload {
    display: none;
}

#tab-products .row > input,
#tab-products .row > .prod-active {
    min-width: 170px;
}

.loader-admin-lead {
    margin: 0 0 8px;
    line-height: 1.5;
}

.loader-admin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin: 16px 0 0;
}

a.loader-admin-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(var(--nav-accent-rgb), 0.52);
    background: rgba(var(--nav-accent-rgb), 0.14);
    color: var(--ui-accent);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

a.loader-admin-open:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.75);
    background: rgba(var(--nav-accent-rgb), 0.22);
    box-shadow: 0 0 18px rgba(var(--nav-accent-rgb), 0.18);
}

.loader-admin-open-hint {
    font-size: 12px;
}

.loader-admin-toggle-block {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.loader-admin-footnote {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.45;
    max-width: 52rem;
}

[data-theme="light"] a.loader-admin-open {
    border-color: rgba(var(--nav-accent-rgb), 0.45);
    background: rgba(var(--nav-accent-rgb), 0.1);
}
#tab-products .row > .picker.picker--like-role {
    min-width: 220px;
    flex: 1 1 220px;
    max-width: 100%;
}
#tab-products .row {
    align-items: stretch;
}
#productSubmitBtn {
    min-width: 120px;
}

.picker-item.multi.picker-item--product-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.picker-item.multi.picker-item--product-row .picker-product-label {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.picker-item.multi.picker-item--product-row .picker-product-tick {
    flex-shrink: 0;
    font-size: 14px;
    opacity: 0.9;
}

#loginWrap:not(.hidden) #chatFab {
    display: none !important;
}

.chat-panel {
    position: fixed;
    left: 256px;
    right: 20px;
    bottom: 24px;
    width: min(440px, calc(100vw - 288px));
    max-width: 440px;
    margin-left: 0;
    z-index: 900;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 14px 0;
}

.resources-overlay {
    z-index: 8500;
}

.resources-menu-card {
    position: relative;
    width: min(420px, calc(100% - 28px));
    max-height: min(88vh, 720px);
    overflow-y: auto;
    margin: min(12vh, 120px) auto 0;
    padding: 20px;
    border-radius: 8px;
    background: var(--ui-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.resources-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.resources-menu-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f1f5f9;
}

.resources-menu-close {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 400;
}

.resources-menu-close.btn-cancel-icon {
    border: 1px solid var(--ui-btn-cancel-border);
    background: transparent;
    color: var(--ui-btn-cancel-color);
}

.resources-menu-close.btn-cancel-icon:hover {
    background: var(--ui-btn-cancel-bg-hover);
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

.resources-menu-desc {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.resources-menu-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resources-useful-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.resources-menu-section-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.resources-useful-lead {
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
}

.resources-useful-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.55;
    color: #cbd5e1;
}

.resources-useful-list li {
    margin-bottom: 8px;
}

.resources-useful-list a {
    color: rgb(var(--nav-accent-rgb));
    font-weight: 600;
    text-decoration: none;
}

.resources-useful-list a:hover {
    text-decoration: underline;
}

.resources-useful-hint {
    color: var(--muted);
    font-weight: 500;
}

[data-theme="light"] .resources-useful-block {
    border-top-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .resources-menu-section-title {
    color: #0f172a;
}

[data-theme="light"] .resources-useful-list {
    color: #334155;
}

.resources-doc-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--ui-surface-elevated);
    color: #e2e8f0;
    font-weight: 600;
    font-size: 13px;
    box-shadow: none;
    cursor: pointer;
    transform: none;
}

.resources-doc-btn:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.48);
    background: rgba(var(--nav-accent-rgb), 0.12);
    filter: none;
    transform: none;
}

.resources-doc-btn-label {
    font-weight: 600;
}

.resources-doc-btn-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
}

[data-theme="light"] .resources-doc-btn {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

[data-theme="light"] .resources-doc-btn:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.42);
    background: rgba(var(--nav-accent-rgb), 0.1);
}

[data-theme="light"] .resources-menu-title {
    color: #0f172a;
}

[data-theme="light"] .prod-active-track {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .prod-active-option:not(.is-active) {
    color: #64748b;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
}
.modal-card {
    position: relative;
    width: min(820px, calc(100% - 36px));
    margin: min(8vh, 64px) auto 18px;
    padding: 22px 24px;
    border-radius: 8px;
    background: var(--ui-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

@media (max-height: 760px) {
    .modal-card {
        margin-top: 14px;
    }
}

[data-theme="light"] .modal-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

[data-theme="light"] .modal-card h2 {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.modal-card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-card--totp-setup {
    width: min(560px, calc(100% - 28px));
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        radial-gradient(120% 90% at 50% -18%, rgba(255, 255, 255, 0.06), transparent 62%),
        linear-gradient(180deg, rgba(11, 11, 11, 0.98), rgba(7, 7, 7, 0.98));
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.totp-setup-body {
    gap: 14px;
}

.totp-qr-wrap {
    display: flex;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(12, 12, 12, 0.92);
}

.totp-qr-image {
    width: 230px;
    height: 230px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    background: #ffffff;
    padding: 6px;
}

.modal-card--key-edit {
    width: min(480px, calc(100% - 36px));
}

.modal-card--key-edit .key-modal-body.stack-fields {
    gap: 12px;
}

.key-modal-section {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.22);
}

.key-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8b92a3;
    margin: 0 0 12px;
}

.key-modal-section-title--danger {
    color: #fca5a5;
}

.key-modal-term-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 14px;
}

.key-modal-field-grow {
    flex: 1 1 160px;
    min-width: 0;
}

.key-modal-field-full {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.key-modal-field-full input {
    width: 100%;
    min-width: 0;
}

.key-modal-term-save,
.key-modal-note-save {
    flex: 0 0 auto;
    min-height: 42px;
}

.key-modal-note-save {
    width: 100%;
    margin-top: 10px;
}

.key-modal-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.key-modal-actions-row .btn-save,
.key-modal-actions-row .key-modal-btn {
    flex: 1 1 140px;
    min-width: 0;
}

.key-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    min-height: 42px;
    box-sizing: border-box;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.key-modal-btn--secondary {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    box-shadow: none;
}

.key-modal-btn--secondary:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

.key-modal-section--status .key-modal-btn--freeze {
    width: 100%;
    border: 1px solid rgba(234, 179, 8, 0.28);
    background: rgba(234, 179, 8, 0.09);
    color: #fde68a;
}

.key-modal-section--status .key-modal-btn--freeze:hover {
    border-color: rgba(250, 204, 21, 0.45);
    background: rgba(234, 179, 8, 0.14);
    color: #fef3c7;
}

.key-modal-section--danger {
    border-color: rgba(248, 113, 113, 0.22);
    background: rgba(248, 113, 113, 0.06);
}

.key-modal-danger-hint {
    margin: -4px 0 12px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(252, 165, 165, 0.88);
}

.key-modal-delete-btn {
    width: 100%;
}

.modal-actions--key-edit {
    margin-top: 8px;
}

[data-theme="light"] .key-modal-section {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(248, 250, 252, 0.95);
}

[data-theme="light"] .key-modal-section-title {
    color: #64748b;
}

[data-theme="light"] .key-modal-section-title--danger {
    color: #b91c1c;
}

[data-theme="light"] .key-modal-btn--secondary {
    border-color: rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: #475569;
}

[data-theme="light"] .key-modal-btn--secondary:hover {
    border-color: rgba(15, 23, 42, 0.22);
    background: #f8fafc;
}

[data-theme="light"] .key-modal-section--status .key-modal-btn--freeze {
    border-color: rgba(180, 83, 9, 0.28);
    background: rgba(254, 243, 199, 0.65);
    color: #92400e;
}

[data-theme="light"] .key-modal-section--status .key-modal-btn--freeze:hover {
    border-color: rgba(180, 83, 9, 0.4);
    background: rgba(254, 243, 199, 0.9);
}

[data-theme="light"] .key-modal-danger-hint {
    color: #991b1b;
}

[data-theme="light"] .key-modal-section--danger {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(254, 226, 226, 0.4);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.04);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb {
    background: rgba(143, 174, 218, 0.35);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(143, 174, 218, 0.55);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stack-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

@media (max-width: 1280px) {
    .products-admin-table .product-actions-cell {
        white-space: normal;
        min-width: 0;
        overflow-x: auto;
    }
    .product-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
}

@media (max-width: 1200px) {
    .profile-page-top {
        grid-template-columns: 1fr 1fr;
    }
    .profile-card-password {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .profile-page-top {
        grid-template-columns: 1fr;
    }
    .profile-card-password {
        grid-column: 1;
    }
}

@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .content {
        padding: 12px;
    }
    .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(300px, 82vw);
        z-index: 4100;
        margin: 0;
        border-radius: 0 16px 16px 0;
        border: 1px solid rgba(255,255,255,0.14);
        border-left: none;
        padding: 14px 14px 20px;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .sidebar-menu {
        justify-content: flex-start;
        gap: 10px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        margin: -12px -12px 12px -12px;
        padding: 48px 12px 8px;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }
    .panel-footer-inner {
        padding-left: 16px;
        padding-right: 16px;
    }
    .panel-footer-bottom {
        padding-left: 16px;
        padding-right: 16px;
        justify-content: center;
        text-align: center;
    }

    .panel-footer-copy {
        text-align: center;
        flex: 1 1 100%;
    }

    .panel-footer-contacts--with-copy {
        justify-content: center;
    }
    .table-scroll {
        max-width: 100%;
    }
    .chat-panel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 78px;
    }
    .modal-card {
        margin-top: 6vh;
        width: calc(100% - 18px);
    }
}

@media (max-width: 640px) {
    .row > * {
        flex: 1 1 100%;
        min-width: 0 !important;
    }
    .row > button,
    .row > .btn-compact {
        flex: 1 1 auto;
        min-width: min(100%, 160px);
    }
    #tab-profile .profile-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    #tab-profile .profile-actions .btn-profile {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        justify-content: center;
    }
    input, select, textarea {
        min-width: 0;
        width: 100%;
    }
    .topbar {
        justify-content: flex-end;
    }
    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }
    .nav-btn {
        padding: 11px 12px;
        font-size: 15px;
    }
    .pager button {
        width: 36px;
        height: 36px;
    }
    .login-card {
        padding: 20px 16px 16px;
    }
    .chat-messages {
        min-height: 280px;
        max-height: 48vh;
    }
    .table-scroll {
        -webkit-overflow-scrolling: touch;
    }
    .table-scroll table {
        min-width: 680px;
    }
    .admins-table,
    .admin-action-logs-table,
    .security-events-table {
        min-width: 640px;
    }
    .products-admin-table {
        min-width: 760px;
    }
    .products-actions-row {
        margin-bottom: 10px;
    }
    .products-add-btn {
        width: 100%;
        min-width: 0;
    }
    .panel-footer {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .panel-footer-inner,
    .panel-footer-bottom {
        gap: 12px;
    }
    .panel-footer-controls {
        width: 100%;
        gap: 10px;
    }
    .footer-control {
        flex: 1 1 calc(50% - 8px);
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 10px;
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0));
    }
    .topbar {
        margin: -10px -10px 10px -10px;
        padding: 52px 10px 8px;
    }
    .topbar-avatar {
        width: 34px;
        height: 34px;
    }
    .sidebar {
        width: min(320px, 90vw);
        border-radius: 0 14px 14px 0;
    }
    .card {
        padding: 14px 12px;
        border-radius: 10px;
    }
    .admins-card-head .btn-save {
        width: 100%;
    }
    .admins-card-head {
        gap: 8px;
    }
    .panel-footer-brand,
    .panel-footer-controls,
    .panel-footer-contacts--with-copy {
        width: 100%;
    }
    .footer-control {
        flex: 1 1 100%;
    }
    .footer-seg,
    .footer-accent-trigger {
        width: 100%;
    }
    .security-grid {
        gap: 14px;
    }
    .blocked-countries-panel {
        padding: 12px;
    }
    .blocked-countries-toolbar {
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .table-scroll-admins {
        border: none;
        background: transparent;
        overflow: visible;
    }
    .table-scroll-admins .admins-table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }
    .table-scroll-admins .admins-table thead {
        display: none;
    }
    .table-scroll-admins .admins-table tbody {
        display: grid;
        gap: 10px;
    }
    .table-scroll-admins .admins-table tr {
        display: grid;
        grid-template-columns: 1fr;
        border: 1px solid var(--d-border);
        border-radius: 10px;
        background: var(--d-surface);
        overflow: hidden;
    }
    .table-scroll-admins .admins-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-sizing: border-box;
        text-align: right;
        min-height: 42px;
    }
    .table-scroll-admins .admins-table tr td:last-child {
        border-bottom: none;
    }
    .table-scroll-admins .admins-table td::before {
        color: var(--muted);
        font-size: 11px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        font-weight: 700;
        white-space: nowrap;
        margin-right: auto;
        text-align: left;
    }
    .table-scroll-admins .admins-table td:nth-child(1)::before { content: "ID"; }
    .table-scroll-admins .admins-table td:nth-child(2)::before { content: "Логин"; }
    .table-scroll-admins .admins-table td:nth-child(3)::before { content: "Роль"; }
    .table-scroll-admins .admins-table td:nth-child(4)::before { content: "Почта"; }
    .table-scroll-admins .admins-table td:nth-child(5)::before { content: "Активен"; }
    .table-scroll-admins .admins-table td:nth-child(6)::before { content: "Создан"; }
    .table-scroll-admins .admins-table td:nth-child(7)::before { content: "Действия"; }
    .table-scroll-admins .admins-table .admin-list-usercell {
        align-items: flex-start;
    }
    .table-scroll-admins .admins-table .admin-list-usercell-inner {
        width: 100%;
        justify-content: flex-end;
    }
    .table-scroll-admins .admins-table .admin-list-names {
        text-align: right;
    }
    #tab-logs .table-scroll,
    #tab-security .table-scroll-sm,
    #tab-security .table-scroll {
        border: none;
        background: transparent;
        overflow: visible;
    }
    #tab-logs .table-scroll table,
    #tab-security .security-table,
    #tab-security .blocked-countries-table,
    #tab-security .security-events-table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }
    #tab-logs .table-scroll thead,
    #tab-security .security-table thead,
    #tab-security .blocked-countries-table thead,
    #tab-security .security-events-table thead {
        display: none;
    }
    #tab-logs .table-scroll tbody,
    #tab-security .security-table tbody,
    #tab-security .blocked-countries-table tbody,
    #tab-security .security-events-table tbody {
        display: grid;
        gap: 10px;
    }
    #tab-logs .table-scroll tr,
    #tab-security .security-table tr,
    #tab-security .blocked-countries-table tr,
    #tab-security .security-events-table tr {
        display: grid;
        grid-template-columns: 1fr;
        border: 1px solid var(--d-border);
        border-radius: 10px;
        background: var(--d-surface);
        overflow: hidden;
    }
    #tab-logs .table-scroll td,
    #tab-security .security-table td,
    #tab-security .blocked-countries-table td,
    #tab-security .security-events-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        text-align: right;
        min-height: 40px;
    }
    #tab-logs .table-scroll tr td:last-child,
    #tab-security .security-table tr td:last-child,
    #tab-security .blocked-countries-table tr td:last-child,
    #tab-security .security-events-table tr td:last-child {
        border-bottom: none;
    }
    #tab-logs .table-scroll td::before,
    #tab-security .security-table td::before,
    #tab-security .blocked-countries-table td::before,
    #tab-security .security-events-table td::before {
        margin-right: auto;
        text-align: left;
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        white-space: nowrap;
    }
    #tab-logs .table-scroll td:nth-child(1)::before { content: "Time"; }
    #tab-logs .table-scroll td:nth-child(2)::before { content: "Product"; }
    #tab-logs .table-scroll td:nth-child(3)::before { content: "Key"; }
    #tab-logs .table-scroll td:nth-child(4)::before { content: "PC"; }
    #tab-logs .table-scroll td:nth-child(5)::before { content: "IP"; }
    #tab-logs .table-scroll td:nth-child(6)::before { content: "HWID"; }
    #tab-logs .table-scroll td:nth-child(7)::before { content: "Source"; }
    #tab-security .security-table td:nth-child(1)::before { content: "ID"; }
    #tab-security .security-table td:nth-child(2)::before { content: "Type"; }
    #tab-security .security-table td:nth-child(3)::before { content: "Value"; }
    #tab-security .security-table td:nth-child(4)::before { content: "Reason"; }
    #tab-security .security-table td:nth-child(5)::before { content: "Until"; }
    #tab-security .security-table td:nth-child(6)::before { content: "Action"; }
    #tab-security .blocked-countries-table td:nth-child(1)::before { content: "Code"; }
    #tab-security .blocked-countries-table td:nth-child(2)::before { content: "Note"; }
    #tab-security .blocked-countries-table td:nth-child(3)::before { content: "Action"; }
    #tab-security .security-events-table td:nth-child(1)::before { content: "Time"; }
    #tab-security .security-events-table td:nth-child(2)::before { content: "Type"; }
    #tab-security .security-events-table td:nth-child(3)::before { content: "Product"; }
    #tab-security .security-events-table td:nth-child(4)::before { content: "Key"; }
    #tab-security .security-events-table td:nth-child(5)::before { content: "IP"; }
    #tab-security .security-events-table td:nth-child(6)::before { content: "Details"; }
    #tab-security .security-filters .picker,
    #tab-security .security-filters .security-input,
    #tab-security .security-filters button,
    #tab-security .security-form-row .picker,
    #tab-security .security-form-row .security-input,
    #tab-security .security-form-row button {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .admins-card-head,
    .products-actions-row,
    .profile-section-head,
    .keygen-modal-head {
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
    }

    .admins-card-head > .btn-save,
    .admins-card-head > .btn-cancel,
    .products-actions-row > .btn-save,
    .products-actions-row > .btn-cancel {
        width: 100%;
    }

    .ticket-filters,
    .security-filters,
    .security-form-row,
    .owner-product-settings-actions,
    .moderation-ban-actions,
    .moderation-ban-fields,
    .profile-email-actions,
    .profile-confirm-inline,
    .key-modal-term-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ticket-filters > *,
    .security-filters > *,
    .security-form-row > *,
    .owner-product-settings-actions > *,
    .moderation-ban-actions > *,
    .moderation-ban-fields > *,
    .profile-email-actions > *,
    .profile-confirm-inline > *,
    .key-modal-term-row > * {
        width: 100%;
        min-width: 0;
    }

    .profile-identity-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-avatar-block {
        width: 100%;
        align-items: center;
    }

    .profile-fields-modern,
    .profile-password-stack {
        width: 100%;
    }

    .ticket-message-wrap textarea,
    #ticketThreadReplyText,
    #ticketCreateText {
        min-height: 96px;
    }

    .chat-panel {
        bottom: 72px;
        border-radius: 12px;
    }

    .chat-messages {
        max-height: 42vh;
    }

    .modal-card,
    .modal-card--ticket-thread,
    .modal-card--totp-setup,
    .modal-card--key-edit {
        width: calc(100% - 12px);
        margin-top: 2vh;
        border-radius: 12px;
    }

    .modal-card--ticket-thread {
        min-height: 88vh;
        max-height: 92vh;
    }

    .table-scroll table {
        min-width: 720px;
    }

    .online-table,
    .keys-table,
    .profile-logins-table,
    .products-admin-table,
    .admin-action-logs-table,
    .security-events-table,
    .security-table,
    .blocked-countries-table {
        min-width: 720px;
    }

    .products-table-shell {
        margin-left: 0;
        margin-right: 0;
        overflow-x: auto;
    }
}

@media (max-width: 520px) {
    .stats-grid,
    .stats-grid--dash,
    .stats-grid--online-compact {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .card h2,
    .admins-card-head h2,
    .profile-section-head h2 {
        font-size: 17px;
    }

    .owner-product-checklist-items {
        grid-template-columns: 1fr;
    }

    .moderation-grid,
    .security-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .topbar-user-name {
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ticket-live-badge {
        font-size: 11px;
        padding: 5px 8px;
    }
}

/* Products management recode */
#tab-products .card-products {
    padding: 18px 16px 16px;
}

.products-actions-row--top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.products-add-btn {
    min-width: 220px;
    min-height: 42px;
}

.products-table-shell {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(14, 14, 14, 0.96), rgba(9, 9, 9, 0.98));
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
    overflow-x: auto;
    overflow-y: hidden;
}

.products-table-shell .products-admin-table {
    min-width: 1320px;
}

.products-admin-table th {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #b7bfd1;
    padding-top: 12px;
    padding-bottom: 12px;
}

.products-admin-table td {
    padding-top: 11px;
    padding-bottom: 11px;
    vertical-align: middle;
}

.owner-product-settings {
    margin-top: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(var(--nav-accent-rgb), 0.08), rgba(0, 0, 0, 0) 56%),
        linear-gradient(180deg, rgba(14, 14, 14, 0.96), rgba(8, 8, 8, 0.98));
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 20px 32px rgba(0, 0, 0, 0.24);
}

.owner-product-settings-title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
}

.owner-product-select-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 12px;
}

.owner-product-select-row #ownerSettingsProductPicker {
    min-width: 0;
}

.owner-product-select-row .btn-cancel {
    min-width: 130px;
}

.owner-product-settings-actions--grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.owner-product-settings-actions--grid .btn-cancel,
.owner-product-settings-actions--grid .btn-save {
    min-height: 40px;
    justify-content: center;
}

.owner-loader-dropzone-wrap {
    width: 100%;
}

.owner-loader-dropzone {
    width: 100%;
    min-height: 72px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.26);
    background: linear-gradient(180deg, rgba(25, 25, 25, 0.96), rgba(13, 13, 13, 0.98));
    color: #d6dbe7;
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-align: left;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.owner-loader-dropzone:hover {
    border-color: rgba(var(--nav-accent-rgb), 0.62);
    box-shadow: 0 0 0 1px rgba(var(--nav-accent-rgb), 0.22);
}

.owner-loader-dropzone.is-dragover {
    border-color: rgba(var(--nav-accent-rgb), 0.9);
    background: linear-gradient(180deg, rgba(var(--nav-accent-rgb), 0.16), rgba(16, 16, 16, 0.98));
    box-shadow: 0 0 0 1px rgba(var(--nav-accent-rgb), 0.35), 0 8px 18px rgba(0, 0, 0, 0.25);
}

.owner-loader-dropzone-icon {
    width: 22px;
    height: 22px;
    color: var(--ui-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.owner-loader-dropzone-icon svg {
    width: 20px;
    height: 20px;
}

.owner-loader-dropzone-text {
    font-size: 13px;
    font-weight: 600;
}

.owner-loader-dropzone-subtext {
    font-size: 12px;
    color: #9ea6ba;
}

.owner-product-security-card {
    margin-top: 4px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.owner-product-security-card > h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.owner-product-ban-form {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(220px, 1.2fr) minmax(220px, 1fr);
    gap: 10px;
    align-items: center;
}

.owner-product-ban-form #ownerSecBanTypePicker,
.owner-product-ban-form #ownerSecBanValue,
.owner-product-ban-form #ownerSecBanReason {
    min-width: 0;
}

.owner-product-ban-form .security-check {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.owner-product-ban-form #ownerSecBanExpires,
.owner-product-ban-form button {
    min-height: 40px;
}

.owner-product-bans-table-shell {
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 9, 9, 0.8);
}

@media (max-width: 1100px) {
    .owner-product-settings-actions--grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 860px) {
    #tab-products .card-products {
        padding: 14px 12px;
    }

    .products-table-shell .products-admin-table {
        min-width: 1180px;
    }

    .owner-product-select-row {
        grid-template-columns: 1fr;
    }

    .owner-product-select-row .btn-cancel {
        width: 100%;
    }

    .owner-product-settings-actions--grid {
        grid-template-columns: 1fr;
    }

    .owner-product-ban-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 680px) {
    .products-table-shell {
        border: none;
        background: transparent;
        overflow: visible;
    }

    .products-table-shell .products-admin-table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

    .products-table-shell .products-admin-table thead {
        display: none;
    }

    .products-table-shell .products-admin-table tbody {
        display: grid;
        gap: 10px;
    }

    .products-table-shell .products-admin-table tr {
        display: grid;
        grid-template-columns: 1fr;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        background: linear-gradient(180deg, rgba(13, 13, 13, 0.96), rgba(8, 8, 8, 0.98));
        overflow: hidden;
    }

    .products-table-shell .products-admin-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        min-height: 42px;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-sizing: border-box;
        text-align: right;
    }

    .products-table-shell .products-admin-table tr td:last-child {
        border-bottom: none;
    }

    .products-table-shell .products-admin-table td::before {
        margin-right: auto;
        text-align: left;
        color: #9ca3af;
        font-size: 11px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        font-weight: 700;
        white-space: nowrap;
    }

    .products-table-shell .products-admin-table td:nth-child(1)::before { content: "ID"; }
    .products-table-shell .products-admin-table td:nth-child(2)::before { content: "Slug"; }
    .products-table-shell .products-admin-table td:nth-child(3)::before { content: "Status"; }
    .products-table-shell .products-admin-table td:nth-child(4)::before { content: "Name"; }
    .products-table-shell .products-admin-table td:nth-child(5)::before { content: "Keys"; }
    .products-table-shell .products-admin-table td:nth-child(6)::before { content: "Downloads"; }
    .products-table-shell .products-admin-table td:nth-child(7)::before { content: "API Secret"; }
    .products-table-shell .products-admin-table td:nth-child(8)::before { content: "Loader URL"; }
    .products-table-shell .products-admin-table td:nth-child(9)::before { content: "VPN/Proxy"; }
    .products-table-shell .products-admin-table td:nth-child(10)::before { content: "Active"; }
    .products-table-shell .products-admin-table td:nth-child(11)::before { content: "Settings"; }

    .products-admin-table .product-actions-cell,
    .products-admin-table .product-actions {
        width: 100%;
        justify-content: flex-end;
        text-align: right;
    }
}

@media (max-width: 560px) {
    .mobile-menu-btn {
        left: 10px;
        top: 10px;
        width: 42px;
        height: 42px;
        border-radius: 11px;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    #ticketThreadModal .keygen-modal-head {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    #ticketThreadModal .keygen-modal-head h2 {
        margin: 0;
        font-size: 16px;
    }

    #ticketThread {
        min-height: 120px;
        max-height: 38vh;
        overflow: auto;
        border-radius: 10px;
        padding: 10px;
    }

    #ticketReplyText,
    #ticketMessage {
        min-height: 96px;
        font-size: 14px;
    }

    #ticketThreadModal .row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #ticketStatusControls {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px !important;
        width: 100%;
    }

    #ticketStatusSelect,
    #ticketSaveStatusBtn,
    #ticketThreadModal .btn-save,
    #ticketThreadModal .btn-cancel {
        width: 100%;
        min-height: 40px;
    }

    #ticketReplyScreenshotName {
        display: block;
        font-size: 12px;
        line-height: 1.35;
        word-break: break-word;
    }
}

/* Product settings redesign v2 */
#ownerProductSettings.owner-product-settings {
    margin-top: 14px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: grid;
    gap: 12px;
}

#ownerProductSettings .owner-settings-section {
    margin-bottom: 0;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(14, 14, 14, 0.97), rgba(9, 9, 9, 0.99));
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

#ownerProductSettings .owner-settings-section:last-child {
    margin-bottom: 0;
}

#ownerProductSettings .owner-product-settings-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}

#ownerProductSettings .owner-product-select-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 12px;
}

#ownerProductSettings .owner-product-select-row .btn-cancel {
    min-width: 110px;
    min-height: 34px;
    border-radius: 8px;
    font-size: 12px;
    padding: 6px 10px;
}

#ownerProductSettings .owner-product-settings-actions--grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

#ownerProductSettings .owner-product-settings-actions--grid .btn-save,
#ownerProductSettings .owner-product-settings-actions--grid .btn-cancel,
#ownerProductSettings .owner-loader-dropzone {
    min-height: 34px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600;
    padding: 6px 10px !important;
}

#ownerProductSettings .owner-loader-dropzone {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 8px;
    align-items: center;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
}

#ownerProductSettings .owner-loader-dropzone-text {
    font-size: 13px;
    font-weight: 600;
}

#ownerProductSettings .owner-loader-dropzone-subtext {
    font-size: 11px;
}

#ownerProductSettings .owner-product-security-card {
    margin-top: 0 !important;
}

#ownerProductSettings .owner-product-security-card > h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

#ownerProductSettings .owner-product-key-format-card {
    margin-top: 2px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

#ownerProductSettings .owner-product-key-format-card > h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

#ownerProductSettings .owner-product-key-format-row {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(90px, 120px) minmax(260px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

#ownerProductSettings .owner-product-key-format-row > * {
    min-width: 0;
}

#ownerProductSettings #ownerKeyLength {
    text-align: center;
}

#ownerProductSettings #ownerKeyMask {
    min-width: 260px;
}

#ownerProductSettings .owner-product-key-format-row .btn-save {
    min-height: 34px;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
}

#ownerProductSettings .btn-cancel,
#ownerProductSettings .btn-save {
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #e5e7eb !important;
    box-shadow: none !important;
}

#ownerProductSettings .btn-cancel:hover,
#ownerProductSettings .btn-save:hover {
    border-color: rgba(255, 255, 255, 0.32) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f3f4f6 !important;
}

#ownerProductSettings .owner-product-ban-form {
    display: grid;
    grid-template-columns: 120px minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 8px;
    align-items: center;
}

#ownerProductSettings .owner-product-ban-form .security-check,
#ownerProductSettings .owner-product-ban-form #ownerSecBanExpires,
#ownerProductSettings .owner-product-ban-form button {
    min-height: 38px;
}

#ownerProductSettings .owner-product-ban-form button {
    border-radius: 10px;
}

#ownerProductSettings .owner-product-bans-table-shell {
    margin-top: 10px;
    border-radius: 10px;
}

@media (max-width: 1200px) {
    #ownerProductSettings .owner-product-settings-actions--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #ownerProductSettings .owner-product-key-format-row {
        grid-template-columns: minmax(160px, 220px) minmax(90px, 120px) minmax(220px, 1fr);
    }

    #ownerProductSettings .owner-product-key-format-row .btn-save {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 900px) {
    #ownerProductSettings .owner-product-select-row {
        grid-template-columns: 1fr;
    }

    #ownerProductSettings .owner-product-settings-actions--grid {
        grid-template-columns: 1fr;
    }

    #ownerProductSettings .owner-product-ban-form {
        grid-template-columns: 1fr;
    }

    #ownerProductSettings .owner-product-key-format-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .picker-btn {
        min-height: 44px;
        font-size: 14px;
        padding: 10px 12px;
    }

    .picker-menu {
        padding: 8px;
        border-radius: 12px;
        max-height: 48vh;
    }

    .picker-search {
        min-height: 40px;
        font-size: 14px;
    }

    .picker-item {
        min-height: 40px;
        font-size: 13px;
        padding: 9px 10px;
    }

    .modal-card {
        width: calc(100% - 8px);
        margin-top: 1vh;
        border-radius: 10px;
    }

    .modal-card--ticket-thread .keygen-modal-body {
        padding: 10px;
    }

    #ticketThreadMessages {
        max-height: 58vh;
    }

    .ticket-message-wrap {
        border-radius: 10px;
        padding: 10px;
    }

    .ticket-message-wrap textarea,
    #ticketThreadReplyText,
    #ticketCreateText {
        min-height: 84px;
        font-size: 14px;
    }

    .owner-product-settings,
    .owner-product-security-card {
        padding: 10px;
        border-radius: 10px;
    }

    .owner-product-settings-title {
        font-size: 16px;
    }

    .owner-loader-dropzone {
        min-height: 64px;
        grid-template-columns: 20px 1fr;
        grid-template-areas:
            "icon text"
            "icon sub";
        row-gap: 2px;
        column-gap: 10px;
    }

    .owner-loader-dropzone-icon {
        grid-area: icon;
    }

    .owner-loader-dropzone-text {
        grid-area: text;
        font-size: 12px;
    }

    .owner-loader-dropzone-subtext {
        grid-area: sub;
        font-size: 11px;
    }
}
