﻿/* layout */
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; margin: 0; }
.header { padding: 1rem; background:#0d6efd; color:white; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 12px; }
.content { padding: 1rem 0; }

/* clients grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.client-card {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: white;
}

.client-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.client-card.selected {
    border-color: #0d6efd;
    background: #e7f1ff;
}

.client-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.client-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    display: inline-block;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: help;
}

.client-dot.ok {
    background: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

/* backups section */
.backups-section {
    border-top: 2px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1.25rem;
}

.backups-by-database {
    padding: 0.5rem 0;
}

.backups-summary .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.backups-summary .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.backups-summary .stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.database-group {
    margin-bottom: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.database-group.expanded {
    border-color: #0d6efd;
}

.database-header {
    background: #f8f9fa;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.database-header:hover {
    background: #e9ecef;
}

.database-group.expanded .database-header {
    background: #e7f1ff;
}

.expand-icon {
    font-size: 0.875rem;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.database-name {
    font-size: 1.1rem;
    color: #212529;
}

.backup-list {
    padding: 1rem;
    background: white;
}

.backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s ease;
}

.backup-item:last-child {
    border-bottom: none;
}

.backup-item:hover {
    background: #f8f9fa;
}

.backup-info {
    flex: 1;
}

.backup-timestamp {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.backup-details {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-download {
    background: #0d6efd;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
}

.btn-download:hover {
    background: #0b5ed7;
    color: white;
}

.small-muted {
    color: #6c757d;
    font-size: 0.85rem;
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: block;
}