/* ========================================
   SanoBackups - Modern Dark Theme
   ======================================== */

:root {
    /* Colors - Cyberpunk inspired */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2332;
    --bg-card: #151d2c;
    --bg-hover: #1e2a3d;
    
    --accent-primary: #00d4aa;
    --accent-secondary: #00b894;
    --accent-glow: rgba(0, 212, 170, 0.3);
    
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #1e293b;
    --border-light: #334155;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    /* Sizes */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 170, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Grid Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 212, 170, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 170, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-blue));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: var(--bg-primary);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    font-weight: 500;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(59, 130, 246, 0.1));
    color: var(--accent-primary);
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.storage-info {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: var(--radius-md);
}

.storage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.storage-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-blue));
    border-radius: 3px;
    transition: width var(--transition-slow);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    gap: 12px;
}

/* Sections */
.section {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ========================================
   Stats Grid
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-icon.sites {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.stat-icon.backups {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-icon.success {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}

.stat-icon.storage {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   Content Grid
   ======================================== */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.link:hover {
    color: var(--accent-secondary);
}

/* Backup List */
.backup-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.backup-item:hover {
    background: var(--bg-hover);
}

.backup-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.backup-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.backup-item-icon.success {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}

.backup-item-icon.failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.backup-item-icon.running {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.backup-item-icon svg {
    width: 20px;
    height: 20px;
}

.backup-item-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.backup-item-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.backup-item-right {
    text-align: right;
}

.backup-item-size {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.backup-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions .card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.action-btn svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

/* ========================================
   Sites Grid
   ======================================== */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.site-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-fast);
}

.site-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}

.site-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.site-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
}

.site-card-icon svg {
    width: 24px;
    height: 24px;
}

.site-card-menu {
    position: relative;
}

.site-card-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.site-card-menu-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.site-card-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 10;
}

.site-card-menu:hover .site-card-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item.danger {
    color: var(--accent-red);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
}

.site-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.site-card-host {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.site-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.site-stat {
    display: flex;
    flex-direction: column;
}

.site-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.site-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.site-card-footer {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.site-card-footer .btn {
    flex: 1;
}

/* ========================================
   Backups Table
   ======================================== */
.backups-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.backups-table th,
.backups-table td {
    padding: 16px 20px;
    text-align: left;
}

.backups-table th {
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.backups-table td {
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.backups-table tbody tr:hover {
    background: var(--bg-hover);
}

.backups-table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.status-badge.running {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.table-actions button:hover {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.table-actions button.danger:hover {
    color: var(--accent-red);
}

.table-actions svg {
    width: 18px;
    height: 18px;
}

.filter-group {
    display: flex;
    gap: 12px;
}

/* ========================================
   Restore Section
   ======================================== */
.restore-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.restore-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.step.active {
    color: var(--accent-primary);
}

.step.completed {
    color: var(--accent-primary);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step.active .step-number {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.step.completed .step-number {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.restore-content {
    max-width: 600px;
    margin: 0 auto;
}

.restore-backup-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   Settings Section
   ======================================== */
.settings-container {
    max-width: 700px;
}

.settings-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.settings-group h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.settings-actions {
    margin-top: 24px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.input,
.select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input::placeholder {
    color: var(--text-muted);
}

.input[readonly] {
    background: var(--bg-primary);
    cursor: not-allowed;
}

.select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
}

.form-group.small {
    width: 120px;
}

.form-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

/* Input with toggle */
.input-with-toggle {
    position: relative;
    display: flex;
}

.input-with-toggle .input {
    padding-right: 45px;
}

.btn-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.btn-toggle-pass:hover {
    color: var(--text-primary);
}

.btn-toggle-pass svg {
    width: 18px;
    height: 18px;
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

/* ========================================
   Modals
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-fast);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content.modal-sm {
    max-width: 450px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* Backup Progress */
.backup-progress {
    text-align: center;
}

.progress-site {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-blue));
    border-radius: 4px;
    transition: width var(--transition-normal);
}

.progress-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.progress-log {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
}

.progress-log p {
    margin-bottom: 4px;
}

.progress-log .success {
    color: var(--accent-primary);
}

.progress-log .error {
    color: var(--accent-red);
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 3px solid var(--accent-primary);
}

.toast.error {
    border-left: 3px solid var(--accent-red);
}

.toast.warning {
    border-left: 3px solid var(--accent-orange);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--accent-primary);
}

.toast.error .toast-icon {
    color: var(--accent-red);
}

.toast.warning .toast-icon {
    color: var(--accent-orange);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state.large svg {
    width: 80px;
    height: 80px;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.empty-row td {
    padding: 60px 20px !important;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 0 16px;
    }
    
    .section {
        padding: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group.small {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 16px;
    }
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   Animations
   ======================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* ========================================
   User Menu
   ======================================== */
.user-menu {
    position: relative;
    margin-left: 12px;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bg-primary);
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.user-dropdown .dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-dropdown .dropdown-item.logout {
    color: var(--accent-red);
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 16px;
}

.user-dropdown .dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.user-dropdown .dropdown-item svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .user-name {
        display: none;
    }
    
    .user-menu-btn svg:last-child {
        display: none;
    }
}

