/* Backup Dashboard Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa;
    color: #333;
    line-height: 1.5;
}

.backup-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
.backup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.backup-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.header-subtitle {
    font-size: 0.85rem;
    color: #7f8c8d;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.last-updated {
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Buttons */
.btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn:hover { background: #f0f0f0; }

.btn-refresh {
    background: #3498db;
    color: #fff;
    border-color: #2980b9;
}

.btn-refresh:hover { background: #2980b9; }

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.btn-sm.active {
    background: #3498db;
    color: #fff;
    border-color: #2980b9;
}

.btn-view {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-view:hover { background: #dfe6e9; }

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
}

.card-icon { flex-shrink: 0; }

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #bdc3c7;
}

.dot-success { background: #27ae60; }
.dot-warning { background: #f39c12; }
.dot-error { background: #e74c3c; }
.dot-unknown { background: #bdc3c7; }

.card-body h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #95a5a6;
    margin-bottom: 0.15rem;
}

.card-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-detail {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Panels */
.info-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
}

.panel.full-width {
    margin-bottom: 1.5rem;
}

.panel h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f5f6fa;
}

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

.info-row .label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.info-row .value {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2c3e50;
    text-align: right;
}

.path-list {
    list-style: none;
    padding: 0;
}

.path-list li {
    font-family: monospace;
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    background: #f5f6fa;
    border-radius: 3px;
    margin-bottom: 0.3rem;
    color: #2c3e50;
}

/* Tables */
.table-container { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #ecf0f1;
}

.data-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f5f6fa;
    vertical-align: middle;
}

.data-table tbody tr:hover { background: #f8f9fa; }

.data-table code {
    background: #f0f0f0;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.loading-cell, .empty-cell {
    text-align: center;
    color: #95a5a6;
    padding: 2rem 0.75rem !important;
}

.tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #e8f5e9;
    color: #27ae60;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.path-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 3px;
    font-size: 0.75rem;
    font-family: monospace;
    margin: 0.1rem;
}

.paths-cell { max-width: 300px; }

/* Log filters */
.log-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.overlay.active { display: flex; }

.overlay-content {
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #ecf0f1;
}

.overlay-header h3 {
    font-size: 0.95rem;
    font-family: monospace;
}

.overlay-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #95a5a6;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.overlay-close:hover { color: #e74c3c; }

.log-content {
    padding: 1rem 1.25rem;
    overflow: auto;
    font-family: 'Fira Code', 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
    white-space: pre-wrap;
    word-break: break-all;
    flex: 1;
}

/* Dark mode */
[data-theme="dark"] body { background: #1a1a2e; color: #e0e0e0; }
[data-theme="dark"] .backup-header h1 { color: #e0e0e0; }
[data-theme="dark"] .header-subtitle { color: #888; }
[data-theme="dark"] .last-updated { color: #666; }

[data-theme="dark"] .status-card {
    background: #16213e;
    border-color: #2a2a4a;
}

[data-theme="dark"] .card-body h3 { color: #888; }
[data-theme="dark"] .card-value { color: #e0e0e0; }
[data-theme="dark"] .card-detail { color: #888; }

[data-theme="dark"] .panel {
    background: #16213e;
    border-color: #2a2a4a;
}

[data-theme="dark"] .panel h2 { color: #e0e0e0; border-color: #2a2a4a; }
[data-theme="dark"] .info-row .label { color: #888; }
[data-theme="dark"] .info-row .value { color: #e0e0e0; }
[data-theme="dark"] .info-row { border-color: #1a1a2e; }

[data-theme="dark"] .path-list li { background: #1a1a2e; color: #b0b0b0; }

[data-theme="dark"] .data-table th { background: #1a1a2e; color: #888; border-color: #2a2a4a; }
[data-theme="dark"] .data-table td { border-color: #1a1a2e; color: #d0d0d0; }
[data-theme="dark"] .data-table tbody tr:hover { background: #1a1a2e; }
[data-theme="dark"] .data-table code { background: #1a1a2e; color: #b0b0b0; }

[data-theme="dark"] .btn { background: #16213e; color: #d0d0d0; border-color: #2a2a4a; }
[data-theme="dark"] .btn:hover { background: #1a1a2e; }
[data-theme="dark"] .btn-refresh { background: #2980b9; border-color: #2471a3; color: #fff; }
[data-theme="dark"] .btn-sm.active { background: #2980b9; border-color: #2471a3; }
[data-theme="dark"] .btn-view { background: #1a1a2e; color: #b0b0b0; }

[data-theme="dark"] .overlay-content { background: #16213e; }
[data-theme="dark"] .overlay-header { border-color: #2a2a4a; }
[data-theme="dark"] .overlay-header h3 { color: #e0e0e0; }
[data-theme="dark"] .log-content { background: #0f0f23; color: #b0b0b0; }

[data-theme="dark"] .tag { background: #1b3a1b; color: #4caf50; }
[data-theme="dark"] .path-badge { background: #1a2a4a; color: #64b5f6; }

/* Responsive */
@media (max-width: 768px) {
    .backup-header { flex-direction: column; align-items: flex-start; }
    .status-cards { grid-template-columns: 1fr 1fr; }
    .info-panels { grid-template-columns: 1fr; }
    .paths-cell { max-width: 150px; }
}

@media (max-width: 480px) {
    .status-cards { grid-template-columns: 1fr; }
    .overlay { padding: 0.5rem; }
}