body {
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
}

h1 {
    margin-bottom: 10px;
}

.news-card {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.news-card h2 {
    margin-top: 0;
}

.news-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.news-description {
    line-height: 1.5;
}

.news-link {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
    font-weight: bold;
}

.top-menu {
    background: #1f2a3a;
    padding: 28px 0;
}

.top-menu .container {
    display: flex;
    align-items: center;
    gap: 48px;
}

.top-menu a {
    color: white;
    text-decoration: none;

    font-size: 28px;
    font-weight: 600;

    padding: 8px 0;
}

.top-menu a:hover {
    text-decoration: underline;
}

.top-menu a.active {
    border-bottom: 3px solid white;
    padding-bottom: 5px;
}

.source-button {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;

    background: #1f2937;
    color: white;

    text-decoration: none;
    border-radius: 6px;
}

.source-button:hover {
    opacity: 0.85;
}

/* =========================
   Таблица источников
   ========================= */

.sources-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.sources-row {
    display: grid;
    grid-template-columns: 2.5fr 1fr 0.7fr 1fr;
    gap: 20px;

    align-items: center;

    padding: 18px 24px;

    border-bottom: 1px solid #e5e7eb;
}

.sources-row:last-child {
    border-bottom: none;
}


/* Заголовок таблицы */

.sources-header {
    background: #1f2a3a;
    color: white;

    font-weight: bold;
}


/* RSS адрес */

.source-rss {
    margin-top: 6px;

    font-size: 14px;
    color: #6b7280;

    word-break: break-all;
}


/* Статусы */

.status {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 6px;

    font-size: 14px;
    font-weight: bold;
}

.status-on {
    background: #dcfce7;
    color: #166534;
}

.status-off {
    background: #fee2e2;
    color: #991b1b;
}


/* Кнопка управления */

.sources-table .source-button {
    display: inline-block;

    padding: 9px 14px;

    text-decoration: none;

    border-radius: 6px;

    background: #1f2a3a;
    color: white;
}

.sources-table .source-button:hover {
    opacity: 0.85;
}

/* =========================
   Форма добавления источника
   ========================= */

.add-source-form {
    margin-bottom: 30px;
    padding: 22px 25px;

    background: white;
    border-radius: 12px;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.add-source-form h2 {
    margin-top: 0;
    margin-bottom: 18px;
}

.add-source-form form {
    display: grid;

    grid-template-columns: 1fr 2fr 1fr auto;

    gap: 12px;
}

.add-source-form input {
    padding: 11px 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    font-size: 15px;
}

.add-source-form input:focus {
    outline: none;
    border-color: #1f2a3a;
}

.add-source-form button {
    padding: 11px 20px;

    border: none;
    border-radius: 6px;

    background: #1f2a3a;
    color: white;

    font-size: 15px;
    cursor: pointer;
}

.add-source-form button:hover {
    opacity: 0.85;
}

/* Кнопка удаления источника */

.delete-button {
    display: inline-block;

    margin-left: 8px;
    padding: 9px 14px;

    text-decoration: none;

    border-radius: 6px;

    background: #dc2626;
    color: white;
}

.delete-button:hover {
    background: #b91c1c;
}

/* Кнопка Включить / Выключить */

.sources-table .source-button {
    display: inline-block;

    padding: 7px 11px;

    text-decoration: none;

    border-radius: 5px;

    background: #1f2a3a;
    color: white;

    font-size: 14px;
    line-height: 1.2;
}

.sources-table .source-button:hover {
    opacity: 0.85;
}


/* Кнопка Удалить */

.delete-button {
    display: inline-block;

    margin-left: 8px;
    padding: 7px 11px;

    text-decoration: none;

    border-radius: 5px;

    background: #dc2626;
    color: white;

    font-size: 14px;
    line-height: 1.2;
}

.delete-button:hover {
    background: #b91c1c;
}

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

.source-actions .delete-button {
    margin-left: 0;
}

.refresh-button {
    display: inline-block;

    margin-bottom: 25px;
    padding: 9px 14px;

    background: #1f2a3a;
    color: white;

    text-decoration: none;
    border-radius: 6px;

    font-size: 14px;
}

.refresh-button:hover {
    opacity: 0.85;
}

.update-message {
    margin-bottom: 25px;
    padding: 12px 16px;

    background: #dcfce7;
    color: #166534;

    border-radius: 6px;

    font-size: 14px;
    font-weight: 600;
}

.news-filters {
    display: flex;
    gap: 10px;
    align-items: center;

    margin-bottom: 25px;
}

.news-filters select {
    padding: 9px 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    font-size: 14px;
    background: white;
}

.news-filters button {
    padding: 9px 14px;

    border: none;
    border-radius: 6px;

    background: #1f2a3a;
    color: white;

    cursor: pointer;
}

.reset-filter {
    padding: 9px 14px;

    text-decoration: none;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    color: #1f2a3a;
    background: white;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    margin-top: 30px;
    margin-bottom: 30px;
}

.pagination a {
    padding: 8px 12px;

    text-decoration: none;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: white;
    color: #1f2a3a;
}

.pagination a:hover {
    background: #f3f4f6;
}

.pagination .active-page {
    background: #1f2a3a;
    color: white;
    border-color: #1f2a3a;
}

/* =========================
   Статистика
   ========================= */

.statistics-card {
    background: white;

    padding: 16px 24px;
    margin-bottom: 20px;

    border-radius: 12px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.statistics-total {
    font-size: 32px;
    font-weight: bold;

    margin-top: 4px;

    color: #1f2a3a;
}

.statistics-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 24px;
}

.statistics-row {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 12px 0;

    border-bottom: 1px solid #e5e7eb;
}

.statistics-row:last-child {
    border-bottom: none;
}

.statistics-row strong {
    background: #eef2f7;

    padding: 5px 10px;

    border-radius: 6px;
}


/* Для небольших экранов */

@media (max-width: 800px) {

    .statistics-grid {
        grid-template-columns: 1fr;
    }

}

.news-search {
    min-width: 260px;

    padding: 9px 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: white;

    font-size: 14px;
}

.news-search:focus {
    outline: none;
    border-color: #1f2a3a;
}

.pagination-dots {
    padding: 8px 4px;
    color: #6b7280;
}

/* Кнопка Изменить */

.edit-button {
    padding: 7px 11px;

    border: none;
    border-radius: 5px;

    background: #64748b;
    color: white;

    font-size: 14px;
    line-height: 1.2;

    cursor: pointer;
}

.edit-button:hover {
    background: #475569;
}

/* Одинаковый размер кнопок управления источниками */

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

.source-actions .source-button,
.source-actions .edit-button,
.source-actions .delete-button {
    box-sizing: border-box;

    height: 36px;
    padding: 0 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin: 0;

    border: none;
    border-radius: 5px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;

    text-decoration: none;
    cursor: pointer;
}

.news-group-badge {
    display: inline-block;

    margin-top: 8px;
    margin-bottom: 8px;

    padding: 5px 9px;

    border-radius: 6px;

    background: #eef2f7;
    color: #475569;

    font-size: 13px;
    font-weight: 600;
}

.news-group-badge {
    display: inline-block;

    margin-top: 8px;
    margin-bottom: 8px;

    padding: 5px 9px;

    border-radius: 6px;

    background: #eef2f7;
    color: #475569;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;
}

.news-group-badge:hover {
    background: #e2e8f0;
}

/* =========================
   Источники: 5 колонок
   RSS / HTML
   ========================= */

.sources-row {
    grid-template-columns:
        2.3fr
        0.6fr
        1.1fr
        0.6fr
        1.7fr;
}


/* Форма добавления / редактирования */

.add-source-form form {
    grid-template-columns:
        1fr
        2fr
        1fr
        0.65fr
        auto;

    align-items: center;
}


/* Выпадающий список RSS / HTML */

.add-source-form select {
    padding: 11px 12px;

    border: 1px solid #d1d5db;
    border-radius: 6px;

    background: white;

    font-family: inherit;
    font-size: 15px;
}


/* Кнопки управления держим в одной строке */

.source-actions {
    flex-wrap: nowrap;
}


/* На небольшом экране разрешаем перенос */

@media (max-width: 1000px) {

    .sources-row {
        grid-template-columns:
            2fr
            0.7fr
            1fr
            0.7fr;
    }

    .source-actions {
        grid-column: 1 / -1;
    }

    .add-source-form form {
        grid-template-columns: 1fr 1fr;
    }
}


/* На телефоне всё в одну колонку */

@media (max-width: 650px) {

    .sources-row {
        grid-template-columns: 1fr;
    }

    .source-actions {
        grid-column: auto;
        flex-wrap: wrap;
    }

    .add-source-form form {
        grid-template-columns: 1fr;
    }
}