* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.header-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}
.external-links {
    display: flex;
    gap: 5px;
}
.icon {
    width: 30px;
    height: 30px;
    transition: transform 0.2s;
}
.icon:hover {
    transform: scale(1.1);
}
header {
    background: #333;
    color: #fff;
    padding: 20px;
    border-radius: 5px 5px 0 0;
}
header h1 {
    margin-bottom: 15px;
}
nav {
    display: flex;
    gap: 15px;
}
nav a {
    color: #fff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
}
nav a.active, nav a:hover {
    background-color: #555;
}
main {
    background: #fff;
    padding: 20px;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-height: 500px;
}
section {
    margin-bottom: 30px;
}
h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
/* Стили для чекбокса */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.checkbox-wrapper input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}
.checkbox-wrapper label {
    font-weight: normal;
    display: inline-block;
}
/* Дополнительные стили для полей настройки */
#account_number_group {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #007bff;
    margin-top: 10px;
}
#account_number_group label {
    color: #0056b3;
    font-weight: bold;
}
#account_number_group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
}
#account_number {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}
/* Формы */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}
.btn {
    display: inline-block;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
}
.btn-primary {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0069d9;
}
/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
table, th, td {
    border: 1px solid #ddd;
}
th, td {
    text-align: left;
    padding: 12px;
}
th {
    background-color: #f2f2f2;
}
tr:nth-child(even) {
    background-color: #f9f9f9;
}
/* Стили для таблицы устройств */
.device-table {
    table-layout: fixed; /* Фиксированная разметка таблицы */
    width: 100%;
    font-size: 13px;
}
/* Устанавливаем конкретную ширину для каждой колонки */
.device-table th:nth-child(1), .device-table td:nth-child(1) { /* Устройство */ 
    width: 12%;
}
.device-table th:nth-child(2), .device-table td:nth-child(2) { /* логин */
    width: 25%; /* Увеличено для логина */
}
.device-table th:nth-child(3), .device-table td:nth-child(3) { /* версия */
    width: 18%;
}
.device-table th:nth-child(4), .device-table td:nth-child(4) { /* Buildnumber */
    width: 15%;
}
.device-table th:nth-child(5), .device-table td:nth-child(5) { /* IP-адрес */
    width: 15%;
}
.device-table th:nth-child(6), .device-table td:nth-child(6) { /* статус */
    width: 15%; /* уменьшено для статуса */
}
/* общие стили для ячеек таблицы устройств */
.device-table th, .device-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}
/* Стили для колонки логина - УВЕЛИЧЕННАЯ */
.login-column {
    min-width: 180px; /* Увеличено со 120px до 180px */
    max-width: 220px; /* Увеличено */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    padding: 8px 10px;
}
/* статусы */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}
.green {
    background-color: #28a745;
}
.yellow {
    background-color: #ffc107;
}
.red {
    background-color: #dc3545;
}
.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}
.info {
    background-color: #000000;
    color: #0c5460;
}
.success {
    background-color: #000000;
    color: #155724;
}
.error {
    background-color: #000000;
    color: #721c24;
}
.warning {
    background-color: #000000;
    color: #856404;
}
.legend {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}
footer {
    text-align: center;
    margin-top: 30px;
    color: #666;
}
/* Стили для контейнера логов */
.log-container {
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background-color: #f9f9f9;
}
.log-content {
    height: 400px;
    overflow-y: auto;
    background-color: #000;  /* черный фон */
    color: #fff;             /* белый текст */
    font-family: monospace;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    line-height: 1.5;
}
.log-entry {
    padding: 2px 0;
    line-height: 1.5;
    border-bottom: 1px solid #333;
}
.log-time {
    color: #ccc;
    margin-right: 10px;
}
.log-entry.info .log-message {
    color: #fff;
}
.log-entry.error .log-message {
    color: #ff6b6b;
}
.log-entry.success .log-message {
    color: #6bff6b;
}
.log-entry.warning .log-message {
    color: #ffcc00;
}
.log-entry.progress .log-message {
    color: #0056b3;
    font-style: italic;
}
.log-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.btn-secondary {
    background-color: #6c757d;
    color: white;
}
.btn-secondary:hover {
    background-color: #5a6268;
}
/* Стили для мини-прогрессбаров в логах */
.progress-bar-mini {
    width: 200px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}
.progress-bar-mini .progress-bar-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
}
/* Стили для активных задач */
.active-tasks-section {
    margin-top: 30px;
    display: none; /* По умолчанию скрыто, появляется, когда есть активные задачи */
}
.task-container {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.task-header {
    background-color: #eee;
    padding: 15px;
    border-radius: 5px 5px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.task-header h3 {
    margin: 0;
    flex-grow: 1;
}
.task-status {
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 15px;
}
.status-running {
    background-color: #cce5ff;
    color: #004085;
}
.status-completed {
    background-color: #d4edda;
    color: #155724;
}
.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}
.status-cancelled {
    background-color: #6c757d;
    color: white;
}
/* Анимация для процесса выполнения */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
.status-running {
    animation: pulse 2s infinite;
}
/* кнопки в заголовке задачи */
.toggle-logs {
    cursor: pointer;
}
/* стиль для кнопки отмены */
.btn-danger {
    background-color: #dc3545;
    color: #fff;
    margin-right: 10px;
}
.btn-danger:hover {
    background-color: #c82333;
}
/* стили для вкладки Регистрация LIMA */
.register-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}
.register-log-section {
    margin-top: 20px;
}
.register-log-section h3 {
    margin-bottom: 15px;
}
/* стили для объединенной колонки статуса - УМЕНЬШЕННАЯ */
.status-cell {
    padding: 4px 6px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
    max-width: 100px;
    font-size: 10px;
    width: 90px;
}
.status-cell.status-green {
    background-color: #28a745;
}
.status-cell.status-yellow {
    background-color: #ffc107;
    color: #212529;
}
.status-cell.status-red {
    background-color: #dc3545;
}
.status-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.status-text {
    font-size: 9px;
    font-weight: 600;
    line-height: 1.1;
}
.status-time {
    font-size: 8px;
    opacity: 0.9;
    font-weight: normal;
    line-height: 1.1;
}
/* убираем старые стили для status-dot в таблице */
.device-table .status-dot {
    display: none;
}
/* стили для легенды остаются прежними */
.legend .status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    margin-left: 15px;
}
.legend .status-dot.green {
    background-color: #28a745;
}
.legend .status-dot.yellow {
    background-color: #ffc107;
}
.legend .status-dot.red {
    background-color: #dc3545;
}
/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .device-table {
        font-size: 11px;
    }
    
    .status-cell {
        min-width: 70px;
        max-width: 85px;
        font-size: 9px;
    }
    
    .status-text {
        font-size: 8px;
    }
    
    .status-time {
        font-size: 7px;
    }
    
    .login-column {
        min-width: 140px;
        max-width: 180px;
    }
    
    .device-table th:nth-child(2), .device-table td:nth-child(2) { /* логин на мобильных */
        width: 30%;
    }
    
    .device-table th:nth-child(6), .device-table td:nth-child(6) { /* статус на мобильных */
        width: 20%;
    }
}

/* НОВЫЕ СТИЛИ ДЛЯ ПРОГРЕСС-БАРОВ */

/* Стили для контейнера прогресс-баров */
.progress-container {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-stage {
    margin-bottom: 20px;
}

.progress-stage:last-child {
    margin-bottom: 0;
}

.progress-stage h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        45deg,
        rgba(255,255,255,.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,.2) 50%,
        rgba(255,255,255,.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 30px 30px;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

.progress-percent {
    font-weight: bold;
}

.progress-speed, .progress-eta {
    color: #888;
}

.progress-stage.inactive {
    opacity: 0.5;
}

.progress-stage.active .progress-bar {
    box-shadow: 0 0 10px rgba(0,123,255,0.3);
}

.progress-stage.completed .progress-fill {
    background: linear-gradient(90deg, #28a745 0%, #1e7e34 100%);
}

/* Стили для прогресс-барок в логах (обновленные) */
.log-entry.progress {
    color: #0056b3;
    font-style: italic;
}

.progress-bar-mini {
    width: 200px;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.progress-bar-mini .progress-bar-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease;
}