@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-base: #060b18;
    --bg-soft: #0d172d;
    --surface: rgba(14, 22, 38, 0.88);
    --surface-strong: rgba(18, 28, 48, 0.95);
    --surface-glass: rgba(24, 39, 68, 0.6);
    --border: rgba(109, 120, 148, 0.28);
    --divider: rgba(109, 120, 148, 0.16);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --soft: #64748b;
    --primary: #6366f1;
    --primary-strong: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.18);
    --success: #34d399;
    --warning: #facc15;
    --danger: #f87171;
    --info: #38bdf8;
    --shadow-lg: 0 34px 80px rgba(3, 10, 24, 0.68);
    --shadow-md: 0 20px 50px rgba(7, 16, 36, 0.45);
    --shadow-sm: 0 14px 32px rgba(8, 17, 40, 0.35);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --font-sans: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Оптимизация рендеринга для всей страницы */
html {
    /* Плавный скролл */
    scroll-behavior: smooth;
    /* Оптимизация шрифтов */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background-color: #020617;
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-strong);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

button:disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

[hidden],
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Глобальный лоадер приложения */
.global-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-base, #060b18);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding: 20px;
}

.global-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.global-loader__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 90%;
}

.global-loader__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border, rgba(109, 120, 148, 0.28));
    border-top-color: var(--primary, #6366f1);
    border-radius: 50%;
    animation: globalLoaderSpin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.global-loader__text {
    font-size: 14px;
    color: var(--muted, #94a3b8);
    letter-spacing: 0.02em;
    text-align: center;
    word-wrap: break-word;
}

/* Мобильная адаптация для лоадера */
@media (max-width: 480px) {
    .global-loader__spinner {
        width: 40px;
        height: 40px;
        border-width: 2.5px;
    }
    
    .global-loader__text {
        font-size: 13px;
    }
}

::selection {
    background: rgba(99, 102, 241, 0.35);
    color: #f8fafc;
}


.app-shell {
    /* max-width: 1340px; */
    margin: 0 auto;
    padding: 36px 24px 72px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    position: relative;
    z-index: 1;
}

.app-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 24px 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(22, 32, 59, 0.92), rgba(12, 21, 40, 0.88));
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(24px);
}

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

.app-header__intro {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.app-header__version {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 500;
    opacity: 0.7;
}

.app-header__intro h1 {
    margin: 0;
    font-size: 1.9rem;
    letter-spacing: -0.01em;
}

.app-header__intro p {
    margin: 0;
    color: var(--muted);
    max-width: 560px;
}

.app-header__panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(10, 18, 32, 0.6);
    padding: 12px 16px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(9, 16, 33, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 5px;
    box-shadow: var(--shadow-sm);
}

.app-nav__item {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.app-nav__item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.12));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-nav__icon {
    width: 18px;
    height: 18px;
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: relative;
    z-index: 1;
}

.app-nav__label {
    position: relative;
    z-index: 1;
}

.app-nav__item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.app-nav__item:hover::before {
    opacity: 1;
}

.app-nav__item:hover .app-nav__icon {
    opacity: 1;
    transform: scale(1.08);
}

.app-nav__item.is-active,
.app-nav__item.active {
    color: #f8fafc;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35), 
                0 2px 8px rgba(99, 102, 241, 0.2);
}

.app-nav__item.is-active::before,
.app-nav__item.active::before {
    opacity: 0;
}

.app-nav__item.is-active .app-nav__icon,
.app-nav__item.active .app-nav__icon {
    opacity: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Timer Display */
.timer-display {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    padding: 4px 8px;
    background: rgba(14, 22, 38, 0.4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.timer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(24, 39, 68, 0.5);
    font-size: 0.75rem;
    min-width: 80px;
}

.timer-item--loading {
    background: rgba(99, 102, 241, 0.12);
}

.timer-item--success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.timer-item--success .timer-label,
.timer-item--success .timer-value {
    color: rgba(110, 231, 183, 1);
}

.timer-item--ping {
    min-width: 100px;
}

.timer-label {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.timer-value {
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

.timer-loader {
    width: 10px;
    height: 10px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

@keyframes cellUpdate {
    0% {
        background-color: rgba(99, 102, 241, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

.cell-updated {
    animation: cellUpdate 0.5s ease-out;
}

/* Стиль для кликабельной ячейки домена */
.domain-cell-clickable {
    position: relative;
    user-select: none;
    transition: background-color 0.2s ease;
}

.domain-cell-clickable:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

.domain-cell-clickable:active {
    background-color: rgba(99, 102, 241, 0.15) !important;
}

/* Анимация копирования ячейки */
.cell-copied {
    animation: cellCopied 0.8s ease-out;
}

@keyframes cellCopied {
    0% {
        background-color: rgba(52, 211, 153, 0.3);
    }
    50% {
        background-color: rgba(52, 211, 153, 0.15);
    }
    100% {
        background-color: transparent;
    }
}

/* Индикатор загрузки строки */
@keyframes rowPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.row-loading {
    position: relative;
    pointer-events: none;
    animation: rowPulse 2.5s ease-in-out infinite;
}

.row-loading::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(99, 102, 241, 0.25) 50%, 
        transparent 100%);
    animation: shimmer 2.5s ease-in-out infinite;
    pointer-events: none;
}

.row-updated {
    animation: rowFlash 1s ease-out;
}

@keyframes rowFlash {
    0% {
        background-color: rgba(34, 197, 94, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.header-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.header-controls__status {
    display: flex;
    align-items: center;
    min-width: 220px;
}

.header-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 220px;
    min-width: 200px;
}

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

.header-control input {
    width: 100%;
    min-width: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    padding: 10px 12px;
}

.header-control input::placeholder {
    color: rgba(148, 163, 184, 0.48);
}

.header-control input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 780px) {
    .header-controls__status {
        min-width: 100%;
    }

    .header-control {
        flex: 1 1 100%;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.section-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-grid {
    display: grid;
    gap: 24px;
}

.section-grid--cloudflare {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr);
    align-items: stretch;
}

.section-grid--cloudflare > .card {
    height: 100%;
}

@media (max-width: 1200px) {
    .section-grid--cloudflare {
        grid-template-columns: 1fr;
    }

    .card__meta-stack {
        align-items: stretch;
    }

    .card__meta-stack .btn-group {
        justify-content: flex-start;
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 26px 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 90% at 12% 0%, rgba(99, 102, 241, 0.12), transparent 65%);
    pointer-events: none;
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 24px;
}

.card__header--tight {
    gap: 20px;
    margin-bottom: 20px;
}

.card__subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.card__meta-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.card__headline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 540px;
}

.card__title h2 {
    margin: 0;
    font-size: 1.35rem;
}

.card__title p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.settings-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.session-widget {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid rgba(99, 102, 241, 0.32);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.session-widget__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 180px;
}

.session-widget__text span:first-child {
    font-weight: 600;
}

.session-status__meta {
    font-size: 0.78rem;
    color: var(--muted);
}

.session-status__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.session-status__dot--idle { background: var(--soft); }
.session-status__dot--checking {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
    animation: pulse 1.5s ease-in-out infinite;
}
.session-status__dot--active {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.25);
}
.session-status__dot--inactive {
    background: var(--warning);
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.25);
}
.session-status__dot--error {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.25);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.65; }
    100% { transform: scale(1); opacity: 1; }
}


.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    background: rgba(148, 163, 184, 0.08);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateZ(0);
    will-change: transform;
    contain: layout style paint;
}

.btn:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.16);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
    transform: translateY(-1px) translateZ(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-strong), #4338ca);
}

.btn-outline {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.35);
}

.btn-outline:hover:not(:disabled) {
    border-color: rgba(148, 163, 184, 0.6);
    background: rgba(148, 163, 184, 0.12);
}

.btn-ghost {
    background: rgba(148, 163, 184, 0.08);
    color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.18);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.35);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.28);
}

.btn-warning {
    background: rgba(250, 204, 21, 0.18);
    color: var(--warning);
    border-color: rgba(250, 204, 21, 0.35);
}

.btn-warning:hover:not(:disabled) {
    background: rgba(250, 204, 21, 0.28);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 10px;
}

/* Кнопки-иконки */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: 8px;
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
    padding: 0 !important;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: 8px;
}

.btn-icon-lg {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    font-size: 1rem;
    line-height: 1;
    border-radius: 8px;
}

/* Контейнер для кнопок действий */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

/* Миниатюрные кнопки с SVG иконками */
.btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px;
    height: 28px;
    padding: 0 !important;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    background: rgba(51, 65, 85, 0.3);
    color: rgba(226, 232, 240, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-icon svg {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: rgba(129, 140, 248, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-icon-danger {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    color: rgba(252, 165, 165, 0.9);
}

.btn-icon-danger:hover {
    background: rgba(248, 113, 113, 0.25);
    border-color: rgba(248, 113, 113, 0.5);
    color: rgba(252, 165, 165, 1);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.3);
}

.btn-icon.is-disabled,
.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Убираем влияние .btn на все элементы - только для button и a */
button.btn,
a.btn,
input[type="button"].btn,
input[type="submit"].btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Группы кнопок */
.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 1.5rem;
}

.form-actions .btn {
    min-width: 120px;
}


.settings-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.settings-grid--compact {
    gap: 16px;
}

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

.field--metric {
    gap: 6px;
}

.field--metric span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
}

.field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #f1f5f9;
}

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

.field input,
.field textarea,
.field select {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    padding: 12px 14px;
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder {
    color: rgba(148, 163, 184, 0.48);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.field textarea {
    resize: vertical;
    min-height: 180px;
    font-family: var(--font-mono);
}

.field--compact textarea {
    min-height: 120px;
}

.field--compact input {
    max-width: 260px;
}

.field--static .static-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 0.86rem;
    color: var(--muted);
    font-weight: 500;
}

.field select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.59 0.590027L6 5.17003L1.41 0.590027L0 2.00003L6 8.00003L12 2.00003L10.59 0.590027Z' fill='%23cbd5f5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.field__hint {
    font-size: 0.78rem;
    color: var(--muted);
}

.field-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}


.tabs {
    display: flex;
    gap: 10px;
    background: rgba(8, 15, 30, 0.78);
    border-radius: var(--radius-md);
    padding: 6px;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.tabs--compact {
    margin-bottom: 0;
}

.tab-button {
    flex: 1;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-weight: 600;
    color: var(--muted);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tab-button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
    color: #f8fafc;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.28);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(240px, 1.2fr);
    gap: 20px;
}

.workspace-grid--single {
    grid-template-columns: 1fr;
}

.workspace-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workspace-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.workspace-card--full {
    padding: 24px 26px 24px;
}

.workspace-card--full .section-header {
    margin-bottom: 18px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.08));
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 20px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.section-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, 
        rgba(99, 102, 241, 0.8),
        rgba(139, 92, 246, 0.8)
    );
    border-radius: 12px 0 0 12px;
}

.section-header {
    position: relative;
}

.section-header--tight {
    gap: 12px;
}

.section-header--tight p {
    font-size: 0.86rem;
    max-width: 520px;
}

.section-header--compact {
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, 
        rgba(226, 232, 240, 1),
        rgba(148, 163, 184, 0.9)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.section-header p {
    margin: 4px 0 0 0;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.875rem;
    font-weight: 400;
    max-width: 600px;
    line-height: 1.5;
}

.domain-actions,
.dms-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.domain-actions {
    justify-content: flex-start;
}


.progress-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.82rem;
    color: var(--muted);
}

.log-card {
    background: rgba(11, 19, 35, 0.72);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.log-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--divider);
}

.log-card__header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.log {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 20px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: rgba(7, 12, 24, 0.45);
    overflow-x: hidden;
}

.log-entry {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.log-entry.success { border-left: 3px solid var(--success); background: rgba(52, 211, 153, 0.12); }
.log-entry.error { border-left: 3px solid var(--danger); background: rgba(248, 113, 113, 0.12); }
.log-entry.warning { border-left: 3px solid var(--warning); background: rgba(250, 204, 21, 0.12); }
.log-entry.info { border-left: 3px solid var(--info); background: rgba(56, 189, 248, 0.12); }

.log::-webkit-scrollbar {
    width: 8px;
}

.log::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 10px;
}

/* Скрываем скроллбар для таблиц */
.dms-table-wrapper::-webkit-scrollbar,
.domain-table-wrapper::-webkit-scrollbar,
.accounts-table-wrapper::-webkit-scrollbar {
    display: none;
}

.dms-table-wrapper,
.domain-table-wrapper,
.accounts-table-wrapper {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.domain-filters {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    background: rgba(9, 16, 33, 0.62);
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.domain-summary {
    background: rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: 14px 16px;
}

.domain-summary p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.domain-summary strong {
    color: #f8fafc;
}


.domain-table-wrapper,
.accounts-table-wrapper {
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 10px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 0;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 60vh;
}

.domain-table-wrapper::before,
.accounts-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(99, 102, 241, 0.5) 50%,
        transparent
    );
    z-index: 1;
}

.domain-table {
    width: 100%;
    min-width: 700px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.domain-table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.85);
    padding: 16px 14px;
    background: linear-gradient(180deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.8));
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.domain-table thead th:first-child {
    border-top-left-radius: 12px;
}

.domain-table thead th:last-child {
    border-top-right-radius: 12px;
}

.domain-table tbody tr {
    background: rgba(30, 41, 59, 0.4);
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.domain-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.5);
    transform: scale(1.002);
    box-shadow: 
        0 2px 8px rgba(99, 102, 241, 0.15),
        inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.domain-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.15);
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.domain-table tbody tr:last-child {
    border-bottom: none;
}

.domain-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.domain-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.domain-table th,
.domain-table td {
    padding: 12px 14px;
    font-size: 0.875rem;
    color: var(--text);
    border: none;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-table td:first-child {
    width: 54px;
    text-align: center;
}

.domain-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.domain-table__placeholder {
    text-align: center;
    color: var(--muted);
    padding: 36px 16px;
    background: rgba(8, 14, 28, 0.6);
    border-radius: 16px;
}

.domain-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(8, 14, 28, 0.82);
}

.domain-pagination__info {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ========================================
   DMS Control Panel - Compact Design
   ======================================== */
.dms-control-panel {
    background: linear-gradient(135deg, rgba(12, 18, 32, 0.5), rgba(18, 26, 45, 0.35));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.dms-control-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    flex-wrap: wrap;
}

.dms-control-panel__title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dms-control-panel__title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.dms-control-panel__actions {
    display: flex;
    gap: 6px;
}

.dms-stats-compact {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(10, 18, 32, 0.6);
    transition: all 0.2s ease;
    font-size: 0.82rem;
}

.stat-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(10, 18, 32, 0.8);
}

.stat-pill.is-active {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.18);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.stat-pill__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 500;
}

.stat-pill__value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
}

.dms-control-panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(6, 12, 24, 0.4);
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    flex-wrap: wrap;
}

.dms-filters-compact {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
}

.input-compact,
.select-compact {
    padding: 7px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(10, 18, 32, 0.7);
    color: var(--text);
    transition: all 0.2s ease;
}

.input-compact {
    min-width: 280px;
    flex: 1;
}

.input-compact:focus,
.select-compact:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(10, 18, 32, 0.9);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.select-compact {
    min-width: 140px;
    cursor: pointer;
}

.selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.selected-badge__label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
}

.selected-badge__count {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 700;
}

.dms-actions-compact {
    display: flex;
    gap: 6px;
}

@media (max-width: 1024px) {
    .dms-control-panel__header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dms-control-panel__title {
        justify-content: space-between;
    }
    
    .dms-stats-compact {
        justify-content: center;
    }
    
    .dms-control-panel__toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dms-filters-compact {
        flex-direction: column;
    }
    
    .input-compact {
        min-width: auto;
    }
    
    .dms-actions-compact {
        justify-content: stretch;
    }
    
    .dms-actions-compact button {
        flex: 1;
    }
}

/* Legacy support - keep old classes working */
.dms-toolbar {
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
}

.dms-toolbar__controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dms-filter-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.dms-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-chip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(10, 18, 32, 0.72);
    padding: 12px 14px;
    transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.stat-chip.is-active {
    border-color: rgba(99, 102, 241, 0.65);
    background: rgba(99, 102, 241, 0.16);
    box-shadow: 0 12px 26px rgba(99, 102, 241, 0.25);
}

.stat-chip__label {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-chip__value {
    font-size: 1.45rem;
    font-weight: 600;
    color: #f8fafc;
}

.dms-toolbar__actions {
    justify-content: flex-start;
}

.dms-layout {
    display: grid;
    gap: 24px;
}

.dms-layout__main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dms-layout__aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@media (min-width: 1280px) {
    .dms-toolbar {
        grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
        align-items: start;
    }

    .dms-toolbar__actions {
        justify-content: flex-end;
    }

    .dms-layout {
        grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr);
        align-items: start;
    }
}

.dms-queue {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(12, 22, 44, 0.94), rgba(16, 28, 54, 0.88));
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    isolation: isolate;
}

.dms-queue::before,
.dms-queue::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
    mix-blend-mode: screen;
}

.dms-queue::before {
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.24), transparent 65%);
}

.dms-queue::after {
    background: radial-gradient(circle at 80% 80%, rgba(14, 116, 144, 0.18), transparent 58%);
}

.dms-queue__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dms-queue__controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dms-queue__metrics {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.queue-metric {
    background: rgba(10, 18, 36, 0.7);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.queue-metric__label {
    font-size: 0.75rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.queue-metric__value {
    font-size: 1.18rem;
    font-weight: 600;
    color: #f8fafc;
}

.dms-queue__status {
    font-size: 0.85rem;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(15, 24, 44, 0.8);
    color: rgba(226, 232, 240, 0.86);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}

.dms-queue__status.status-info { border-color: rgba(56, 189, 248, 0.4); background: rgba(56, 189, 248, 0.12); color: var(--info); }
.dms-queue__status.status-success { border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.12); color: var(--success); }
.dms-queue__status.status-warning { border-color: rgba(250, 204, 21, 0.45); background: rgba(250, 204, 21, 0.14); color: var(--warning); }
.dms-queue__status.status-error { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.dms-queue__status.status-muted { border-color: rgba(148, 163, 184, 0.26); background: rgba(148, 163, 184, 0.12); color: var(--muted); }

.dms-filters {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
    background: rgba(9, 16, 33, 0.62);
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.14);
}


.dms-table-wrapper {
    position: relative;
    margin-top: 20px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 10px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 0;
    overflow-x: auto;
    /* overflow-y убран, max-height убран - таблица растягивается на всю длину */
}

.dms-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(99, 102, 241, 0.5) 50%,
        transparent
    );
}

.data-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

/* Оптимизация для tbody - минимизируем reflow при обновлении */
.data-table tbody {
    will-change: contents;
    /* Изоляция для улучшения производительности */
    contain: layout style;
}

.data-table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.85);
    padding: 16px 14px;
    background: linear-gradient(180deg, rgba(51, 65, 85, 0.6), rgba(30, 41, 59, 0.8));
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.data-table thead th:first-child {
    border-top-left-radius: 12px;
}

.data-table thead th:last-child {
    border-top-right-radius: 12px;
}

.data-table tbody tr {
    background: rgba(30, 41, 59, 0.4);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    /* Изоляция строки для оптимизации */
    contain: layout paint;
    will-change: auto;
}

.data-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.5);
    box-shadow: 
        0 2px 8px rgba(99, 102, 241, 0.15),
        inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.data-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.15);
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.data-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border: none;
    font-size: 0.875rem;
    color: var(--text);
    vertical-align: middle;
    white-space: nowrap;
    /* Отключение сглаживания субпикселей для скорости */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Колонка домена - без обрезки */
.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    min-width: 200px;
}

.data-table td {
    /* Изоляция для улучшения производительности */
    contain: layout paint;
    /* Убрали backdrop-filter - он очень тяжёлый */
}

.data-table td:last-child {
    white-space: nowrap;
}

/* Оптимизация размеров колонок */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 40px;
    max-width: 40px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 50px;
    max-width: 50px;
}

.data-table th:nth-child(9),
.data-table td:nth-child(9) {
    /* VT Status колонка */
    width: 140px;
    max-width: 140px;
    white-space: nowrap;
}

.data-table th:nth-child(12),
.data-table td:nth-child(12) {
    /* Кнопки действий */
    width: 120px;
    max-width: 120px;
    text-align: right;
}

.domain-table td {
    overflow-wrap: anywhere;
}

.domain-table td:last-child {
    white-space: nowrap;
}

/* Ширины колонок для оптимального отображения */
.checkbox-col {
    width: 50px;
    text-align: center;
}

.domain-col {
    min-width: 200px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-col {
    width: 120px;
    text-align: center;
}

.vt-status-col {
    width: 140px;
    text-align: center;
}

.actions-col {
    width: 140px;
    text-align: right;
}

.date-col {
    width: 180px;
    white-space: nowrap;
}

/* Расширенные столбцы для таблиц VirusTotal и Users */
.data-table--vt-wide th:nth-child(1),
.data-table--vt-wide td:nth-child(1) {
    /* Название в таблице VirusTotal - расширенная ширина */
    width: auto;
    min-width: 180px;
    max-width: none;
    white-space: normal;
    word-break: break-word;
}

/* Таблица пользователей - расширенный столбец "Имя пользователя" */
#users-table-body tr td:nth-child(2),
#users-table-body tr th:nth-child(2) {
    width: auto;
    min-width: 180px;
    max-width: none;
    white-space: normal;
    word-break: break-word;
}

.ip-col {
    width: 140px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.username-col {
    min-width: 150px;
    white-space: nowrap;
}

.role-col {
    width: 100px;
    text-align: center;
}

.permissions-col {
    min-width: 250px;
}

/* Красивые кастомные чекбоксы для таблиц */
.row-checkbox,
#dms-select-all,
#domain-select-all {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--bg-soft);
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
    padding: 0;
    vertical-align: middle;
    list-style: none;
    outline: none;
}

.row-checkbox:before {
    display: none !important;
}

.row-checkbox:hover,
#dms-select-all:hover,
#domain-select-all:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.row-checkbox:checked,
#dms-select-all:checked,
#domain-select-all:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.row-checkbox:checked::after,
#dms-select-all:checked::after,
#domain-select-all:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.row-checkbox:indeterminate,
#dms-select-all:indeterminate,
#domain-select-all:indeterminate {
    background: var(--primary);
    border-color: var(--primary);
}

.row-checkbox:indeterminate::after,
#dms-select-all:indeterminate::after,
#domain-select-all:indeterminate::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 6px;
    width: 8px;
    height: 2px;
    background: white;
    border: none;
    transform: none;
}

.row-checkbox:disabled,
#dms-select-all:disabled,
#domain-select-all:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.table-placeholder {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Лоадер для таблиц */
.table-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.table-loader.active {
    opacity: 1;
    pointer-events: all;
}

.table-loader__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.table-loader__text {
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 500;
}

/* Обёртка для таблицы с position: relative */
.table-wrapper {
    position: relative;
    min-height: 200px;
}

.cell-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.cell-subtext {
    font-size: 0.72rem;
    color: var(--soft);
    margin-top: 2px;
}

.dms-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.dms-pagination__info {
    font-size: 0.82rem;
    color: var(--muted);
}

#dms-selected-count {
    font-weight: 600;
    color: #f8fafc;
}


.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.688rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid transparent;
    position: relative;
    overflow: visible;
    white-space: nowrap;
}

/* VT Loader - анимированный индикатор загрузки */
.vt-loader {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(125, 211, 252, 0.3);
    border-top-color: rgba(125, 211, 252, 1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.vt-cell {
    contain: initial !important;
    position: relative;
    overflow: visible;
    min-width: 100px;
    max-width: 140px;
}

.tag--muted { 
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.08)); 
    border-color: rgba(148, 163, 184, 0.25); 
    color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.tag--primary { 
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.12)); 
    border-color: rgba(99, 102, 241, 0.4); 
    color: rgba(129, 140, 248, 1);
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
}

.tag--success { 
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.12)); 
    border-color: rgba(52, 211, 153, 0.4); 
    color: rgba(110, 231, 183, 1);
    box-shadow: 0 1px 3px rgba(52, 211, 153, 0.2);
}

.tag--info { 
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.12)); 
    border-color: rgba(56, 189, 248, 0.4); 
    color: rgba(125, 211, 252, 1);
    box-shadow: 0 1px 3px rgba(56, 189, 248, 0.2);
}

.tag--warning { 
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.22), rgba(250, 204, 21, 0.14)); 
    border-color: rgba(250, 204, 21, 0.45); 
    color: rgba(253, 224, 71, 1);
    box-shadow: 0 1px 3px rgba(250, 204, 21, 0.2);
}

.tag--danger { 
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.22), rgba(248, 113, 113, 0.14)); 
    border-color: rgba(248, 113, 113, 0.45); 
    color: rgba(252, 165, 165, 1);
    box-shadow: 0 1px 3px rgba(248, 113, 113, 0.2);
}

/* VT Flags Tooltip - должен быть прямым дочерним элементом .tag */
.tag .vt-tooltip {
    position: absolute;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    text-align: left;
    line-height: 1.6;
    z-index: 99999;
    box-shadow: 0 20px 50px rgba(7, 16, 36, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    min-width: 240px;
    max-width: 400px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    word-wrap: break-word;
    white-space: pre-wrap;
    color: #e2e8f0;
    display: block;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
}

.tag .vt-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-top-color: var(--surface-strong);
}

/* Permission Badges - компактные бейджи для прав доступа */
.permission-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: help;
    transition: all 0.2s ease;
}

.permission-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.permission-badge--dms {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.1));
    border-color: rgba(99, 102, 241, 0.35);
    color: rgba(129, 140, 248, 0.95);
}

.permission-badge--cloudflare {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.18), rgba(251, 146, 60, 0.1));
    border-color: rgba(251, 146, 60, 0.35);
    color: rgba(253, 186, 116, 0.95);
}

.permission-badge--vt {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.1));
    border-color: rgba(34, 197, 94, 0.35);
    color: rgba(74, 222, 128, 0.95);
}

.permission-badge--users {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(168, 85, 247, 0.1));
    border-color: rgba(168, 85, 247, 0.35);
    color: rgba(192, 132, 252, 0.95);
}

.text-muted {
    color: rgba(148, 163, 184, 0.6);
    font-style: italic;
}

.tag[data-vt-flags]:hover .vt-tooltip,
.tag:hover .vt-tooltip {
    opacity: 1;
    visibility: visible;
}

.accounts-grid {
    display: grid;
    gap: 20px;
}

.vt-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    margin-top: 20px;
}

.vt-queue-panel {
    position: sticky;
    top: 20px;
    align-self: start;
}

.vt-accounts-main {
    min-width: 0;
}

@media (max-width: 1200px) {
    .vt-layout {
        grid-template-columns: 1fr;
    }
    
    .vt-queue-panel {
        position: static;
    }
}

.data-table--wide {
    width: 100%;
    min-width: 900px;
}

.vt-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 16px 0 20px;
}

.summary-tile {
    flex: 1 1 160px;
    min-width: 140px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(11, 20, 36, 0.66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.summary-tile__label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

.summary-tile__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
}

.accounts-grid--split {
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
    align-items: start;
}

@media (max-width: 1200px) {
    .accounts-grid--split {
        grid-template-columns: 1fr;
    }

    .vt-summary {
        flex-direction: column;
    }

    .summary-tile {
        width: 100%;
    }
}

.vt-queue {
    grid-column: 1 / -1;
}

.accounts-table-card {
    border-radius: 22px;
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(155deg, rgba(8, 16, 33, 0.84), rgba(11, 21, 40, 0.7));
    box-shadow: 0 24px 60px rgba(2, 6, 16, 0.38);
    padding: 18px;
    overflow-x: auto;
}

.accounts-form-card {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(9, 16, 33, 0.75);
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.editable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    color: var(--primary);
    border-bottom: 1px dashed rgba(99, 102, 241, 0);
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    cursor: pointer;
    padding: 4px 6px;
    margin: -4px -6px;
    border-radius: 4px;
}

.editable__icon {
    opacity: 0.4;
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 4px;
    color: var(--muted);
}

.editable:hover .editable__icon {
    opacity: 1;
    transform: translateX(2px);
}

.editable:hover,
.editable:focus-visible {
    color: var(--primary-strong);
    border-bottom-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.08);
    outline: none;
}

.editable--empty {
    color: rgba(226, 232, 240, 0.75);
    border-bottom-color: rgba(148, 163, 184, 0.35);
}

.editable--empty .editable__icon {
    opacity: 0.25;
}

.editable--empty:hover .editable__icon {
    opacity: 0.6;
}

.editable__placeholder {
    font-style: italic;
    opacity: 0.65;
}

.editable.is-pending::after {
    content: '';
    position: absolute;
    right: -24px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.45);
    border-top-color: var(--primary);
    animation: spin 0.65s linear infinite;
}

.inline-edit {
    width: 100%;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.92);
    color: var(--text);
    font: inherit;
    padding: 6px 8px;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

.inline-edit:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
}


.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.modal__overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(142, 97, 255, 0.12) 0%, rgba(7, 12, 24, 0.82) 55%);
    backdrop-filter: blur(18px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.modal__dialog {
    position: relative;
    background: linear-gradient(155deg, rgba(12, 20, 36, 0.96), rgba(16, 28, 52, 0.94));
    border-radius: 26px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow:
        0 45px 120px rgba(2, 6, 12, 0.7),
        0 0 0 1px rgba(11, 18, 36, 0.6),
        inset 0 0 0 1px rgba(132, 144, 196, 0.08);
    width: min(540px, 92%);
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px 30px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateY(18px) scale(0.96);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.32s ease;
    isolation: isolate;
}

.modal__dialog::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.22), transparent 60%);
    opacity: 0.45;
    pointer-events: none;
    mix-blend-mode: screen;
}

.modal__dialog::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 24px;
    background: radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.16), transparent 55%);
    opacity: 0.4;
    pointer-events: none;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.modal__header h3 {
    margin: 0;
    font-size: 1.18rem;
    letter-spacing: -0.01em;
}

.modal__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.modal__close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.08);
    color: rgba(226, 232, 240, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.modal__close:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #f8fafc;
    transform: rotate(180deg) scale(1.05);
}

.modal__footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal__error {
    font-size: 0.82rem;
    color: var(--danger);
    background: rgba(248, 113, 113, 0.18);
    border: 1px solid rgba(248, 113, 113, 0.32);
    padding: 10px 12px;
    border-radius: 10px;
}

body.modal-open {
    overflow: hidden;
}

.modal--open {
    opacity: 1;
    pointer-events: auto;
}

.modal--open .modal__overlay {
    opacity: 1;
}

.modal--open .modal__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal--closing {
    pointer-events: none;
}

.modal--closing .modal__overlay {
    opacity: 0;
}

.modal--closing .modal__dialog {
    transform: translateY(24px) scale(0.94);
    opacity: 0;
}

.toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1100;
    pointer-events: none;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    background: rgba(12, 20, 36, 0.95);
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 22px 48px rgba(2, 6, 12, 0.45);
    padding: 14px 18px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.toast--success { border-color: rgba(52, 211, 153, 0.45); background: rgba(5, 46, 36, 0.92); }
.toast--warning { border-color: rgba(250, 204, 21, 0.45); background: rgba(46, 43, 12, 0.9); }
.toast--error { border-color: rgba(248, 113, 113, 0.45); background: rgba(60, 15, 18, 0.9); }
.toast--info { border-color: rgba(56, 189, 248, 0.45); background: rgba(12, 33, 54, 0.9); }


@media (min-width: 1080px) {
    .accounts-grid {
        grid-template-columns: 2.2fr 1fr;
    }
}

@media (max-width: 1090px) {
    .app-header {
        flex-direction: column;
        align-items: stretch;
    }

    .app-nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }
}

@media (max-width: 960px) {
    .app-shell {
        padding: 32px 18px 64px;
    }

    .workspace-grid,
    .dms-top {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .card {
        padding: 22px 20px 26px;
    }

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

    .settings-card__actions .btn {
        flex: 1 1 auto;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .dms-actions,
    .domain-actions {
        justify-content: flex-start;
    }

    .toast-stack {
        left: 16px;
        right: 16px;
        top: 16px;
        align-items: stretch;
    }
}

/* DNS и Zone компактные грид-системы */
.dns-grid,
.zone-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

.dns-input-group,
.zone-input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dns-params {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.dns-status-group,
.zone-status-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dns-status-group .log-card,
.zone-status-group .log-card {
    flex: 1;
    min-height: 300px;
}

@media (max-width: 1100px) {
    .dns-grid,
    .zone-grid {
        grid-template-columns: 1fr;
    }
    
    .dns-params {
        grid-template-columns: 1fr;
    }
}

/* VirusTotal новая компоновка */
.section-header--vt {
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--divider);
    margin-bottom: 0;
}

.section-header__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.vt-header-stats {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    width: 100%;
}

.vt-stat-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.vt-stat-card {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(145deg, rgba(11, 20, 36, 0.7), rgba(8, 16, 33, 0.6));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.vt-stat__label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.vt-stat__value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
}

.vt-stat__value--highlight {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.vt-queue-compact {
    min-width: 380px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(9, 16, 33, 0.75);
}

.vt-queue-compact__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vt-queue-compact__header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.vt-queue-compact__controls {
    display: flex;
    gap: 8px;
}

.vt-queue-compact__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 10px;
}

.queue-metric-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.queue-metric-inline__label {
    font-size: 0.78rem;
    color: var(--muted);
}

.queue-metric-inline__value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.vt-queue-compact__status {
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.vt-queue-compact__status.status-info {
    color: var(--info);
}

.vt-queue-compact__status.status-success {
    color: var(--success);
}

.vt-queue-compact__status.status-error {
    color: var(--danger);
}

.vt-queue-compact__status.status-warning {
    color: var(--warning);
}

.vt-main-content {
    padding-top: 24px;
}

.accounts-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: linear-gradient(155deg, rgba(8, 16, 33, 0.84), rgba(11, 21, 40, 0.7));
    box-shadow: 0 24px 60px rgba(2, 6, 16, 0.38);
    padding: 20px;
}

.data-table--vt-wide {
    width: 100%;
    min-width: 1100px;
}

.data-table--vt-wide th {
    white-space: nowrap;
    font-size: 0.8rem;
}

.data-table--vt-wide td {
    font-size: 0.85rem;
}

@media (max-width: 1400px) {
    .vt-header-stats {
        grid-template-columns: 1fr;
    }
    
    .vt-stat-group {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vt-queue-compact {
        min-width: 100%;
    }
}

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

/* Оптимизация производительности при скролле */
body.is-scrolling .data-table tbody tr {
    transition: none;
    will-change: auto;
    pointer-events: none;
}

body.is-scrolling .btn {
    transition: none;
    will-change: auto;
}

body.is-scrolling * {
    pointer-events: none;
}

body.is-scrolling .dms-table-wrapper {
    pointer-events: auto;
}

/* Улучшенная производительность для пользователей с предпочтением уменьшения движения */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   DMS Header
   ======================================== */
.dms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(12, 18, 32, 0.45), rgba(18, 26, 45, 0.3));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dms-header__info h3 {
    margin: 0 0 4px 0;
    font-size: 1.3rem;
    letter-spacing: -0.015em;
}

.dms-header__info p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
}

.dms-header__actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ========================================
   Modal Extensions
   ======================================== */
.modal__dialog--wide {
    width: min(1080px, 94%);
    max-width: 1080px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.modal-grid__input,
.modal-grid__preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.domain-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(10, 18, 32, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--radius-md);
    padding: 18px;
    height: 100%;
}

.domain-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.domain-preview__header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.domain-preview__count {
    font-size: 0.84rem;
    color: var(--muted);
}

.domain-preview__count strong {
    color: var(--primary);
    font-size: 1.1rem;
    margin-right: 4px;
}

.domain-preview__list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 380px;
}

.domain-preview__item {
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e0e7ff;
    transition: background 0.15s ease;
}

.domain-preview__item:hover {
    background: rgba(99, 102, 241, 0.14);
}

.domain-preview__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--muted);
    font-size: 0.88rem;
    font-style: italic;
}

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: radial-gradient(circle at top, rgba(30, 64, 175, 0.35), rgba(15, 23, 42, 0.95));
}

.login-card {
    width: min(360px, 100%);
    padding: 2rem;
    background: rgba(15, 23, 42, 0.92);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.45);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #f8fafc;
}

.login-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.login-form .field {
    margin-bottom: 1rem;
    text-align: left;
}

.login-form input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.9);
    color: #f1f5f9;
}

.login-form input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-error {
    margin-top: 0.75rem;
    color: #f87171;
    font-size: 0.9rem;
    text-align: center;
}

.app-header__auth {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.auth-user {
    color: var(--muted);
    font-weight: 600;
}

/* WebSocket Live индикатор */
.ws-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ws-status-indicator__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--soft);
    transition: all 0.3s ease;
    animation: pulse-idle 2s ease-in-out infinite;
}

.ws-status-indicator__text {
    color: var(--muted);
    transition: color 0.3s ease;
}

/* Состояния подключения */
.ws-status-indicator[data-status="connecting"] .ws-status-indicator__dot {
    background: var(--warning);
    animation: pulse-connecting 1.5s ease-in-out infinite;
}

.ws-status-indicator[data-status="connected"] .ws-status-indicator__dot {
    background: var(--success);
    animation: pulse-success 2s ease-in-out infinite;
}

.ws-status-indicator[data-status="connected"] .ws-status-indicator__text {
    color: var(--success);
}

.ws-status-indicator[data-status="disconnected"] .ws-status-indicator__dot {
    background: var(--danger);
    animation: none;
}

.ws-status-indicator[data-status="disconnected"] .ws-status-indicator__text {
    color: var(--danger);
}

.ws-status-indicator[data-status="error"] .ws-status-indicator__dot {
    background: var(--danger);
    animation: pulse-error 1s ease-in-out infinite;
}

.ws-status-indicator[data-status="error"] .ws-status-indicator__text {
    color: var(--danger);
}

/* Анимации пульсации */
@keyframes pulse-idle {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes pulse-connecting {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes pulse-success {
    0%, 100% { opacity: 0.8; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
    50% { opacity: 1; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0); }
}

@keyframes pulse-error {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; transform: scale(1.15); }
}

/* Стили для управления пользователями */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.permission-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.permission-section__title {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkbox-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.checkbox-placeholder {
    color: var(--muted);
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    cursor: pointer;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
}

.checkbox-label::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-soft);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.checkbox-label:hover::before {
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* Галочка внутри чекбокса */
.checkbox-label::after {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    width: 0.375rem;
    height: 0.625rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translateY(-65%) rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.checkbox-label.checked::before,
.checkbox-label input[type="checkbox"]:checked::before,
.checkbox-label:has(input[type="checkbox"]:checked)::before {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.checkbox-label.checked::after,
.checkbox-label input[type="checkbox"]:checked ~ ::after,
.checkbox-label:has(input[type="checkbox"]:checked)::after {
    opacity: 1;
}

.checkbox-label span {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.checkbox-label:hover span {
    color: var(--primary);
}

@media (max-width: 1024px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
    
    .domain-preview__list {
        max-height: 240px;
    }
}
