/* Общие стили */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Шапка */
.header {
    background: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 { font-size: 1.4rem; }
.site-title {
    color: white;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
}
.site-title:hover { color: #ecf0f1; }
.header .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}
.user-name {
    color: #ecf0f1;
    font-weight: 500;
}
.header .user-info a {
    color: #ecf0f1;
    text-decoration: none;
}

/* Древовидная навигация */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-item { position: relative; }
.nav-link {
    display: inline-block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
}
.nav-item.has-submenu > .nav-link::after {
    content: ' ▾';
    font-size: 0.7rem;
    opacity: 0.7;
}
.nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background: #34495e;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    padding: 6px 0;
    z-index: 100;
}
.nav-item:hover .nav-submenu,
.nav-item.open .nav-submenu {
    display: block;
}
.nav-submenu a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 9px 18px;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.15s;
}
.nav-submenu a:hover {
    background: rgba(255, 255, 255, 0.1);
}
/* Активный пункт (подсвечивается скриптом по текущему URL) */
.nav-link.active,
.nav-submenu a.active {
    background: #3498db;
    color: white;
}
.nav-logout {
    color: #ecf0f1;
    text-decoration: none;
    margin-left: 15px;
    padding: 10px 14px;
    border-radius: 6px;
}
.nav-logout:hover {
    background: rgba(231, 76, 60, 0.6);
}

@media (max-width: 900px) {
    .header { flex-direction: column; gap: 10px; }
    .main-nav { flex-wrap: wrap; justify-content: center; }
}

/* Контейнер */
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }

/* Карточки статистики */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-card h3 {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.stat-card .value {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
}
.stat-card .unit {
    font-size: 0.9rem;
    color: #95a5a6;
    margin-left: 5px;
}

/* Секции */
.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
}
tr:hover { background: #f8f9fa; }

/* Поиск */
.search-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}
.search-form button {
    padding: 10px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}
.search-form button:hover { background: #2980b9; }
.info { margin-left: auto; color: #7f8c8d; font-size: 0.9rem; }

/* Книги */
.book-row td { border-top: 1px solid #eee; }
.book-title { font-weight: 500; max-width: 40%; min-width: 250px; }
.book-author { color: #555; }
.book-cover {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.book-cover-placeholder {
    width: 60px;
    height: 80px;
    background: #ecf0f1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdc3c7;
    font-size: 1.5rem;
}
td {
    padding: 10px 16px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    vertical-align: top;
}
/* Обёртка двух описаний: свёрнута — единый блок в 3 строки */
.book-descriptions {
    font-size: 0.82rem;
    line-height: 1.4;
    margin-top: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.book-descriptions:not(.expanded) {
    max-height: 4.2em; /* 3 строки */
}
.book-descriptions:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.5em;
    background: linear-gradient(transparent, #fff 70%);
    pointer-events: none;
    z-index: 1;
}
.book-descriptions:not(.expanded).no-truncate::after {
    display: none;
}
.book-descriptions.expanded {
    overflow: visible;
}

.book-annotation {
    color: #777;
    word-break: break-word;
}

/* Сгенерированное описание в табличном режиме — тот же стиль, что у аннотации */
.book-description {
    color: #777;
    word-break: break-word;
}
.book-description-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #4a6fa5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 6px;
}

/* Метаданные: ключевые слова + год */
.book-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* Год издания */
.book-year {
    display: inline-block;
    color: #555;
    font-size: 0.85rem;
    margin-left: 8px;
    font-weight: 400;
    background: #f5f5f5;
    padding: 1px 6px;
    border-radius: 3px;
}

/* Ключевые слова */
.book-keywords .kw {
    display: inline-block;
    background: #e8f4fd;
    color: #2980b9;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 4px;
    margin-bottom: 2px;
}
.book-keywords .mkw {
    display: inline-block;
    background: #fdf2e8;
    color: #d35400;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 4px;
    margin-bottom: 2px;
}
.book-keywords .gkw {
    display: inline-block;
    background: #eef3f8;
    color: #2c3e50;
    border: 1px solid #d5dde5;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 4px;
    margin-bottom: 2px;
}

/* Кнопки */
.download-btn {
    display: inline-block;
    padding: 6px 16px;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
}
.download-btn:hover { background: #229954; }

.btn-generate-desc {
    display: inline-block;
    padding: 6px 12px;
    background: #9b59b6;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 5px;
    transition: background 0.2s;
}
.btn-generate-desc:hover { background: #8e44ad; }

/* Кнопка генерации ключевых слов — те же состояния, другой цвет */
.btn-generate-kw {
    display: inline-block;
    padding: 6px 12px;
    background: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 5px;
    transition: background 0.2s;
}
.btn-generate-kw:hover { background: #21618c; }
.btn-generate-kw.queued {
    background: #bdc3c7;
    color: #555;
    min-width: 52px;
    font-size: 0.85rem;
}
.btn-generate-kw.queued:hover { background: #e74c3c; color: white; }

/* Кнопка книги, стоящей в очереди на генерацию (клик — отмена).
   ВАЖНО: не используем атрибут disabled — disabled-кнопка не генерирует click. */
.btn-generate-desc.queued {
    background: #bdc3c7;
    color: #555;
    min-width: 52px;
    font-size: 0.85rem;
}
.btn-generate-desc.queued:hover { background: #e74c3c; color: white; }
.btn-generate-desc.queued.canceling {
    background: #f5b7b1;
    color: #7b241c;
}
.btn-generate-desc.queued.canceling:hover { background: #f5b7b1; }

/* Кнопка удаления описания */
.btn-delete-desc {
    background: none;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-delete-desc:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

/* Кнопка отмены генерации */
.btn-cancel-gen {
    background: none;
    border: 1px solid #f39c12;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #b9770e;
    transition: all 0.2s;
}
.btn-cancel-gen:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}
.btn-cancel-gen.canceling {
    background: #f39c12;
    border-color: #f39c12;
    color: white;
    cursor: pointer;
}
.btn-cancel-gen.canceling:hover {
    background: #e67e22;
    border-color: #e67e22;
}

/* Карточки книг, ожидающих генерации, на странице описаний */
.description-card-queued {
    opacity: 0.75;
    border-left: 4px solid #f39c12;
}
.queue-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #fef5e7;
    color: #b9770e;
    border: 1px solid #f8d79b;
    border-radius: 12px;
    font-size: 0.8rem;
}
.queue-badge.running {
    background: #eaf2f8;
    color: #2874a6;
    border-color: #aed6f1;
}
.queue-badge.canceling {
    background: #fdedec;
    color: #c0392b;
    border-color: #f5b7b1;
}
.task-kind {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-right: 6px;
}
.task-kind-desc {
    background: #eaf2f8;
    color: #2874a6;
    border: 1px solid #aed6f1;
}
.task-kind-kw {
    background: #e8f8f5;
    color: #148f77;
    border: 1px solid #a3e4d7;
}

/* Модальное окно описания */
.description-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.description-modal.active { display: flex; }
.description-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.description-modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}
.description-modal-content .description-text {
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}
.description-modal-content .close-btn {
    padding: 8px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
.description-modal-content .close-btn:hover { background: #2980b9; }

/* Пагинация */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #3498db;
    font-size: 0.9rem;
    background: white;
}
.pagination a:hover { background: #f0f0f0; }
.pagination .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}
.pagination .disabled { color: #bbb; pointer-events: none; }

/* Авторизация */
.login-form {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.login-form h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}
.login-form button {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}
.login-form button:hover { background: #2980b9; }
.login-error {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Статистика обложек */
.cover-stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}
.cover-stat {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}
.cover-stat .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #27ae60;
}
.cover-stat .label {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Пустой результат */
.empty { text-align: center; padding: 40px; color: #999; }

/* Страница описаний */
.info-bar {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #555;
}
.descriptions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.description-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.description-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.book-cover-sm {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 3px;
}
.book-cover-placeholder.book-cover-sm {
    width: 40px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.description-meta { flex: 1; }
.description-book-title {
    font-weight: 600;
    font-size: 1.05rem;
}
.description-book-title a {
    color: var(--accent);
    text-decoration: none;
}
.description-book-title a:hover { text-decoration: underline; }
.description-author {
    color: #666;
    font-size: 0.9rem;
    margin-top: 2px;
}
.description-genre {
    color: #999;
    font-size: 0.8rem;
    margin-top: 1px;
    font-style: italic;
}
.description-date {
    color: #999;
    font-size: 0.8rem;
    margin-top: 2px;
}
.description-text {
    line-height: 1.6;
    color: #333;
    font-size: 0.95rem;
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    margin-bottom: 10px;
}
.description-footer {
    display: flex;
    align-items: center;
    gap: 15px;
}
.description-size {
    color: #999;
    font-size: 0.85rem;
}
.description-model {
    color: #8e44ad;
    font-size: 0.8rem;
}
.description-gen-time {
    color: #2980b9;
    font-size: 0.8rem;
}

/* Теги ключевых слов на странице /keywords */
.kw-tag {
    display: inline-block;
    background: #eef3f8;
    color: #2c3e50;
    border: 1px solid #d5dde5;
    border-radius: 12px;
    padding: 2px 10px;
    margin: 2px 4px 2px 0;
    font-size: 0.85rem;
}

/* Блок сгенерированных ключевых слов на карточке описания (/descriptions) */
.description-keywords {
    margin: 6px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.description-keywords .btn-delete-kw {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    opacity: 0.6;
}
.description-keywords .btn-delete-kw:hover { opacity: 1; }

/* Настройки генерации на карточке очереди (раскрывающийся JSON) */
.gen-settings {
    display: inline-block;
    font-size: 0.8rem;
    color: #666;
}
.gen-settings summary {
    cursor: pointer;
    user-select: none;
}
.gen-settings summary:hover { color: #2980b9; }
.gen-settings-json {
    margin: 6px 0 0;
    padding: 8px 10px;
    background: #f7f7f9;
    border: 1px solid #e3e3e8;
    border-radius: 4px;
    font-size: 0.75rem;
    max-width: 480px;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
}
.description-file {
    color: #bbb;
    font-size: 0.75rem;
    font-family: monospace;
    margin-left: auto;
}

/* Компактная таблица архива */
.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.compact-table th {
    text-align: left;
    padding: 8px 10px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.compact-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}
.compact-table tbody tr:hover {
    background: #f8f9fa;
}
.compact-table .cell-filename {
    font-family: monospace;
    font-size: 0.8rem;
    color: #6c757d;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.compact-table a {
    color: var(--accent);
    text-decoration: none;
}
.compact-table a:hover {
    text-decoration: underline;
}

/* Ссылки авторов */
.author-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}
.author-link:hover { text-decoration: underline; }

/* Страница архивов */
.archives-info {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}
.archives-info code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85rem;
}
.archive-row td { vertical-align: middle; }
.archive-row.total-row {
    font-weight: bold;
    background: #f0f4f8;
    border-top: 2px solid #2c3e50;
}
.archive-row.total-row td { padding: 12px; }
.cell-warn {
    background: #fff3cd !important;
    color: #856404;
    font-weight: bold;
}
.cell-fb2 { color: #666; }
.cell-db { color: #2c3e50; }
.cell-good { color: #27ae60; font-weight: bold; }
.cell-cover { color: #e67e22; }
.cell-emb { color: #27ae60; }
.relevance {
    font-weight: bold;
    text-align: center;
    min-width: 80px;
}
.relevance-high { color: #27ae60; }
.relevance-medium { color: #f39c12; }
.relevance-low { color: #e74c3c; }
.archive-name {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    font-family: monospace;
    font-size: 0.9rem;
}
.archive-name:hover { color: #3498db; }
.btn-view {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-view:hover { transform: scale(1.2); }
.btn-index-single {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.btn-index-single:hover { background: #3498db; color: white; border-color: #3498db; }
.badge {
    display: inline-block;
    background: #3498db;
    color: white;
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 0.8rem;
    margin-left: 8px;
    vertical-align: middle;
}

/* Форма */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.form-group {
    flex: 1;
    min-width: 200px;
}
.form-group-small {
    max-width: 120px;
    min-width: 80px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 5px;
    text-transform: uppercase;
}
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}
.form-checks {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.form-actions {
    margin-top: 10px;
}
.btn-primary {
    padding: 12px 28px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}
.btn-primary:hover { background: #2980b9; }
.btn-primary:disabled { background: #bdc3c7; cursor: not-allowed; }
.btn-secondary {
    padding: 12px 28px;
    background: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}
.btn-secondary:hover { background: #d35400; }
.btn-secondary:disabled { background: #bdc3c7; cursor: not-allowed; }
.help-text {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
    line-height: 1.5;
}

/* Прогресс */
.indexing-active {
    border-left: 4px solid #e67e22;
}
.progress-bar {
    height: 24px;
    background: #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 12px;
    transition: width 0.3s ease;
    width: 0%;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #555;
}
.error-msg {
    margin-top: 10px;
    color: #e74c3c;
    font-size: 0.9rem;
}

/* Страница пользователей */
.users-table {
    width: 100%;
    margin-bottom: 30px;
}
.users-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
}
.badge-admin {
    display: inline-block;
    background: #27ae60;
    color: white;
    border-radius: 12px;
    padding: 3px 12px;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge-user {
    display: inline-block;
    background: #95a5a6;
    color: white;
    border-radius: 12px;
    padding: 3px 12px;
    font-size: 0.8rem;
}
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===================================================================
   HWMon — Аппаратные сенсоры
   =================================================================== */

.hwmon-timestamp {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

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

.hwmon-card {
    background: #1e1e2e;
    border: 1px solid #3a3a5a;
    border-radius: 8px;
    padding: 16px;
}

.hwmon-card h2 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: #cdd6f4;
    border-bottom: 1px solid #3a3a5a;
    padding-bottom: 8px;
}

.hwmon-table {
    width: 100%;
    border-collapse: collapse;
}

.hwmon-table tr {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.hwmon-table td {
    color: #bac2de;
    font-size: 0.9rem;
}

.hwmon-table td:first-child {
    color: #a6adc8;
}

.hwmon-table .val {
    font-weight: 600;
    color: #cdd6f4;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.hwmon-table .val-muted {
    color: #6c7086;
    font-style: italic;
}

.hwmon-warm {
    color: #f9e2af !important;
}

.hwmon-hot {
    color: #f38ba8 !important;
    font-weight: 700;
}
