/* ========================================================================
   backups.css – стили модуля «Резервное копирование»
   ======================================================================== */

.backups-auth-wrap {
    max-width: 380px;
    margin: 0 0 24px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.backups-db-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.backups-db-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.backups-db-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8f9fa;
    flex-wrap: wrap;
    gap: 8px;
}

.backups-db-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: none;
    border: none;
    text-align: left;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    min-width: 200px;
}

.backups-db-name {
    word-break: break-all;
}

.backups-db-count {
    font-weight: 400;
    color: #6c757d;
    font-size: 0.85rem;
    white-space: nowrap;
}

.backups-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #495057;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}

.backups-table-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
    padding: 0 14px;
}

.backups-table-list.open {
    max-height: 600px;
    overflow-y: auto;
    padding: 10px 14px;
    border-top: 1px solid #eee;
}

.backups-table-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.9rem;
    cursor: pointer;
}

.backups-table-item:hover {
    color: #0d6efd;
}

.backups-table-meta {
    color: #6c757d;
    font-size: 0.8rem;
}

.backups-db-host {
    color: #6c757d;
    font-weight: 400;
    font-size: 0.8rem;
}

.backups-db-card-error {
    border-color: #f1aeb5;
}

.backups-db-error {
    color: #842029;
    background: #f8d7da;
    font-size: 0.85rem;
}

/* ---- Компактная форма подключения к БД (разворачивается под кнопкой) ---- */
.backups-add-db-panel {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.backups-add-db-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.backups-add-db-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 150px;
    min-width: 130px;
}

.backups-add-db-field label {
    font-size: 0.78rem;
    color: #6c757d;
    margin-bottom: 0;
}

.backups-add-db-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}
/* ---- Копия текущего сайта: скачивание и восстановление ---- */
.backups-site-card {
    border: 1px solid #cfe2ff;
    border-radius: 10px;
    background: #fff;
    padding: 16px 18px;
    margin-bottom: 24px;
}

.backups-site-head h5 {
    font-size: 1.05rem;
}

.backups-site-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.backups-site-progress {
    margin-top: 12px;
    max-width: 560px;
}

.backups-site-preview {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px dashed #adb5bd;
    border-radius: 8px;
    background: #f8f9fa;
    overflow-wrap: anywhere;
}

.backups-site-facts {
    max-width: 560px;
    margin-bottom: 10px;
    background: transparent;
}

.backups-site-facts th {
    width: 110px;
    color: #6c757d;
    font-weight: 400;
}

.backups-site-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.backups-site-snapshots {
    margin-top: 14px;
}

.backups-site-snapshots summary {
    cursor: pointer;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 6px;
}

.backups-site-snapshot-table {
    max-width: 560px;
}

.backups-section-title {
    margin: 0 0 12px;
    font-weight: 600;
    color: #495057;
}

.backups-site-filelist {
    margin: 6px 0 10px;
    font-size: 0.85rem;
}

.backups-site-filelist summary {
    cursor: pointer;
}

.backups-site-filelist ul {
    max-height: 240px;
    overflow-y: auto;
    margin: 6px 0 0;
    padding-left: 18px;
}

/* ===== Шаблоны сайтов (2026-09-17) ===== */
.backups-templates .backups-template-form {
    margin-top: 12px;
}

.backups-templates-table td,
.backups-templates-table th {
    font-size: 0.85rem;
    vertical-align: top;
}

.backups-templates-table .badge {
    font-weight: 500;
    margin-left: 4px;
}

/* ===== Развернуть сайт из шаблона (2026-09-18) ===== */
.backups-template-apply .backups-templates-table td,
.backups-template-apply .backups-templates-table th {
    font-size: 0.85rem;
    vertical-align: top;
}

/* Кнопка замены — красная и одна в строке: перепутать её с «скачать»
   у соседней карточки не должно быть легко. */
.backups-template-apply .backups-templates-table td .text-muted {
    font-size: 0.8rem;
}

/* ===== Глазик видимости шаблона в «Конструкторе сайтов» (2026-09-19) ===== */
.backups-templates-table .backups-template-eye {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    margin-top: -1px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #198754;
    cursor: pointer;
}

.backups-templates-table .backups-template-eye:hover,
.backups-templates-table .backups-template-eye:focus-visible {
    border-color: currentColor;
}

.backups-templates-table .backups-template-eye.is-off {
    color: #6c757d;
}

.backups-templates-table .backups-template-eye:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Скрытый шаблон — приглушённо, но кнопки строки остаются яркими. */
.backups-templates-table tr.backups-template-hidden .backups-template-name,
.backups-templates-table tr.backups-template-hidden td:nth-child(2) > .text-muted,
.backups-templates-table tr.backups-template-hidden td:nth-child(3),
.backups-templates-table tr.backups-template-hidden td:nth-child(4),
.backups-templates-table tr.backups-template-hidden td:nth-child(5) {
    opacity: 0.55;
}
