/* Конвейер РПД. Тёмная тема и компоненты — как в веб-сервисе GigaAM. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #2d2d30;
    --bg-card: #38383b;
    --bg-input: #1e1e1e;
    --bg-progress: #2a2a2e;
    --border: #4a4a4e;
    --border-light: #5a5a5d;
    --text: #dcdcdc;
    --text-muted: #909090;
    --accent: #3d7eff;
    --accent-dark: #2f6bdb;
    --danger: #e05555;
    --warn: #d8a13a;
    --success: #4caf50;
    --radius: 6px;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

/* ===== ВХОД ===== */
.login-screen {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; background: var(--bg);
}
.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 40px 36px; width: 380px; text-align: center;
}
.login-logo {
    width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}
.login-title { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
    background: var(--bg-input); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 10px 16px; color: var(--text);
    font-size: 15px; outline: none; transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--accent); }
.btn-login {
    background: var(--accent); color: #fff; border: none;
    border-radius: var(--radius); padding: 12px; font-size: 15px;
    font-weight: 600; cursor: pointer; transition: background 0.2s; margin-top: 8px;
}
.btn-login:hover { background: var(--accent-dark); }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 4px; }

/* ===== КАРКАС ===== */
.main-screen { max-width: 1100px; margin: 0 auto; padding: 16px; }
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0 16px;
}
.app-header h1 { font-size: 22px; font-weight: 700; color: #fff; }
.app-header h1 a { color: #fff; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-badge {
    background: var(--accent); color: #fff; padding: 4px 12px;
    border-radius: 12px; font-size: 12px; font-weight: 600;
}
.btn-logout {
    background: transparent; border: 1px solid var(--border-light);
    color: var(--text); padding: 8px 14px; border-radius: var(--radius);
    cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.btn-logout:hover { background: var(--border); }

/* ===== ШАГИ МАСТЕРА ===== */
.steps { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.step {
    color: var(--text-muted); padding: 10px 20px; font-size: 14px;
    font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.step.active { color: var(--accent); border-bottom-color: var(--accent); }
.step.done { color: var(--text); }

/* ===== КАРТОЧКИ ===== */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px;
}
.card-title { font-size: 15px; font-weight: 700; color: #e0e0e0; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: #e0e0e0; }
.field .hint { color: var(--text-muted); font-size: 12px; }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }

.input, select, textarea {
    background: var(--bg-input); border: 1px solid var(--border-light);
    border-radius: 4px; padding: 10px 12px; color: var(--text);
    font-size: 14px; outline: none; width: 100%;
    font-family: inherit;
}
.input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 120px; resize: vertical; }

.btn {
    background: transparent; border: 1px solid var(--border-light);
    border-radius: 4px; padding: 10px 18px; color: var(--text);
    font-size: 14px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-start {
    width: 100%; background: var(--accent); color: #fff; font-size: 16px;
    font-weight: 700; padding: 14px; border: none; border-radius: var(--radius);
}
.btn-start:hover { background: var(--accent-dark); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-label input[type="checkbox"], .checkbox-label input[type="radio"] {
    width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer;
}

/* ===== ЗОНА ЗАГРУЗКИ ===== */
.drop-zone {
    border: 2px dashed var(--border-light); border-radius: var(--radius);
    padding: 34px 24px; text-align: center; transition: all 0.2s; cursor: pointer;
}
.drop-zone p { color: var(--text-muted); }
.drop-zone-title { color: var(--text) !important; font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.drop-zone-hint { font-size: 12px; margin-top: 6px; }
.drop-zone.dragover { border-color: var(--accent); background: rgba(61, 126, 255, 0.08); }

.file-list {
    margin-top: 16px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg-input);
}
.file-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px; gap: 12px;
}
.file-item:last-child { border-bottom: none; }
.file-item-name { color: var(--text); word-break: break-all; }
.file-kind { color: var(--text-muted); white-space: nowrap; font-size: 12px; }
.badge-ok { color: var(--success); }
.badge-no { color: var(--danger); }

/* ===== ПОДСКАЗКИ И СООБЩЕНИЯ ===== */
.note {
    border-left: 3px solid var(--accent); background: rgba(61, 126, 255, 0.07);
    padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 12px;
}
.note-warn { border-left-color: var(--warn); background: rgba(216, 161, 58, 0.09); }
.note-error { border-left-color: var(--danger); background: rgba(224, 85, 85, 0.09); }

/* ===== ТАБЛИЦЫ ===== */
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td {
    text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
    vertical-align: top;
}
table.grid th { color: var(--text-muted); font-weight: 600; font-size: 12px; }
table.grid tr:last-child td { border-bottom: none; }
.scroll-box { max-height: 420px; overflow-y: auto; }

/* ===== ПРОГРЕСС ===== */
.progress-card {
    background: #313135; border: 1px solid #45454a; border-radius: 8px;
    padding: 16px; margin-bottom: 12px;
}
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-title { color: #c8c8cc; font-size: 14px; font-weight: 700; }
.progress-counter { color: var(--accent); font-size: 14px; font-weight: 700; }
.progress-bar {
    height: 22px; background: var(--bg-progress); border-radius: 11px;
    overflow: hidden; margin-bottom: 6px;
}
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: 11px; transition: width 0.5s; width: 0%;
    display: flex; align-items: center; justify-content: center;
    color: #f0f0f0; font-size: 12px; font-weight: 600;
}
.status-label {
    text-align: center; padding: 6px; margin-top: 6px;
    background: var(--bg-progress); border-radius: var(--radius);
    color: #e0e0e0; font-size: 13px; font-weight: 600;
}

.stage-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.stage-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.stage-list li.active { color: var(--accent); font-weight: 600; }
.stage-list li.done { color: var(--text); }
.stage-dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--border-light); flex: 0 0 auto;
}
.stage-list li.active .stage-dot { background: var(--accent); }
.stage-list li.done .stage-dot { background: var(--success); }

/* ===== ЖУРНАЛ ===== */
.log-panel {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px;
    font-family: 'Consolas', 'Courier New', monospace; font-size: 13px;
    color: var(--text); min-height: 340px; max-height: 62vh; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word;
}
.log-line { padding: 1px 0; }
.log-line-error { color: var(--danger); }
.log-line-warn { color: var(--warn); }
.log-line-success { color: var(--success); }
.log-line-stage { color: #7ab7ff; font-weight: 600; }

/* ===== СЕТКА ПРОГОНА ===== */
.run-grid { display: grid; grid-template-columns: 280px 1fr; gap: 12px; }
@media (max-width: 860px) { .run-grid { grid-template-columns: 1fr; } }

.status-pill {
    display: inline-block; padding: 3px 10px; border-radius: 10px;
    font-size: 12px; font-weight: 600;
}
.status-draft { background: #45454a; color: var(--text); }
.status-queued, .status-running { background: rgba(61,126,255,0.18); color: var(--accent); }
.status-done { background: rgba(76,175,80,0.18); color: var(--success); }
.status-failed { background: rgba(224,85,85,0.18); color: var(--danger); }

.status-interrupted { background: rgba(216,161,58,0.18); color: var(--warn); }
