* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

.header p {
    color: #666;
    font-size: 14px;
}

.auth-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.auth-section input {
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    margin-bottom: 15px;
}

.auth-section button {
    padding: 15px 40px;
    font-size: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.auth-section button:hover {
    transform: translateY(-2px);
}

.main-content {
    display: none;
}

.nav-tabs {
    background: white;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.nav-tabs a {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-tabs a:hover {
    background: #f0f0f0;
}

.nav-tabs a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.panel.full-width {
    grid-column: 1 / -1;
}

.panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.personalization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.person-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.person-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.person-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #e7f0ff 0%, #d4e5ff 100%);
}

.person-card h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 18px;
}

.person-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.person-card .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status.empty {
    background: #fee;
    color: #c00;
}

.status.filled {
    background: #efe;
    color: #0a0;
}

.editor-container {
    margin-top: 20px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.editor-header h3 {
    color: #333;
    font-size: 20px;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

textarea.editor {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

textarea.editor:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #51cf66;
    color: white;
}

.btn-danger {
    background: #ff6b6b;
    color: white;
}

.btn-secondary {
    background: #868e96;
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.session-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.8;
}

.session-info strong {
    color: #667eea;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.file-list {
    max-height: 500px;
    overflow-y: auto;
}

.file-accordion {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.file-accordion:last-child {
    margin-bottom: 0;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header .folder-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
}

.accordion-header .folder-label .folder-icon {
    font-size: 18px;
    transition: transform 0.2s;
}

.file-accordion.open .accordion-header .folder-icon {
    transform: rotate(90deg);
}

.accordion-header .badge {
    background: #dee2e6;
    color: #495057;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

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

.btn-clear-folder {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.btn-clear-folder:hover {
    background: #ff6b6b;
    opacity: 1;
}

.btn-remove-folder {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.6;
}

.btn-remove-folder:hover {
    background: #c92a2a;
    color: #fff;
    opacity: 1;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.file-accordion.open .accordion-content {
    max-height: 2000px;
    transition: max-height 0.35s ease-in;
}

.accordion-inner {
    padding: 4px 0;
    background: #fff;
    border-top: 1px solid #eee;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px 6px 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 13px;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-item.selected {
    background: #e7f0ff;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
}

.file-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.folder-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #667eea;
}

.bulk-actions {
    display: none;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    align-items: center;
    gap: 12px;
}

.bulk-actions.visible {
    display: flex;
}

.bulk-actions .selected-count {
    font-weight: 600;
    color: #856404;
}

.bulk-actions .btn {
    margin-left: auto;
}

.file-icon {
    font-size: 16px;
}

.file-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-actions {
    display: flex;
    gap: 4px;
}

.file-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

.empty-folder {
    padding: 8px 12px 8px 24px;
    color: #999;
    font-size: 13px;
    background: #fafafa;
}

.tree-folder {
    margin-left: 16px;
    border-left: 1px dashed #ddd;
}

.tree-folder-header {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    transition: background 0.2s;
}

.tree-folder-header:hover {
    background: #f8f9fa;
}

.tree-folder-header .folder-icon {
    margin-right: 6px;
    font-size: 14px;
    transition: transform 0.2s;
}

.tree-folder.open > .tree-folder-header .folder-icon {
    transform: rotate(90deg);
}

.tree-folder-content {
    display: none;
}

.tree-folder.open > .tree-folder-content {
    display: block;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Прогресс-мониторинг в виджете ── */
.chat-widget-progress {
    padding: 10px 14px;
    background: #f0f3ff;
    border-bottom: 1px solid #d0d7ff;
    flex-shrink: 0;
}

.cw-progress-card {
    background: #fff;
    border: 1px solid #d0d7ff;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

/* Шапка: режим · таймер · токены */
.cw-progress-head {
    font-size: 12px;
    color: #555;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.cw-progress-head b {
    color: #333;
}

.cw-elapsed {
    color: #667eea;
    font-weight: 600;
}

/* Заголовок плана */
.cw-progress-plan-header {
    font-size: 12px;
    color: #495057;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Список шагов */
.cw-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 6px 8px;
    margin-top: 4px;
}

.cw-progress-step {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 12px;
    color: #adb5bd;
    line-height: 1.4;
}

.cw-step-icon {
    flex-shrink: 0;
    font-size: 11px;
    width: 14px;
    text-align: center;
}

.cw-step-num {
    flex-shrink: 0;
    color: #adb5bd;
    font-size: 11px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.cw-step-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-progress-step.cw-step-active {
    color: #4c6ef5;
    font-weight: 600;
}

.cw-progress-step.cw-step-active .cw-step-num {
    color: #4c6ef5;
}

.cw-progress-step.cw-step-done {
    color: #868e96;
    opacity: 0.8;
}

.cw-progress-step.cw-step-pending {
    color: #ced4da;
}

/* Текущее действие агента */
.cw-progress-status {
    font-size: 12px;
    color: #495057;
    font-weight: 500;
    margin-top: 7px;
    padding: 5px 8px;
    background: #eef2ff;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-progress-status code {
    background: #d0d7ff;
    color: #3b4fd8;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
}

.toast.success {
    background: #51cf66;
}

.toast.error {
    background: #ff6b6b;
}

.template-hint {
    background: #fff9db;
    border-left: 4px solid #ffd43b;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.template-hint strong {
    color: #f59f00;
}

input[type="file"] {
    display: none;
}

/* Каналы связи */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.channel-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s;
}

.channel-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.channel-card h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.channel-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
}

.channel-card input:focus {
    outline: none;
    border-color: #667eea;
}

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

.page-grid.three-cols {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Консоль */
.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.console-controls {
    display: flex;
    gap: 10px;
}

.console-info {
    background: #e7f5ff;
    border-left: 4px solid #339af0;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.console-info code {
    background: #d0ebff;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: 600;
}

/* Светлая тема консоли (по умолчанию) */
.terminal-container {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
}

.terminal {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.terminal-output {
    background: #ffffff;
    color: #333;
    padding: 20px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-output::-webkit-scrollbar {
    width: 10px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 5px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.terminal-line {
    margin-bottom: 2px;
}

.terminal-line.command {
    color: #495057;
    font-weight: 600;
}

.terminal-line.command-line {
    color: #495057;
    font-weight: 600;
}

.terminal-line.output {
    color: #333;
}

.terminal-line.error {
    color: #e03131;
}

.terminal-line.muted {
    color: #868e96;
    font-style: italic;
}

.terminal-line.info {
    color: #1971c2;
    font-style: italic;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 2px solid #e9ecef;
}

.terminal-prompt {
    color: #495057;
    font-weight: 600;
    margin-right: 10px;
    user-select: none;
}

.prompt-user {
    color: #2f9e44;
}

.prompt-dir {
    color: #1971c2;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #333;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    caret-color: #333;
}

.terminal-input::placeholder {
    color: #adb5bd;
}

.terminal-input:disabled {
    opacity: 0.5;
}

/* Тёмная тема консоли */
.terminal-container.dark-theme {
    background: #1e1e1e;
    border-color: #3e3e42;
}

.terminal-container.dark-theme .terminal-output {
    background: #1e1e1e;
    color: #d4d4d4;
}

.terminal-container.dark-theme .terminal-output::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.terminal-container.dark-theme .terminal-output::-webkit-scrollbar-thumb {
    background: #555;
}

.terminal-container.dark-theme .terminal-output::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.terminal-container.dark-theme .terminal-line.command,
.terminal-container.dark-theme .terminal-line.command-line {
    color: #4ec9b0;
}

.terminal-container.dark-theme .terminal-line.output {
    color: #d4d4d4;
}

.terminal-container.dark-theme .terminal-line.error {
    color: #f48771;
}

.terminal-container.dark-theme .terminal-line.muted {
    color: #868e96;
}

.terminal-container.dark-theme .terminal-line.info {
    color: #6cb6ff;
}

.terminal-container.dark-theme .terminal-input-line {
    background: #252526;
    border-top-color: #3e3e42;
}

.terminal-container.dark-theme .terminal-prompt {
    color: #4ec9b0;
}

.terminal-container.dark-theme .prompt-user {
    color: #51cf66;
}

.terminal-container.dark-theme .prompt-dir {
    color: #339af0;
}

.terminal-container.dark-theme .terminal-input {
    color: #d4d4d4;
    caret-color: #aeafad;
}

.terminal-container.dark-theme .terminal-input::placeholder {
    color: #6a6a6a;
}

.console-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.status-indicator {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator.ready {
    color: #51cf66;
}

.status-indicator.executing {
    color: #ff922b;
}

.status-indicator.error {
    color: #ff6b6b;
}

.welcome-message {
    margin-bottom: 5px;
}

/* Статистика диска */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.stat-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.top-files-list {
    max-height: 300px;
    overflow-y: auto;
}

.top-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    background: #f8f9fa;
    font-size: 13px;
}

.top-file-item:hover {
    background: #e9ecef;
}

.top-file-rank {
    font-weight: 600;
    color: #667eea;
    min-width: 25px;
}

.top-file-size {
    font-weight: 600;
    color: #333;
    min-width: 60px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.top-file-path {
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

/* Навыки (Skills) */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.skills-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.skill-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s;
}

.skill-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.skill-card.selected {
    border-color: #51cf66;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.skill-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.skill-checkbox-wrapper {
    flex-shrink: 0;
    margin-top: 2px;
}

.skill-select-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #51cf66;
}

.skill-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.skill-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.skill-tag {
    background: #e9ecef;
    color: #495057;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.skill-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

.skill-visibility {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 8px;
}

.skill-visibility.public {
    background: #e7f5ff;
    color: #1971c2;
}

.skill-visibility.private {
    background: #fff9db;
    color: #f59f00;
}

.skill-owner {
    background: #f3e8ff;
    color: #7c3aed;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.skill-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.btn-view, .btn-edit {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-view:hover, .btn-edit:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.btn-delete {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #fff5f5;
    border-color: #ff6b6b;
}

/* Мета-информация о навыке */
.skill-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    font-size: 12px;
}

.skill-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.skill-meta-label {
    color: #868e96;
    font-weight: 500;
}

.skill-meta-value {
    color: #333;
    font-weight: 600;
}

.skill-meta-value code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Превью системного промпта */
.skill-prompt-preview {
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
    font-size: 12px;
}

.skill-prompt-preview strong {
    color: #495057;
    display: block;
    margin-bottom: 4px;
}

.skill-prompt-preview p {
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Модальные окна */
.modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Задачи (Tasks) — новый дизайн ────────────────────────────────────────── */

/* Сетка карточек */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

/* Фильтры */
.tasks-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tasks-filter-btn {
    padding: 6px 14px;
    border: 1.5px solid #dee2e6;
    border-radius: 20px;
    background: #fff;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tasks-filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tasks-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

.filter-count {
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
}

.tasks-filter-btn:not(.active) .filter-count {
    background: #e9ecef;
    color: #868e96;
}

/* Карточка задачи */
.task-card-new {
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 20px;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card-new:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #d0d7ff;
}

/* Цветная полоска слева по статусу */
.task-card-new.status-in-progress { border-left: 4px solid #667eea; }
.task-card-new.status-done        { border-left: 4px solid #51cf66; }
.task-card-new.status-failed      { border-left: 4px solid #ff6b6b; }
.task-card-new.status-paused      { border-left: 4px solid #ffd43b; }
.task-card-new.status-unknown     { border-left: 4px solid #dee2e6; }

/* Шапка карточки */
.task-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.task-card-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.task-card-goal {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    /* Обрезаем длинные цели до 2 строк */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-meta {
    flex-shrink: 0;
    text-align: right;
}

.task-date {
    font-size: 11px;
    color: #adb5bd;
    white-space: nowrap;
}

/* Бейдж статуса */
.task-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

.task-status-badge.in-progress { background: #eef2ff; color: #4c6ef5; }
.task-status-badge.done        { background: #ebfbee; color: #2f9e44; }
.task-status-badge.failed      { background: #fff5f5; color: #e03131; }
.task-status-badge.paused      { background: #fff9db; color: #e67700; }
.task-status-badge.unknown     { background: #f1f3f5; color: #868e96; }

/* Прогресс */
.task-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-progress-bg {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease, background 0.3s ease;
}

.task-progress-pct {
    font-size: 12px;
    font-weight: 700;
    color: #495057;
    min-width: 34px;
    text-align: right;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Метрики */
.task-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.task-metric {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 7px 8px;
    text-align: center;
}

.task-metric-label {
    font-size: 10px;
    color: #868e96;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.task-metric-value {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Активный шаг */
.task-active-step {
    background: #eef2ff;
    border-left: 3px solid #667eea;
    border-radius: 0 8px 8px 0;
    padding: 8px 12px;
    font-size: 13px;
    color: #4c6ef5;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Превью шагов */
.task-steps-preview {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 10px;
}

.task-step-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #495057;
    line-height: 1.4;
}

.task-step-icon {
    font-size: 11px;
    font-weight: 700;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    font-family: 'Monaco', 'Courier New', monospace;
}

.task-step-icon.tsc-done     { color: #2f9e44; }
.task-step-icon.tsc-progress { color: #4c6ef5; }
.task-step-icon.tsc-failed   { color: #e03131; }
.task-step-icon.tsc-pending  { color: #ced4da; }

.task-step-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-steps-more {
    font-size: 11px;
    color: #adb5bd;
    padding-top: 4px;
    padding-left: 22px;
    font-style: italic;
}

/* Кнопки действий */
.task-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.task-btn {
    padding: 9px 12px;
    border: 1.5px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.task-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.task-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.task-btn-steps {
    border-color: #667eea;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102,126,234,0.25);
}

.task-btn-steps:hover {
    box-shadow: 0 4px 14px rgba(102,126,234,0.4);
}

.task-btn-log { border-color: #cc5de8; color: #862e9c; }
.task-btn-log:hover { background: #f8f0fc; }

/* Строка удаления зависшей задачи */
.task-delete-row {
    margin-top: -4px;
}

.task-btn-delete {
    width: 100%;
    border-color: #ffc9c9;
    color: #c92a2a;
    background: #fff5f5;
    font-size: 12px;
    padding: 7px 12px;
}

.task-btn-delete:hover {
    background: #ffe0e0;
    border-color: #ff6b6b;
    box-shadow: 0 3px 10px rgba(255,107,107,0.2);
}

/* Кнопка подтверждения удаления в диалоге */
.task-btn-delete-confirm {
    border-color: #ff6b6b;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    box-shadow: 0 2px 8px rgba(255,107,107,0.3);
}

.task-btn-delete-confirm:hover {
    box-shadow: 0 4px 14px rgba(255,107,107,0.45);
}

/* ─── Модальное окно задач ──────────────────────────────────────────────────── */

.task-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.task-modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.task-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.task-modal-overlay.visible .task-modal {
    transform: translateY(0) scale(1);
}

.task-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.task-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.task-modal-controls {
    display: flex;
    gap: 6px;
}

.task-modal-ctrl-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.task-modal-ctrl-btn:hover { background: rgba(255,255,255,0.28); }
.task-modal-close { font-size: 18px; }

.task-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.task-modal-body::-webkit-scrollbar { width: 8px; }
.task-modal-body::-webkit-scrollbar-track { background: #f8f9fa; }
.task-modal-body::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 4px; }

/* Цель задачи в модале */
.task-modal-goal {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    line-height: 1.5;
}

/* Список шагов в модале */
.task-modal-steps {
    padding: 8px 0;
}

.task-step-row.modal-step {
    padding-top: 8px;
    padding-right: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #333;
}

.task-step-row.modal-step:last-child {
    border-bottom: none;
}

/* Debug Log в модале */
.task-debug-body {
    padding: 16px 20px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fafafa;
    min-height: 200px;
    max-height: 60vh;
    overflow-y: auto;
}

.task-debug-body::-webkit-scrollbar { width: 8px; }
.task-debug-body::-webkit-scrollbar-track { background: #f0f0f0; }
.task-debug-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* ─── Старые стили задач (оставляем для совместимости) ──────────────────────── */

.task-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.task-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #2c3e50;
}

.task-status {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
}

.status-IN_PROGRESS { background: #e3f2fd; color: #1976d2; }
.status-DONE { background: #e8f5e9; color: #388e3c; }
.status-FAILED { background: #ffebee; color: #d32f2f; }
.status-PAUSED { background: #fff3e0; color: #f57c00; }

.progress-container {
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar {
    height: 10px;
    background-color: #4CAF50;
    transition: width 0.5s ease-in-out;
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
}

.step-item:last-child {
    border-bottom: none;
}

.step-icon {
    margin-right: 10px;
    font-family: monospace;
    font-weight: bold;
}

.step-icon.done { color: #4CAF50; }
.step-icon.progress { color: #2196F3; }
.step-icon.failed { color: #f44336; }
.step-icon.pending { color: #9e9e9e; }

.step-content {
    flex-grow: 1;
}

.step-text {
    margin: 0;
}

.step-notes {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    background: #f9f9f9;
    padding: 5px;
    border-radius: 4px;
    border-left: 3px solid #ccc;
}

.debug-log {
    margin-top: 15px;
    padding: 10px;
    background: #2b2b2b;
    color: #a9b7c6;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9em;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.toggle-debug {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 0;
    font-size: 0.9em;
    margin-top: 10px;
}

.toggle-debug:hover {
    text-decoration: underline;
}

/* ─── Лоадер инициализации контейнера ──────────────────────────────────────── */

.init-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.init-loader-overlay.visible {
    opacity: 1;
}

.init-loader-overlay.hiding {
    opacity: 0;
    pointer-events: none;
}

.init-loader-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    transform: translateY(20px);
    transition: transform 0.35s ease;
}

.init-loader-overlay.visible .init-loader-card {
    transform: translateY(0);
}

.init-loader-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.init-loader-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px;
}

.init-loader-subtitle {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* Spinner */
.init-spinner {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid #e9ecef;
    border-top-color: #667eea;
    animation: initSpin 0.9s linear infinite;
}

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

/* Прогресс-бар */
.init-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.init-progress-bar-bg {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
}

.init-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.init-progress-pct {
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    min-width: 36px;
    text-align: right;
}

/* Текущий шаг */
.init-step-label {
    font-size: 13px;
    color: #555;
    margin-bottom: 20px;
    min-height: 18px;
    font-style: italic;
}

/* Список шагов */
.init-steps-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.init-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #aaa;
    background: transparent;
    transition: background 0.2s, color 0.2s;
}

.init-step-item.active {
    background: #f0f3ff;
    color: #333;
}

.init-step-item.done {
    color: #555;
}

/* Иконка-точка статуса */
.init-step-icon-wrap {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.init-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dee2e6;
    transition: background 0.2s, transform 0.2s;
}

.init-step-item.active .init-step-dot {
    background: #667eea;
    transform: scale(1.4);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    animation: initPulse 1.2s ease-in-out infinite;
}

.init-step-item.done .init-step-dot {
    background: #51cf66;
}

@keyframes initPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); }
    50%       { box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.08); }
}

.init-step-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.init-step-name {
    flex: 1;
    font-weight: 500;
}

/* Статус справа (галочка для done) */
.init-step-status {
    font-size: 14px;
    min-width: 18px;
    text-align: center;
}

.init-step-item.done .init-step-status::after {
    content: '✓';
    color: #51cf66;
    font-weight: 700;
}

.init-step-item.active .init-step-status::after {
    content: '…';
    color: #667eea;
}

/* Сноска */
.init-loader-note {
    font-size: 12px;
    color: #bbb;
    text-align: center;
    margin: 0;
}

/* ─── Приложения (Apps / PM2) ───────────────────────────────────────────────── */

/* ── Просмотр приложения в модальном окне ── */
.appview-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.appview-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.appview-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 1100px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 80px rgba(0,0,0,0.35);
    overflow: hidden;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.25s ease;
}

.appview-overlay.visible .appview-modal {
    transform: translateY(0) scale(1);
}

.appview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.appview-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.appview-icon { font-size: 18px; }

.appview-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.appview-ctrl-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s;
    line-height: 1;
}

.appview-ctrl-btn:hover { background: rgba(255,255,255,0.28); }
.appview-close { font-size: 18px; }

.appview-body {
    flex: 1;
    overflow: hidden;
    background: #f0f0f0;
}

.appview-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.appview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    gap: 12px;
}

.appview-url {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #667eea;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appview-hint {
    font-size: 11px;
    color: #adb5bd;
    white-space: nowrap;
    flex-shrink: 0;
}

.apps-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.apps-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.apps-count-badge {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.apps-autoupdate {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}

.apps-autoupdate input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    margin: 0;
    padding: 0;
}

.apps-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.apps-empty .apps-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
}

.apps-empty p {
    font-size: 15px;
    margin-bottom: 6px;
    color: #888;
}

.apps-empty small {
    font-size: 13px;
    color: #bbb;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.app-card {
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 20px;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #d0d7ff;
}

.app-card.status-online  { border-left: 4px solid #51cf66; }
.app-card.status-stopped { border-left: 4px solid #adb5bd; }
.app-card.status-errored { border-left: 4px solid #ff6b6b; }
.app-card.status-launching { border-left: 4px solid #ffd43b; }
.app-card.status-unknown { border-left: 4px solid #dee2e6; }

/* Заголовок карточки */
.app-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
}

.app-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.app-card-id {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Бейдж статуса */
.app-status-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.app-status-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}

.app-status-badge.online   { background: #ebfbee; color: #2f9e44; }
.app-status-badge.stopped  { background: #f1f3f5; color: #868e96; }
.app-status-badge.errored  { background: #fff5f5; color: #e03131; }
.app-status-badge.launching { background: #fff9db; color: #e67700; }
.app-status-badge.unknown  { background: #f1f3f5; color: #adb5bd; }

/* Метрики */
.app-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.app-metric {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.app-metric-label {
    font-size: 11px;
    color: #868e96;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.app-metric-value {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Путь к скрипту */
.app-script-path {
    font-size: 12px;
    color: #868e96;
    font-family: 'Monaco', 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 14px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Кнопки действий — две строки */
.app-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

/* Строка управления: 3 равных + маленький delete */
.app-actions-ctrl {
    grid-template-columns: 1fr 1fr 1fr auto;
}

.app-btn {
    padding: 9px 12px;
    border: 1.5px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    min-width: 0;
}

.app-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.app-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Открыть — акцентная */
.app-btn.btn-open {
    border-color: #667eea;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}
.app-btn.btn-open:hover {
    box-shadow: 0 4px 14px rgba(102,126,234,0.45);
    transform: translateY(-1px);
}

/* Логи */
.app-btn.btn-logs    { border-color: #cc5de8; color: #862e9c; }
.app-btn.btn-logs:hover    { background: #f8f0fc; }

/* Старт */
.app-btn.btn-start   { border-color: #51cf66; color: #2f9e44; }
.app-btn.btn-start:hover   { background: #ebfbee; }

/* Стоп */
.app-btn.btn-stop    { border-color: #adb5bd; color: #495057; }
.app-btn.btn-stop:hover    { background: #f1f3f5; }

/* Рестарт */
.app-btn.btn-restart { border-color: #339af0; color: #1971c2; }
.app-btn.btn-restart:hover { background: #e7f5ff; }

/* Удалить — иконка-кнопка */
.app-btn.btn-delete {
    border-color: #ff6b6b;
    color: #c92a2a;
    padding: 9px 11px;
    flex-shrink: 0;
}
.app-btn.btn-delete:hover  { background: #fff5f5; }

/* Модальное окно логов */
.logs-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.logs-modal {
    background: #1e1e1e;
    border-radius: 14px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.logs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}

.logs-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logs-modal-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

.logs-modal-close:hover {
    background: #333;
    color: #fff;
}

.logs-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-break: break-all;
}

.logs-modal-body::-webkit-scrollbar { width: 8px; }
.logs-modal-body::-webkit-scrollbar-track { background: #2d2d2d; }
.logs-modal-body::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

.logs-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.logs-lines-select {
    background: #2d2d2d;
    border: 1px solid #444;
    color: #ccc;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* Бейдж порта в заголовке карточки */
.app-port-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #667eea;
    background: #eef0ff;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #c5cbf5;
}

/* Блок предупреждения для errored-приложений */
.app-error-hint {
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #c92a2a;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Кнопка "Починить" */
.app-btn.btn-fix {
    border-color: #fd7e14;
    color: #d9480f;
    background: #fff4e6;
    font-size: 12px;
    padding: 6px 10px;
    margin-left: auto;
    flex-shrink: 0;
}
.app-btn.btn-fix:hover { background: #ffe8cc; }

/* ─── Плавающий чат-виджет ИИ агента ──────────────────────────────────────── */

/* Кнопка-триггер */
.chat-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 8000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    line-height: 1;
}

.chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.55);
}

.chat-fab:active {
    transform: scale(0.95);
}

.chat-fab.hidden {
    display: none;
}

/* Пульсирующее кольцо */
.chat-fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.4);
    animation: fabPulse 2.5s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.15); opacity: 0; }
}

/* Индикатор «не настроен» */
.chat-fab.disabled {
    background: linear-gradient(135deg, #868e96 0%, #495057 100%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    cursor: default;
}

.chat-fab.disabled:hover {
    transform: none;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.chat-fab.disabled::before {
    display: none;
}

/* Бейдж-подсказка */
.chat-fab-hint {
    position: fixed;
    bottom: 38px;
    right: 100px;
    z-index: 8000;
    background: #fff;
    color: #333;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s, transform 0.2s;
}

.chat-fab-hint.visible {
    opacity: 1;
    transform: translateX(0);
}

.chat-fab-hint::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #fff;
    border-right: none;
}

/* ── Чат-панель (модальное окно) ── */
.chat-widget-overlay {
    position: fixed;
    inset: 0;
    z-index: 8500;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.chat-widget-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.chat-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 8600;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 56px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.chat-widget.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Шапка чата */
.chat-widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.chat-widget-header-icon {
    font-size: 22px;
    line-height: 1;
}

.chat-widget-header-title {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.chat-widget-header-model {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
}

.chat-widget-header-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.chat-widget-header-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Кнопка очистки контекста в хедере */
.cw-header-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.cw-header-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ── Кнопка СТОП (отмена агента) ── */
.cw-stop-btn {
    background: rgba(255, 80, 80, 0.25);
    border: 1.5px solid rgba(255,255,255,0.4);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: none;           /* скрыта по умолчанию */
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.cw-stop-btn.visible {
    display: flex;
}

.cw-stop-btn:hover {
    background: rgba(255, 60, 60, 0.55);
    transform: scale(1.08);
}

.cw-stop-btn:active {
    transform: scale(0.95);
}

/* Состояние "отменяется..." в прогресс-блоке */
.cw-progress-cancelling {
    font-size: 12px;
    color: #e03131;
    font-weight: 600;
    margin-top: 7px;
    padding: 5px 8px;
    background: #fff5f5;
    border-radius: 6px;
    border-left: 3px solid #ff6b6b;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: cwCancelPulse 1s ease-in-out infinite;
}

@keyframes cwCancelPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ── Переключатель режимов ── */
.cw-mode-bar {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.cw-mode-btn {
    flex: 1;
    padding: 7px 8px;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #495057;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    white-space: nowrap;
}

.cw-mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.cw-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

/* ── Бейдж режима в user-сообщении ── */
.cw-mode-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85);
    margin-bottom: 4px;
}

.cw-user-text {
    display: block;
}

/* ── Инлайн-кнопки под сообщением агента ── */
.cw-inline-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.cw-inline-btn {
    padding: 6px 14px;
    border: 1.5px solid #667eea;
    border-radius: 8px;
    background: #fff;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.cw-inline-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.cw-inline-btn:active {
    transform: translateY(0);
}

/* Сообщения */
.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.chat-widget-messages::-webkit-scrollbar { width: 6px; }
.chat-widget-messages::-webkit-scrollbar-track { background: transparent; }
.chat-widget-messages::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 3px; }

.cw-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.cw-msg.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.cw-msg.agent {
    background: #fff;
    color: #333;
    border: 1px solid #e9ecef;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.cw-msg.system {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #868e96;
    font-size: 12px;
    align-self: center;
    text-align: center;
    border-radius: 10px;
    padding: 8px 14px;
}

.cw-msg.error {
    background: #fff5f5;
    color: #c92a2a;
    border: 1px solid #ffc9c9;
    align-self: center;
    text-align: center;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 12px;
}

/* Typing indicator */
.cw-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px;
    align-self: flex-start;
}

.cw-typing span {
    width: 7px;
    height: 7px;
    background: #adb5bd;
    border-radius: 50%;
    animation: cwBlink 1.2s infinite;
}

.cw-typing span:nth-child(2) { animation-delay: 0.2s; }
.cw-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cwBlink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

/* Строка ввода */
.chat-widget-input {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

.chat-widget-input textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid #dee2e6;
    border-radius: 12px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    height: 40px;
    max-height: 100px;
    outline: none;
    color: #333;
    background: #f8f9fa;
    transition: border-color 0.15s;
}

.chat-widget-input textarea:focus {
    border-color: #667eea;
    background: #fff;
}

.chat-widget-input textarea::placeholder {
    color: #adb5bd;
}

.chat-widget-send {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
    line-height: 1;
}

.chat-widget-send:hover {
    transform: scale(1.05);
}

.chat-widget-send:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

/* Экран «не настроен» */
.chat-widget-not-configured {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    gap: 14px;
}

.chat-widget-not-configured .nc-icon {
    font-size: 48px;
    opacity: 0.6;
}

.chat-widget-not-configured .nc-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.chat-widget-not-configured .nc-desc {
    font-size: 13px;
    color: #868e96;
    line-height: 1.5;
}

.chat-widget-not-configured .nc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s;
}

.chat-widget-not-configured .nc-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102,126,234,0.4);
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .chat-fab {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 24px;
    }

    .chat-fab-hint {
        display: none;
    }
}

/* ─── Container Cron (Расписание) ─────────────────────────────────────────── */

/* Статус-бар демона */
.cron-daemon-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid #e9ecef;
}

.cron-daemon-status {
    font-weight: 600;
}

.cron-daemon-path {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: #868e96;
}

/* Предупреждение расхождений */
.cron-discrepancy-warning {
    background: #fff9db;
    border: 1px solid #ffd43b;
    border-left: 4px solid #f59f00;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #866400;
}

/* Карточка cron-задачи */
.cron-card {
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 20px;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cron-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: #d0d7ff;
}

.cron-card.card-warning {
    border-left: 4px solid #ffd43b;
}

/* Шапка карточки */
.cron-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.cron-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.cron-card-track-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.cron-card-desc {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

/* Бейдж трека */
.cron-track-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.cron-track-badge-shell {
    background: #e7f5ff;
    color: #1971c2;
}

.cron-track-badge-agent {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Тело карточки */
.cron-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cron-card-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.cron-card-label {
    flex-shrink: 0;
    font-size: 14px;
}

.cron-card-expr {
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: 600;
    color: #333;
}

.cron-card-hint {
    color: #868e96;
    font-size: 12px;
    margin-left: 4px;
}

.cron-card-id {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: #adb5bd;
}

.cron-card-file-status {
    font-size: 13px;
    color: #495057;
}

/* Action preview для agent */
.cron-card-action {
    font-size: 12px;
    color: #868e96;
    font-style: italic;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #7c3aed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Футер карточки */
.cron-card-footer {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.cron-card-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.cron-card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.cron-card-btn-delete {
    border-color: #ffc9c9;
    color: #c92a2a;
}

.cron-card-btn-delete:hover {
    background: #fff5f5;
    border-color: #ff6b6b;
}

.cron-card-btn-confirm {
    border-color: #ff6b6b;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
    box-shadow: 0 2px 8px rgba(255,107,107,0.3);
}

/* ─── Модальные окна Cron ─────────────────────────────────────────────────── */

.cron-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.cron-modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.cron-modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    transform: translateY(20px) scale(0.98);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.cron-modal-overlay.visible .cron-modal-box {
    transform: translateY(0) scale(1);
}

.cron-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.cron-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.cron-modal-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.cron-modal-close:hover {
    background: rgba(255,255,255,0.28);
}

.cron-modal-ctrl-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.cron-modal-ctrl-btn:hover {
    background: rgba(255,255,255,0.28);
}

.cron-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cron-modal-body::-webkit-scrollbar { width: 8px; }
.cron-modal-body::-webkit-scrollbar-track { background: #f8f9fa; }
.cron-modal-body::-webkit-scrollbar-thumb { background: #dee2e6; border-radius: 4px; }

.cron-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* Форма создания */
.cron-form-group {
    margin-bottom: 16px;
}

.cron-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.cron-form-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s;
}

.cron-form-input:focus {
    border-color: #667eea;
}

.cron-form-mono {
    font-family: 'Monaco', 'Courier New', monospace;
}

.cron-form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.15s;
}

.cron-form-textarea:focus {
    border-color: #667eea;
}

.cron-form-textarea.cron-form-mono {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.cron-form-hint {
    font-size: 12px;
    color: #868e96;
    margin-top: 4px;
    min-height: 18px;
}

.cron-form-hint code {
    background: #f1f3f5;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
}

.cron-form-hint.cron-form-hint-ok {
    color: #2f9e44;
}

.cron-form-hint.cron-form-hint-error {
    color: #e03131;
}

.cron-form-error {
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #c92a2a;
}

/* Шпаргалка по cron */
.cron-cheatsheet {
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.cron-cheatsheet summary {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    background: #f8f9fa;
    user-select: none;
}

.cron-cheatsheet summary:hover {
    background: #e9ecef;
}

.cron-cheatsheet-body {
    padding: 12px 14px;
    font-size: 13px;
}

.cron-cheat-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 12px;
}

.cron-cheat-table td {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
}

.cron-cheat-examples {
    font-size: 12px;
    line-height: 1.8;
    color: #495057;
}

.cron-cheat-examples code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
}

/* Радио-кнопки трека */
.cron-track-radios {
    display: flex;
    gap: 10px;
}

.cron-track-radio {
    flex: 1;
    cursor: pointer;
}

.cron-track-radio input[type="radio"] {
    display: none;
}

.cron-track-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 12px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    text-align: center;
    transition: all 0.18s;
    background: #fff;
}

.cron-track-radio input[type="radio"]:checked + .cron-track-option {
    border-color: #667eea;
    background: #eef2ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.cron-track-option:hover {
    border-color: #667eea;
}

.cron-track-icon {
    font-size: 22px;
}

.cron-track-option span {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.cron-track-option small {
    font-size: 11px;
    color: #868e96;
}

/* Лог-прек */
.cron-log-pre {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d4d4d4;
    background: #1e1e1e;
    padding: 16px 20px;
    min-height: 300px;
    max-height: 50vh;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.cron-log-pre::-webkit-scrollbar { width: 8px; }
.cron-log-pre::-webkit-scrollbar-track { background: #2d2d2d; }
.cron-log-pre::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

/* Табы файла */
.cron-file-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #333;
    background: #252526;
    padding: 0 16px;
}

.cron-file-tab {
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.cron-file-tab:hover {
    color: #ccc;
}

.cron-file-tab.active {
    color: #d4d4d4;
    border-bottom-color: #667eea;
}

@media (max-width: 768px) {
    .tab-content.active {
        grid-template-columns: 1fr;
    }
    .page-grid {
        grid-template-columns: 1fr;
    }
    .page-grid.three-cols {
        grid-template-columns: 1fr;
    }
    .console-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .console-controls {
        width: 100%;
    }
    .console-controls .btn {
        flex: 1;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .skills-grid {
        grid-template-columns: 1fr;
    }
    .cron-track-radios {
        flex-direction: column;
    }
}
