/* Общие сбросы */
body { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    background: #f0f2f5; 
    font-family: 'Segoe UI', Arial, sans-serif; 
    margin: 0; 
}

/* Контейнер */
.container { 
    background: white; 
    padding: 2rem; 
    border-radius: 12px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.08); 
    width: 320px; /* По умолчанию для логина */
    transition: width 0.3s ease;
}

/* Если нужно широкое окно для таблиц */
.container.wide {
    width: 90%;
    max-width: 1000px;
}

h2 { margin-top: 0; color: #333; text-align: center; }

/* Инпуты */
input { 
    width: 100%; 
    margin-bottom: 1rem; 
    padding: 12px; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    box-sizing: border-box; 
    font-size: 14px;
}

/* Кнопки */
button { 
    width: 100%; 
    padding: 12px; 
    background: #007bff; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold;
    transition: background 0.2s;
}

button:hover { background: #0056b3; }

/* Навигация */
.main-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.main-nav a {
    text-decoration: none;
    color: #666;
    font-size: 14px;
}

.main-nav a:hover { color: #007bff; }

.text-danger { color: #dc3545 !important; }

.footer {
    margin-top: 20px;
    font-size: 12px;
    color: #aaa;
    text-align: center;
}

.settings-section {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.settings-section h3 {
    margin-top: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Стили для переключателя (Toggle Switch) */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.module-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.module-card.active { border-left: 5px solid var(--success); }
.module-card.disabled { opacity: 0.7; border-left: 5px solid var(--danger); background: #fafafa; }

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-info { display: flex; align-items: center; gap: 15px; }
.module-icon { font-size: 24px; }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    color: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.settings-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-save { padding: 15px 40px; font-size: 16px; }
.btn-back { background-color: #6c757d; padding: 15px 40px; }

input:checked + .slider { background-color: green; }
input:checked + .slider:before { transform: translateX(22px); }

@media (max-width: 800px) {
    .modules-settings-grid, .settings-grid {
        grid-template-columns: 1fr;
    }
}

.btn-action {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
}

.status-text {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
}

.status-text.warning { color: #f59e0b; }
.status-text.success { color: var(--success); }

.module-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две равные кнопки в ряд */
    gap: 10px;
    margin-top: 12px;
}

.btn-save-cat {
    background-color: #10b981; /* Зеленый */
    color: white;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-run-parser {
    background-color: #4f46e5; /* Индиго */
    color: white;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save-cat:hover { background-color: #059669; }
.btn-run-parser:hover { background-color: #4338ca; }

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

.btn-small {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-refresh-small {
    background: #f1f5f9; /* Светло-серый фон, чтобы не сливалась */
    border: 1px solid #cbd5e1;
    color: #475569;
    cursor: pointer;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-refresh-small:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: rotate(90deg); /* Эффект при наведении */
}