/* ==============================================================================
   PRO-DIAG Remote Assist — Фирменные стили (PRO-DIAG Brand Style)
   Палитра: Обсидиан #06111b, Подложки #0b1b27, Бордюры #294656, Янтарь #00d5eb
   Закругления: 12-16px, Стекло, Мягкое янтарное свечение
   ============================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Основные цвета */
    --bg-primary: #06111b;
    --bg-secondary: #0b1b27;
    --bg-card: #102330;
    --bg-subcard: #122c3c;
    --bg-hover: #1e2a40;
    --bg-input: #0f1523;

    /* Бордюры */
    --border: #294656;
    --border-light: #3d6073;
    --border-hover: rgba(0, 213, 235, 0.45);

    /* Текст */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Фирменный янтарный акцент PRO-DIAG */
    --accent: #00d5eb;
    --accent-hover: #009bb8;
    --accent-gradient: linear-gradient(135deg, #00d5eb 0%, #009bb8 100%);
    --accent-glow: rgba(0, 213, 235, 0.25);
    --accent-subtle: rgba(0, 213, 235, 0.12);

    /* Статусные цвета */
    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.15);
    --warning: #00d5eb;
    --warning-subtle: rgba(0, 213, 235, 0.15);
    --danger: #ef4444;
    --danger-subtle: rgba(239, 68, 68, 0.15);
    --info: #38bdf8;
    --info-subtle: rgba(56, 189, 248, 0.15);

    /* Геометрия */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 25px rgba(0, 213, 235, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(0, 213, 235, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(0, 155, 184, 0.03) 0%, transparent 45%);
}

/* ==============================================================================
   Экран авторизации
   ============================================================================== */
.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #102330 0%, #06111b 100%);
    padding: 20px;
}

.auth-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px 38px;
    width: 100%;
    max-width: 460px;
    text-align: center;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.logo-badge-brand {
    display: inline-block;
    background: var(--accent-gradient);
    color: #06111b;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 2px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.auth-box h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 13px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 213, 235, 0.15);
}

.auth-hint {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-hint code {
    background: var(--bg-subcard);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
    font-family: monospace;
}

.error-message {
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
}

/* ==============================================================================
   Главный интерфейс и Header
   ============================================================================== */
.main-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: rgba(18, 23, 34, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-badge {
    background: var(--accent-gradient);
    color: #06111b;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 15px var(--accent-glow);
    text-transform: uppercase;
}

.header-title-box h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.header-title-box p {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Action Buttons in PRO-DIAG style (#00d5eb) */
.btn-header-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(0, 213, 235, 0.12);
    border: 1px solid rgba(0, 213, 235, 0.45);
    color: #00d5eb;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 213, 235, 0.1);
    white-space: nowrap;
}

.btn-header-action:hover {
    background: var(--accent-gradient);
    color: #06111b;
    border-color: #00d5eb;
    box-shadow: 0 0 20px rgba(0, 213, 235, 0.4);
    transform: translateY(-1px);
}

.btn-header-action span {
    font-size: 13px;
}

/* Radar & Connection Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(14, 19, 29, 0.8);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.radar-dot-wrap {
    position: relative;
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.status-dot.online-green {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
    background: var(--text-muted);
}

.radar-ring-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: radarAnim 2s infinite cubic-bezier(0.2, 0.8, 0.4, 1);
}

@keyframes radarAnim {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* ==============================================================================
   Панель 4 Киллер-фич (Top Action Bar)
   ============================================================================== */
.killer-actions-bar {
    background: linear-gradient(90deg, rgba(20, 27, 41, 0.9) 0%, rgba(18, 23, 34, 0.9) 100%);
    border-bottom: 1px solid var(--border);
    padding: 10px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.killer-group-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.killer-buttons-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-killer {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-killer:hover {
    border-color: var(--accent);
    background: rgba(0, 213, 235, 0.1);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 213, 235, 0.18);
}

.btn-killer.accent-glow {
    border-color: rgba(0, 213, 235, 0.5);
    background: rgba(0, 213, 235, 0.08);
}

/* ==============================================================================
   Навигация по вкладкам (5 Вкладок)
   ============================================================================== */
.nav {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    overflow-x: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(0, 213, 235, 0.04);
}

.nav-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(0, 213, 235, 0.06);
}

.nav-item span {
    font-size: 16px;
}

/* ==============================================================================
   Контентная область
   ============================================================================== */
.content {
    flex: 1;
    padding: 24px 28px 48px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 22px;
}

.tab-content.active {
    display: flex;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   Карточки и секции
   ============================================================================== */
.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.section:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), 0 0 20px rgba(0, 213, 235, 0.06);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
    line-height: 1.5;
}

/* ==============================================================================
   Кнопки
   ============================================================================== */
.btn-primary {
    padding: 10px 18px;
    background: var(--accent-gradient);
    color: #06111b;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 15px var(--accent-glow);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(0, 213, 235, 0.4);
}

.btn-secondary {
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 213, 235, 0.08);
}

.btn-cloud-install {
    padding: 9px 16px;
    background: var(--accent-gradient);
    color: #06111b;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 15px var(--accent-glow);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-cloud-install:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(0, 213, 235, 0.45);
}

.btn-cloud {
    padding: 8px 14px;
    background: var(--bg-subcard);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-cloud:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==============================================================================
   Живые задачи установки (Live Task Progress)
   ============================================================================== */
.task-live-card {
    background: linear-gradient(135deg, rgba(0, 213, 235, 0.08) 0%, rgba(18, 23, 34, 0.95) 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 30px var(--accent-glow);
}

.task-live-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.task-live-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
}

.task-progress-outer {
    background: #090c12;
    border: 1px solid var(--border);
    height: 22px;
    border-radius: 11px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.task-progress-inner {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 213, 235, 0.5);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.18) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.18) 75%,
        transparent 75%,
        transparent
    );
    background-size: 28px 28px;
    animation: moveStripes 1.2s linear infinite;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 28px 0; }
}

.task-live-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.task-live-bottom strong {
    color: var(--accent);
}

.btn-abort-task {
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-abort-task:hover {
    background: var(--danger);
    color: #fff;
}

/* ==============================================================================
   Баннер телеметрии DiagAgent (Telemtry Banner)
   ============================================================================== */
.agent-banner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}

.agent-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.agent-banner-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-meta-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.agent-badge {
    padding: 4px 10px;
    background: var(--bg-subcard);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.agent-badge.success {
    background: var(--success-subtle);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.agent-badge.warning {
    background: var(--warning-subtle);
    border-color: rgba(0, 213, 235, 0.3);
    color: var(--warning);
}

.agent-badge.info {
    background: var(--info-subtle);
    border-color: rgba(56, 189, 248, 0.3);
    color: var(--info);
}

.agent-disks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.agent-disk-card {
    background: var(--bg-subcard);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agent-disk-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.agent-disk-bar {
    background: #090c12;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.agent-disk-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
}

.agent-disk-fill.ok {
    background: var(--success);
}

.agent-disk-fill.warn {
    background: var(--danger);
}

/* ==============================================================================
   Каталог программ (Programs Grid & Cards)
   ============================================================================== */
.prog-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.prog-search {
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    transition: all 0.2s;
}

.prog-search:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 213, 235, 0.15);
}

.prog-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.prog-chip {
    padding: 7px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.prog-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.prog-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #06111b;
    font-weight: 700;
    box-shadow: 0 0 10px var(--accent-glow);
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
}

@media (max-width: 600px) {
    .programs-grid { grid-template-columns: 1fr; }
}

.prog-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
    transition: all 0.25s ease;
    position: relative;
}

.prog-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), 0 0 20px rgba(0, 213, 235, 0.1);
    transform: translateY(-2px);
}

.prog-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.prog-title-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.prog-badge-cat {
    background: var(--bg-subcard);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.prog-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.prog-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 12px;
}

.prog-meta-item {
    color: var(--text-muted);
}

.prog-meta-item strong {
    color: var(--text-primary);
}

.prog-alert-box {
    background: rgba(0, 213, 235, 0.08);
    border: 1px dashed rgba(0, 213, 235, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 12px;
    color: #e2e8f0;
}

.prog-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-quick-fix {
    padding: 5px 10px;
    background: var(--bg-subcard);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quick-fix:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.prog-actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-instructions-toggle {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-instructions-toggle:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.instructions-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 12px;
}

.instruction-step-card {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.instruction-step-card:last-child {
    border-bottom: none;
}

.instruction-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #06111b;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.instruction-step-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.instruction-step-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==============================================================================
   Вкладка Авто-фиксы (Autofix Grid & Items)
   ============================================================================== */
.autofix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.autofix-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
    transition: all 0.2s;
}

.autofix-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card), 0 0 15px rgba(0, 213, 235, 0.08);
}

.autofix-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autofix-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.autofix-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.autofix-status-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    background: var(--bg-card);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.autofix-status-line strong {
    color: var(--text-primary);
}

/* ==============================================================================
   Вкладка Тестер сканеров (Scanner Tester)
   ============================================================================== */
.scanner-test-hero {
    background: linear-gradient(135deg, rgba(0, 213, 235, 0.08) 0%, rgba(18, 23, 34, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: var(--shadow-card);
}

.scanner-hero-left h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scanner-hero-left p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 650px;
}

.scanner-verdict-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 20px;
}

.scanner-verdict-box.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.scanner-verdict-box.warning {
    border-color: var(--warning);
    background: rgba(0, 213, 235, 0.05);
}

.scanner-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

/* ==============================================================================
   Вкладка Консоль мастера (Master Console)
   ============================================================================== */
.console-box {
    background: #080a0f;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.console-header {
    background: #0e131d;
    border-bottom: 1px solid var(--border);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.console-chips-row {
    padding: 12px 18px;
    background: #0c1018;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.console-chip {
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    cursor: pointer;
    transition: all 0.2s;
}

.console-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.console-output {
    padding: 16px 20px;
    font-family: 'Consolas', 'Cascadia Code', monospace;
    font-size: 13px;
    color: #e2e8f0;
    min-height: 280px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
}

.console-input-row {
    display: flex;
    border-top: 1px solid var(--border);
    background: #0d121c;
}

.console-shell-select {
    background: #111724;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
    padding: 0 14px;
    cursor: pointer;
}

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 18px;
    color: #fff;
    font-family: monospace;
    font-size: 14px;
}

.console-input:focus {
    outline: none;
}

/* ==============================================================================
   Модальное окно (Traffic Light & Modal)
   ============================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 14, 20, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 660px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

.modal-card h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--accent);
}

.modal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 22px;
}

.modal-item {
    background: var(--bg-subcard);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 13px;
}

/* ==============================================================================
   Уведомления (Toasts)
   ============================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 150;
    max-width: 400px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    animation: toastSlide 0.3s ease;
}

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Service status tags */
.service-status {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.service-status.running {
    background: var(--success-subtle);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.service-status.stopped {
    background: var(--danger-subtle);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* Precision Lab: shared application shell and component system */
:root{--bg-primary:#06111b;--bg-secondary:#091a26;--bg-card:#102330;--bg-subcard:#102837;--bg-input:#071722;--bg-hover:#143245;--border:#294656;--border-light:#3d6073;--text-secondary:#aec3d1;--text-muted:#7895a8;--radius-sm:6px;--radius-md:8px;--radius-lg:10px;--radius-xl:12px;--success:#39e986;--warning:#f5b544;--shadow-card:0 8px 28px #0002;--accent:#00d5eb;--accent-gradient:linear-gradient(120deg,#00dfed,#00a9c9)}
body{font-family:'Segoe UI',Arial,sans-serif;font-size:13px;background:radial-gradient(ellipse at 65% 0,#0d2431 0,transparent 48%),#06111b}
button,input,select{font:inherit}button,a,input,select{outline-offset:4px}button:focus-visible,a:focus-visible{outline:2px solid var(--accent)}
.header{height:72px;padding:12px 24px;background:#07151fee;box-shadow:0 1px 0 #ffffff05;gap:20px}.header-title-box h1{font-size:20px;letter-spacing:-.4px}.header-title-box p{font-size:11px;margin-top:3px}.header-left{gap:12px}.header-right{gap:10px}
.brand-badge{font-size:0;background:none;box-shadow:none;padding:0;width:42px;height:28px;border-radius:0;position:relative}.brand-badge:before,.brand-badge:after{content:'';position:absolute;width:14px;height:26px;transform:skew(-32deg);background:var(--accent);left:7px;top:1px}.brand-badge:after{left:24px}
.btn-header-action,.btn-secondary,.btn-killer,.btn-cloud,.btn-instructions-toggle,.btn-quick-fix{border-radius:6px;background:linear-gradient(180deg,#132b3a80,#071722);border:1px solid #355364;color:#e4eff6;box-shadow:inset 0 1px #ffffff05;font-weight:600}
.btn-header-action{padding:9px 12px}.agent-download-btn,.accent-glow{border-color:#00bad2;box-shadow:inset 0 0 18px #00d5eb0c}.btn-primary,.btn-cloud-install{border-radius:6px;background:linear-gradient(135deg,#00d4e6,#00a8c5);color:#04151c;border:1px solid #2ce6f4;font-weight:650}.btn-primary:hover,.btn-cloud-install:hover{filter:brightness(1.15)}
.status-indicator{background:transparent;border:0;border-left:1px solid var(--border);border-radius:0;font-size:11px;padding:4px 12px}.header-right .status-indicator:last-child{display:none}
.nav{position:fixed;top:72px;bottom:0;left:0;width:214px;display:flex;flex-direction:column;align-items:stretch;padding:24px 10px 18px 0;gap:7px;background:linear-gradient(110deg,#071722,#06121e);border-right:1px solid var(--border);border-bottom:0;z-index:35;overflow:auto}
.nav-item{flex:none;text-align:left;justify-content:flex-start;font-size:13px;border:0;border-radius:0 7px 7px 0;padding:14px 18px;white-space:normal;color:#c6d6e0}.nav-item.active{color:#f5fbff;background:linear-gradient(90deg,#006a7b70,#0c344345);border-left:4px solid #00d5eb;border-bottom:0;padding-left:14px}.nav-item span{font-size:18px;color:#a7cad9}.sidebar-foot{margin-top:auto;padding:25px 14px 0;border-top:1px solid var(--border);font-size:10px;color:#bdd0db;line-height:2}.sidebar-foot small{color:#68879a;font-size:8px;letter-spacing:1px}
.killer-actions-bar{margin-left:214px;background:transparent;padding:18px 24px 0;border:0;justify-content:flex-start;gap:18px}.killer-group-title{font-size:10px;letter-spacing:1px;color:var(--text-muted)}.btn-killer{padding:9px 13px;font-size:12px}.killer-buttons-wrap{gap:8px}
.content{margin-left:214px;padding:22px 24px;max-width:none;width:calc(100% - 214px)}.workspace-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;border-left:4px solid var(--accent);padding-left:16px}.workspace-heading h1{font-size:25px;line-height:1.2;letter-spacing:.1px}.workspace-heading p{font-size:12px;color:var(--text-secondary);margin-top:6px}
.section{background:transparent;border:0;box-shadow:none;padding:0;margin-bottom:20px}.section-header{margin-bottom:16px;gap:12px}.section-header h2{font-size:18px}.section-desc{font-size:12px;max-width:700px}.section-header>div:last-child{align-items:center}.section-header .btn-secondary{font-size:10px;padding:7px 9px}
.agent-banner,.info-card,.autofix-card,.prog-card,.agent-disk-card,.scanner-verdict-box,.scanner-test-hero,.console-container{background:linear-gradient(120deg,#122a3890,#081923 85%);border:1px solid var(--border);box-shadow:inset 0 1px #b5e7ff08;border-radius:8px}.agent-banner{padding:16px;margin-bottom:18px}.agent-banner-header{margin-bottom:10px;padding-bottom:10px}.agent-banner-title{font-size:13px}.agent-meta-badges{gap:7px}.agent-badge{font-size:10px;border-radius:5px;padding:3px 8px}.agent-disks-grid{gap:12px}.agent-disk-card{padding:12px}.agent-disk-bar{height:6px;margin:9px 0;background:#193444;border-radius:8px}.agent-disk-fill{background:var(--accent-gradient)}
.programs-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.prog-card{padding:15px;gap:10px;min-width:0;transition:border-color .18s,box-shadow .18s}.prog-card:hover{border-color:#00bfd5;box-shadow:0 0 18px #00d5eb12;transform:none}.prog-card:has(input:checked){border-color:#00d5eb;box-shadow:inset 0 0 28px #00d5eb09,0 0 12px #00d5eb18}.prog-card-top{align-items:center;gap:8px}.prog-card h3{font-size:16px;line-height:1.25;letter-spacing:-.2px}.prog-card-top>div:last-child{font-size:10px}.prog-desc{font-size:11px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:33px;color:#b8ccd8}.prog-card .prog-actions-row{margin-top:auto;padding-top:8px;gap:6px}.prog-actions-row button,.prog-actions-row a{font-size:10px;padding:6px 8px}.prog-meta-grid,.prog-alert-box,.prog-quick-actions{display:none}.prog-badge-cat{display:none}.prog-card .service-status{font-size:9px;white-space:normal}.prog-toolbar{margin-bottom:16px}.prog-search{padding:10px 13px;font-size:12px;background:#071722;border-radius:6px}.prog-categories{gap:5px;max-height:66px;overflow:auto}.prog-category-btn{font-size:10px;padding:5px 9px}.drive-toolbar{display:flex;align-items:center;gap:12px;padding:10px 12px;margin:12px 0;border:1px solid var(--border);border-radius:6px;background:#0b202d}.drive-toolbar label{color:#a8c4d4;font:11px Consolas,monospace}.drive-toolbar span{margin-left:auto;font-size:10px;color:var(--text-muted)}select,input{background:#081a26;border:1px solid #355364;border-radius:5px;color:#d8eaf4;padding:7px 9px}input[type=checkbox]{accent-color:var(--accent)}
.autofix-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:14px}.autofix-card{padding:18px;gap:12px}.autofix-title h4{font-size:15px}.autofix-desc{font-size:12px;line-height:1.5}.autofix-card button{font-size:11px;padding:8px 10px}.scanner-test-hero{padding:18px}.scanner-cards-grid{gap:14px}.info-card{padding:18px}.card-title-row h3{font-size:14px}.console-output{background:#04111c;color:#cce2ef;font:12px/1.7 Consolas,monospace;min-height:340px}.console-input-row{border-top:1px solid var(--border)}
.server-log-section{margin:0 24px 24px 238px;padding:15px;border:1px solid var(--border);border-radius:8px;background:linear-gradient(120deg,#102635,#071620)}.server-log-section h3{font-size:14px}.server-log-section .section-header{margin-bottom:10px}.log-controls{display:flex;gap:8px}.log-controls input{width:170px}.log-controls select,.log-controls input,.log-controls button{font-size:10px}#serverLogOutput{height:155px;overflow:auto;background:#04111c;border:1px solid #1d3949;border-radius:5px;padding:12px;font:11px/1.65 Consolas,monospace;white-space:pre-wrap;color:#aed2e2}
.auth-screen{background:radial-gradient(ellipse at center,#13344766,transparent 60%),#06111b}.auth-box{max-width:500px;background:linear-gradient(140deg,#112b3a,#061621);border:1px solid #355364;border-radius:10px;text-align:left;padding:34px}.auth-box h1{font-size:27px}.auth-form label{font-size:12px;color:#a9c8d9}.logo-badge-brand{background:none;color:white;padding:0;font-size:23px;letter-spacing:-.5px;box-shadow:none}.logo-badge-brand:before{content:'//';color:#00d5eb;font-style:italic;font-size:32px;margin-right:14px}.auth-radar{width:92px;height:92px;margin:20px auto;border:1px solid #00d5eb77;border-radius:50%;background:repeating-radial-gradient(circle,transparent 0 14px,#00d5eb33 15px 16px),conic-gradient(from 0deg,transparent 70%,#00d5eb55);animation:radarSweep 5s linear infinite;box-shadow:0 0 35px #00d5eb15}.auth-hint{border-top:1px solid var(--border);padding-top:18px}.modal-card{background:linear-gradient(135deg,#102a39,#061721);border:1px solid #3a5a6e;border-radius:10px}.modal-card h3{color:#e1f4ff}.modal-overlay{backdrop-filter:blur(7px)}
@keyframes radarSweep{to{transform:rotate(360deg)}}
@media(min-width:1700px){.programs-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.prog-card{min-height:180px}.content{padding:26px 30px}}
@media(max-width:1200px){.programs-grid,.autofix-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.header-title-box p{display:none}.header-right{gap:5px}.header-title-box h1{font-size:16px}.nav{width:180px}.content{margin-left:180px;width:calc(100% - 180px)}.killer-actions-bar{margin-left:180px}.server-log-section{margin-left:204px}.killer-group-title{display:none}.btn-header-action{font-size:10px;padding:8px}}
@media(max-width:850px){.header{height:auto;min-height:72px;flex-wrap:wrap}.header-right{flex-wrap:wrap}.nav{position:static;width:auto;flex-direction:row;overflow:auto;padding:8px}.sidebar-foot{display:none}.nav-item{white-space:nowrap;font-size:11px;padding:10px}.killer-actions-bar,.content,.server-log-section{margin-left:0;width:auto}.programs-grid,.autofix-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace-heading h1{font-size:20px}.drive-toolbar{flex-wrap:wrap}.server-log-section{margin:0 20px 20px}.header-right .status-indicator{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.precision-table{width:100%;border-collapse:collapse;font-size:12px}.precision-table th{text-align:left;color:#aac8db;background:#153143;padding:10px}.precision-table td{padding:10px;border-bottom:1px solid #294656;overflow-wrap:anywhere;max-width:380px}.precision-table small{display:block;color:#7895a8}.metric-card{padding:20px;border:1px solid #294656;border-radius:8px;background:linear-gradient(130deg,#122e40,#071825);min-width:0}.metric-card h3{font-size:13px;margin-bottom:12px}.metric-card>strong{font-size:25px;color:#00d5eb}.metric-card p{font-size:12px;color:#a8c6d7;margin-top:8px}.sparkline{width:100%;height:60px;margin-top:12px;background:linear-gradient(0deg,#00d5eb09,transparent)}#telemetryCardsGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.metric-card:nth-child(-n+2){grid-column:span 2}.scanner-adapter{padding:12px;border:1px solid #294656;border-radius:6px;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}.scanner-adapter small{width:100%;color:#7895a8}#scannerProblems{margin-top:15px}.compact-version{display:flex;align-items:center;justify-content:space-between;gap:6px}.compact-version>span:first-child{font-size:10px!important}.prog-title-box{min-width:0}.prog-card-top .btn-secondary{padding:0 7px}.prog-card .prog-actions-row label{font-size:10px!important}@media(max-width:850px){#telemetryCardsGrid{grid-template-columns:1fr 1fr}.metric-card:nth-child(-n+2){grid-column:span 1}}
.dashboard-main{display:grid;grid-template-columns:minmax(0,2.3fr) minmax(270px,1fr);gap:14px}.dashboard-client,.dashboard-resources{border:1px solid #294656;border-radius:8px;background:linear-gradient(120deg,#112b3c,#071722);padding:16px}.dashboard-client h3{font-size:14px;display:flex;align-items:center;gap:8px}.dashboard-client h3 .agent-badge{margin-left:auto}.dashboard-inner{display:grid;grid-template-columns:1fr 1.1fr;gap:15px;margin-top:15px}.dashboard-specs{border:1px solid #244758;border-radius:5px;padding:10px 12px}.dashboard-specs h4{font-size:12px;border-bottom:1px solid #244758;padding-bottom:6px}.dashboard-specs p{font-size:11px;color:#b3cedc;margin-top:6px}.vehicle-diagram{display:flex;flex-direction:column;justify-content:center;text-align:center}.vehicle-diagram span{font-size:11px}.vehicle-diagram small{font-size:9px;color:#789bad}.vehicle-diagram svg{width:100%;max-height:150px;filter:drop-shadow(0 0 6px #00d5eb22)}.dashboard-resources h4{font-size:12px}.dashboard-resources h4 small{float:right;color:#39e986;font-size:9px}.dash-metric{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:center;border-bottom:1px solid #244758;padding:8px 0}.dash-metric span,.dash-disk span{font-size:12px;font-weight:600}.dash-metric b,.dash-disk b{font-size:16px;color:#00d5eb;float:right}.dash-metric small,.dash-disk small{display:block;font-size:10px;color:#a8c6d8}.dash-metric .sparkline{height:42px;margin:0}.dash-disk{padding-top:10px}#agentTelemetryBanner{padding:0;border:0;background:none;box-shadow:none;margin-bottom:20px}.prog-card{min-height:170px}.prog-card .instructions-container{display:none!important}.prog-actions-row{flex-wrap:wrap}.prog-actions-row button{font-size:11px}.prog-card .prog-desc{min-height:32px}.prog-card .prog-actions-row label{gap:4px!important}.prog-card .prog-actions-row .btn-secondary:disabled{display:none}.prog-categories{max-height:35px;flex-wrap:nowrap;overflow:auto;scrollbar-width:thin}.section-header h2{font-size:17px}.section-header .section-desc{max-width:600px}.section-header{margin-bottom:10px}.prog-category-btn{white-space:nowrap}@media(max-width:1100px){.dashboard-main{grid-template-columns:1fr}.dashboard-resources{display:none}}@media(max-width:650px){.dashboard-inner{grid-template-columns:1fr}.vehicle-diagram{display:none}}

.prog-chip{flex:0 0 auto;white-space:nowrap} #progCategories{overflow-x:auto;flex-wrap:nowrap}

.task-guide{margin-top:8px;font-size:11px;color:#8dafc1}.task-guide summary{cursor:pointer}.prog-categories{max-height:none;padding-bottom:6px;scrollbar-color:#294656 #071722}button,input,select{font-family:inherit}

.scanner-cards-grid{grid-template-columns:1fr 1fr!important}.sparkline{width:100%;height:80px} @media(max-width:800px){.scanner-cards-grid{grid-template-columns:1fr!important}}

.task-live-card{padding:10px 14px;border-color:#294656;box-shadow:none;border-radius:7px;margin-bottom:16px}.task-live-top{margin-bottom:7px}.task-live-title{font-size:12px}.task-progress-outer{height:7px;margin-bottom:6px}.task-live-bottom{font-size:10px;gap:10px}.task-live-bottom>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:55%}.task-guide{margin-top:5px}.dashboard-inner{margin-top:10px}.dashboard-client,.dashboard-resources{padding:12px}

#tab-programs{gap:0}.workspace-heading{margin-bottom:16px}.drive-toolbar{padding:6px 10px;margin:8px 0}.prog-toolbar{margin-bottom:10px}.prog-search{padding:7px 10px}.vehicle-diagram svg{max-height:125px}.dashboard-specs p{margin-top:4px}
